spexcode 0.1.6 → 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/README.md +99 -35
- package/README.zh-CN.md +135 -0
- package/package.json +5 -6
- package/spec-cli/README.md +86 -0
- package/spec-cli/bin/spex.mjs +15 -3
- package/spec-cli/hooks/dispatch.sh +20 -8
- package/spec-cli/hooks/harness.sh +18 -11
- package/spec-cli/src/board.ts +47 -18
- package/spec-cli/src/boardCache.ts +70 -0
- package/spec-cli/src/boardDelta.ts +90 -0
- package/spec-cli/src/boardStream.ts +178 -0
- package/spec-cli/src/cli.ts +184 -122
- package/spec-cli/src/client.ts +6 -4
- package/spec-cli/src/gateway.ts +64 -24
- package/spec-cli/src/git.ts +105 -92
- package/spec-cli/src/guide.ts +186 -19
- package/spec-cli/src/harness-select.ts +63 -0
- package/spec-cli/src/harness.ts +506 -100
- package/spec-cli/src/help.ts +362 -0
- package/spec-cli/src/hooks.ts +0 -14
- package/spec-cli/src/index.ts +279 -32
- package/spec-cli/src/init.ts +41 -1
- package/spec-cli/src/issues.ts +301 -0
- package/spec-cli/src/layout.ts +70 -28
- package/spec-cli/src/lint.ts +12 -10
- package/spec-cli/src/listen.ts +28 -0
- package/spec-cli/src/localIssues.ts +700 -0
- package/spec-cli/src/materialize.ts +182 -27
- package/spec-cli/src/mentions.ts +192 -0
- package/spec-cli/src/plugin-harness.ts +145 -0
- package/spec-cli/src/pty-bridge.ts +378 -81
- package/spec-cli/src/self.ts +123 -20
- package/spec-cli/src/sessions.ts +461 -298
- package/spec-cli/src/specs.ts +55 -14
- package/spec-cli/src/supervise.ts +23 -3
- package/spec-cli/src/tsx-bin.ts +14 -5
- package/spec-cli/src/uninstall.ts +146 -0
- package/spec-cli/templates/hooks/post-merge +27 -0
- package/spec-cli/templates/hooks/pre-commit +51 -31
- package/spec-cli/templates/hooks/prepare-commit-msg +31 -8
- package/spec-cli/templates/presets/careful/.config/clarify-before-code/spec.md +11 -0
- package/spec-cli/templates/spec/project/.config/core/spec-of-file/spec-of-file.sh +26 -3
- package/spec-cli/templates/spec/project/.config/core/spec.md +4 -0
- package/spec-cli/templates/spec/project/.config/core/stop-gate/stop-gate.sh +16 -4
- package/spec-cli/templates/spec/project/.config/extract/spec.md +1 -1
- package/spec-cli/templates/spec/project/.config/regroup/spec.md +1 -1
- package/spec-cli/templates/spec/project/.config/reproduce-before-fix/spec.md +18 -0
- package/spec-cli/templates/spec/project/.config/spec.md +3 -3
- package/spec-cli/templates/spec/project/.config/supervisor/spec.md +2 -2
- package/spec-cli/templates/spec/project/.config/tidy/spec.md +1 -1
- package/spec-cli/templates/spec/project/spec.md +2 -2
- package/spec-dashboard/dist/assets/index-Ct_ubwrd.css +32 -0
- package/spec-dashboard/dist/assets/index-DehTZ-h9.js +145 -0
- package/spec-dashboard/dist/index.html +17 -5
- package/spec-forge/src/cache.ts +16 -0
- package/spec-forge/src/cli.ts +4 -10
- package/spec-forge/src/drivers/github.ts +74 -4
- package/spec-forge/src/drivers.ts +13 -0
- package/spec-forge/src/port.ts +25 -0
- package/spec-forge/src/resident.ts +40 -6
- package/spec-yatsu/src/cli.ts +227 -38
- package/spec-yatsu/src/evaltab.ts +169 -19
- package/spec-yatsu/src/filing.ts +48 -0
- package/spec-yatsu/src/freshness.ts +55 -20
- package/spec-yatsu/src/proof.ts +89 -3
- package/spec-yatsu/src/scenariofresh.ts +92 -0
- package/spec-yatsu/src/sidecar.ts +75 -11
- package/spec-yatsu/src/timeline.ts +47 -0
- package/spec-yatsu/src/yatsu.ts +47 -3
- package/spec-cli/src/relay.ts +0 -28
- package/spec-cli/templates/spec/project/.config/scenario/spec.md +0 -32
- package/spec-dashboard/dist/assets/index-Bk4E1EQy.js +0 -139
- package/spec-dashboard/dist/assets/index-Cq7hwngj.css +0 -32
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function vp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yp={exports:{}},Ea={},wp={exports:{}},Ee={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Mn=Symbol.for("react.element"),a0=Symbol.for("react.portal"),l0=Symbol.for("react.fragment"),c0=Symbol.for("react.strict_mode"),u0=Symbol.for("react.profiler"),h0=Symbol.for("react.provider"),d0=Symbol.for("react.context"),f0=Symbol.for("react.forward_ref"),p0=Symbol.for("react.suspense"),g0=Symbol.for("react.memo"),_0=Symbol.for("react.lazy"),Th=Symbol.iterator;function m0(e){return e===null||typeof e!="object"?null:(e=Th&&e[Th]||e["@@iterator"],typeof e=="function"?e:null)}var Sp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xp=Object.assign,Cp={};function _i(e,t,r){this.props=e,this.context=t,this.refs=Cp,this.updater=r||Sp}_i.prototype.isReactComponent={};_i.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function bp(){}bp.prototype=_i.prototype;function cu(e,t,r){this.props=e,this.context=t,this.refs=Cp,this.updater=r||Sp}var uu=cu.prototype=new bp;uu.constructor=cu;xp(uu,_i.prototype);uu.isPureReactComponent=!0;var Ph=Array.isArray,Ep=Object.prototype.hasOwnProperty,hu={current:null},kp={key:!0,ref:!0,__self:!0,__source:!0};function Lp(e,t,r){var s,i={},o=null,c=null;if(t!=null)for(s in t.ref!==void 0&&(c=t.ref),t.key!==void 0&&(o=""+t.key),t)Ep.call(t,s)&&!kp.hasOwnProperty(s)&&(i[s]=t[s]);var n=arguments.length-2;if(n===1)i.children=r;else if(1<n){for(var a=Array(n),p=0;p<n;p++)a[p]=arguments[p+2];i.children=a}if(e&&e.defaultProps)for(s in n=e.defaultProps,n)i[s]===void 0&&(i[s]=n[s]);return{$$typeof:Mn,type:e,key:o,ref:c,props:i,_owner:hu.current}}function v0(e,t){return{$$typeof:Mn,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function du(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mn}function y0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Nh=/\/+/g;function ul(e,t){return typeof e=="object"&&e!==null&&e.key!=null?y0(""+e.key):t.toString(36)}function ko(e,t,r,s,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var c=!1;if(e===null)c=!0;else switch(o){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case Mn:case a0:c=!0}}if(c)return c=e,i=i(c),e=s===""?"."+ul(c,0):s,Ph(i)?(r="",e!=null&&(r=e.replace(Nh,"$&/")+"/"),ko(i,t,r,"",function(p){return p})):i!=null&&(du(i)&&(i=v0(i,r+(!i.key||c&&c.key===i.key?"":(""+i.key).replace(Nh,"$&/")+"/")+e)),t.push(i)),1;if(c=0,s=s===""?".":s+":",Ph(e))for(var n=0;n<e.length;n++){o=e[n];var a=s+ul(o,n);c+=ko(o,t,r,a,i)}else if(a=m0(e),typeof a=="function")for(e=a.call(e),n=0;!(o=e.next()).done;)o=o.value,a=s+ul(o,n++),c+=ko(o,t,r,a,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return c}function Zn(e,t,r){if(e==null)return e;var s=[],i=0;return ko(e,s,"","",function(o){return t.call(r,o,i++)}),s}function w0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var _t={current:null},Lo={transition:null},S0={ReactCurrentDispatcher:_t,ReactCurrentBatchConfig:Lo,ReactCurrentOwner:hu};function Mp(){throw Error("act(...) is not supported in production builds of React.")}Ee.Children={map:Zn,forEach:function(e,t,r){Zn(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Zn(e,function(){t++}),t},toArray:function(e){return Zn(e,function(t){return t})||[]},only:function(e){if(!du(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ee.Component=_i;Ee.Fragment=l0;Ee.Profiler=u0;Ee.PureComponent=cu;Ee.StrictMode=c0;Ee.Suspense=p0;Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S0;Ee.act=Mp;Ee.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=xp({},e.props),i=e.key,o=e.ref,c=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,c=hu.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var n=e.type.defaultProps;for(a in t)Ep.call(t,a)&&!kp.hasOwnProperty(a)&&(s[a]=t[a]===void 0&&n!==void 0?n[a]:t[a])}var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){n=Array(a);for(var p=0;p<a;p++)n[p]=arguments[p+2];s.children=n}return{$$typeof:Mn,type:e.type,key:i,ref:o,props:s,_owner:c}};Ee.createContext=function(e){return e={$$typeof:d0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:h0,_context:e},e.Consumer=e};Ee.createElement=Lp;Ee.createFactory=function(e){var t=Lp.bind(null,e);return t.type=e,t};Ee.createRef=function(){return{current:null}};Ee.forwardRef=function(e){return{$$typeof:f0,render:e}};Ee.isValidElement=du;Ee.lazy=function(e){return{$$typeof:_0,_payload:{_status:-1,_result:e},_init:w0}};Ee.memo=function(e,t){return{$$typeof:g0,type:e,compare:t===void 0?null:t}};Ee.startTransition=function(e){var t=Lo.transition;Lo.transition={};try{e()}finally{Lo.transition=t}};Ee.unstable_act=Mp;Ee.useCallback=function(e,t){return _t.current.useCallback(e,t)};Ee.useContext=function(e){return _t.current.useContext(e)};Ee.useDebugValue=function(){};Ee.useDeferredValue=function(e){return _t.current.useDeferredValue(e)};Ee.useEffect=function(e,t){return _t.current.useEffect(e,t)};Ee.useId=function(){return _t.current.useId()};Ee.useImperativeHandle=function(e,t,r){return _t.current.useImperativeHandle(e,t,r)};Ee.useInsertionEffect=function(e,t){return _t.current.useInsertionEffect(e,t)};Ee.useLayoutEffect=function(e,t){return _t.current.useLayoutEffect(e,t)};Ee.useMemo=function(e,t){return _t.current.useMemo(e,t)};Ee.useReducer=function(e,t,r){return _t.current.useReducer(e,t,r)};Ee.useRef=function(e){return _t.current.useRef(e)};Ee.useState=function(e){return _t.current.useState(e)};Ee.useSyncExternalStore=function(e,t,r){return _t.current.useSyncExternalStore(e,t,r)};Ee.useTransition=function(){return _t.current.useTransition()};Ee.version="18.3.1";wp.exports=Ee;var H=wp.exports;const Rp=vp(H);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var x0=H,C0=Symbol.for("react.element"),b0=Symbol.for("react.fragment"),E0=Object.prototype.hasOwnProperty,k0=x0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,L0={key:!0,ref:!0,__self:!0,__source:!0};function Dp(e,t,r){var s,i={},o=null,c=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(c=t.ref);for(s in t)E0.call(t,s)&&!L0.hasOwnProperty(s)&&(i[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)i[s]===void 0&&(i[s]=t[s]);return{$$typeof:C0,type:e,key:o,ref:c,props:i,_owner:k0.current}}Ea.Fragment=b0;Ea.jsx=Dp;Ea.jsxs=Dp;yp.exports=Ea;var E=yp.exports,Ql={},Ap={exports:{}},Dt={},Tp={exports:{}},Pp={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(B,L){var P=B.length;B.push(L);e:for(;0<P;){var O=P-1>>>1,I=B[O];if(0<i(I,L))B[O]=L,B[P]=I,P=O;else break e}}function r(B){return B.length===0?null:B[0]}function s(B){if(B.length===0)return null;var L=B[0],P=B.pop();if(P!==L){B[0]=P;e:for(var O=0,I=B.length,W=I>>>1;O<W;){var K=2*(O+1)-1,q=B[K],Z=K+1,z=B[Z];if(0>i(q,P))Z<I&&0>i(z,q)?(B[O]=z,B[Z]=P,O=Z):(B[O]=q,B[K]=P,O=K);else if(Z<I&&0>i(z,P))B[O]=z,B[Z]=P,O=Z;else break e}}return L}function i(B,L){var P=B.sortIndex-L.sortIndex;return P!==0?P:B.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,n=c.now();e.unstable_now=function(){return c.now()-n}}var a=[],p=[],_=1,l=null,g=3,v=!1,w=!1,m=!1,h=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function u(B){for(var L=r(p);L!==null;){if(L.callback===null)s(p);else if(L.startTime<=B)s(p),L.sortIndex=L.expirationTime,t(a,L);else break;L=r(p)}}function y(B){if(m=!1,u(B),!w)if(r(a)!==null)w=!0,$(C);else{var L=r(p);L!==null&&F(y,L.startTime-B)}}function C(B,L){w=!1,m&&(m=!1,f(x),x=-1),v=!0;var P=g;try{for(u(L),l=r(a);l!==null&&(!(l.expirationTime>L)||B&&!D());){var O=l.callback;if(typeof O=="function"){l.callback=null,g=l.priorityLevel;var I=O(l.expirationTime<=L);L=e.unstable_now(),typeof I=="function"?l.callback=I:l===r(a)&&s(a),u(L)}else s(a);l=r(a)}if(l!==null)var W=!0;else{var K=r(p);K!==null&&F(y,K.startTime-L),W=!1}return W}finally{l=null,g=P,v=!1}}var S=!1,b=null,x=-1,k=5,M=-1;function D(){return!(e.unstable_now()-M<k)}function R(){if(b!==null){var B=e.unstable_now();M=B;var L=!0;try{L=b(!0,B)}finally{L?T():(S=!1,b=null)}}else S=!1}var T;if(typeof d=="function")T=function(){d(R)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,j=A.port2;A.port1.onmessage=R,T=function(){j.postMessage(null)}}else T=function(){h(R,0)};function $(B){b=B,S||(S=!0,T())}function F(B,L){x=h(function(){B(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_continueExecution=function(){w||v||(w=!0,$(C))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var L=3;break;default:L=g}var P=g;g=L;try{return B()}finally{g=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,L){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var P=g;g=B;try{return L()}finally{g=P}},e.unstable_scheduleCallback=function(B,L,P){var O=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?O+P:O):P=O,B){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=P+I,B={id:_++,callback:L,priorityLevel:B,startTime:P,expirationTime:I,sortIndex:-1},P>O?(B.sortIndex=P,t(p,B),r(a)===null&&B===r(p)&&(m?(f(x),x=-1):m=!0,F(y,P-O))):(B.sortIndex=I,t(a,B),w||v||(w=!0,$(C))),B},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(B){var L=g;return function(){var P=g;g=L;try{return B.apply(this,arguments)}finally{g=P}}}})(Pp);Tp.exports=Pp;var M0=Tp.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var R0=H,Mt=M0;function se(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 Np=new Set,Zi={};function Es(e,t){ti(e,t),ti(e+"Capture",t)}function ti(e,t){for(Zi[e]=t,e=0;e<t.length;e++)Np.add(t[e])}var mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zl=Object.prototype.hasOwnProperty,D0=/^[: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]*$/,Ih={},Bh={};function A0(e){return Zl.call(Bh,e)?!0:Zl.call(Ih,e)?!1:D0.test(e)?Bh[e]=!0:(Ih[e]=!0,!1)}function T0(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 P0(e,t,r,s){if(t===null||typeof t>"u"||T0(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 mt(e,t,r,s,i,o,c){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=c}var lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){lt[e]=new mt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];lt[t]=new mt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){lt[e]=new mt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){lt[e]=new mt(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){lt[e]=new mt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){lt[e]=new mt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){lt[e]=new mt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){lt[e]=new mt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){lt[e]=new mt(e,5,!1,e.toLowerCase(),null,!1,!1)});var fu=/[\-:]([a-z])/g;function pu(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(fu,pu);lt[t]=new mt(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(fu,pu);lt[t]=new mt(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(fu,pu);lt[t]=new mt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){lt[e]=new mt(e,1,!1,e.toLowerCase(),null,!1,!1)});lt.xlinkHref=new mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){lt[e]=new mt(e,1,!1,e.toLowerCase(),null,!0,!0)});function gu(e,t,r,s){var i=lt.hasOwnProperty(t)?lt[t]:null;(i!==null?i.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(P0(t,r,i,s)&&(r=null),s||i===null?A0(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,s=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,s?e.setAttributeNS(s,t,r):e.setAttribute(t,r))))}var Cr=R0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Jn=Symbol.for("react.element"),Ps=Symbol.for("react.portal"),Ns=Symbol.for("react.fragment"),_u=Symbol.for("react.strict_mode"),Jl=Symbol.for("react.profiler"),Ip=Symbol.for("react.provider"),Bp=Symbol.for("react.context"),mu=Symbol.for("react.forward_ref"),ec=Symbol.for("react.suspense"),tc=Symbol.for("react.suspense_list"),vu=Symbol.for("react.memo"),Rr=Symbol.for("react.lazy"),Op=Symbol.for("react.offscreen"),Oh=Symbol.iterator;function Ci(e){return e===null||typeof e!="object"?null:(e=Oh&&e[Oh]||e["@@iterator"],typeof e=="function"?e:null)}var Ye=Object.assign,hl;function Ni(e){if(hl===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);hl=t&&t[1]||""}return`
|
|
34
|
-
`+hl+e}var dl=!1;function fl(e,t){if(!e||dl)return"";dl=!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(p){var s=p}Reflect.construct(e,[],t)}else{try{t.call()}catch(p){s=p}e.call(t.prototype)}else{try{throw Error()}catch(p){s=p}e()}}catch(p){if(p&&s&&typeof p.stack=="string"){for(var i=p.stack.split(`
|
|
35
|
-
`),o=s.stack.split(`
|
|
36
|
-
`),c=i.length-1,n=o.length-1;1<=c&&0<=n&&i[c]!==o[n];)n--;for(;1<=c&&0<=n;c--,n--)if(i[c]!==o[n]){if(c!==1||n!==1)do if(c--,n--,0>n||i[c]!==o[n]){var a=`
|
|
37
|
-
`+i[c].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=c&&0<=n);break}}}finally{dl=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ni(e):""}function N0(e){switch(e.tag){case 5:return Ni(e.type);case 16:return Ni("Lazy");case 13:return Ni("Suspense");case 19:return Ni("SuspenseList");case 0:case 2:case 15:return e=fl(e.type,!1),e;case 11:return e=fl(e.type.render,!1),e;case 1:return e=fl(e.type,!0),e;default:return""}}function rc(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 Ns:return"Fragment";case Ps:return"Portal";case Jl:return"Profiler";case _u:return"StrictMode";case ec:return"Suspense";case tc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Bp:return(e.displayName||"Context")+".Consumer";case Ip:return(e._context.displayName||"Context")+".Provider";case mu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vu:return t=e.displayName||null,t!==null?t:rc(e.type)||"Memo";case Rr:t=e._payload,e=e._init;try{return rc(e(t))}catch{}}return null}function I0(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 rc(t);case 8:return t===_u?"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 Vr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $p(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function B0(e){var t=$p(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 i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(c){s=""+c,o.call(this,c)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(c){s=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function eo(e){e._valueTracker||(e._valueTracker=B0(e))}function jp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=$p(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function Vo(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 sc(e,t){var r=t.checked;return Ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function $h(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=Vr(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 Fp(e,t){t=t.checked,t!=null&&gu(e,"checked",t,!1)}function ic(e,t){Fp(e,t);var r=Vr(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")?nc(e,t.type,r):t.hasOwnProperty("defaultValue")&&nc(e,t.type,Vr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jh(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 nc(e,t,r){(t!=="number"||Vo(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ii=Array.isArray;function Gs(e,t,r,s){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&s&&(e[r].defaultSelected=!0)}else{for(r=""+Vr(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,s&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function oc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return Ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fh(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(se(92));if(Ii(r)){if(1<r.length)throw Error(se(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Vr(r)}}function Hp(e,t){var r=Vr(t.value),s=Vr(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 Hh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function zp(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 ac(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?zp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var to,Wp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,s,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,s,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(to=to||document.createElement("div"),to.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=to.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ji(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Fi={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},O0=["Webkit","ms","Moz","O"];Object.keys(Fi).forEach(function(e){O0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fi[t]=Fi[e]})});function Up(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Fi.hasOwnProperty(e)&&Fi[e]?(""+t).trim():t+"px"}function Vp(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,i=Up(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,i):e[r]=i}}var $0=Ye({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function lc(e,t){if(t){if($0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function cc(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 uc=null;function yu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hc=null,qs=null,Xs=null;function zh(e){if(e=An(e)){if(typeof hc!="function")throw Error(se(280));var t=e.stateNode;t&&(t=Da(t),hc(e.stateNode,e.type,t))}}function Kp(e){qs?Xs?Xs.push(e):Xs=[e]:qs=e}function Gp(){if(qs){var e=qs,t=Xs;if(Xs=qs=null,zh(e),t)for(e=0;e<t.length;e++)zh(t[e])}}function qp(e,t){return e(t)}function Xp(){}var pl=!1;function Yp(e,t,r){if(pl)return e(t,r);pl=!0;try{return qp(e,t,r)}finally{pl=!1,(qs!==null||Xs!==null)&&(Xp(),Gp())}}function en(e,t){var r=e.stateNode;if(r===null)return null;var s=Da(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(se(231,t,typeof r));return r}var dc=!1;if(mr)try{var bi={};Object.defineProperty(bi,"passive",{get:function(){dc=!0}}),window.addEventListener("test",bi,bi),window.removeEventListener("test",bi,bi)}catch{dc=!1}function j0(e,t,r,s,i,o,c,n,a){var p=Array.prototype.slice.call(arguments,3);try{t.apply(r,p)}catch(_){this.onError(_)}}var Hi=!1,Ko=null,Go=!1,fc=null,F0={onError:function(e){Hi=!0,Ko=e}};function H0(e,t,r,s,i,o,c,n,a){Hi=!1,Ko=null,j0.apply(F0,arguments)}function z0(e,t,r,s,i,o,c,n,a){if(H0.apply(this,arguments),Hi){if(Hi){var p=Ko;Hi=!1,Ko=null}else throw Error(se(198));Go||(Go=!0,fc=p)}}function ks(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Qp(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 Wh(e){if(ks(e)!==e)throw Error(se(188))}function W0(e){var t=e.alternate;if(!t){if(t=ks(e),t===null)throw Error(se(188));return t!==e?null:e}for(var r=e,s=t;;){var i=r.return;if(i===null)break;var o=i.alternate;if(o===null){if(s=i.return,s!==null){r=s;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===r)return Wh(i),e;if(o===s)return Wh(i),t;o=o.sibling}throw Error(se(188))}if(r.return!==s.return)r=i,s=o;else{for(var c=!1,n=i.child;n;){if(n===r){c=!0,r=i,s=o;break}if(n===s){c=!0,s=i,r=o;break}n=n.sibling}if(!c){for(n=o.child;n;){if(n===r){c=!0,r=o,s=i;break}if(n===s){c=!0,s=o,r=i;break}n=n.sibling}if(!c)throw Error(se(189))}}if(r.alternate!==s)throw Error(se(190))}if(r.tag!==3)throw Error(se(188));return r.stateNode.current===r?e:t}function Zp(e){return e=W0(e),e!==null?Jp(e):null}function Jp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Jp(e);if(t!==null)return t;e=e.sibling}return null}var eg=Mt.unstable_scheduleCallback,Uh=Mt.unstable_cancelCallback,U0=Mt.unstable_shouldYield,V0=Mt.unstable_requestPaint,Ze=Mt.unstable_now,K0=Mt.unstable_getCurrentPriorityLevel,wu=Mt.unstable_ImmediatePriority,tg=Mt.unstable_UserBlockingPriority,qo=Mt.unstable_NormalPriority,G0=Mt.unstable_LowPriority,rg=Mt.unstable_IdlePriority,ka=null,nr=null;function q0(e){if(nr&&typeof nr.onCommitFiberRoot=="function")try{nr.onCommitFiberRoot(ka,e,void 0,(e.current.flags&128)===128)}catch{}}var Xt=Math.clz32?Math.clz32:Q0,X0=Math.log,Y0=Math.LN2;function Q0(e){return e>>>=0,e===0?32:31-(X0(e)/Y0|0)|0}var ro=64,so=4194304;function Bi(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 Xo(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,i=e.suspendedLanes,o=e.pingedLanes,c=r&268435455;if(c!==0){var n=c&~i;n!==0?s=Bi(n):(o&=c,o!==0&&(s=Bi(o)))}else c=r&~i,c!==0?s=Bi(c):o!==0&&(s=Bi(o));if(s===0)return 0;if(t!==0&&t!==s&&!(t&i)&&(i=s&-s,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(s&4&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)r=31-Xt(t),i=1<<r,s|=e[r],t&=~i;return s}function Z0(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 J0(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var c=31-Xt(o),n=1<<c,a=i[c];a===-1?(!(n&r)||n&s)&&(i[c]=Z0(n,t)):a<=t&&(e.expiredLanes|=n),o&=~n}}function pc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function sg(){var e=ro;return ro<<=1,!(ro&4194240)&&(ro=64),e}function gl(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Rn(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xt(t),e[t]=r}function ey(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 i=31-Xt(r),o=1<<i;t[i]=0,s[i]=-1,e[i]=-1,r&=~o}}function Su(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-Xt(r),i=1<<s;i&t|e[s]&t&&(e[s]|=t),r&=~i}}var Ne=0;function ig(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ng,xu,og,ag,lg,gc=!1,io=[],Br=null,Or=null,$r=null,tn=new Map,rn=new Map,Ar=[],ty="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 Vh(e,t){switch(e){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":$r=null;break;case"pointerover":case"pointerout":tn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rn.delete(t.pointerId)}}function Ei(e,t,r,s,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:s,nativeEvent:o,targetContainers:[i]},t!==null&&(t=An(t),t!==null&&xu(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ry(e,t,r,s,i){switch(t){case"focusin":return Br=Ei(Br,e,t,r,s,i),!0;case"dragenter":return Or=Ei(Or,e,t,r,s,i),!0;case"mouseover":return $r=Ei($r,e,t,r,s,i),!0;case"pointerover":var o=i.pointerId;return tn.set(o,Ei(tn.get(o)||null,e,t,r,s,i)),!0;case"gotpointercapture":return o=i.pointerId,rn.set(o,Ei(rn.get(o)||null,e,t,r,s,i)),!0}return!1}function cg(e){var t=ns(e.target);if(t!==null){var r=ks(t);if(r!==null){if(t=r.tag,t===13){if(t=Qp(r),t!==null){e.blockedOn=t,lg(e.priority,function(){og(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 Mo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=_c(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);uc=s,r.target.dispatchEvent(s),uc=null}else return t=An(r),t!==null&&xu(t),e.blockedOn=r,!1;t.shift()}return!0}function Kh(e,t,r){Mo(e)&&r.delete(t)}function sy(){gc=!1,Br!==null&&Mo(Br)&&(Br=null),Or!==null&&Mo(Or)&&(Or=null),$r!==null&&Mo($r)&&($r=null),tn.forEach(Kh),rn.forEach(Kh)}function ki(e,t){e.blockedOn===t&&(e.blockedOn=null,gc||(gc=!0,Mt.unstable_scheduleCallback(Mt.unstable_NormalPriority,sy)))}function sn(e){function t(i){return ki(i,e)}if(0<io.length){ki(io[0],e);for(var r=1;r<io.length;r++){var s=io[r];s.blockedOn===e&&(s.blockedOn=null)}}for(Br!==null&&ki(Br,e),Or!==null&&ki(Or,e),$r!==null&&ki($r,e),tn.forEach(t),rn.forEach(t),r=0;r<Ar.length;r++)s=Ar[r],s.blockedOn===e&&(s.blockedOn=null);for(;0<Ar.length&&(r=Ar[0],r.blockedOn===null);)cg(r),r.blockedOn===null&&Ar.shift()}var Ys=Cr.ReactCurrentBatchConfig,Yo=!0;function iy(e,t,r,s){var i=Ne,o=Ys.transition;Ys.transition=null;try{Ne=1,Cu(e,t,r,s)}finally{Ne=i,Ys.transition=o}}function ny(e,t,r,s){var i=Ne,o=Ys.transition;Ys.transition=null;try{Ne=4,Cu(e,t,r,s)}finally{Ne=i,Ys.transition=o}}function Cu(e,t,r,s){if(Yo){var i=_c(e,t,r,s);if(i===null)El(e,t,s,Qo,r),Vh(e,s);else if(ry(i,e,t,r,s))s.stopPropagation();else if(Vh(e,s),t&4&&-1<ty.indexOf(e)){for(;i!==null;){var o=An(i);if(o!==null&&ng(o),o=_c(e,t,r,s),o===null&&El(e,t,s,Qo,r),o===i)break;i=o}i!==null&&s.stopPropagation()}else El(e,t,s,null,r)}}var Qo=null;function _c(e,t,r,s){if(Qo=null,e=yu(s),e=ns(e),e!==null)if(t=ks(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Qp(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 Qo=e,null}function ug(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(K0()){case wu:return 1;case tg:return 4;case qo:case G0:return 16;case rg:return 536870912;default:return 16}default:return 16}}var Nr=null,bu=null,Ro=null;function hg(){if(Ro)return Ro;var e,t=bu,r=t.length,s,i="value"in Nr?Nr.value:Nr.textContent,o=i.length;for(e=0;e<r&&t[e]===i[e];e++);var c=r-e;for(s=1;s<=c&&t[r-s]===i[o-s];s++);return Ro=i.slice(e,1<s?1-s:void 0)}function Do(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 no(){return!0}function Gh(){return!1}function At(e){function t(r,s,i,o,c){this._reactName=r,this._targetInst=i,this.type=s,this.nativeEvent=o,this.target=c,this.currentTarget=null;for(var n in e)e.hasOwnProperty(n)&&(r=e[n],this[n]=r?r(o):o[n]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?no:Gh,this.isPropagationStopped=Gh,this}return Ye(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=no)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=no)},persist:function(){},isPersistent:no}),t}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Eu=At(mi),Dn=Ye({},mi,{view:0,detail:0}),oy=At(Dn),_l,ml,Li,La=Ye({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ku,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!==Li&&(Li&&e.type==="mousemove"?(_l=e.screenX-Li.screenX,ml=e.screenY-Li.screenY):ml=_l=0,Li=e),_l)},movementY:function(e){return"movementY"in e?e.movementY:ml}}),qh=At(La),ay=Ye({},La,{dataTransfer:0}),ly=At(ay),cy=Ye({},Dn,{relatedTarget:0}),vl=At(cy),uy=Ye({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),hy=At(uy),dy=Ye({},mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fy=At(dy),py=Ye({},mi,{data:0}),Xh=At(py),gy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_y={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"},my={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=my[e])?!!t[e]:!1}function ku(){return vy}var yy=Ye({},Dn,{key:function(e){if(e.key){var t=gy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Do(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?_y[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ku,charCode:function(e){return e.type==="keypress"?Do(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Do(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wy=At(yy),Sy=Ye({},La,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yh=At(Sy),xy=Ye({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ku}),Cy=At(xy),by=Ye({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ey=At(by),ky=Ye({},La,{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}),Ly=At(ky),My=[9,13,27,32],Lu=mr&&"CompositionEvent"in window,zi=null;mr&&"documentMode"in document&&(zi=document.documentMode);var Ry=mr&&"TextEvent"in window&&!zi,dg=mr&&(!Lu||zi&&8<zi&&11>=zi),Qh=" ",Zh=!1;function fg(e,t){switch(e){case"keyup":return My.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Is=!1;function Dy(e,t){switch(e){case"compositionend":return pg(t);case"keypress":return t.which!==32?null:(Zh=!0,Qh);case"textInput":return e=t.data,e===Qh&&Zh?null:e;default:return null}}function Ay(e,t){if(Is)return e==="compositionend"||!Lu&&fg(e,t)?(e=hg(),Ro=bu=Nr=null,Is=!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 dg&&t.locale!=="ko"?null:t.data;default:return null}}var Ty={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 Jh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ty[e.type]:t==="textarea"}function gg(e,t,r,s){Kp(s),t=Zo(t,"onChange"),0<t.length&&(r=new Eu("onChange","change",null,r,s),e.push({event:r,listeners:t}))}var Wi=null,nn=null;function Py(e){kg(e,0)}function Ma(e){var t=$s(e);if(jp(t))return e}function Ny(e,t){if(e==="change")return t}var _g=!1;if(mr){var yl;if(mr){var wl="oninput"in document;if(!wl){var ed=document.createElement("div");ed.setAttribute("oninput","return;"),wl=typeof ed.oninput=="function"}yl=wl}else yl=!1;_g=yl&&(!document.documentMode||9<document.documentMode)}function td(){Wi&&(Wi.detachEvent("onpropertychange",mg),nn=Wi=null)}function mg(e){if(e.propertyName==="value"&&Ma(nn)){var t=[];gg(t,nn,e,yu(e)),Yp(Py,t)}}function Iy(e,t,r){e==="focusin"?(td(),Wi=t,nn=r,Wi.attachEvent("onpropertychange",mg)):e==="focusout"&&td()}function By(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ma(nn)}function Oy(e,t){if(e==="click")return Ma(t)}function $y(e,t){if(e==="input"||e==="change")return Ma(t)}function jy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qt=typeof Object.is=="function"?Object.is:jy;function on(e,t){if(Qt(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 i=r[s];if(!Zl.call(t,i)||!Qt(e[i],t[i]))return!1}return!0}function rd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sd(e,t){var r=rd(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=rd(r)}}function vg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yg(){for(var e=window,t=Vo();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Vo(e.document)}return t}function Mu(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 Fy(e){var t=yg(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&vg(r.ownerDocument.documentElement,r)){if(s!==null&&Mu(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 i=r.textContent.length,o=Math.min(s.start,i);s=s.end===void 0?o:Math.min(s.end,i),!e.extend&&o>s&&(i=s,s=o,o=i),i=sd(r,o);var c=sd(r,s);i&&c&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==c.node||e.focusOffset!==c.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>s?(e.addRange(t),e.extend(c.node,c.offset)):(t.setEnd(c.node,c.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 Hy=mr&&"documentMode"in document&&11>=document.documentMode,Bs=null,mc=null,Ui=null,vc=!1;function id(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;vc||Bs==null||Bs!==Vo(s)||(s=Bs,"selectionStart"in s&&Mu(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}),Ui&&on(Ui,s)||(Ui=s,s=Zo(mc,"onSelect"),0<s.length&&(t=new Eu("onSelect","select",null,t,r),e.push({event:t,listeners:s}),t.target=Bs)))}function oo(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Os={animationend:oo("Animation","AnimationEnd"),animationiteration:oo("Animation","AnimationIteration"),animationstart:oo("Animation","AnimationStart"),transitionend:oo("Transition","TransitionEnd")},Sl={},wg={};mr&&(wg=document.createElement("div").style,"AnimationEvent"in window||(delete Os.animationend.animation,delete Os.animationiteration.animation,delete Os.animationstart.animation),"TransitionEvent"in window||delete Os.transitionend.transition);function Ra(e){if(Sl[e])return Sl[e];if(!Os[e])return e;var t=Os[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in wg)return Sl[e]=t[r];return e}var Sg=Ra("animationend"),xg=Ra("animationiteration"),Cg=Ra("animationstart"),bg=Ra("transitionend"),Eg=new Map,nd="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 Xr(e,t){Eg.set(e,t),Es(t,[e])}for(var xl=0;xl<nd.length;xl++){var Cl=nd[xl],zy=Cl.toLowerCase(),Wy=Cl[0].toUpperCase()+Cl.slice(1);Xr(zy,"on"+Wy)}Xr(Sg,"onAnimationEnd");Xr(xg,"onAnimationIteration");Xr(Cg,"onAnimationStart");Xr("dblclick","onDoubleClick");Xr("focusin","onFocus");Xr("focusout","onBlur");Xr(bg,"onTransitionEnd");ti("onMouseEnter",["mouseout","mouseover"]);ti("onMouseLeave",["mouseout","mouseover"]);ti("onPointerEnter",["pointerout","pointerover"]);ti("onPointerLeave",["pointerout","pointerover"]);Es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Es("onBeforeInput",["compositionend","keypress","textInput","paste"]);Es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oi="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(" "),Uy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oi));function od(e,t,r){var s=e.type||"unknown-event";e.currentTarget=r,z0(s,t,void 0,e),e.currentTarget=null}function kg(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],i=s.event;s=s.listeners;e:{var o=void 0;if(t)for(var c=s.length-1;0<=c;c--){var n=s[c],a=n.instance,p=n.currentTarget;if(n=n.listener,a!==o&&i.isPropagationStopped())break e;od(i,n,p),o=a}else for(c=0;c<s.length;c++){if(n=s[c],a=n.instance,p=n.currentTarget,n=n.listener,a!==o&&i.isPropagationStopped())break e;od(i,n,p),o=a}}}if(Go)throw e=fc,Go=!1,fc=null,e}function Fe(e,t){var r=t[Cc];r===void 0&&(r=t[Cc]=new Set);var s=e+"__bubble";r.has(s)||(Lg(t,e,2,!1),r.add(s))}function bl(e,t,r){var s=0;t&&(s|=4),Lg(r,e,s,t)}var ao="_reactListening"+Math.random().toString(36).slice(2);function an(e){if(!e[ao]){e[ao]=!0,Np.forEach(function(r){r!=="selectionchange"&&(Uy.has(r)||bl(r,!1,e),bl(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ao]||(t[ao]=!0,bl("selectionchange",!1,t))}}function Lg(e,t,r,s){switch(ug(t)){case 1:var i=iy;break;case 4:i=ny;break;default:i=Cu}r=i.bind(null,t,r,e),i=void 0,!dc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),s?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function El(e,t,r,s,i){var o=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var c=s.tag;if(c===3||c===4){var n=s.stateNode.containerInfo;if(n===i||n.nodeType===8&&n.parentNode===i)break;if(c===4)for(c=s.return;c!==null;){var a=c.tag;if((a===3||a===4)&&(a=c.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;c=c.return}for(;n!==null;){if(c=ns(n),c===null)return;if(a=c.tag,a===5||a===6){s=o=c;continue e}n=n.parentNode}}s=s.return}Yp(function(){var p=o,_=yu(r),l=[];e:{var g=Eg.get(e);if(g!==void 0){var v=Eu,w=e;switch(e){case"keypress":if(Do(r)===0)break e;case"keydown":case"keyup":v=wy;break;case"focusin":w="focus",v=vl;break;case"focusout":w="blur",v=vl;break;case"beforeblur":case"afterblur":v=vl;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":v=qh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=ly;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=Cy;break;case Sg:case xg:case Cg:v=hy;break;case bg:v=Ey;break;case"scroll":v=oy;break;case"wheel":v=Ly;break;case"copy":case"cut":case"paste":v=fy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=Yh}var m=(t&4)!==0,h=!m&&e==="scroll",f=m?g!==null?g+"Capture":null:g;m=[];for(var d=p,u;d!==null;){u=d;var y=u.stateNode;if(u.tag===5&&y!==null&&(u=y,f!==null&&(y=en(d,f),y!=null&&m.push(ln(d,y,u)))),h)break;d=d.return}0<m.length&&(g=new v(g,w,null,r,_),l.push({event:g,listeners:m}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",g&&r!==uc&&(w=r.relatedTarget||r.fromElement)&&(ns(w)||w[vr]))break e;if((v||g)&&(g=_.window===_?_:(g=_.ownerDocument)?g.defaultView||g.parentWindow:window,v?(w=r.relatedTarget||r.toElement,v=p,w=w?ns(w):null,w!==null&&(h=ks(w),w!==h||w.tag!==5&&w.tag!==6)&&(w=null)):(v=null,w=p),v!==w)){if(m=qh,y="onMouseLeave",f="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(m=Yh,y="onPointerLeave",f="onPointerEnter",d="pointer"),h=v==null?g:$s(v),u=w==null?g:$s(w),g=new m(y,d+"leave",v,r,_),g.target=h,g.relatedTarget=u,y=null,ns(_)===p&&(m=new m(f,d+"enter",w,r,_),m.target=u,m.relatedTarget=h,y=m),h=y,v&&w)t:{for(m=v,f=w,d=0,u=m;u;u=As(u))d++;for(u=0,y=f;y;y=As(y))u++;for(;0<d-u;)m=As(m),d--;for(;0<u-d;)f=As(f),u--;for(;d--;){if(m===f||f!==null&&m===f.alternate)break t;m=As(m),f=As(f)}m=null}else m=null;v!==null&&ad(l,g,v,m,!1),w!==null&&h!==null&&ad(l,h,w,m,!0)}}e:{if(g=p?$s(p):window,v=g.nodeName&&g.nodeName.toLowerCase(),v==="select"||v==="input"&&g.type==="file")var C=Ny;else if(Jh(g))if(_g)C=$y;else{C=By;var S=Iy}else(v=g.nodeName)&&v.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(C=Oy);if(C&&(C=C(e,p))){gg(l,C,r,_);break e}S&&S(e,g,p),e==="focusout"&&(S=g._wrapperState)&&S.controlled&&g.type==="number"&&nc(g,"number",g.value)}switch(S=p?$s(p):window,e){case"focusin":(Jh(S)||S.contentEditable==="true")&&(Bs=S,mc=p,Ui=null);break;case"focusout":Ui=mc=Bs=null;break;case"mousedown":vc=!0;break;case"contextmenu":case"mouseup":case"dragend":vc=!1,id(l,r,_);break;case"selectionchange":if(Hy)break;case"keydown":case"keyup":id(l,r,_)}var b;if(Lu)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else Is?fg(e,r)&&(x="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(x="onCompositionStart");x&&(dg&&r.locale!=="ko"&&(Is||x!=="onCompositionStart"?x==="onCompositionEnd"&&Is&&(b=hg()):(Nr=_,bu="value"in Nr?Nr.value:Nr.textContent,Is=!0)),S=Zo(p,x),0<S.length&&(x=new Xh(x,e,null,r,_),l.push({event:x,listeners:S}),b?x.data=b:(b=pg(r),b!==null&&(x.data=b)))),(b=Ry?Dy(e,r):Ay(e,r))&&(p=Zo(p,"onBeforeInput"),0<p.length&&(_=new Xh("onBeforeInput","beforeinput",null,r,_),l.push({event:_,listeners:p}),_.data=b))}kg(l,t)})}function ln(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Zo(e,t){for(var r=t+"Capture",s=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=en(e,r),o!=null&&s.unshift(ln(e,o,i)),o=en(e,t),o!=null&&s.push(ln(e,o,i))),e=e.return}return s}function As(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ad(e,t,r,s,i){for(var o=t._reactName,c=[];r!==null&&r!==s;){var n=r,a=n.alternate,p=n.stateNode;if(a!==null&&a===s)break;n.tag===5&&p!==null&&(n=p,i?(a=en(r,o),a!=null&&c.unshift(ln(r,a,n))):i||(a=en(r,o),a!=null&&c.push(ln(r,a,n)))),r=r.return}c.length!==0&&e.push({event:t,listeners:c})}var Vy=/\r\n?/g,Ky=/\u0000|\uFFFD/g;function ld(e){return(typeof e=="string"?e:""+e).replace(Vy,`
|
|
38
|
-
`).replace(Ky,"")}function lo(e,t,r){if(t=ld(t),ld(e)!==t&&r)throw Error(se(425))}function Jo(){}var yc=null,wc=null;function Sc(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 xc=typeof setTimeout=="function"?setTimeout:void 0,Gy=typeof clearTimeout=="function"?clearTimeout:void 0,cd=typeof Promise=="function"?Promise:void 0,qy=typeof queueMicrotask=="function"?queueMicrotask:typeof cd<"u"?function(e){return cd.resolve(null).then(e).catch(Xy)}:xc;function Xy(e){setTimeout(function(){throw e})}function kl(e,t){var r=t,s=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(s===0){e.removeChild(i),sn(t);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=i}while(r);sn(t)}function jr(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 ud(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 vi=Math.random().toString(36).slice(2),sr="__reactFiber$"+vi,cn="__reactProps$"+vi,vr="__reactContainer$"+vi,Cc="__reactEvents$"+vi,Yy="__reactListeners$"+vi,Qy="__reactHandles$"+vi;function ns(e){var t=e[sr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[vr]||r[sr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=ud(e);e!==null;){if(r=e[sr])return r;e=ud(e)}return t}e=r,r=e.parentNode}return null}function An(e){return e=e[sr]||e[vr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $s(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function Da(e){return e[cn]||null}var bc=[],js=-1;function Yr(e){return{current:e}}function He(e){0>js||(e.current=bc[js],bc[js]=null,js--)}function Ie(e,t){js++,bc[js]=e.current,e.current=t}var Kr={},ft=Yr(Kr),St=Yr(!1),ps=Kr;function ri(e,t){var r=e.type.contextTypes;if(!r)return Kr;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in r)i[o]=t[o];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xt(e){return e=e.childContextTypes,e!=null}function ea(){He(St),He(ft)}function hd(e,t,r){if(ft.current!==Kr)throw Error(se(168));Ie(ft,t),Ie(St,r)}function Mg(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var i in s)if(!(i in t))throw Error(se(108,I0(e)||"Unknown",i));return Ye({},r,s)}function ta(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kr,ps=ft.current,Ie(ft,e),Ie(St,St.current),!0}function dd(e,t,r){var s=e.stateNode;if(!s)throw Error(se(169));r?(e=Mg(e,t,ps),s.__reactInternalMemoizedMergedChildContext=e,He(St),He(ft),Ie(ft,e)):He(St),Ie(St,r)}var dr=null,Aa=!1,Ll=!1;function Rg(e){dr===null?dr=[e]:dr.push(e)}function Zy(e){Aa=!0,Rg(e)}function Qr(){if(!Ll&&dr!==null){Ll=!0;var e=0,t=Ne;try{var r=dr;for(Ne=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}dr=null,Aa=!1}catch(i){throw dr!==null&&(dr=dr.slice(e+1)),eg(wu,Qr),i}finally{Ne=t,Ll=!1}}return null}var Fs=[],Hs=0,ra=null,sa=0,It=[],Bt=0,gs=null,fr=1,pr="";function ts(e,t){Fs[Hs++]=sa,Fs[Hs++]=ra,ra=e,sa=t}function Dg(e,t,r){It[Bt++]=fr,It[Bt++]=pr,It[Bt++]=gs,gs=e;var s=fr;e=pr;var i=32-Xt(s)-1;s&=~(1<<i),r+=1;var o=32-Xt(t)+i;if(30<o){var c=i-i%5;o=(s&(1<<c)-1).toString(32),s>>=c,i-=c,fr=1<<32-Xt(t)+i|r<<i|s,pr=o+e}else fr=1<<o|r<<i|s,pr=e}function Ru(e){e.return!==null&&(ts(e,1),Dg(e,1,0))}function Du(e){for(;e===ra;)ra=Fs[--Hs],Fs[Hs]=null,sa=Fs[--Hs],Fs[Hs]=null;for(;e===gs;)gs=It[--Bt],It[Bt]=null,pr=It[--Bt],It[Bt]=null,fr=It[--Bt],It[Bt]=null}var Lt=null,kt=null,Ve=!1,Vt=null;function Ag(e,t){var r=Ot(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 fd(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,Lt=e,kt=jr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Lt=e,kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=gs!==null?{id:fr,overflow:pr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Ot(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Lt=e,kt=null,!0):!1;default:return!1}}function Ec(e){return(e.mode&1)!==0&&(e.flags&128)===0}function kc(e){if(Ve){var t=kt;if(t){var r=t;if(!fd(e,t)){if(Ec(e))throw Error(se(418));t=jr(r.nextSibling);var s=Lt;t&&fd(e,t)?Ag(s,r):(e.flags=e.flags&-4097|2,Ve=!1,Lt=e)}}else{if(Ec(e))throw Error(se(418));e.flags=e.flags&-4097|2,Ve=!1,Lt=e}}}function pd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Lt=e}function co(e){if(e!==Lt)return!1;if(!Ve)return pd(e),Ve=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Sc(e.type,e.memoizedProps)),t&&(t=kt)){if(Ec(e))throw Tg(),Error(se(418));for(;t;)Ag(e,t),t=jr(t.nextSibling)}if(pd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){kt=jr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}kt=null}}else kt=Lt?jr(e.stateNode.nextSibling):null;return!0}function Tg(){for(var e=kt;e;)e=jr(e.nextSibling)}function si(){kt=Lt=null,Ve=!1}function Au(e){Vt===null?Vt=[e]:Vt.push(e)}var Jy=Cr.ReactCurrentBatchConfig;function Mi(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(se(309));var s=r.stateNode}if(!s)throw Error(se(147,e));var i=s,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(c){var n=i.refs;c===null?delete n[o]:n[o]=c},t._stringRef=o,t)}if(typeof e!="string")throw Error(se(284));if(!r._owner)throw Error(se(290,e))}return e}function uo(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function gd(e){var t=e._init;return t(e._payload)}function Pg(e){function t(f,d){if(e){var u=f.deletions;u===null?(f.deletions=[d],f.flags|=16):u.push(d)}}function r(f,d){if(!e)return null;for(;d!==null;)t(f,d),d=d.sibling;return null}function s(f,d){for(f=new Map;d!==null;)d.key!==null?f.set(d.key,d):f.set(d.index,d),d=d.sibling;return f}function i(f,d){return f=Wr(f,d),f.index=0,f.sibling=null,f}function o(f,d,u){return f.index=u,e?(u=f.alternate,u!==null?(u=u.index,u<d?(f.flags|=2,d):u):(f.flags|=2,d)):(f.flags|=1048576,d)}function c(f){return e&&f.alternate===null&&(f.flags|=2),f}function n(f,d,u,y){return d===null||d.tag!==6?(d=Nl(u,f.mode,y),d.return=f,d):(d=i(d,u),d.return=f,d)}function a(f,d,u,y){var C=u.type;return C===Ns?_(f,d,u.props.children,y,u.key):d!==null&&(d.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Rr&&gd(C)===d.type)?(y=i(d,u.props),y.ref=Mi(f,d,u),y.return=f,y):(y=Oo(u.type,u.key,u.props,null,f.mode,y),y.ref=Mi(f,d,u),y.return=f,y)}function p(f,d,u,y){return d===null||d.tag!==4||d.stateNode.containerInfo!==u.containerInfo||d.stateNode.implementation!==u.implementation?(d=Il(u,f.mode,y),d.return=f,d):(d=i(d,u.children||[]),d.return=f,d)}function _(f,d,u,y,C){return d===null||d.tag!==7?(d=hs(u,f.mode,y,C),d.return=f,d):(d=i(d,u),d.return=f,d)}function l(f,d,u){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Nl(""+d,f.mode,u),d.return=f,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Jn:return u=Oo(d.type,d.key,d.props,null,f.mode,u),u.ref=Mi(f,null,d),u.return=f,u;case Ps:return d=Il(d,f.mode,u),d.return=f,d;case Rr:var y=d._init;return l(f,y(d._payload),u)}if(Ii(d)||Ci(d))return d=hs(d,f.mode,u,null),d.return=f,d;uo(f,d)}return null}function g(f,d,u,y){var C=d!==null?d.key:null;if(typeof u=="string"&&u!==""||typeof u=="number")return C!==null?null:n(f,d,""+u,y);if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Jn:return u.key===C?a(f,d,u,y):null;case Ps:return u.key===C?p(f,d,u,y):null;case Rr:return C=u._init,g(f,d,C(u._payload),y)}if(Ii(u)||Ci(u))return C!==null?null:_(f,d,u,y,null);uo(f,u)}return null}function v(f,d,u,y,C){if(typeof y=="string"&&y!==""||typeof y=="number")return f=f.get(u)||null,n(d,f,""+y,C);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Jn:return f=f.get(y.key===null?u:y.key)||null,a(d,f,y,C);case Ps:return f=f.get(y.key===null?u:y.key)||null,p(d,f,y,C);case Rr:var S=y._init;return v(f,d,u,S(y._payload),C)}if(Ii(y)||Ci(y))return f=f.get(u)||null,_(d,f,y,C,null);uo(d,y)}return null}function w(f,d,u,y){for(var C=null,S=null,b=d,x=d=0,k=null;b!==null&&x<u.length;x++){b.index>x?(k=b,b=null):k=b.sibling;var M=g(f,b,u[x],y);if(M===null){b===null&&(b=k);break}e&&b&&M.alternate===null&&t(f,b),d=o(M,d,x),S===null?C=M:S.sibling=M,S=M,b=k}if(x===u.length)return r(f,b),Ve&&ts(f,x),C;if(b===null){for(;x<u.length;x++)b=l(f,u[x],y),b!==null&&(d=o(b,d,x),S===null?C=b:S.sibling=b,S=b);return Ve&&ts(f,x),C}for(b=s(f,b);x<u.length;x++)k=v(b,f,x,u[x],y),k!==null&&(e&&k.alternate!==null&&b.delete(k.key===null?x:k.key),d=o(k,d,x),S===null?C=k:S.sibling=k,S=k);return e&&b.forEach(function(D){return t(f,D)}),Ve&&ts(f,x),C}function m(f,d,u,y){var C=Ci(u);if(typeof C!="function")throw Error(se(150));if(u=C.call(u),u==null)throw Error(se(151));for(var S=C=null,b=d,x=d=0,k=null,M=u.next();b!==null&&!M.done;x++,M=u.next()){b.index>x?(k=b,b=null):k=b.sibling;var D=g(f,b,M.value,y);if(D===null){b===null&&(b=k);break}e&&b&&D.alternate===null&&t(f,b),d=o(D,d,x),S===null?C=D:S.sibling=D,S=D,b=k}if(M.done)return r(f,b),Ve&&ts(f,x),C;if(b===null){for(;!M.done;x++,M=u.next())M=l(f,M.value,y),M!==null&&(d=o(M,d,x),S===null?C=M:S.sibling=M,S=M);return Ve&&ts(f,x),C}for(b=s(f,b);!M.done;x++,M=u.next())M=v(b,f,x,M.value,y),M!==null&&(e&&M.alternate!==null&&b.delete(M.key===null?x:M.key),d=o(M,d,x),S===null?C=M:S.sibling=M,S=M);return e&&b.forEach(function(R){return t(f,R)}),Ve&&ts(f,x),C}function h(f,d,u,y){if(typeof u=="object"&&u!==null&&u.type===Ns&&u.key===null&&(u=u.props.children),typeof u=="object"&&u!==null){switch(u.$$typeof){case Jn:e:{for(var C=u.key,S=d;S!==null;){if(S.key===C){if(C=u.type,C===Ns){if(S.tag===7){r(f,S.sibling),d=i(S,u.props.children),d.return=f,f=d;break e}}else if(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Rr&&gd(C)===S.type){r(f,S.sibling),d=i(S,u.props),d.ref=Mi(f,S,u),d.return=f,f=d;break e}r(f,S);break}else t(f,S);S=S.sibling}u.type===Ns?(d=hs(u.props.children,f.mode,y,u.key),d.return=f,f=d):(y=Oo(u.type,u.key,u.props,null,f.mode,y),y.ref=Mi(f,d,u),y.return=f,f=y)}return c(f);case Ps:e:{for(S=u.key;d!==null;){if(d.key===S)if(d.tag===4&&d.stateNode.containerInfo===u.containerInfo&&d.stateNode.implementation===u.implementation){r(f,d.sibling),d=i(d,u.children||[]),d.return=f,f=d;break e}else{r(f,d);break}else t(f,d);d=d.sibling}d=Il(u,f.mode,y),d.return=f,f=d}return c(f);case Rr:return S=u._init,h(f,d,S(u._payload),y)}if(Ii(u))return w(f,d,u,y);if(Ci(u))return m(f,d,u,y);uo(f,u)}return typeof u=="string"&&u!==""||typeof u=="number"?(u=""+u,d!==null&&d.tag===6?(r(f,d.sibling),d=i(d,u),d.return=f,f=d):(r(f,d),d=Nl(u,f.mode,y),d.return=f,f=d),c(f)):r(f,d)}return h}var ii=Pg(!0),Ng=Pg(!1),ia=Yr(null),na=null,zs=null,Tu=null;function Pu(){Tu=zs=na=null}function Nu(e){var t=ia.current;He(ia),e._currentValue=t}function Lc(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 Qs(e,t){na=e,Tu=zs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(yt=!0),e.firstContext=null)}function jt(e){var t=e._currentValue;if(Tu!==e)if(e={context:e,memoizedValue:t,next:null},zs===null){if(na===null)throw Error(se(308));zs=e,na.dependencies={lanes:0,firstContext:e}}else zs=zs.next=e;return t}var os=null;function Iu(e){os===null?os=[e]:os.push(e)}function Ig(e,t,r,s){var i=t.interleaved;return i===null?(r.next=r,Iu(t)):(r.next=i.next,i.next=r),t.interleaved=r,yr(e,s)}function yr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Dr=!1;function Bu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bg(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 _r(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fr(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Re&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,yr(e,r)}return i=s.interleaved,i===null?(t.next=t,Iu(s)):(t.next=i.next,i.next=t),s.interleaved=t,yr(e,r)}function Ao(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,Su(e,r)}}function _d(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var i=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var c={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?i=o=c:o=o.next=c,r=r.next}while(r!==null);o===null?i=o=t:o=o.next=t}else i=o=t;r={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:o,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 oa(e,t,r,s){var i=e.updateQueue;Dr=!1;var o=i.firstBaseUpdate,c=i.lastBaseUpdate,n=i.shared.pending;if(n!==null){i.shared.pending=null;var a=n,p=a.next;a.next=null,c===null?o=p:c.next=p,c=a;var _=e.alternate;_!==null&&(_=_.updateQueue,n=_.lastBaseUpdate,n!==c&&(n===null?_.firstBaseUpdate=p:n.next=p,_.lastBaseUpdate=a))}if(o!==null){var l=i.baseState;c=0,_=p=a=null,n=o;do{var g=n.lane,v=n.eventTime;if((s&g)===g){_!==null&&(_=_.next={eventTime:v,lane:0,tag:n.tag,payload:n.payload,callback:n.callback,next:null});e:{var w=e,m=n;switch(g=t,v=r,m.tag){case 1:if(w=m.payload,typeof w=="function"){l=w.call(v,l,g);break e}l=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=m.payload,g=typeof w=="function"?w.call(v,l,g):w,g==null)break e;l=Ye({},l,g);break e;case 2:Dr=!0}}n.callback!==null&&n.lane!==0&&(e.flags|=64,g=i.effects,g===null?i.effects=[n]:g.push(n))}else v={eventTime:v,lane:g,tag:n.tag,payload:n.payload,callback:n.callback,next:null},_===null?(p=_=v,a=l):_=_.next=v,c|=g;if(n=n.next,n===null){if(n=i.shared.pending,n===null)break;g=n,n=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(!0);if(_===null&&(a=l),i.baseState=a,i.firstBaseUpdate=p,i.lastBaseUpdate=_,t=i.shared.interleaved,t!==null){i=t;do c|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);ms|=c,e.lanes=c,e.memoizedState=l}}function md(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],i=s.callback;if(i!==null){if(s.callback=null,s=r,typeof i!="function")throw Error(se(191,i));i.call(s)}}}var Tn={},or=Yr(Tn),un=Yr(Tn),hn=Yr(Tn);function as(e){if(e===Tn)throw Error(se(174));return e}function Ou(e,t){switch(Ie(hn,t),Ie(un,e),Ie(or,Tn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ac(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ac(t,e)}He(or),Ie(or,t)}function ni(){He(or),He(un),He(hn)}function Og(e){as(hn.current);var t=as(or.current),r=ac(t,e.type);t!==r&&(Ie(un,e),Ie(or,r))}function $u(e){un.current===e&&(He(or),He(un))}var qe=Yr(0);function aa(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ml=[];function ju(){for(var e=0;e<Ml.length;e++)Ml[e]._workInProgressVersionPrimary=null;Ml.length=0}var To=Cr.ReactCurrentDispatcher,Rl=Cr.ReactCurrentBatchConfig,_s=0,Xe=null,rt=null,it=null,la=!1,Vi=!1,dn=0,e1=0;function ct(){throw Error(se(321))}function Fu(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Qt(e[r],t[r]))return!1;return!0}function Hu(e,t,r,s,i,o){if(_s=o,Xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,To.current=e===null||e.memoizedState===null?i1:n1,e=r(s,i),Vi){o=0;do{if(Vi=!1,dn=0,25<=o)throw Error(se(301));o+=1,it=rt=null,t.updateQueue=null,To.current=o1,e=r(s,i)}while(Vi)}if(To.current=ca,t=rt!==null&&rt.next!==null,_s=0,it=rt=Xe=null,la=!1,t)throw Error(se(300));return e}function zu(){var e=dn!==0;return dn=0,e}function tr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?Xe.memoizedState=it=e:it=it.next=e,it}function Ft(){if(rt===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=it===null?Xe.memoizedState:it.next;if(t!==null)it=t,rt=e;else{if(e===null)throw Error(se(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},it===null?Xe.memoizedState=it=e:it=it.next=e}return it}function fn(e,t){return typeof t=="function"?t(e):t}function Dl(e){var t=Ft(),r=t.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=e;var s=rt,i=s.baseQueue,o=r.pending;if(o!==null){if(i!==null){var c=i.next;i.next=o.next,o.next=c}s.baseQueue=i=o,r.pending=null}if(i!==null){o=i.next,s=s.baseState;var n=c=null,a=null,p=o;do{var _=p.lane;if((_s&_)===_)a!==null&&(a=a.next={lane:0,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),s=p.hasEagerState?p.eagerState:e(s,p.action);else{var l={lane:_,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null};a===null?(n=a=l,c=s):a=a.next=l,Xe.lanes|=_,ms|=_}p=p.next}while(p!==null&&p!==o);a===null?c=s:a.next=n,Qt(s,t.memoizedState)||(yt=!0),t.memoizedState=s,t.baseState=c,t.baseQueue=a,r.lastRenderedState=s}if(e=r.interleaved,e!==null){i=e;do o=i.lane,Xe.lanes|=o,ms|=o,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Al(e){var t=Ft(),r=t.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=e;var s=r.dispatch,i=r.pending,o=t.memoizedState;if(i!==null){r.pending=null;var c=i=i.next;do o=e(o,c.action),c=c.next;while(c!==i);Qt(o,t.memoizedState)||(yt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,s]}function $g(){}function jg(e,t){var r=Xe,s=Ft(),i=t(),o=!Qt(s.memoizedState,i);if(o&&(s.memoizedState=i,yt=!0),s=s.queue,Wu(zg.bind(null,r,s,e),[e]),s.getSnapshot!==t||o||it!==null&&it.memoizedState.tag&1){if(r.flags|=2048,pn(9,Hg.bind(null,r,s,i,t),void 0,null),nt===null)throw Error(se(349));_s&30||Fg(r,t,i)}return i}function Fg(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Xe.updateQueue,t===null?(t={lastEffect:null,stores:null},Xe.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Hg(e,t,r,s){t.value=r,t.getSnapshot=s,Wg(t)&&Ug(e)}function zg(e,t,r){return r(function(){Wg(t)&&Ug(e)})}function Wg(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Qt(e,r)}catch{return!0}}function Ug(e){var t=yr(e,1);t!==null&&Yt(t,e,1,-1)}function vd(e){var t=tr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:e},t.queue=e,e=e.dispatch=s1.bind(null,Xe,e),[t.memoizedState,e]}function pn(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=Xe.updateQueue,t===null?(t={lastEffect:null,stores:null},Xe.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 Vg(){return Ft().memoizedState}function Po(e,t,r,s){var i=tr();Xe.flags|=e,i.memoizedState=pn(1|t,r,void 0,s===void 0?null:s)}function Ta(e,t,r,s){var i=Ft();s=s===void 0?null:s;var o=void 0;if(rt!==null){var c=rt.memoizedState;if(o=c.destroy,s!==null&&Fu(s,c.deps)){i.memoizedState=pn(t,r,o,s);return}}Xe.flags|=e,i.memoizedState=pn(1|t,r,o,s)}function yd(e,t){return Po(8390656,8,e,t)}function Wu(e,t){return Ta(2048,8,e,t)}function Kg(e,t){return Ta(4,2,e,t)}function Gg(e,t){return Ta(4,4,e,t)}function qg(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 Xg(e,t,r){return r=r!=null?r.concat([e]):null,Ta(4,4,qg.bind(null,t,e),r)}function Uu(){}function Yg(e,t){var r=Ft();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Fu(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function Qg(e,t){var r=Ft();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Fu(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function Zg(e,t,r){return _s&21?(Qt(r,t)||(r=sg(),Xe.lanes|=r,ms|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,yt=!0),e.memoizedState=r)}function t1(e,t){var r=Ne;Ne=r!==0&&4>r?r:4,e(!0);var s=Rl.transition;Rl.transition={};try{e(!1),t()}finally{Ne=r,Rl.transition=s}}function Jg(){return Ft().memoizedState}function r1(e,t,r){var s=zr(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},e_(e))t_(t,r);else if(r=Ig(e,t,r,s),r!==null){var i=gt();Yt(r,e,s,i),r_(r,t,s)}}function s1(e,t,r){var s=zr(e),i={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(e_(e))t_(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var c=t.lastRenderedState,n=o(c,r);if(i.hasEagerState=!0,i.eagerState=n,Qt(n,c)){var a=t.interleaved;a===null?(i.next=i,Iu(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}r=Ig(e,t,i,s),r!==null&&(i=gt(),Yt(r,e,s,i),r_(r,t,s))}}function e_(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function t_(e,t){Vi=la=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function r_(e,t,r){if(r&4194240){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Su(e,r)}}var ca={readContext:jt,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useInsertionEffect:ct,useLayoutEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useMutableSource:ct,useSyncExternalStore:ct,useId:ct,unstable_isNewReconciler:!1},i1={readContext:jt,useCallback:function(e,t){return tr().memoizedState=[e,t===void 0?null:t],e},useContext:jt,useEffect:yd,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Po(4194308,4,qg.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Po(4194308,4,e,t)},useInsertionEffect:function(e,t){return Po(4,2,e,t)},useMemo:function(e,t){var r=tr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=tr();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=r1.bind(null,Xe,e),[s.memoizedState,e]},useRef:function(e){var t=tr();return e={current:e},t.memoizedState=e},useState:vd,useDebugValue:Uu,useDeferredValue:function(e){return tr().memoizedState=e},useTransition:function(){var e=vd(!1),t=e[0];return e=t1.bind(null,e[1]),tr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=Xe,i=tr();if(Ve){if(r===void 0)throw Error(se(407));r=r()}else{if(r=t(),nt===null)throw Error(se(349));_s&30||Fg(s,t,r)}i.memoizedState=r;var o={value:r,getSnapshot:t};return i.queue=o,yd(zg.bind(null,s,o,e),[e]),s.flags|=2048,pn(9,Hg.bind(null,s,o,r,t),void 0,null),r},useId:function(){var e=tr(),t=nt.identifierPrefix;if(Ve){var r=pr,s=fr;r=(s&~(1<<32-Xt(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=dn++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=e1++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},n1={readContext:jt,useCallback:Yg,useContext:jt,useEffect:Wu,useImperativeHandle:Xg,useInsertionEffect:Kg,useLayoutEffect:Gg,useMemo:Qg,useReducer:Dl,useRef:Vg,useState:function(){return Dl(fn)},useDebugValue:Uu,useDeferredValue:function(e){var t=Ft();return Zg(t,rt.memoizedState,e)},useTransition:function(){var e=Dl(fn)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:$g,useSyncExternalStore:jg,useId:Jg,unstable_isNewReconciler:!1},o1={readContext:jt,useCallback:Yg,useContext:jt,useEffect:Wu,useImperativeHandle:Xg,useInsertionEffect:Kg,useLayoutEffect:Gg,useMemo:Qg,useReducer:Al,useRef:Vg,useState:function(){return Al(fn)},useDebugValue:Uu,useDeferredValue:function(e){var t=Ft();return rt===null?t.memoizedState=e:Zg(t,rt.memoizedState,e)},useTransition:function(){var e=Al(fn)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:$g,useSyncExternalStore:jg,useId:Jg,unstable_isNewReconciler:!1};function zt(e,t){if(e&&e.defaultProps){t=Ye({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Mc(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:Ye({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Pa={isMounted:function(e){return(e=e._reactInternals)?ks(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=gt(),i=zr(e),o=_r(s,i);o.payload=t,r!=null&&(o.callback=r),t=Fr(e,o,i),t!==null&&(Yt(t,e,i,s),Ao(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=gt(),i=zr(e),o=_r(s,i);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=Fr(e,o,i),t!==null&&(Yt(t,e,i,s),Ao(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=gt(),s=zr(e),i=_r(r,s);i.tag=2,t!=null&&(i.callback=t),t=Fr(e,i,s),t!==null&&(Yt(t,e,s,r),Ao(t,e,s))}};function wd(e,t,r,s,i,o,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,o,c):t.prototype&&t.prototype.isPureReactComponent?!on(r,s)||!on(i,o):!0}function s_(e,t,r){var s=!1,i=Kr,o=t.contextType;return typeof o=="object"&&o!==null?o=jt(o):(i=xt(t)?ps:ft.current,s=t.contextTypes,o=(s=s!=null)?ri(e,i):Kr),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Pa,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Sd(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&&Pa.enqueueReplaceState(t,t.state,null)}function Rc(e,t,r,s){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},Bu(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=jt(o):(o=xt(t)?ps:ft.current,i.context=ri(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Mc(e,t,o,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Pa.enqueueReplaceState(i,i.state,null),oa(e,r,i,s),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function oi(e,t){try{var r="",s=t;do r+=N0(s),s=s.return;while(s);var i=r}catch(o){i=`
|
|
39
|
-
Error generating stack: `+o.message+`
|
|
40
|
-
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Tl(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Dc(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var a1=typeof WeakMap=="function"?WeakMap:Map;function i_(e,t,r){r=_r(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){ha||(ha=!0,Fc=s),Dc(e,t)},r}function n_(e,t,r){r=_r(-1,r),r.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var i=t.value;r.payload=function(){return s(i)},r.callback=function(){Dc(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){Dc(e,t),typeof s!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var c=t.stack;this.componentDidCatch(t.value,{componentStack:c!==null?c:""})}),r}function xd(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new a1;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(r)||(i.add(r),e=S1.bind(null,e,t,r),t.then(e,e))}function Cd(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 bd(e,t,r,s,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=_r(-1,1),t.tag=2,Fr(r,t,1))),r.lanes|=1),e)}var l1=Cr.ReactCurrentOwner,yt=!1;function pt(e,t,r,s){t.child=e===null?Ng(t,null,r,s):ii(t,e.child,r,s)}function Ed(e,t,r,s,i){r=r.render;var o=t.ref;return Qs(t,i),s=Hu(e,t,r,s,o,i),r=zu(),e!==null&&!yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wr(e,t,i)):(Ve&&r&&Ru(t),t.flags|=1,pt(e,t,s,i),t.child)}function kd(e,t,r,s,i){if(e===null){var o=r.type;return typeof o=="function"&&!Zu(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,o_(e,t,o,s,i)):(e=Oo(r.type,null,s,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var c=o.memoizedProps;if(r=r.compare,r=r!==null?r:on,r(c,s)&&e.ref===t.ref)return wr(e,t,i)}return t.flags|=1,e=Wr(o,s),e.ref=t.ref,e.return=t,t.child=e}function o_(e,t,r,s,i){if(e!==null){var o=e.memoizedProps;if(on(o,s)&&e.ref===t.ref)if(yt=!1,t.pendingProps=s=o,(e.lanes&i)!==0)e.flags&131072&&(yt=!0);else return t.lanes=e.lanes,wr(e,t,i)}return Ac(e,t,r,s,i)}function a_(e,t,r){var s=t.pendingProps,i=s.children,o=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ie(Us,bt),bt|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ie(Us,bt),bt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=o!==null?o.baseLanes:r,Ie(Us,bt),bt|=s}else o!==null?(s=o.baseLanes|r,t.memoizedState=null):s=r,Ie(Us,bt),bt|=s;return pt(e,t,i,r),t.child}function l_(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ac(e,t,r,s,i){var o=xt(r)?ps:ft.current;return o=ri(t,o),Qs(t,i),r=Hu(e,t,r,s,o,i),s=zu(),e!==null&&!yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wr(e,t,i)):(Ve&&s&&Ru(t),t.flags|=1,pt(e,t,r,i),t.child)}function Ld(e,t,r,s,i){if(xt(r)){var o=!0;ta(t)}else o=!1;if(Qs(t,i),t.stateNode===null)No(e,t),s_(t,r,s),Rc(t,r,s,i),s=!0;else if(e===null){var c=t.stateNode,n=t.memoizedProps;c.props=n;var a=c.context,p=r.contextType;typeof p=="object"&&p!==null?p=jt(p):(p=xt(r)?ps:ft.current,p=ri(t,p));var _=r.getDerivedStateFromProps,l=typeof _=="function"||typeof c.getSnapshotBeforeUpdate=="function";l||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(n!==s||a!==p)&&Sd(t,c,s,p),Dr=!1;var g=t.memoizedState;c.state=g,oa(t,s,c,i),a=t.memoizedState,n!==s||g!==a||St.current||Dr?(typeof _=="function"&&(Mc(t,r,_,s),a=t.memoizedState),(n=Dr||wd(t,r,n,s,g,a,p))?(l||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=a),c.props=s,c.state=a,c.context=p,s=n):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{c=t.stateNode,Bg(e,t),n=t.memoizedProps,p=t.type===t.elementType?n:zt(t.type,n),c.props=p,l=t.pendingProps,g=c.context,a=r.contextType,typeof a=="object"&&a!==null?a=jt(a):(a=xt(r)?ps:ft.current,a=ri(t,a));var v=r.getDerivedStateFromProps;(_=typeof v=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(n!==l||g!==a)&&Sd(t,c,s,a),Dr=!1,g=t.memoizedState,c.state=g,oa(t,s,c,i);var w=t.memoizedState;n!==l||g!==w||St.current||Dr?(typeof v=="function"&&(Mc(t,r,v,s),w=t.memoizedState),(p=Dr||wd(t,r,p,s,g,w,a)||!1)?(_||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,w,a),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,w,a)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||n===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=w),c.props=s,c.state=w,c.context=a,s=p):(typeof c.componentDidUpdate!="function"||n===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),s=!1)}return Tc(e,t,r,s,o,i)}function Tc(e,t,r,s,i,o){l_(e,t);var c=(t.flags&128)!==0;if(!s&&!c)return i&&dd(t,r,!1),wr(e,t,o);s=t.stateNode,l1.current=t;var n=c&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&c?(t.child=ii(t,e.child,null,o),t.child=ii(t,null,n,o)):pt(e,t,n,o),t.memoizedState=s.state,i&&dd(t,r,!0),t.child}function c_(e){var t=e.stateNode;t.pendingContext?hd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hd(e,t.context,!1),Ou(e,t.containerInfo)}function Md(e,t,r,s,i){return si(),Au(i),t.flags|=256,pt(e,t,r,s),t.child}var Pc={dehydrated:null,treeContext:null,retryLane:0};function Nc(e){return{baseLanes:e,cachePool:null,transitions:null}}function u_(e,t,r){var s=t.pendingProps,i=qe.current,o=!1,c=(t.flags&128)!==0,n;if((n=c)||(n=e!==null&&e.memoizedState===null?!1:(i&2)!==0),n?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ie(qe,i&1),e===null)return kc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(c=s.children,e=s.fallback,o?(s=t.mode,o=t.child,c={mode:"hidden",children:c},!(s&1)&&o!==null?(o.childLanes=0,o.pendingProps=c):o=Ba(c,s,0,null),e=hs(e,s,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Nc(r),t.memoizedState=Pc,e):Vu(t,c));if(i=e.memoizedState,i!==null&&(n=i.dehydrated,n!==null))return c1(e,t,c,s,n,i,r);if(o){o=s.fallback,c=t.mode,i=e.child,n=i.sibling;var a={mode:"hidden",children:s.children};return!(c&1)&&t.child!==i?(s=t.child,s.childLanes=0,s.pendingProps=a,t.deletions=null):(s=Wr(i,a),s.subtreeFlags=i.subtreeFlags&14680064),n!==null?o=Wr(n,o):(o=hs(o,c,r,null),o.flags|=2),o.return=t,s.return=t,s.sibling=o,t.child=s,s=o,o=t.child,c=e.child.memoizedState,c=c===null?Nc(r):{baseLanes:c.baseLanes|r,cachePool:null,transitions:c.transitions},o.memoizedState=c,o.childLanes=e.childLanes&~r,t.memoizedState=Pc,s}return o=e.child,e=o.sibling,s=Wr(o,{mode:"visible",children:s.children}),!(t.mode&1)&&(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 Vu(e,t){return t=Ba({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ho(e,t,r,s){return s!==null&&Au(s),ii(t,e.child,null,r),e=Vu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function c1(e,t,r,s,i,o,c){if(r)return t.flags&256?(t.flags&=-257,s=Tl(Error(se(422))),ho(e,t,c,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=s.fallback,i=t.mode,s=Ba({mode:"visible",children:s.children},i,0,null),o=hs(o,i,c,null),o.flags|=2,s.return=t,o.return=t,s.sibling=o,t.child=s,t.mode&1&&ii(t,e.child,null,c),t.child.memoizedState=Nc(c),t.memoizedState=Pc,o);if(!(t.mode&1))return ho(e,t,c,null);if(i.data==="$!"){if(s=i.nextSibling&&i.nextSibling.dataset,s)var n=s.dgst;return s=n,o=Error(se(419)),s=Tl(o,s,void 0),ho(e,t,c,s)}if(n=(c&e.childLanes)!==0,yt||n){if(s=nt,s!==null){switch(c&-c){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(s.suspendedLanes|c)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,yr(e,i),Yt(s,e,i,-1))}return Qu(),s=Tl(Error(se(421))),ho(e,t,c,s)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=x1.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,kt=jr(i.nextSibling),Lt=t,Ve=!0,Vt=null,e!==null&&(It[Bt++]=fr,It[Bt++]=pr,It[Bt++]=gs,fr=e.id,pr=e.overflow,gs=t),t=Vu(t,s.children),t.flags|=4096,t)}function Rd(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Lc(e.return,t,r)}function Pl(e,t,r,s,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=s,o.tail=r,o.tailMode=i)}function h_(e,t,r){var s=t.pendingProps,i=s.revealOrder,o=s.tail;if(pt(e,t,s.children,r),s=qe.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rd(e,r,t);else if(e.tag===19)Rd(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(Ie(qe,s),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&aa(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Pl(t,!1,i,r,o);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&aa(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Pl(t,!0,r,null,o);break;case"together":Pl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function No(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function wr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ms|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,r=Wr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Wr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function u1(e,t,r){switch(t.tag){case 3:c_(t),si();break;case 5:Og(t);break;case 1:xt(t.type)&&ta(t);break;case 4:Ou(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,i=t.memoizedProps.value;Ie(ia,s._currentValue),s._currentValue=i;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Ie(qe,qe.current&1),t.flags|=128,null):r&t.child.childLanes?u_(e,t,r):(Ie(qe,qe.current&1),e=wr(e,t,r),e!==null?e.sibling:null);Ie(qe,qe.current&1);break;case 19:if(s=(r&t.childLanes)!==0,e.flags&128){if(s)return h_(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ie(qe,qe.current),s)break;return null;case 22:case 23:return t.lanes=0,a_(e,t,r)}return wr(e,t,r)}var d_,Ic,f_,p_;d_=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}};Ic=function(){};f_=function(e,t,r,s){var i=e.memoizedProps;if(i!==s){e=t.stateNode,as(or.current);var o=null;switch(r){case"input":i=sc(e,i),s=sc(e,s),o=[];break;case"select":i=Ye({},i,{value:void 0}),s=Ye({},s,{value:void 0}),o=[];break;case"textarea":i=oc(e,i),s=oc(e,s),o=[];break;default:typeof i.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Jo)}lc(r,s);var c;r=null;for(p in i)if(!s.hasOwnProperty(p)&&i.hasOwnProperty(p)&&i[p]!=null)if(p==="style"){var n=i[p];for(c in n)n.hasOwnProperty(c)&&(r||(r={}),r[c]="")}else p!=="dangerouslySetInnerHTML"&&p!=="children"&&p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(Zi.hasOwnProperty(p)?o||(o=[]):(o=o||[]).push(p,null));for(p in s){var a=s[p];if(n=i!=null?i[p]:void 0,s.hasOwnProperty(p)&&a!==n&&(a!=null||n!=null))if(p==="style")if(n){for(c in n)!n.hasOwnProperty(c)||a&&a.hasOwnProperty(c)||(r||(r={}),r[c]="");for(c in a)a.hasOwnProperty(c)&&n[c]!==a[c]&&(r||(r={}),r[c]=a[c])}else r||(o||(o=[]),o.push(p,r)),r=a;else p==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,n=n?n.__html:void 0,a!=null&&n!==a&&(o=o||[]).push(p,a)):p==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(p,""+a):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&(Zi.hasOwnProperty(p)?(a!=null&&p==="onScroll"&&Fe("scroll",e),o||n===a||(o=[])):(o=o||[]).push(p,a))}r&&(o=o||[]).push("style",r);var p=o;(t.updateQueue=p)&&(t.flags|=4)}};p_=function(e,t,r,s){r!==s&&(t.flags|=4)};function Ri(e,t){if(!Ve)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 ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,s|=i.subtreeFlags&14680064,s|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,s|=i.subtreeFlags,s|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function h1(e,t,r){var s=t.pendingProps;switch(Du(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return xt(t.type)&&ea(),ut(t),null;case 3:return s=t.stateNode,ni(),He(St),He(ft),ju(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(co(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vt!==null&&(Wc(Vt),Vt=null))),Ic(e,t),ut(t),null;case 5:$u(t);var i=as(hn.current);if(r=t.type,e!==null&&t.stateNode!=null)f_(e,t,r,s,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(se(166));return ut(t),null}if(e=as(or.current),co(t)){s=t.stateNode,r=t.type;var o=t.memoizedProps;switch(s[sr]=t,s[cn]=o,e=(t.mode&1)!==0,r){case"dialog":Fe("cancel",s),Fe("close",s);break;case"iframe":case"object":case"embed":Fe("load",s);break;case"video":case"audio":for(i=0;i<Oi.length;i++)Fe(Oi[i],s);break;case"source":Fe("error",s);break;case"img":case"image":case"link":Fe("error",s),Fe("load",s);break;case"details":Fe("toggle",s);break;case"input":$h(s,o),Fe("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!o.multiple},Fe("invalid",s);break;case"textarea":Fh(s,o),Fe("invalid",s)}lc(r,o),i=null;for(var c in o)if(o.hasOwnProperty(c)){var n=o[c];c==="children"?typeof n=="string"?s.textContent!==n&&(o.suppressHydrationWarning!==!0&&lo(s.textContent,n,e),i=["children",n]):typeof n=="number"&&s.textContent!==""+n&&(o.suppressHydrationWarning!==!0&&lo(s.textContent,n,e),i=["children",""+n]):Zi.hasOwnProperty(c)&&n!=null&&c==="onScroll"&&Fe("scroll",s)}switch(r){case"input":eo(s),jh(s,o,!0);break;case"textarea":eo(s),Hh(s);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(s.onclick=Jo)}s=i,t.updateQueue=s,s!==null&&(t.flags|=4)}else{c=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=zp(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=c.createElement(r,{is:s.is}):(e=c.createElement(r),r==="select"&&(c=e,s.multiple?c.multiple=!0:s.size&&(c.size=s.size))):e=c.createElementNS(e,r),e[sr]=t,e[cn]=s,d_(e,t,!1,!1),t.stateNode=e;e:{switch(c=cc(r,s),r){case"dialog":Fe("cancel",e),Fe("close",e),i=s;break;case"iframe":case"object":case"embed":Fe("load",e),i=s;break;case"video":case"audio":for(i=0;i<Oi.length;i++)Fe(Oi[i],e);i=s;break;case"source":Fe("error",e),i=s;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),i=s;break;case"details":Fe("toggle",e),i=s;break;case"input":$h(e,s),i=sc(e,s),Fe("invalid",e);break;case"option":i=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},i=Ye({},s,{value:void 0}),Fe("invalid",e);break;case"textarea":Fh(e,s),i=oc(e,s),Fe("invalid",e);break;default:i=s}lc(r,i),n=i;for(o in n)if(n.hasOwnProperty(o)){var a=n[o];o==="style"?Vp(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Wp(e,a)):o==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&Ji(e,a):typeof a=="number"&&Ji(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Zi.hasOwnProperty(o)?a!=null&&o==="onScroll"&&Fe("scroll",e):a!=null&&gu(e,o,a,c))}switch(r){case"input":eo(e),jh(e,s,!1);break;case"textarea":eo(e),Hh(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Vr(s.value));break;case"select":e.multiple=!!s.multiple,o=s.value,o!=null?Gs(e,!!s.multiple,o,!1):s.defaultValue!=null&&Gs(e,!!s.multiple,s.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Jo)}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 ut(t),null;case 6:if(e&&t.stateNode!=null)p_(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(se(166));if(r=as(hn.current),as(or.current),co(t)){if(s=t.stateNode,r=t.memoizedProps,s[sr]=t,(o=s.nodeValue!==r)&&(e=Lt,e!==null))switch(e.tag){case 3:lo(s.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&lo(s.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[sr]=t,t.stateNode=s}return ut(t),null;case 13:if(He(qe),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ve&&kt!==null&&t.mode&1&&!(t.flags&128))Tg(),si(),t.flags|=98560,o=!1;else if(o=co(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(se(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(se(317));o[sr]=t}else si(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ut(t),o=!1}else Vt!==null&&(Wc(Vt),Vt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||qe.current&1?st===0&&(st=3):Qu())),t.updateQueue!==null&&(t.flags|=4),ut(t),null);case 4:return ni(),Ic(e,t),e===null&&an(t.stateNode.containerInfo),ut(t),null;case 10:return Nu(t.type._context),ut(t),null;case 17:return xt(t.type)&&ea(),ut(t),null;case 19:if(He(qe),o=t.memoizedState,o===null)return ut(t),null;if(s=(t.flags&128)!==0,c=o.rendering,c===null)if(s)Ri(o,!1);else{if(st!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=aa(e),c!==null){for(t.flags|=128,Ri(o,!1),s=c.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=r,r=t.child;r!==null;)o=r,e=s,o.flags&=14680066,c=o.alternate,c===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,e=c.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ie(qe,qe.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ze()>ai&&(t.flags|=128,s=!0,Ri(o,!1),t.lanes=4194304)}else{if(!s)if(e=aa(c),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ri(o,!0),o.tail===null&&o.tailMode==="hidden"&&!c.alternate&&!Ve)return ut(t),null}else 2*Ze()-o.renderingStartTime>ai&&r!==1073741824&&(t.flags|=128,s=!0,Ri(o,!1),t.lanes=4194304);o.isBackwards?(c.sibling=t.child,t.child=c):(r=o.last,r!==null?r.sibling=c:t.child=c,o.last=c)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ze(),t.sibling=null,r=qe.current,Ie(qe,s?r&1|2:r&1),t):(ut(t),null);case 22:case 23:return Yu(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?bt&1073741824&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function d1(e,t){switch(Du(t),t.tag){case 1:return xt(t.type)&&ea(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ni(),He(St),He(ft),ju(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $u(t),null;case 13:if(He(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return He(qe),null;case 4:return ni(),null;case 10:return Nu(t.type._context),null;case 22:case 23:return Yu(),null;case 24:return null;default:return null}}var fo=!1,dt=!1,f1=typeof WeakSet=="function"?WeakSet:Set,ue=null;function Ws(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){Qe(e,t,s)}else r.current=null}function Bc(e,t,r){try{r()}catch(s){Qe(e,t,s)}}var Dd=!1;function p1(e,t){if(yc=Yo,e=yg(),Mu(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 i=s.anchorOffset,o=s.focusNode;s=s.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var c=0,n=-1,a=-1,p=0,_=0,l=e,g=null;t:for(;;){for(var v;l!==r||i!==0&&l.nodeType!==3||(n=c+i),l!==o||s!==0&&l.nodeType!==3||(a=c+s),l.nodeType===3&&(c+=l.nodeValue.length),(v=l.firstChild)!==null;)g=l,l=v;for(;;){if(l===e)break t;if(g===r&&++p===i&&(n=c),g===o&&++_===s&&(a=c),(v=l.nextSibling)!==null)break;l=g,g=l.parentNode}l=v}r=n===-1||a===-1?null:{start:n,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(wc={focusedElem:e,selectionRange:r},Yo=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var m=w.memoizedProps,h=w.memoizedState,f=t.stateNode,d=f.getSnapshotBeforeUpdate(t.elementType===t.type?m:zt(t.type,m),h);f.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var u=t.stateNode.containerInfo;u.nodeType===1?u.textContent="":u.nodeType===9&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(y){Qe(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return w=Dd,Dd=!1,w}function Ki(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var i=s=s.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Bc(t,r,o)}i=i.next}while(i!==s)}}function Na(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 Oc(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 g_(e){var t=e.alternate;t!==null&&(e.alternate=null,g_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[sr],delete t[cn],delete t[Cc],delete t[Yy],delete t[Qy])),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 __(e){return e.tag===5||e.tag===3||e.tag===4}function Ad(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||__(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 $c(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=Jo));else if(s!==4&&(e=e.child,e!==null))for($c(e,t,r),e=e.sibling;e!==null;)$c(e,t,r),e=e.sibling}function jc(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(jc(e,t,r),e=e.sibling;e!==null;)jc(e,t,r),e=e.sibling}var ot=null,Wt=!1;function kr(e,t,r){for(r=r.child;r!==null;)m_(e,t,r),r=r.sibling}function m_(e,t,r){if(nr&&typeof nr.onCommitFiberUnmount=="function")try{nr.onCommitFiberUnmount(ka,r)}catch{}switch(r.tag){case 5:dt||Ws(r,t);case 6:var s=ot,i=Wt;ot=null,kr(e,t,r),ot=s,Wt=i,ot!==null&&(Wt?(e=ot,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ot.removeChild(r.stateNode));break;case 18:ot!==null&&(Wt?(e=ot,r=r.stateNode,e.nodeType===8?kl(e.parentNode,r):e.nodeType===1&&kl(e,r),sn(e)):kl(ot,r.stateNode));break;case 4:s=ot,i=Wt,ot=r.stateNode.containerInfo,Wt=!0,kr(e,t,r),ot=s,Wt=i;break;case 0:case 11:case 14:case 15:if(!dt&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){i=s=s.next;do{var o=i,c=o.destroy;o=o.tag,c!==void 0&&(o&2||o&4)&&Bc(r,t,c),i=i.next}while(i!==s)}kr(e,t,r);break;case 1:if(!dt&&(Ws(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(n){Qe(r,t,n)}kr(e,t,r);break;case 21:kr(e,t,r);break;case 22:r.mode&1?(dt=(s=dt)||r.memoizedState!==null,kr(e,t,r),dt=s):kr(e,t,r);break;default:kr(e,t,r)}}function Td(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new f1),t.forEach(function(s){var i=C1.bind(null,e,s);r.has(s)||(r.add(s),s.then(i,i))})}}function Ht(e,t){var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var i=r[s];try{var o=e,c=t,n=c;e:for(;n!==null;){switch(n.tag){case 5:ot=n.stateNode,Wt=!1;break e;case 3:ot=n.stateNode.containerInfo,Wt=!0;break e;case 4:ot=n.stateNode.containerInfo,Wt=!0;break e}n=n.return}if(ot===null)throw Error(se(160));m_(o,c,i),ot=null,Wt=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(p){Qe(i,t,p)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)v_(t,e),t=t.sibling}function v_(e,t){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ht(t,e),er(e),s&4){try{Ki(3,e,e.return),Na(3,e)}catch(m){Qe(e,e.return,m)}try{Ki(5,e,e.return)}catch(m){Qe(e,e.return,m)}}break;case 1:Ht(t,e),er(e),s&512&&r!==null&&Ws(r,r.return);break;case 5:if(Ht(t,e),er(e),s&512&&r!==null&&Ws(r,r.return),e.flags&32){var i=e.stateNode;try{Ji(i,"")}catch(m){Qe(e,e.return,m)}}if(s&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,c=r!==null?r.memoizedProps:o,n=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{n==="input"&&o.type==="radio"&&o.name!=null&&Fp(i,o),cc(n,c);var p=cc(n,o);for(c=0;c<a.length;c+=2){var _=a[c],l=a[c+1];_==="style"?Vp(i,l):_==="dangerouslySetInnerHTML"?Wp(i,l):_==="children"?Ji(i,l):gu(i,_,l,p)}switch(n){case"input":ic(i,o);break;case"textarea":Hp(i,o);break;case"select":var g=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var v=o.value;v!=null?Gs(i,!!o.multiple,v,!1):g!==!!o.multiple&&(o.defaultValue!=null?Gs(i,!!o.multiple,o.defaultValue,!0):Gs(i,!!o.multiple,o.multiple?[]:"",!1))}i[cn]=o}catch(m){Qe(e,e.return,m)}}break;case 6:if(Ht(t,e),er(e),s&4){if(e.stateNode===null)throw Error(se(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){Qe(e,e.return,m)}}break;case 3:if(Ht(t,e),er(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{sn(t.containerInfo)}catch(m){Qe(e,e.return,m)}break;case 4:Ht(t,e),er(e);break;case 13:Ht(t,e),er(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(qu=Ze())),s&4&&Td(e);break;case 22:if(_=r!==null&&r.memoizedState!==null,e.mode&1?(dt=(p=dt)||_,Ht(t,e),dt=p):Ht(t,e),er(e),s&8192){if(p=e.memoizedState!==null,(e.stateNode.isHidden=p)&&!_&&e.mode&1)for(ue=e,_=e.child;_!==null;){for(l=ue=_;ue!==null;){switch(g=ue,v=g.child,g.tag){case 0:case 11:case 14:case 15:Ki(4,g,g.return);break;case 1:Ws(g,g.return);var w=g.stateNode;if(typeof w.componentWillUnmount=="function"){s=g,r=g.return;try{t=s,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(m){Qe(s,r,m)}}break;case 5:Ws(g,g.return);break;case 22:if(g.memoizedState!==null){Nd(l);continue}}v!==null?(v.return=g,ue=v):Nd(l)}_=_.sibling}e:for(_=null,l=e;;){if(l.tag===5){if(_===null){_=l;try{i=l.stateNode,p?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(n=l.stateNode,a=l.memoizedProps.style,c=a!=null&&a.hasOwnProperty("display")?a.display:null,n.style.display=Up("display",c))}catch(m){Qe(e,e.return,m)}}}else if(l.tag===6){if(_===null)try{l.stateNode.nodeValue=p?"":l.memoizedProps}catch(m){Qe(e,e.return,m)}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===e)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===e)break e;for(;l.sibling===null;){if(l.return===null||l.return===e)break e;_===l&&(_=null),l=l.return}_===l&&(_=null),l.sibling.return=l.return,l=l.sibling}}break;case 19:Ht(t,e),er(e),s&4&&Td(e);break;case 21:break;default:Ht(t,e),er(e)}}function er(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(__(r)){var s=r;break e}r=r.return}throw Error(se(160))}switch(s.tag){case 5:var i=s.stateNode;s.flags&32&&(Ji(i,""),s.flags&=-33);var o=Ad(e);jc(e,o,i);break;case 3:case 4:var c=s.stateNode.containerInfo,n=Ad(e);$c(e,n,c);break;default:throw Error(se(161))}}catch(a){Qe(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function g1(e,t,r){ue=e,y_(e)}function y_(e,t,r){for(var s=(e.mode&1)!==0;ue!==null;){var i=ue,o=i.child;if(i.tag===22&&s){var c=i.memoizedState!==null||fo;if(!c){var n=i.alternate,a=n!==null&&n.memoizedState!==null||dt;n=fo;var p=dt;if(fo=c,(dt=a)&&!p)for(ue=i;ue!==null;)c=ue,a=c.child,c.tag===22&&c.memoizedState!==null?Id(i):a!==null?(a.return=c,ue=a):Id(i);for(;o!==null;)ue=o,y_(o),o=o.sibling;ue=i,fo=n,dt=p}Pd(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,ue=o):Pd(e)}}function Pd(e){for(;ue!==null;){var t=ue;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:dt||Na(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!dt)if(r===null)s.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:zt(t.type,r.memoizedProps);s.componentDidUpdate(i,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&md(t,o,s);break;case 3:var c=t.updateQueue;if(c!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}md(t,c,r)}break;case 5:var n=t.stateNode;if(r===null&&t.flags&4){r=n;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var p=t.alternate;if(p!==null){var _=p.memoizedState;if(_!==null){var l=_.dehydrated;l!==null&&sn(l)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}dt||t.flags&512&&Oc(t)}catch(g){Qe(t,t.return,g)}}if(t===e){ue=null;break}if(r=t.sibling,r!==null){r.return=t.return,ue=r;break}ue=t.return}}function Nd(e){for(;ue!==null;){var t=ue;if(t===e){ue=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ue=r;break}ue=t.return}}function Id(e){for(;ue!==null;){var t=ue;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Na(4,t)}catch(a){Qe(t,r,a)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var i=t.return;try{s.componentDidMount()}catch(a){Qe(t,i,a)}}var o=t.return;try{Oc(t)}catch(a){Qe(t,o,a)}break;case 5:var c=t.return;try{Oc(t)}catch(a){Qe(t,c,a)}}}catch(a){Qe(t,t.return,a)}if(t===e){ue=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ue=n;break}ue=t.return}}var _1=Math.ceil,ua=Cr.ReactCurrentDispatcher,Ku=Cr.ReactCurrentOwner,$t=Cr.ReactCurrentBatchConfig,Re=0,nt=null,et=null,at=0,bt=0,Us=Yr(0),st=0,gn=null,ms=0,Ia=0,Gu=0,Gi=null,vt=null,qu=0,ai=1/0,hr=null,ha=!1,Fc=null,Hr=null,po=!1,Ir=null,da=0,qi=0,Hc=null,Io=-1,Bo=0;function gt(){return Re&6?Ze():Io!==-1?Io:Io=Ze()}function zr(e){return e.mode&1?Re&2&&at!==0?at&-at:Jy.transition!==null?(Bo===0&&(Bo=sg()),Bo):(e=Ne,e!==0||(e=window.event,e=e===void 0?16:ug(e.type)),e):1}function Yt(e,t,r,s){if(50<qi)throw qi=0,Hc=null,Error(se(185));Rn(e,r,s),(!(Re&2)||e!==nt)&&(e===nt&&(!(Re&2)&&(Ia|=r),st===4&&Tr(e,at)),Ct(e,s),r===1&&Re===0&&!(t.mode&1)&&(ai=Ze()+500,Aa&&Qr()))}function Ct(e,t){var r=e.callbackNode;J0(e,t);var s=Xo(e,e===nt?at:0);if(s===0)r!==null&&Uh(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&Uh(r),t===1)e.tag===0?Zy(Bd.bind(null,e)):Rg(Bd.bind(null,e)),qy(function(){!(Re&6)&&Qr()}),r=null;else{switch(ig(s)){case 1:r=wu;break;case 4:r=tg;break;case 16:r=qo;break;case 536870912:r=rg;break;default:r=qo}r=L_(r,w_.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function w_(e,t){if(Io=-1,Bo=0,Re&6)throw Error(se(327));var r=e.callbackNode;if(Zs()&&e.callbackNode!==r)return null;var s=Xo(e,e===nt?at:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=fa(e,s);else{t=s;var i=Re;Re|=2;var o=x_();(nt!==e||at!==t)&&(hr=null,ai=Ze()+500,us(e,t));do try{y1();break}catch(n){S_(e,n)}while(!0);Pu(),ua.current=o,Re=i,et!==null?t=0:(nt=null,at=0,t=st)}if(t!==0){if(t===2&&(i=pc(e),i!==0&&(s=i,t=zc(e,i))),t===1)throw r=gn,us(e,0),Tr(e,s),Ct(e,Ze()),r;if(t===6)Tr(e,s);else{if(i=e.current.alternate,!(s&30)&&!m1(i)&&(t=fa(e,s),t===2&&(o=pc(e),o!==0&&(s=o,t=zc(e,o))),t===1))throw r=gn,us(e,0),Tr(e,s),Ct(e,Ze()),r;switch(e.finishedWork=i,e.finishedLanes=s,t){case 0:case 1:throw Error(se(345));case 2:rs(e,vt,hr);break;case 3:if(Tr(e,s),(s&130023424)===s&&(t=qu+500-Ze(),10<t)){if(Xo(e,0)!==0)break;if(i=e.suspendedLanes,(i&s)!==s){gt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=xc(rs.bind(null,e,vt,hr),t);break}rs(e,vt,hr);break;case 4:if(Tr(e,s),(s&4194240)===s)break;for(t=e.eventTimes,i=-1;0<s;){var c=31-Xt(s);o=1<<c,c=t[c],c>i&&(i=c),s&=~o}if(s=i,s=Ze()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*_1(s/1960))-s,10<s){e.timeoutHandle=xc(rs.bind(null,e,vt,hr),s);break}rs(e,vt,hr);break;case 5:rs(e,vt,hr);break;default:throw Error(se(329))}}}return Ct(e,Ze()),e.callbackNode===r?w_.bind(null,e):null}function zc(e,t){var r=Gi;return e.current.memoizedState.isDehydrated&&(us(e,t).flags|=256),e=fa(e,t),e!==2&&(t=vt,vt=r,t!==null&&Wc(t)),e}function Wc(e){vt===null?vt=e:vt.push.apply(vt,e)}function m1(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 i=r[s],o=i.getSnapshot;i=i.value;try{if(!Qt(o(),i))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 Tr(e,t){for(t&=~Gu,t&=~Ia,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Xt(t),s=1<<r;e[r]=-1,t&=~s}}function Bd(e){if(Re&6)throw Error(se(327));Zs();var t=Xo(e,0);if(!(t&1))return Ct(e,Ze()),null;var r=fa(e,t);if(e.tag!==0&&r===2){var s=pc(e);s!==0&&(t=s,r=zc(e,s))}if(r===1)throw r=gn,us(e,0),Tr(e,t),Ct(e,Ze()),r;if(r===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,rs(e,vt,hr),Ct(e,Ze()),null}function Xu(e,t){var r=Re;Re|=1;try{return e(t)}finally{Re=r,Re===0&&(ai=Ze()+500,Aa&&Qr())}}function vs(e){Ir!==null&&Ir.tag===0&&!(Re&6)&&Zs();var t=Re;Re|=1;var r=$t.transition,s=Ne;try{if($t.transition=null,Ne=1,e)return e()}finally{Ne=s,$t.transition=r,Re=t,!(Re&6)&&Qr()}}function Yu(){bt=Us.current,He(Us)}function us(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Gy(r)),et!==null)for(r=et.return;r!==null;){var s=r;switch(Du(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&ea();break;case 3:ni(),He(St),He(ft),ju();break;case 5:$u(s);break;case 4:ni();break;case 13:He(qe);break;case 19:He(qe);break;case 10:Nu(s.type._context);break;case 22:case 23:Yu()}r=r.return}if(nt=e,et=e=Wr(e.current,null),at=bt=t,st=0,gn=null,Gu=Ia=ms=0,vt=Gi=null,os!==null){for(t=0;t<os.length;t++)if(r=os[t],s=r.interleaved,s!==null){r.interleaved=null;var i=s.next,o=r.pending;if(o!==null){var c=o.next;o.next=i,s.next=c}r.pending=s}os=null}return e}function S_(e,t){do{var r=et;try{if(Pu(),To.current=ca,la){for(var s=Xe.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}la=!1}if(_s=0,it=rt=Xe=null,Vi=!1,dn=0,Ku.current=null,r===null||r.return===null){st=1,gn=t,et=null;break}e:{var o=e,c=r.return,n=r,a=t;if(t=at,n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var p=a,_=n,l=_.tag;if(!(_.mode&1)&&(l===0||l===11||l===15)){var g=_.alternate;g?(_.updateQueue=g.updateQueue,_.memoizedState=g.memoizedState,_.lanes=g.lanes):(_.updateQueue=null,_.memoizedState=null)}var v=Cd(c);if(v!==null){v.flags&=-257,bd(v,c,n,o,t),v.mode&1&&xd(o,p,t),t=v,a=p;var w=t.updateQueue;if(w===null){var m=new Set;m.add(a),t.updateQueue=m}else w.add(a);break e}else{if(!(t&1)){xd(o,p,t),Qu();break e}a=Error(se(426))}}else if(Ve&&n.mode&1){var h=Cd(c);if(h!==null){!(h.flags&65536)&&(h.flags|=256),bd(h,c,n,o,t),Au(oi(a,n));break e}}o=a=oi(a,n),st!==4&&(st=2),Gi===null?Gi=[o]:Gi.push(o),o=c;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var f=i_(o,a,t);_d(o,f);break e;case 1:n=a;var d=o.type,u=o.stateNode;if(!(o.flags&128)&&(typeof d.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Hr===null||!Hr.has(u)))){o.flags|=65536,t&=-t,o.lanes|=t;var y=n_(o,n,t);_d(o,y);break e}}o=o.return}while(o!==null)}b_(r)}catch(C){t=C,et===r&&r!==null&&(et=r=r.return);continue}break}while(!0)}function x_(){var e=ua.current;return ua.current=ca,e===null?ca:e}function Qu(){(st===0||st===3||st===2)&&(st=4),nt===null||!(ms&268435455)&&!(Ia&268435455)||Tr(nt,at)}function fa(e,t){var r=Re;Re|=2;var s=x_();(nt!==e||at!==t)&&(hr=null,us(e,t));do try{v1();break}catch(i){S_(e,i)}while(!0);if(Pu(),Re=r,ua.current=s,et!==null)throw Error(se(261));return nt=null,at=0,st}function v1(){for(;et!==null;)C_(et)}function y1(){for(;et!==null&&!U0();)C_(et)}function C_(e){var t=k_(e.alternate,e,bt);e.memoizedProps=e.pendingProps,t===null?b_(e):et=t,Ku.current=null}function b_(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=d1(r,t),r!==null){r.flags&=32767,et=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{st=6,et=null;return}}else if(r=h1(r,t,bt),r!==null){et=r;return}if(t=t.sibling,t!==null){et=t;return}et=t=e}while(t!==null);st===0&&(st=5)}function rs(e,t,r){var s=Ne,i=$t.transition;try{$t.transition=null,Ne=1,w1(e,t,r,s)}finally{$t.transition=i,Ne=s}return null}function w1(e,t,r,s){do Zs();while(Ir!==null);if(Re&6)throw Error(se(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(se(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(ey(e,o),e===nt&&(et=nt=null,at=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||po||(po=!0,L_(qo,function(){return Zs(),null})),o=(r.flags&15990)!==0,r.subtreeFlags&15990||o){o=$t.transition,$t.transition=null;var c=Ne;Ne=1;var n=Re;Re|=4,Ku.current=null,p1(e,r),v_(r,e),Fy(wc),Yo=!!yc,wc=yc=null,e.current=r,g1(r),V0(),Re=n,Ne=c,$t.transition=o}else e.current=r;if(po&&(po=!1,Ir=e,da=i),o=e.pendingLanes,o===0&&(Hr=null),q0(r.stateNode),Ct(e,Ze()),t!==null)for(s=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],s(i.value,{componentStack:i.stack,digest:i.digest});if(ha)throw ha=!1,e=Fc,Fc=null,e;return da&1&&e.tag!==0&&Zs(),o=e.pendingLanes,o&1?e===Hc?qi++:(qi=0,Hc=e):qi=0,Qr(),null}function Zs(){if(Ir!==null){var e=ig(da),t=$t.transition,r=Ne;try{if($t.transition=null,Ne=16>e?16:e,Ir===null)var s=!1;else{if(e=Ir,Ir=null,da=0,Re&6)throw Error(se(331));var i=Re;for(Re|=4,ue=e.current;ue!==null;){var o=ue,c=o.child;if(ue.flags&16){var n=o.deletions;if(n!==null){for(var a=0;a<n.length;a++){var p=n[a];for(ue=p;ue!==null;){var _=ue;switch(_.tag){case 0:case 11:case 15:Ki(8,_,o)}var l=_.child;if(l!==null)l.return=_,ue=l;else for(;ue!==null;){_=ue;var g=_.sibling,v=_.return;if(g_(_),_===p){ue=null;break}if(g!==null){g.return=v,ue=g;break}ue=v}}}var w=o.alternate;if(w!==null){var m=w.child;if(m!==null){w.child=null;do{var h=m.sibling;m.sibling=null,m=h}while(m!==null)}}ue=o}}if(o.subtreeFlags&2064&&c!==null)c.return=o,ue=c;else e:for(;ue!==null;){if(o=ue,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ki(9,o,o.return)}var f=o.sibling;if(f!==null){f.return=o.return,ue=f;break e}ue=o.return}}var d=e.current;for(ue=d;ue!==null;){c=ue;var u=c.child;if(c.subtreeFlags&2064&&u!==null)u.return=c,ue=u;else e:for(c=d;ue!==null;){if(n=ue,n.flags&2048)try{switch(n.tag){case 0:case 11:case 15:Na(9,n)}}catch(C){Qe(n,n.return,C)}if(n===c){ue=null;break e}var y=n.sibling;if(y!==null){y.return=n.return,ue=y;break e}ue=n.return}}if(Re=i,Qr(),nr&&typeof nr.onPostCommitFiberRoot=="function")try{nr.onPostCommitFiberRoot(ka,e)}catch{}s=!0}return s}finally{Ne=r,$t.transition=t}}return!1}function Od(e,t,r){t=oi(r,t),t=i_(e,t,1),e=Fr(e,t,1),t=gt(),e!==null&&(Rn(e,1,t),Ct(e,t))}function Qe(e,t,r){if(e.tag===3)Od(e,e,r);else for(;t!==null;){if(t.tag===3){Od(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Hr===null||!Hr.has(s))){e=oi(r,e),e=n_(t,e,1),t=Fr(t,e,1),e=gt(),t!==null&&(Rn(t,1,e),Ct(t,e));break}}t=t.return}}function S1(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=gt(),e.pingedLanes|=e.suspendedLanes&r,nt===e&&(at&r)===r&&(st===4||st===3&&(at&130023424)===at&&500>Ze()-qu?us(e,0):Gu|=r),Ct(e,t)}function E_(e,t){t===0&&(e.mode&1?(t=so,so<<=1,!(so&130023424)&&(so=4194304)):t=1);var r=gt();e=yr(e,t),e!==null&&(Rn(e,t,r),Ct(e,r))}function x1(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),E_(e,r)}function C1(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(se(314))}s!==null&&s.delete(t),E_(e,r)}var k_;k_=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||St.current)yt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return yt=!1,u1(e,t,r);yt=!!(e.flags&131072)}else yt=!1,Ve&&t.flags&1048576&&Dg(t,sa,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;No(e,t),e=t.pendingProps;var i=ri(t,ft.current);Qs(t,r),i=Hu(null,t,s,e,i,r);var o=zu();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xt(s)?(o=!0,ta(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Bu(t),i.updater=Pa,t.stateNode=i,i._reactInternals=t,Rc(t,s,e,r),t=Tc(null,t,s,!0,o,r)):(t.tag=0,Ve&&o&&Ru(t),pt(null,t,i,r),t=t.child),t;case 16:s=t.elementType;e:{switch(No(e,t),e=t.pendingProps,i=s._init,s=i(s._payload),t.type=s,i=t.tag=E1(s),e=zt(s,e),i){case 0:t=Ac(null,t,s,e,r);break e;case 1:t=Ld(null,t,s,e,r);break e;case 11:t=Ed(null,t,s,e,r);break e;case 14:t=kd(null,t,s,zt(s.type,e),r);break e}throw Error(se(306,s,""))}return t;case 0:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:zt(s,i),Ac(e,t,s,i,r);case 1:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:zt(s,i),Ld(e,t,s,i,r);case 3:e:{if(c_(t),e===null)throw Error(se(387));s=t.pendingProps,o=t.memoizedState,i=o.element,Bg(e,t),oa(t,s,null,r);var c=t.memoizedState;if(s=c.element,o.isDehydrated)if(o={element:s,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=oi(Error(se(423)),t),t=Md(e,t,s,r,i);break e}else if(s!==i){i=oi(Error(se(424)),t),t=Md(e,t,s,r,i);break e}else for(kt=jr(t.stateNode.containerInfo.firstChild),Lt=t,Ve=!0,Vt=null,r=Ng(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(si(),s===i){t=wr(e,t,r);break e}pt(e,t,s,r)}t=t.child}return t;case 5:return Og(t),e===null&&kc(t),s=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,c=i.children,Sc(s,i)?c=null:o!==null&&Sc(s,o)&&(t.flags|=32),l_(e,t),pt(e,t,c,r),t.child;case 6:return e===null&&kc(t),null;case 13:return u_(e,t,r);case 4:return Ou(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ii(t,null,s,r):pt(e,t,s,r),t.child;case 11:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:zt(s,i),Ed(e,t,s,i,r);case 7:return pt(e,t,t.pendingProps,r),t.child;case 8:return pt(e,t,t.pendingProps.children,r),t.child;case 12:return pt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,i=t.pendingProps,o=t.memoizedProps,c=i.value,Ie(ia,s._currentValue),s._currentValue=c,o!==null)if(Qt(o.value,c)){if(o.children===i.children&&!St.current){t=wr(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var n=o.dependencies;if(n!==null){c=o.child;for(var a=n.firstContext;a!==null;){if(a.context===s){if(o.tag===1){a=_r(-1,r&-r),a.tag=2;var p=o.updateQueue;if(p!==null){p=p.shared;var _=p.pending;_===null?a.next=a:(a.next=_.next,_.next=a),p.pending=a}}o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Lc(o.return,r,t),n.lanes|=r;break}a=a.next}}else if(o.tag===10)c=o.type===t.type?null:o.child;else if(o.tag===18){if(c=o.return,c===null)throw Error(se(341));c.lanes|=r,n=c.alternate,n!==null&&(n.lanes|=r),Lc(c,r,t),c=o.sibling}else c=o.child;if(c!==null)c.return=o;else for(c=o;c!==null;){if(c===t){c=null;break}if(o=c.sibling,o!==null){o.return=c.return,c=o;break}c=c.return}o=c}pt(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,s=t.pendingProps.children,Qs(t,r),i=jt(i),s=s(i),t.flags|=1,pt(e,t,s,r),t.child;case 14:return s=t.type,i=zt(s,t.pendingProps),i=zt(s.type,i),kd(e,t,s,i,r);case 15:return o_(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:zt(s,i),No(e,t),t.tag=1,xt(s)?(e=!0,ta(t)):e=!1,Qs(t,r),s_(t,s,i),Rc(t,s,i,r),Tc(null,t,s,!0,e,r);case 19:return h_(e,t,r);case 22:return a_(e,t,r)}throw Error(se(156,t.tag))};function L_(e,t){return eg(e,t)}function b1(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 Ot(e,t,r,s){return new b1(e,t,r,s)}function Zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function E1(e){if(typeof e=="function")return Zu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===mu)return 11;if(e===vu)return 14}return 2}function Wr(e,t){var r=e.alternate;return r===null?(r=Ot(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 Oo(e,t,r,s,i,o){var c=2;if(s=e,typeof e=="function")Zu(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case Ns:return hs(r.children,i,o,t);case _u:c=8,i|=8;break;case Jl:return e=Ot(12,r,t,i|2),e.elementType=Jl,e.lanes=o,e;case ec:return e=Ot(13,r,t,i),e.elementType=ec,e.lanes=o,e;case tc:return e=Ot(19,r,t,i),e.elementType=tc,e.lanes=o,e;case Op:return Ba(r,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ip:c=10;break e;case Bp:c=9;break e;case mu:c=11;break e;case vu:c=14;break e;case Rr:c=16,s=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=Ot(c,r,t,i),t.elementType=e,t.type=s,t.lanes=o,t}function hs(e,t,r,s){return e=Ot(7,e,s,t),e.lanes=r,e}function Ba(e,t,r,s){return e=Ot(22,e,s,t),e.elementType=Op,e.lanes=r,e.stateNode={isHidden:!1},e}function Nl(e,t,r){return e=Ot(6,e,null,t),e.lanes=r,e}function Il(e,t,r){return t=Ot(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function k1(e,t,r,s,i){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=gl(0),this.expirationTimes=gl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gl(0),this.identifierPrefix=s,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ju(e,t,r,s,i,o,c,n,a){return e=new k1(e,t,r,n,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ot(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bu(o),e}function L1(e,t,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ps,key:s==null?null:""+s,children:e,containerInfo:t,implementation:r}}function M_(e){if(!e)return Kr;e=e._reactInternals;e:{if(ks(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var r=e.type;if(xt(r))return Mg(e,r,t)}return t}function R_(e,t,r,s,i,o,c,n,a){return e=Ju(r,s,!0,e,i,o,c,n,a),e.context=M_(null),r=e.current,s=gt(),i=zr(r),o=_r(s,i),o.callback=t??null,Fr(r,o,i),e.current.lanes=i,Rn(e,i,s),Ct(e,s),e}function Oa(e,t,r,s){var i=t.current,o=gt(),c=zr(i);return r=M_(r),t.context===null?t.context=r:t.pendingContext=r,t=_r(o,c),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Fr(i,t,c),e!==null&&(Yt(e,i,c,o),Ao(e,i,c)),c}function pa(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 $d(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function eh(e,t){$d(e,t),(e=e.alternate)&&$d(e,t)}function M1(){return null}var D_=typeof reportError=="function"?reportError:function(e){console.error(e)};function th(e){this._internalRoot=e}$a.prototype.render=th.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));Oa(e,t,null,null)};$a.prototype.unmount=th.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vs(function(){Oa(null,e,null,null)}),t[vr]=null}};function $a(e){this._internalRoot=e}$a.prototype.unstable_scheduleHydration=function(e){if(e){var t=ag();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Ar.length&&t!==0&&t<Ar[r].priority;r++);Ar.splice(r,0,e),r===0&&cg(e)}};function rh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ja(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function jd(){}function R1(e,t,r,s,i){if(i){if(typeof s=="function"){var o=s;s=function(){var p=pa(c);o.call(p)}}var c=R_(t,s,e,0,null,!1,!1,"",jd);return e._reactRootContainer=c,e[vr]=c.current,an(e.nodeType===8?e.parentNode:e),vs(),c}for(;i=e.lastChild;)e.removeChild(i);if(typeof s=="function"){var n=s;s=function(){var p=pa(a);n.call(p)}}var a=Ju(e,0,!1,null,null,!1,!1,"",jd);return e._reactRootContainer=a,e[vr]=a.current,an(e.nodeType===8?e.parentNode:e),vs(function(){Oa(t,a,r,s)}),a}function Fa(e,t,r,s,i){var o=r._reactRootContainer;if(o){var c=o;if(typeof i=="function"){var n=i;i=function(){var a=pa(c);n.call(a)}}Oa(t,c,e,i)}else c=R1(r,t,e,i,s);return pa(c)}ng=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Bi(t.pendingLanes);r!==0&&(Su(t,r|1),Ct(t,Ze()),!(Re&6)&&(ai=Ze()+500,Qr()))}break;case 13:vs(function(){var s=yr(e,1);if(s!==null){var i=gt();Yt(s,e,1,i)}}),eh(e,1)}};xu=function(e){if(e.tag===13){var t=yr(e,134217728);if(t!==null){var r=gt();Yt(t,e,134217728,r)}eh(e,134217728)}};og=function(e){if(e.tag===13){var t=zr(e),r=yr(e,t);if(r!==null){var s=gt();Yt(r,e,t,s)}eh(e,t)}};ag=function(){return Ne};lg=function(e,t){var r=Ne;try{return Ne=e,t()}finally{Ne=r}};hc=function(e,t,r){switch(t){case"input":if(ic(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 i=Da(s);if(!i)throw Error(se(90));jp(s),ic(s,i)}}}break;case"textarea":Hp(e,r);break;case"select":t=r.value,t!=null&&Gs(e,!!r.multiple,t,!1)}};qp=Xu;Xp=vs;var D1={usingClientEntryPoint:!1,Events:[An,$s,Da,Kp,Gp,Xu]},Di={findFiberByHostInstance:ns,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},A1={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:Cr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Zp(e),e===null?null:e.stateNode},findFiberByHostInstance:Di.findFiberByHostInstance||M1,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 go=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!go.isDisabled&&go.supportsFiber)try{ka=go.inject(A1),nr=go}catch{}}Dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D1;Dt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!rh(t))throw Error(se(200));return L1(e,t,null,r)};Dt.createRoot=function(e,t){if(!rh(e))throw Error(se(299));var r=!1,s="",i=D_;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Ju(e,1,!1,null,null,r,!1,s,i),e[vr]=t.current,an(e.nodeType===8?e.parentNode:e),new th(t)};Dt.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(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=Zp(t),e=e===null?null:e.stateNode,e};Dt.flushSync=function(e){return vs(e)};Dt.hydrate=function(e,t,r){if(!ja(t))throw Error(se(200));return Fa(null,e,t,!0,r)};Dt.hydrateRoot=function(e,t,r){if(!rh(e))throw Error(se(405));var s=r!=null&&r.hydratedSources||null,i=!1,o="",c=D_;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(c=r.onRecoverableError)),t=R_(t,null,e,1,r??null,i,!1,o,c),e[vr]=t.current,an(e),s)for(e=0;e<s.length;e++)r=s[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new $a(t)};Dt.render=function(e,t,r){if(!ja(t))throw Error(se(200));return Fa(null,e,t,!1,r)};Dt.unmountComponentAtNode=function(e){if(!ja(e))throw Error(se(40));return e._reactRootContainer?(vs(function(){Fa(null,null,e,!1,function(){e._reactRootContainer=null,e[vr]=null})}),!0):!1};Dt.unstable_batchedUpdates=Xu;Dt.unstable_renderSubtreeIntoContainer=function(e,t,r,s){if(!ja(r))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return Fa(e,t,r,!1,s)};Dt.version="18.3.1-next-f1338f8080-20240426";function A_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A_)}catch(e){console.error(e)}}A_(),Ap.exports=Dt;var T1=Ap.exports,Fd=T1;Ql.createRoot=Fd.createRoot,Ql.hydrateRoot=Fd.hydrateRoot;function tt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,s;r<e.length;r++)(s=tt(e[r]))!==""&&(t+=(t&&" ")+s);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var P1={value:()=>{}};function Ha(){for(var e=0,t=arguments.length,r={},s;e<t;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new $o(r)}function $o(e){this._=e}function N1(e,t){return e.trim().split(/^|\s+/).map(function(r){var s="",i=r.indexOf(".");if(i>=0&&(s=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}$o.prototype=Ha.prototype={constructor:$o,on:function(e,t){var r=this._,s=N1(e+"",r),i,o=-1,c=s.length;if(arguments.length<2){for(;++o<c;)if((i=(e=s[o]).type)&&(i=I1(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<c;)if(i=(e=s[o]).type)r[i]=Hd(r[i],e.name,t);else if(t==null)for(i in r)r[i]=Hd(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new $o(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),s=0,i,o;s<i;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],s=0,i=o.length;s<i;++s)o[s].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],i=0,o=s.length;i<o;++i)s[i].value.apply(t,r)}};function I1(e,t){for(var r=0,s=e.length,i;r<s;++r)if((i=e[r]).name===t)return i.value}function Hd(e,t,r){for(var s=0,i=e.length;s<i;++s)if(e[s].name===t){e[s]=P1,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:t,value:r}),e}var Uc="http://www.w3.org/1999/xhtml";const zd={svg:"http://www.w3.org/2000/svg",xhtml:Uc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function za(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),zd.hasOwnProperty(t)?{space:zd[t],local:e}:e}function B1(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Uc&&t.documentElement.namespaceURI===Uc?t.createElement(e):t.createElementNS(r,e)}}function O1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function T_(e){var t=za(e);return(t.local?O1:B1)(t)}function $1(){}function sh(e){return e==null?$1:function(){return this.querySelector(e)}}function j1(e){typeof e!="function"&&(e=sh(e));for(var t=this._groups,r=t.length,s=new Array(r),i=0;i<r;++i)for(var o=t[i],c=o.length,n=s[i]=new Array(c),a,p,_=0;_<c;++_)(a=o[_])&&(p=e.call(a,a.__data__,_,o))&&("__data__"in a&&(p.__data__=a.__data__),n[_]=p);return new Rt(s,this._parents)}function F1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function H1(){return[]}function P_(e){return e==null?H1:function(){return this.querySelectorAll(e)}}function z1(e){return function(){return F1(e.apply(this,arguments))}}function W1(e){typeof e=="function"?e=z1(e):e=P_(e);for(var t=this._groups,r=t.length,s=[],i=[],o=0;o<r;++o)for(var c=t[o],n=c.length,a,p=0;p<n;++p)(a=c[p])&&(s.push(e.call(a,a.__data__,p,c)),i.push(a));return new Rt(s,i)}function N_(e){return function(){return this.matches(e)}}function I_(e){return function(t){return t.matches(e)}}var U1=Array.prototype.find;function V1(e){return function(){return U1.call(this.children,e)}}function K1(){return this.firstElementChild}function G1(e){return this.select(e==null?K1:V1(typeof e=="function"?e:I_(e)))}var q1=Array.prototype.filter;function X1(){return Array.from(this.children)}function Y1(e){return function(){return q1.call(this.children,e)}}function Q1(e){return this.selectAll(e==null?X1:Y1(typeof e=="function"?e:I_(e)))}function Z1(e){typeof e!="function"&&(e=N_(e));for(var t=this._groups,r=t.length,s=new Array(r),i=0;i<r;++i)for(var o=t[i],c=o.length,n=s[i]=[],a,p=0;p<c;++p)(a=o[p])&&e.call(a,a.__data__,p,o)&&n.push(a);return new Rt(s,this._parents)}function B_(e){return new Array(e.length)}function J1(){return new Rt(this._enter||this._groups.map(B_),this._parents)}function ga(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ga.prototype={constructor:ga,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ew(e){return function(){return e}}function tw(e,t,r,s,i,o){for(var c=0,n,a=t.length,p=o.length;c<p;++c)(n=t[c])?(n.__data__=o[c],s[c]=n):r[c]=new ga(e,o[c]);for(;c<a;++c)(n=t[c])&&(i[c]=n)}function rw(e,t,r,s,i,o,c){var n,a,p=new Map,_=t.length,l=o.length,g=new Array(_),v;for(n=0;n<_;++n)(a=t[n])&&(g[n]=v=c.call(a,a.__data__,n,t)+"",p.has(v)?i[n]=a:p.set(v,a));for(n=0;n<l;++n)v=c.call(e,o[n],n,o)+"",(a=p.get(v))?(s[n]=a,a.__data__=o[n],p.delete(v)):r[n]=new ga(e,o[n]);for(n=0;n<_;++n)(a=t[n])&&p.get(g[n])===a&&(i[n]=a)}function sw(e){return e.__data__}function iw(e,t){if(!arguments.length)return Array.from(this,sw);var r=t?rw:tw,s=this._parents,i=this._groups;typeof e!="function"&&(e=ew(e));for(var o=i.length,c=new Array(o),n=new Array(o),a=new Array(o),p=0;p<o;++p){var _=s[p],l=i[p],g=l.length,v=nw(e.call(_,_&&_.__data__,p,s)),w=v.length,m=n[p]=new Array(w),h=c[p]=new Array(w),f=a[p]=new Array(g);r(_,l,m,h,f,v,t);for(var d=0,u=0,y,C;d<w;++d)if(y=m[d]){for(d>=u&&(u=d+1);!(C=h[u])&&++u<w;);y._next=C||null}}return c=new Rt(c,s),c._enter=n,c._exit=a,c}function nw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ow(){return new Rt(this._exit||this._groups.map(B_),this._parents)}function aw(e,t,r){var s=this.enter(),i=this,o=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?o.remove():r(o),s&&i?s.merge(i).order():i}function lw(e){for(var t=e.selection?e.selection():e,r=this._groups,s=t._groups,i=r.length,o=s.length,c=Math.min(i,o),n=new Array(i),a=0;a<c;++a)for(var p=r[a],_=s[a],l=p.length,g=n[a]=new Array(l),v,w=0;w<l;++w)(v=p[w]||_[w])&&(g[w]=v);for(;a<i;++a)n[a]=r[a];return new Rt(n,this._parents)}function cw(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var s=e[t],i=s.length-1,o=s[i],c;--i>=0;)(c=s[i])&&(o&&c.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(c,o),o=c);return this}function uw(e){e||(e=hw);function t(l,g){return l&&g?e(l.__data__,g.__data__):!l-!g}for(var r=this._groups,s=r.length,i=new Array(s),o=0;o<s;++o){for(var c=r[o],n=c.length,a=i[o]=new Array(n),p,_=0;_<n;++_)(p=c[_])&&(a[_]=p);a.sort(t)}return new Rt(i,this._parents).order()}function hw(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dw(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fw(){return Array.from(this)}function pw(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],i=0,o=s.length;i<o;++i){var c=s[i];if(c)return c}return null}function gw(){let e=0;for(const t of this)++e;return e}function _w(){return!this.node()}function mw(e){for(var t=this._groups,r=0,s=t.length;r<s;++r)for(var i=t[r],o=0,c=i.length,n;o<c;++o)(n=i[o])&&e.call(n,n.__data__,o,i);return this}function vw(e){return function(){this.removeAttribute(e)}}function yw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ww(e,t){return function(){this.setAttribute(e,t)}}function Sw(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function xw(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Cw(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function bw(e,t){var r=za(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((t==null?r.local?yw:vw:typeof t=="function"?r.local?Cw:xw:r.local?Sw:ww)(r,t))}function O_(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ew(e){return function(){this.style.removeProperty(e)}}function kw(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Lw(e,t,r){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function Mw(e,t,r){return arguments.length>1?this.each((t==null?Ew:typeof t=="function"?Lw:kw)(e,t,r??"")):li(this.node(),e)}function li(e,t){return e.style.getPropertyValue(t)||O_(e).getComputedStyle(e,null).getPropertyValue(t)}function Rw(e){return function(){delete this[e]}}function Dw(e,t){return function(){this[e]=t}}function Aw(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Tw(e,t){return arguments.length>1?this.each((t==null?Rw:typeof t=="function"?Aw:Dw)(e,t)):this.node()[e]}function $_(e){return e.trim().split(/^|\s+/)}function ih(e){return e.classList||new j_(e)}function j_(e){this._node=e,this._names=$_(e.getAttribute("class")||"")}j_.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function F_(e,t){for(var r=ih(e),s=-1,i=t.length;++s<i;)r.add(t[s])}function H_(e,t){for(var r=ih(e),s=-1,i=t.length;++s<i;)r.remove(t[s])}function Pw(e){return function(){F_(this,e)}}function Nw(e){return function(){H_(this,e)}}function Iw(e,t){return function(){(t.apply(this,arguments)?F_:H_)(this,e)}}function Bw(e,t){var r=$_(e+"");if(arguments.length<2){for(var s=ih(this.node()),i=-1,o=r.length;++i<o;)if(!s.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?Iw:t?Pw:Nw)(r,t))}function Ow(){this.textContent=""}function $w(e){return function(){this.textContent=e}}function jw(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Fw(e){return arguments.length?this.each(e==null?Ow:(typeof e=="function"?jw:$w)(e)):this.node().textContent}function Hw(){this.innerHTML=""}function zw(e){return function(){this.innerHTML=e}}function Ww(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Uw(e){return arguments.length?this.each(e==null?Hw:(typeof e=="function"?Ww:zw)(e)):this.node().innerHTML}function Vw(){this.nextSibling&&this.parentNode.appendChild(this)}function Kw(){return this.each(Vw)}function Gw(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qw(){return this.each(Gw)}function Xw(e){var t=typeof e=="function"?e:T_(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Yw(){return null}function Qw(e,t){var r=typeof e=="function"?e:T_(e),s=t==null?Yw:typeof t=="function"?t:sh(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function Zw(){var e=this.parentNode;e&&e.removeChild(this)}function Jw(){return this.each(Zw)}function eS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tS(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rS(e){return this.select(e?tS:eS)}function sS(e){return arguments.length?this.property("__data__",e):this.node().__data__}function iS(e){return function(t){e.call(this,t,this.__data__)}}function nS(e){return e.trim().split(/^|\s+/).map(function(t){var r="",s=t.indexOf(".");return s>=0&&(r=t.slice(s+1),t=t.slice(0,s)),{type:t,name:r}})}function oS(e){return function(){var t=this.__on;if(t){for(var r=0,s=-1,i=t.length,o;r<i;++r)o=t[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++s]=o;++s?t.length=s:delete this.__on}}}function aS(e,t,r){return function(){var s=this.__on,i,o=iS(t);if(s){for(var c=0,n=s.length;c<n;++c)if((i=s[c]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=r),i.value=t;return}}this.addEventListener(e.type,o,r),i={type:e.type,name:e.name,value:t,listener:o,options:r},s?s.push(i):this.__on=[i]}}function lS(e,t,r){var s=nS(e+""),i,o=s.length,c;if(arguments.length<2){var n=this.node().__on;if(n){for(var a=0,p=n.length,_;a<p;++a)for(i=0,_=n[a];i<o;++i)if((c=s[i]).type===_.type&&c.name===_.name)return _.value}return}for(n=t?aS:oS,i=0;i<o;++i)this.each(n(s[i],t,r));return this}function z_(e,t,r){var s=O_(e),i=s.CustomEvent;typeof i=="function"?i=new i(t,r):(i=s.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function cS(e,t){return function(){return z_(this,e,t)}}function uS(e,t){return function(){return z_(this,e,t.apply(this,arguments))}}function hS(e,t){return this.each((typeof t=="function"?uS:cS)(e,t))}function*dS(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],i=0,o=s.length,c;i<o;++i)(c=s[i])&&(yield c)}var W_=[null];function Rt(e,t){this._groups=e,this._parents=t}function Pn(){return new Rt([[document.documentElement]],W_)}function fS(){return this}Rt.prototype=Pn.prototype={constructor:Rt,select:j1,selectAll:W1,selectChild:G1,selectChildren:Q1,filter:Z1,data:iw,enter:J1,exit:ow,join:aw,merge:lw,selection:fS,order:cw,sort:uw,call:dw,nodes:fw,node:pw,size:gw,empty:_w,each:mw,attr:bw,style:Mw,property:Tw,classed:Bw,text:Fw,html:Uw,raise:Kw,lower:qw,append:Xw,insert:Qw,remove:Jw,clone:rS,datum:sS,on:lS,dispatch:hS,[Symbol.iterator]:dS};function Et(e){return typeof e=="string"?new Rt([[document.querySelector(e)]],[document.documentElement]):new Rt([[e]],W_)}function pS(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ut(e,t){if(e=pS(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var s=r.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const gS={passive:!1},_n={capture:!0,passive:!1};function Bl(e){e.stopImmediatePropagation()}function Js(e){e.preventDefault(),e.stopImmediatePropagation()}function U_(e){var t=e.document.documentElement,r=Et(e).on("dragstart.drag",Js,_n);"onselectstart"in t?r.on("selectstart.drag",Js,_n):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function V_(e,t){var r=e.document.documentElement,s=Et(e).on("dragstart.drag",null);t&&(s.on("click.drag",Js,_n),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in r?s.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const _o=e=>()=>e;function Vc(e,{sourceEvent:t,subject:r,target:s,identifier:i,active:o,x:c,y:n,dx:a,dy:p,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:n,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:_}})}Vc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function _S(e){return!e.ctrlKey&&!e.button}function mS(){return this.parentNode}function vS(e,t){return t??{x:e.x,y:e.y}}function yS(){return navigator.maxTouchPoints||"ontouchstart"in this}function K_(){var e=_S,t=mS,r=vS,s=yS,i={},o=Ha("start","drag","end"),c=0,n,a,p,_,l=0;function g(y){y.on("mousedown.drag",v).filter(s).on("touchstart.drag",h).on("touchmove.drag",f,gS).on("touchend.drag touchcancel.drag",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(y,C){if(!(_||!e.call(this,y,C))){var S=u(this,t.call(this,y,C),y,C,"mouse");S&&(Et(y.view).on("mousemove.drag",w,_n).on("mouseup.drag",m,_n),U_(y.view),Bl(y),p=!1,n=y.clientX,a=y.clientY,S("start",y))}}function w(y){if(Js(y),!p){var C=y.clientX-n,S=y.clientY-a;p=C*C+S*S>l}i.mouse("drag",y)}function m(y){Et(y.view).on("mousemove.drag mouseup.drag",null),V_(y.view,p),Js(y),i.mouse("end",y)}function h(y,C){if(e.call(this,y,C)){var S=y.changedTouches,b=t.call(this,y,C),x=S.length,k,M;for(k=0;k<x;++k)(M=u(this,b,y,C,S[k].identifier,S[k]))&&(Bl(y),M("start",y,S[k]))}}function f(y){var C=y.changedTouches,S=C.length,b,x;for(b=0;b<S;++b)(x=i[C[b].identifier])&&(Js(y),x("drag",y,C[b]))}function d(y){var C=y.changedTouches,S=C.length,b,x;for(_&&clearTimeout(_),_=setTimeout(function(){_=null},500),b=0;b<S;++b)(x=i[C[b].identifier])&&(Bl(y),x("end",y,C[b]))}function u(y,C,S,b,x,k){var M=o.copy(),D=Ut(k||S,C),R,T,A;if((A=r.call(y,new Vc("beforestart",{sourceEvent:S,target:g,identifier:x,active:c,x:D[0],y:D[1],dx:0,dy:0,dispatch:M}),b))!=null)return R=A.x-D[0]||0,T=A.y-D[1]||0,function j($,F,B){var L=D,P;switch($){case"start":i[x]=j,P=c++;break;case"end":delete i[x],--c;case"drag":D=Ut(B||F,C),P=c;break}M.call($,y,new Vc($,{sourceEvent:F,subject:A,target:g,identifier:x,active:P,x:D[0]+R,y:D[1]+T,dx:D[0]-L[0],dy:D[1]-L[1],dispatch:M}),b)}}return g.filter=function(y){return arguments.length?(e=typeof y=="function"?y:_o(!!y),g):e},g.container=function(y){return arguments.length?(t=typeof y=="function"?y:_o(y),g):t},g.subject=function(y){return arguments.length?(r=typeof y=="function"?y:_o(y),g):r},g.touchable=function(y){return arguments.length?(s=typeof y=="function"?y:_o(!!y),g):s},g.on=function(){var y=o.on.apply(o,arguments);return y===o?g:y},g.clickDistance=function(y){return arguments.length?(l=(y=+y)*y,g):Math.sqrt(l)},g}function nh(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function G_(e,t){var r=Object.create(e.prototype);for(var s in t)r[s]=t[s];return r}function Nn(){}var mn=.7,_a=1/mn,ei="\\s*([+-]?\\d+)\\s*",vn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ar="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wS=/^#([0-9a-f]{3,8})$/,SS=new RegExp(`^rgb\\(${ei},${ei},${ei}\\)$`),xS=new RegExp(`^rgb\\(${ar},${ar},${ar}\\)$`),CS=new RegExp(`^rgba\\(${ei},${ei},${ei},${vn}\\)$`),bS=new RegExp(`^rgba\\(${ar},${ar},${ar},${vn}\\)$`),ES=new RegExp(`^hsl\\(${vn},${ar},${ar}\\)$`),kS=new RegExp(`^hsla\\(${vn},${ar},${ar},${vn}\\)$`),Wd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};nh(Nn,ys,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ud,formatHex:Ud,formatHex8:LS,formatHsl:MS,formatRgb:Vd,toString:Vd});function Ud(){return this.rgb().formatHex()}function LS(){return this.rgb().formatHex8()}function MS(){return q_(this).formatHsl()}function Vd(){return this.rgb().formatRgb()}function ys(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=wS.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Kd(t):r===3?new wt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?mo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?mo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=SS.exec(e))?new wt(t[1],t[2],t[3],1):(t=xS.exec(e))?new wt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=CS.exec(e))?mo(t[1],t[2],t[3],t[4]):(t=bS.exec(e))?mo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ES.exec(e))?Xd(t[1],t[2]/100,t[3]/100,1):(t=kS.exec(e))?Xd(t[1],t[2]/100,t[3]/100,t[4]):Wd.hasOwnProperty(e)?Kd(Wd[e]):e==="transparent"?new wt(NaN,NaN,NaN,0):null}function Kd(e){return new wt(e>>16&255,e>>8&255,e&255,1)}function mo(e,t,r,s){return s<=0&&(e=t=r=NaN),new wt(e,t,r,s)}function RS(e){return e instanceof Nn||(e=ys(e)),e?(e=e.rgb(),new wt(e.r,e.g,e.b,e.opacity)):new wt}function Kc(e,t,r,s){return arguments.length===1?RS(e):new wt(e,t,r,s??1)}function wt(e,t,r,s){this.r=+e,this.g=+t,this.b=+r,this.opacity=+s}nh(wt,Kc,G_(Nn,{brighter(e){return e=e==null?_a:Math.pow(_a,e),new wt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?mn:Math.pow(mn,e),new wt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new wt(ds(this.r),ds(this.g),ds(this.b),ma(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Gd,formatHex:Gd,formatHex8:DS,formatRgb:qd,toString:qd}));function Gd(){return`#${ls(this.r)}${ls(this.g)}${ls(this.b)}`}function DS(){return`#${ls(this.r)}${ls(this.g)}${ls(this.b)}${ls((isNaN(this.opacity)?1:this.opacity)*255)}`}function qd(){const e=ma(this.opacity);return`${e===1?"rgb(":"rgba("}${ds(this.r)}, ${ds(this.g)}, ${ds(this.b)}${e===1?")":`, ${e})`}`}function ma(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ds(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ls(e){return e=ds(e),(e<16?"0":"")+e.toString(16)}function Xd(e,t,r,s){return s<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Kt(e,t,r,s)}function q_(e){if(e instanceof Kt)return new Kt(e.h,e.s,e.l,e.opacity);if(e instanceof Nn||(e=ys(e)),!e)return new Kt;if(e instanceof Kt)return e;e=e.rgb();var t=e.r/255,r=e.g/255,s=e.b/255,i=Math.min(t,r,s),o=Math.max(t,r,s),c=NaN,n=o-i,a=(o+i)/2;return n?(t===o?c=(r-s)/n+(r<s)*6:r===o?c=(s-t)/n+2:c=(t-r)/n+4,n/=a<.5?o+i:2-o-i,c*=60):n=a>0&&a<1?0:c,new Kt(c,n,a,e.opacity)}function AS(e,t,r,s){return arguments.length===1?q_(e):new Kt(e,t,r,s??1)}function Kt(e,t,r,s){this.h=+e,this.s=+t,this.l=+r,this.opacity=+s}nh(Kt,AS,G_(Nn,{brighter(e){return e=e==null?_a:Math.pow(_a,e),new Kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?mn:Math.pow(mn,e),new Kt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,s=r+(r<.5?r:1-r)*t,i=2*r-s;return new wt(Ol(e>=240?e-240:e+120,i,s),Ol(e,i,s),Ol(e<120?e+240:e-120,i,s),this.opacity)},clamp(){return new Kt(Yd(this.h),vo(this.s),vo(this.l),ma(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ma(this.opacity);return`${e===1?"hsl(":"hsla("}${Yd(this.h)}, ${vo(this.s)*100}%, ${vo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Yd(e){return e=(e||0)%360,e<0?e+360:e}function vo(e){return Math.max(0,Math.min(1,e||0))}function Ol(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const oh=e=>()=>e;function TS(e,t){return function(r){return e+r*t}}function PS(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(s){return Math.pow(e+s*t,r)}}function NS(e){return(e=+e)==1?X_:function(t,r){return r-t?PS(t,r,e):oh(isNaN(t)?r:t)}}function X_(e,t){var r=t-e;return r?TS(e,r):oh(isNaN(e)?t:e)}const va=function e(t){var r=NS(t);function s(i,o){var c=r((i=Kc(i)).r,(o=Kc(o)).r),n=r(i.g,o.g),a=r(i.b,o.b),p=X_(i.opacity,o.opacity);return function(_){return i.r=c(_),i.g=n(_),i.b=a(_),i.opacity=p(_),i+""}}return s.gamma=e,s}(1);function IS(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,s=t.slice(),i;return function(o){for(i=0;i<r;++i)s[i]=e[i]*(1-o)+t[i]*o;return s}}function BS(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function OS(e,t){var r=t?t.length:0,s=e?Math.min(r,e.length):0,i=new Array(s),o=new Array(r),c;for(c=0;c<s;++c)i[c]=Xi(e[c],t[c]);for(;c<r;++c)o[c]=t[c];return function(n){for(c=0;c<s;++c)o[c]=i[c](n);return o}}function $S(e,t){var r=new Date;return e=+e,t=+t,function(s){return r.setTime(e*(1-s)+t*s),r}}function rr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function jS(e,t){var r={},s={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Xi(e[i],t[i]):s[i]=t[i];return function(o){for(i in r)s[i]=r[i](o);return s}}var Gc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$l=new RegExp(Gc.source,"g");function FS(e){return function(){return e}}function HS(e){return function(t){return e(t)+""}}function Y_(e,t){var r=Gc.lastIndex=$l.lastIndex=0,s,i,o,c=-1,n=[],a=[];for(e=e+"",t=t+"";(s=Gc.exec(e))&&(i=$l.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),n[c]?n[c]+=o:n[++c]=o),(s=s[0])===(i=i[0])?n[c]?n[c]+=i:n[++c]=i:(n[++c]=null,a.push({i:c,x:rr(s,i)})),r=$l.lastIndex;return r<t.length&&(o=t.slice(r),n[c]?n[c]+=o:n[++c]=o),n.length<2?a[0]?HS(a[0].x):FS(t):(t=a.length,function(p){for(var _=0,l;_<t;++_)n[(l=a[_]).i]=l.x(p);return n.join("")})}function Xi(e,t){var r=typeof t,s;return t==null||r==="boolean"?oh(t):(r==="number"?rr:r==="string"?(s=ys(t))?(t=s,va):Y_:t instanceof ys?va:t instanceof Date?$S:BS(t)?IS:Array.isArray(t)?OS:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?jS:rr)(e,t)}var Qd=180/Math.PI,qc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Q_(e,t,r,s,i,o){var c,n,a;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(a=e*r+t*s)&&(r-=e*a,s-=t*a),(n=Math.sqrt(r*r+s*s))&&(r/=n,s/=n,a/=n),e*s<t*r&&(e=-e,t=-t,a=-a,c=-c),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*Qd,skewX:Math.atan(a)*Qd,scaleX:c,scaleY:n}}var yo;function zS(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qc:Q_(t.a,t.b,t.c,t.d,t.e,t.f)}function WS(e){return e==null||(yo||(yo=document.createElementNS("http://www.w3.org/2000/svg","g")),yo.setAttribute("transform",e),!(e=yo.transform.baseVal.consolidate()))?qc:(e=e.matrix,Q_(e.a,e.b,e.c,e.d,e.e,e.f))}function Z_(e,t,r,s){function i(p){return p.length?p.pop()+" ":""}function o(p,_,l,g,v,w){if(p!==l||_!==g){var m=v.push("translate(",null,t,null,r);w.push({i:m-4,x:rr(p,l)},{i:m-2,x:rr(_,g)})}else(l||g)&&v.push("translate("+l+t+g+r)}function c(p,_,l,g){p!==_?(p-_>180?_+=360:_-p>180&&(p+=360),g.push({i:l.push(i(l)+"rotate(",null,s)-2,x:rr(p,_)})):_&&l.push(i(l)+"rotate("+_+s)}function n(p,_,l,g){p!==_?g.push({i:l.push(i(l)+"skewX(",null,s)-2,x:rr(p,_)}):_&&l.push(i(l)+"skewX("+_+s)}function a(p,_,l,g,v,w){if(p!==l||_!==g){var m=v.push(i(v)+"scale(",null,",",null,")");w.push({i:m-4,x:rr(p,l)},{i:m-2,x:rr(_,g)})}else(l!==1||g!==1)&&v.push(i(v)+"scale("+l+","+g+")")}return function(p,_){var l=[],g=[];return p=e(p),_=e(_),o(p.translateX,p.translateY,_.translateX,_.translateY,l,g),c(p.rotate,_.rotate,l,g),n(p.skewX,_.skewX,l,g),a(p.scaleX,p.scaleY,_.scaleX,_.scaleY,l,g),p=_=null,function(v){for(var w=-1,m=g.length,h;++w<m;)l[(h=g[w]).i]=h.x(v);return l.join("")}}}var US=Z_(zS,"px, ","px)","deg)"),VS=Z_(WS,", ",")",")"),KS=1e-12;function Zd(e){return((e=Math.exp(e))+1/e)/2}function GS(e){return((e=Math.exp(e))-1/e)/2}function qS(e){return((e=Math.exp(2*e))-1)/(e+1)}const jo=function e(t,r,s){function i(o,c){var n=o[0],a=o[1],p=o[2],_=c[0],l=c[1],g=c[2],v=_-n,w=l-a,m=v*v+w*w,h,f;if(m<KS)f=Math.log(g/p)/t,h=function(b){return[n+b*v,a+b*w,p*Math.exp(t*b*f)]};else{var d=Math.sqrt(m),u=(g*g-p*p+s*m)/(2*p*r*d),y=(g*g-p*p-s*m)/(2*g*r*d),C=Math.log(Math.sqrt(u*u+1)-u),S=Math.log(Math.sqrt(y*y+1)-y);f=(S-C)/t,h=function(b){var x=b*f,k=Zd(C),M=p/(r*d)*(k*qS(t*x+C)-GS(C));return[n+M*v,a+M*w,p*k/Zd(t*x+C)]}}return h.duration=f*1e3*t/Math.SQRT2,h}return i.rho=function(o){var c=Math.max(.001,+o),n=c*c,a=n*n;return e(c,n,a)},i}(Math.SQRT2,2,4);var ci=0,$i=0,Ai=0,J_=1e3,ya,ji,wa=0,ws=0,Wa=0,yn=typeof performance=="object"&&performance.now?performance:Date,em=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ah(){return ws||(em(XS),ws=yn.now()+Wa)}function XS(){ws=0}function Sa(){this._call=this._time=this._next=null}Sa.prototype=tm.prototype={constructor:Sa,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?ah():+r)+(t==null?0:+t),!this._next&&ji!==this&&(ji?ji._next=this:ya=this,ji=this),this._call=e,this._time=r,Xc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xc())}};function tm(e,t,r){var s=new Sa;return s.restart(e,t,r),s}function YS(){ah(),++ci;for(var e=ya,t;e;)(t=ws-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ci}function Jd(){ws=(wa=yn.now())+Wa,ci=$i=0;try{YS()}finally{ci=0,ZS(),ws=0}}function QS(){var e=yn.now(),t=e-wa;t>J_&&(Wa-=t,wa=e)}function ZS(){for(var e,t=ya,r,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:ya=r);ji=e,Xc(s)}function Xc(e){if(!ci){$i&&($i=clearTimeout($i));var t=e-ws;t>24?(e<1/0&&($i=setTimeout(Jd,e-yn.now()-Wa)),Ai&&(Ai=clearInterval(Ai))):(Ai||(wa=yn.now(),Ai=setInterval(QS,J_)),ci=1,em(Jd))}}function ef(e,t,r){var s=new Sa;return t=t==null?0:+t,s.restart(i=>{s.stop(),e(i+t)},t,r),s}var JS=Ha("start","end","cancel","interrupt"),ex=[],rm=0,tf=1,Yc=2,Fo=3,rf=4,Qc=5,Ho=6;function Ua(e,t,r,s,i,o){var c=e.__transition;if(!c)e.__transition={};else if(r in c)return;tx(e,r,{name:t,index:s,group:i,on:JS,tween:ex,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:rm})}function lh(e,t){var r=Jt(e,t);if(r.state>rm)throw new Error("too late; already scheduled");return r}function lr(e,t){var r=Jt(e,t);if(r.state>Fo)throw new Error("too late; already running");return r}function Jt(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function tx(e,t,r){var s=e.__transition,i;s[t]=r,r.timer=tm(o,0,r.time);function o(p){r.state=tf,r.timer.restart(c,r.delay,r.time),r.delay<=p&&c(p-r.delay)}function c(p){var _,l,g,v;if(r.state!==tf)return a();for(_ in s)if(v=s[_],v.name===r.name){if(v.state===Fo)return ef(c);v.state===rf?(v.state=Ho,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete s[_]):+_<t&&(v.state=Ho,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete s[_])}if(ef(function(){r.state===Fo&&(r.state=rf,r.timer.restart(n,r.delay,r.time),n(p))}),r.state=Yc,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Yc){for(r.state=Fo,i=new Array(g=r.tween.length),_=0,l=-1;_<g;++_)(v=r.tween[_].value.call(e,e.__data__,r.index,r.group))&&(i[++l]=v);i.length=l+1}}function n(p){for(var _=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(a),r.state=Qc,1),l=-1,g=i.length;++l<g;)i[l].call(e,_);r.state===Qc&&(r.on.call("end",e,e.__data__,r.index,r.group),a())}function a(){r.state=Ho,r.timer.stop(),delete s[t];for(var p in s)return;delete e.__transition}}function zo(e,t){var r=e.__transition,s,i,o=!0,c;if(r){t=t==null?null:t+"";for(c in r){if((s=r[c]).name!==t){o=!1;continue}i=s.state>Yc&&s.state<Qc,s.state=Ho,s.timer.stop(),s.on.call(i?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[c]}o&&delete e.__transition}}function rx(e){return this.each(function(){zo(this,e)})}function sx(e,t){var r,s;return function(){var i=lr(this,e),o=i.tween;if(o!==r){s=r=o;for(var c=0,n=s.length;c<n;++c)if(s[c].name===t){s=s.slice(),s.splice(c,1);break}}i.tween=s}}function ix(e,t,r){var s,i;if(typeof r!="function")throw new Error;return function(){var o=lr(this,e),c=o.tween;if(c!==s){i=(s=c).slice();for(var n={name:t,value:r},a=0,p=i.length;a<p;++a)if(i[a].name===t){i[a]=n;break}a===p&&i.push(n)}o.tween=i}}function nx(e,t){var r=this._id;if(e+="",arguments.length<2){for(var s=Jt(this.node(),r).tween,i=0,o=s.length,c;i<o;++i)if((c=s[i]).name===e)return c.value;return null}return this.each((t==null?sx:ix)(r,e,t))}function ch(e,t,r){var s=e._id;return e.each(function(){var i=lr(this,s);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return Jt(i,s).value[t]}}function sm(e,t){var r;return(typeof t=="number"?rr:t instanceof ys?va:(r=ys(t))?(t=r,va):Y_)(e,t)}function ox(e){return function(){this.removeAttribute(e)}}function ax(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lx(e,t,r){var s,i=r+"",o;return function(){var c=this.getAttribute(e);return c===i?null:c===s?o:o=t(s=c,r)}}function cx(e,t,r){var s,i=r+"",o;return function(){var c=this.getAttributeNS(e.space,e.local);return c===i?null:c===s?o:o=t(s=c,r)}}function ux(e,t,r){var s,i,o;return function(){var c,n=r(this),a;return n==null?void this.removeAttribute(e):(c=this.getAttribute(e),a=n+"",c===a?null:c===s&&a===i?o:(i=a,o=t(s=c,n)))}}function hx(e,t,r){var s,i,o;return function(){var c,n=r(this),a;return n==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),a=n+"",c===a?null:c===s&&a===i?o:(i=a,o=t(s=c,n)))}}function dx(e,t){var r=za(e),s=r==="transform"?VS:sm;return this.attrTween(e,typeof t=="function"?(r.local?hx:ux)(r,s,ch(this,"attr."+e,t)):t==null?(r.local?ax:ox)(r):(r.local?cx:lx)(r,s,t))}function fx(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function px(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function gx(e,t){var r,s;function i(){var o=t.apply(this,arguments);return o!==s&&(r=(s=o)&&px(e,o)),r}return i._value=t,i}function _x(e,t){var r,s;function i(){var o=t.apply(this,arguments);return o!==s&&(r=(s=o)&&fx(e,o)),r}return i._value=t,i}function mx(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var s=za(e);return this.tween(r,(s.local?gx:_x)(s,t))}function vx(e,t){return function(){lh(this,e).delay=+t.apply(this,arguments)}}function yx(e,t){return t=+t,function(){lh(this,e).delay=t}}function wx(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vx:yx)(t,e)):Jt(this.node(),t).delay}function Sx(e,t){return function(){lr(this,e).duration=+t.apply(this,arguments)}}function xx(e,t){return t=+t,function(){lr(this,e).duration=t}}function Cx(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Sx:xx)(t,e)):Jt(this.node(),t).duration}function bx(e,t){if(typeof t!="function")throw new Error;return function(){lr(this,e).ease=t}}function Ex(e){var t=this._id;return arguments.length?this.each(bx(t,e)):Jt(this.node(),t).ease}function kx(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;lr(this,e).ease=r}}function Lx(e){if(typeof e!="function")throw new Error;return this.each(kx(this._id,e))}function Mx(e){typeof e!="function"&&(e=N_(e));for(var t=this._groups,r=t.length,s=new Array(r),i=0;i<r;++i)for(var o=t[i],c=o.length,n=s[i]=[],a,p=0;p<c;++p)(a=o[p])&&e.call(a,a.__data__,p,o)&&n.push(a);return new Sr(s,this._parents,this._name,this._id)}function Rx(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,s=t.length,i=r.length,o=Math.min(s,i),c=new Array(s),n=0;n<o;++n)for(var a=t[n],p=r[n],_=a.length,l=c[n]=new Array(_),g,v=0;v<_;++v)(g=a[v]||p[v])&&(l[v]=g);for(;n<s;++n)c[n]=t[n];return new Sr(c,this._parents,this._name,this._id)}function Dx(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Ax(e,t,r){var s,i,o=Dx(t)?lh:lr;return function(){var c=o(this,e),n=c.on;n!==s&&(i=(s=n).copy()).on(t,r),c.on=i}}function Tx(e,t){var r=this._id;return arguments.length<2?Jt(this.node(),r).on.on(e):this.each(Ax(r,e,t))}function Px(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Nx(){return this.on("end.remove",Px(this._id))}function Ix(e){var t=this._name,r=this._id;typeof e!="function"&&(e=sh(e));for(var s=this._groups,i=s.length,o=new Array(i),c=0;c<i;++c)for(var n=s[c],a=n.length,p=o[c]=new Array(a),_,l,g=0;g<a;++g)(_=n[g])&&(l=e.call(_,_.__data__,g,n))&&("__data__"in _&&(l.__data__=_.__data__),p[g]=l,Ua(p[g],t,r,g,p,Jt(_,r)));return new Sr(o,this._parents,t,r)}function Bx(e){var t=this._name,r=this._id;typeof e!="function"&&(e=P_(e));for(var s=this._groups,i=s.length,o=[],c=[],n=0;n<i;++n)for(var a=s[n],p=a.length,_,l=0;l<p;++l)if(_=a[l]){for(var g=e.call(_,_.__data__,l,a),v,w=Jt(_,r),m=0,h=g.length;m<h;++m)(v=g[m])&&Ua(v,t,r,m,g,w);o.push(g),c.push(_)}return new Sr(o,c,t,r)}var Ox=Pn.prototype.constructor;function $x(){return new Ox(this._groups,this._parents)}function jx(e,t){var r,s,i;return function(){var o=li(this,e),c=(this.style.removeProperty(e),li(this,e));return o===c?null:o===r&&c===s?i:i=t(r=o,s=c)}}function im(e){return function(){this.style.removeProperty(e)}}function Fx(e,t,r){var s,i=r+"",o;return function(){var c=li(this,e);return c===i?null:c===s?o:o=t(s=c,r)}}function Hx(e,t,r){var s,i,o;return function(){var c=li(this,e),n=r(this),a=n+"";return n==null&&(a=n=(this.style.removeProperty(e),li(this,e))),c===a?null:c===s&&a===i?o:(i=a,o=t(s=c,n))}}function zx(e,t){var r,s,i,o="style."+t,c="end."+o,n;return function(){var a=lr(this,e),p=a.on,_=a.value[o]==null?n||(n=im(t)):void 0;(p!==r||i!==_)&&(s=(r=p).copy()).on(c,i=_),a.on=s}}function Wx(e,t,r){var s=(e+="")=="transform"?US:sm;return t==null?this.styleTween(e,jx(e,s)).on("end.style."+e,im(e)):typeof t=="function"?this.styleTween(e,Hx(e,s,ch(this,"style."+e,t))).each(zx(this._id,e)):this.styleTween(e,Fx(e,s,t),r).on("end.style."+e,null)}function Ux(e,t,r){return function(s){this.style.setProperty(e,t.call(this,s),r)}}function Vx(e,t,r){var s,i;function o(){var c=t.apply(this,arguments);return c!==i&&(s=(i=c)&&Ux(e,c,r)),s}return o._value=t,o}function Kx(e,t,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,Vx(e,t,r??""))}function Gx(e){return function(){this.textContent=e}}function qx(e){return function(){var t=e(this);this.textContent=t??""}}function Xx(e){return this.tween("text",typeof e=="function"?qx(ch(this,"text",e)):Gx(e==null?"":e+""))}function Yx(e){return function(t){this.textContent=e.call(this,t)}}function Qx(e){var t,r;function s(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&Yx(i)),t}return s._value=e,s}function Zx(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Qx(e))}function Jx(){for(var e=this._name,t=this._id,r=nm(),s=this._groups,i=s.length,o=0;o<i;++o)for(var c=s[o],n=c.length,a,p=0;p<n;++p)if(a=c[p]){var _=Jt(a,t);Ua(a,e,r,p,c,{time:_.time+_.delay+_.duration,delay:0,duration:_.duration,ease:_.ease})}return new Sr(s,this._parents,e,r)}function eC(){var e,t,r=this,s=r._id,i=r.size();return new Promise(function(o,c){var n={value:c},a={value:function(){--i===0&&o()}};r.each(function(){var p=lr(this,s),_=p.on;_!==e&&(t=(e=_).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(a)),p.on=t}),i===0&&o()})}var tC=0;function Sr(e,t,r,s){this._groups=e,this._parents=t,this._name=r,this._id=s}function nm(){return++tC}var ur=Pn.prototype;Sr.prototype={constructor:Sr,select:Ix,selectAll:Bx,selectChild:ur.selectChild,selectChildren:ur.selectChildren,filter:Mx,merge:Rx,selection:$x,transition:Jx,call:ur.call,nodes:ur.nodes,node:ur.node,size:ur.size,empty:ur.empty,each:ur.each,on:Tx,attr:dx,attrTween:mx,style:Wx,styleTween:Kx,text:Xx,textTween:Zx,remove:Nx,tween:nx,delay:wx,duration:Cx,ease:Ex,easeVarying:Lx,end:eC,[Symbol.iterator]:ur[Symbol.iterator]};function rC(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var sC={time:null,delay:0,duration:250,ease:rC};function iC(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function nC(e){var t,r;e instanceof Sr?(t=e._id,e=e._name):(t=nm(),(r=sC).time=ah(),e=e==null?null:e+"");for(var s=this._groups,i=s.length,o=0;o<i;++o)for(var c=s[o],n=c.length,a,p=0;p<n;++p)(a=c[p])&&Ua(a,e,t,p,c,r||iC(a,t));return new Sr(s,this._parents,e,t)}Pn.prototype.interrupt=rx;Pn.prototype.transition=nC;const wo=e=>()=>e;function oC(e,{sourceEvent:t,target:r,transform:s,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:i}})}function gr(e,t,r){this.k=e,this.x=t,this.y=r}gr.prototype={constructor:gr,scale:function(e){return e===1?this:new gr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new gr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Va=new gr(1,0,0);om.prototype=gr.prototype;function om(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Va;return e.__zoom}function jl(e){e.stopImmediatePropagation()}function Ti(e){e.preventDefault(),e.stopImmediatePropagation()}function aC(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function lC(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function sf(){return this.__zoom||Va}function cC(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function uC(){return navigator.maxTouchPoints||"ontouchstart"in this}function hC(e,t,r){var s=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],o=e.invertY(t[0][1])-r[0][1],c=e.invertY(t[1][1])-r[1][1];return e.translate(i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i),c>o?(o+c)/2:Math.min(0,o)||Math.max(0,c))}function am(){var e=aC,t=lC,r=hC,s=cC,i=uC,o=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],n=250,a=jo,p=Ha("start","zoom","end"),_,l,g,v=500,w=150,m=0,h=10;function f(A){A.property("__zoom",sf).on("wheel.zoom",x,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",M).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}f.transform=function(A,j,$,F){var B=A.selection?A.selection():A;B.property("__zoom",sf),A!==B?C(A,j,$,F):B.interrupt().each(function(){S(this,arguments).event(F).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},f.scaleBy=function(A,j,$,F){f.scaleTo(A,function(){var B=this.__zoom.k,L=typeof j=="function"?j.apply(this,arguments):j;return B*L},$,F)},f.scaleTo=function(A,j,$,F){f.transform(A,function(){var B=t.apply(this,arguments),L=this.__zoom,P=$==null?y(B):typeof $=="function"?$.apply(this,arguments):$,O=L.invert(P),I=typeof j=="function"?j.apply(this,arguments):j;return r(u(d(L,I),P,O),B,c)},$,F)},f.translateBy=function(A,j,$,F){f.transform(A,function(){return r(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof $=="function"?$.apply(this,arguments):$),t.apply(this,arguments),c)},null,F)},f.translateTo=function(A,j,$,F,B){f.transform(A,function(){var L=t.apply(this,arguments),P=this.__zoom,O=F==null?y(L):typeof F=="function"?F.apply(this,arguments):F;return r(Va.translate(O[0],O[1]).scale(P.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof $=="function"?-$.apply(this,arguments):-$),L,c)},F,B)};function d(A,j){return j=Math.max(o[0],Math.min(o[1],j)),j===A.k?A:new gr(j,A.x,A.y)}function u(A,j,$){var F=j[0]-$[0]*A.k,B=j[1]-$[1]*A.k;return F===A.x&&B===A.y?A:new gr(A.k,F,B)}function y(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function C(A,j,$,F){A.on("start.zoom",function(){S(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(F).end()}).tween("zoom",function(){var B=this,L=arguments,P=S(B,L).event(F),O=t.apply(B,L),I=$==null?y(O):typeof $=="function"?$.apply(B,L):$,W=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),K=B.__zoom,q=typeof j=="function"?j.apply(B,L):j,Z=a(K.invert(I).concat(W/K.k),q.invert(I).concat(W/q.k));return function(z){if(z===1)z=q;else{var N=Z(z),U=W/N[2];z=new gr(U,I[0]-N[0]*U,I[1]-N[1]*U)}P.zoom(null,z)}})}function S(A,j,$){return!$&&A.__zooming||new b(A,j)}function b(A,j){this.that=A,this.args=j,this.active=0,this.sourceEvent=null,this.extent=t.apply(A,j),this.taps=0}b.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,j){return this.mouse&&A!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var j=Et(this.that).datum();p.call(A,this.that,new oC(A,{sourceEvent:this.sourceEvent,target:f,transform:this.that.__zoom,dispatch:p}),j)}};function x(A,...j){if(!e.apply(this,arguments))return;var $=S(this,j).event(A),F=this.__zoom,B=Math.max(o[0],Math.min(o[1],F.k*Math.pow(2,s.apply(this,arguments)))),L=Ut(A);if($.wheel)($.mouse[0][0]!==L[0]||$.mouse[0][1]!==L[1])&&($.mouse[1]=F.invert($.mouse[0]=L)),clearTimeout($.wheel);else{if(F.k===B)return;$.mouse=[L,F.invert(L)],zo(this),$.start()}Ti(A),$.wheel=setTimeout(P,w),$.zoom("mouse",r(u(d(F,B),$.mouse[0],$.mouse[1]),$.extent,c));function P(){$.wheel=null,$.end()}}function k(A,...j){if(g||!e.apply(this,arguments))return;var $=A.currentTarget,F=S(this,j,!0).event(A),B=Et(A.view).on("mousemove.zoom",I,!0).on("mouseup.zoom",W,!0),L=Ut(A,$),P=A.clientX,O=A.clientY;U_(A.view),jl(A),F.mouse=[L,this.__zoom.invert(L)],zo(this),F.start();function I(K){if(Ti(K),!F.moved){var q=K.clientX-P,Z=K.clientY-O;F.moved=q*q+Z*Z>m}F.event(K).zoom("mouse",r(u(F.that.__zoom,F.mouse[0]=Ut(K,$),F.mouse[1]),F.extent,c))}function W(K){B.on("mousemove.zoom mouseup.zoom",null),V_(K.view,F.moved),Ti(K),F.event(K).end()}}function M(A,...j){if(e.apply(this,arguments)){var $=this.__zoom,F=Ut(A.changedTouches?A.changedTouches[0]:A,this),B=$.invert(F),L=$.k*(A.shiftKey?.5:2),P=r(u(d($,L),F,B),t.apply(this,j),c);Ti(A),n>0?Et(this).transition().duration(n).call(C,P,F,A):Et(this).call(f.transform,P,F,A)}}function D(A,...j){if(e.apply(this,arguments)){var $=A.touches,F=$.length,B=S(this,j,A.changedTouches.length===F).event(A),L,P,O,I;for(jl(A),P=0;P<F;++P)O=$[P],I=Ut(O,this),I=[I,this.__zoom.invert(I),O.identifier],B.touch0?!B.touch1&&B.touch0[2]!==I[2]&&(B.touch1=I,B.taps=0):(B.touch0=I,L=!0,B.taps=1+!!_);_&&(_=clearTimeout(_)),L&&(B.taps<2&&(l=I[0],_=setTimeout(function(){_=null},v)),zo(this),B.start())}}function R(A,...j){if(this.__zooming){var $=S(this,j).event(A),F=A.changedTouches,B=F.length,L,P,O,I;for(Ti(A),L=0;L<B;++L)P=F[L],O=Ut(P,this),$.touch0&&$.touch0[2]===P.identifier?$.touch0[0]=O:$.touch1&&$.touch1[2]===P.identifier&&($.touch1[0]=O);if(P=$.that.__zoom,$.touch1){var W=$.touch0[0],K=$.touch0[1],q=$.touch1[0],Z=$.touch1[1],z=(z=q[0]-W[0])*z+(z=q[1]-W[1])*z,N=(N=Z[0]-K[0])*N+(N=Z[1]-K[1])*N;P=d(P,Math.sqrt(z/N)),O=[(W[0]+q[0])/2,(W[1]+q[1])/2],I=[(K[0]+Z[0])/2,(K[1]+Z[1])/2]}else if($.touch0)O=$.touch0[0],I=$.touch0[1];else return;$.zoom("touch",r(u(P,O,I),$.extent,c))}}function T(A,...j){if(this.__zooming){var $=S(this,j).event(A),F=A.changedTouches,B=F.length,L,P;for(jl(A),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),L=0;L<B;++L)P=F[L],$.touch0&&$.touch0[2]===P.identifier?delete $.touch0:$.touch1&&$.touch1[2]===P.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(P=Ut(P,this),Math.hypot(l[0]-P[0],l[1]-P[1])<h)){var O=Et(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return f.wheelDelta=function(A){return arguments.length?(s=typeof A=="function"?A:wo(+A),f):s},f.filter=function(A){return arguments.length?(e=typeof A=="function"?A:wo(!!A),f):e},f.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:wo(!!A),f):i},f.extent=function(A){return arguments.length?(t=typeof A=="function"?A:wo([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),f):t},f.scaleExtent=function(A){return arguments.length?(o[0]=+A[0],o[1]=+A[1],f):[o[0],o[1]]},f.translateExtent=function(A){return arguments.length?(c[0][0]=+A[0][0],c[1][0]=+A[1][0],c[0][1]=+A[0][1],c[1][1]=+A[1][1],f):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},f.constrain=function(A){return arguments.length?(r=A,f):r},f.duration=function(A){return arguments.length?(n=+A,f):n},f.interpolate=function(A){return arguments.length?(a=A,f):a},f.on=function(){var A=p.on.apply(p,arguments);return A===p?f:A},f.clickDistance=function(A){return arguments.length?(m=(A=+A)*A,f):Math.sqrt(m)},f.tapDistance=function(A){return arguments.length?(h=+A,f):h},f}const Zt={error001:(e="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:r,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},wn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],lm=["Enter"," ","Escape"],cm={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ui;(function(e){e.Strict="strict",e.Loose="loose"})(ui||(ui={}));var fs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(fs||(fs={}));var Sn;(function(e){e.Partial="partial",e.Full="full"})(Sn||(Sn={}));const um={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Pr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Pr||(Pr={}));var Ss;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ss||(Ss={}));var he;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(he||(he={}));const nf={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top};function hm(e){return e===null?null:e?"valid":"invalid"}const dm=e=>"id"in e&&"source"in e&&"target"in e,dC=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),uh=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),In=(e,t=[0,0])=>{const{width:r,height:s}=br(e),i=e.origin??t,o=r*i[0],c=s*i[1];return{x:e.position.x-o,y:e.position.y-c}},fC=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((s,i)=>{const o=typeof i=="string";let c=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(c=o?t.nodeLookup.get(i):uh(i)?i:t.nodeLookup.get(i.id));const n=c?xa(c,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ka(s,n)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ga(r)},Bn=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(r=Ka(r,xa(i)),s=!0)}),s?Ga(r):{x:0,y:0,width:0,height:0}},hh=(e,t,[r,s,i]=[0,0,1],o=!1,c=!1)=>{const n={...yi(t,[r,s,i]),width:t.width/i,height:t.height/i},a=[];for(const p of e.values()){const{measured:_,selectable:l=!0,hidden:g=!1}=p;if(c&&!l||g)continue;const v=_.width??p.width??p.initialWidth??null,w=_.height??p.height??p.initialHeight??null,m=xn(n,di(p)),h=(v??0)*(w??0),f=o&&m>0;(!p.internals.handleBounds||f||m>=h||p.dragging)&&a.push(p)}return a},pC=(e,t)=>{const r=new Set;return e.forEach(s=>{r.add(s.id)}),t.filter(s=>r.has(s.source)||r.has(s.target))};function gC(e,t){const r=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!s||s.has(i.id))&&r.set(i.id,i)}),r}async function _C({nodes:e,width:t,height:r,panZoom:s,minZoom:i,maxZoom:o},c){if(e.size===0)return!0;const n=gC(e,c),a=Bn(n),p=fh(a,t,r,(c==null?void 0:c.minZoom)??i,(c==null?void 0:c.maxZoom)??o,(c==null?void 0:c.padding)??.1);return await s.setViewport(p,{duration:c==null?void 0:c.duration,ease:c==null?void 0:c.ease,interpolate:c==null?void 0:c.interpolate}),!0}function fm({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:s=[0,0],nodeExtent:i,onError:o}){const c=r.get(e),n=c.parentId?r.get(c.parentId):void 0,{x:a,y:p}=n?n.internals.positionAbsolute:{x:0,y:0},_=c.origin??s;let l=c.extent||i;if(c.extent==="parent"&&!c.expandParent)if(!n)o==null||o("005",Zt.error005());else{const v=n.measured.width,w=n.measured.height;v&&w&&(l=[[a,p],[a+v,p+w]])}else n&&Cs(c.extent)&&(l=[[c.extent[0][0]+a,c.extent[0][1]+p],[c.extent[1][0]+a,c.extent[1][1]+p]]);const g=Cs(l)?xs(t,l,c.measured):t;return(c.measured.width===void 0||c.measured.height===void 0)&&(o==null||o("015",Zt.error015())),{position:{x:g.x-a+(c.measured.width??0)*_[0],y:g.y-p+(c.measured.height??0)*_[1]},positionAbsolute:g}}async function mC({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:s,onBeforeDelete:i}){const o=new Set(e.map(g=>g.id)),c=[];for(const g of r){if(g.deletable===!1)continue;const v=o.has(g.id),w=!v&&g.parentId&&c.find(m=>m.id===g.parentId);(v||w)&&c.push(g)}const n=new Set(t.map(g=>g.id)),a=s.filter(g=>g.deletable!==!1),_=pC(c,a);for(const g of a)n.has(g.id)&&!_.find(w=>w.id===g.id)&&_.push(g);if(!i)return{edges:_,nodes:c};const l=await i({nodes:c,edges:_});return typeof l=="boolean"?l?{edges:_,nodes:c}:{edges:[],nodes:[]}:l}const hi=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),xs=(e={x:0,y:0},t,r)=>({x:hi(e.x,t[0][0],t[1][0]-((r==null?void 0:r.width)??0)),y:hi(e.y,t[0][1],t[1][1]-((r==null?void 0:r.height)??0))});function pm(e,t,r){const{width:s,height:i}=br(r),{x:o,y:c}=r.internals.positionAbsolute;return xs(e,[[o,c],[o+s,c+i]],t)}const of=(e,t,r)=>e<t?hi(Math.abs(e-t),1,t)/t:e>r?-hi(Math.abs(e-r),1,t)/t:0,dh=(e,t,r=15,s=40)=>{const i=of(e.x,s,t.width-s)*r,o=of(e.y,s,t.height-s)*r;return[i,o]},Ka=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Zc=({x:e,y:t,width:r,height:s})=>({x:e,y:t,x2:e+r,y2:t+s}),Ga=({x:e,y:t,x2:r,y2:s})=>({x:e,y:t,width:r-e,height:s-t}),di=(e,t=[0,0])=>{var i,o;const{x:r,y:s}=uh(e)?e.internals.positionAbsolute:In(e,t);return{x:r,y:s,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},xa=(e,t=[0,0])=>{var i,o;const{x:r,y:s}=uh(e)?e.internals.positionAbsolute:In(e,t);return{x:r,y:s,x2:r+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:s+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},gm=(e,t)=>Ga(Ka(Zc(e),Zc(t))),xn=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*s)},af=e=>Gt(e.width)&&Gt(e.height)&&Gt(e.x)&&Gt(e.y),Gt=e=>!isNaN(e)&&isFinite(e),_m=(e,t)=>(r,s)=>{},On=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),yi=({x:e,y:t},[r,s,i],o=!1,c=[1,1])=>{const n={x:(e-r)/i,y:(t-s)/i};return o?On(n,c):n},fi=({x:e,y:t},[r,s,i])=>({x:e*i+r,y:t*i+s});function Ts(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function vC(e,t,r){if(typeof e=="string"||typeof e=="number"){const s=Ts(e,r),i=Ts(e,t);return{top:s,right:i,bottom:s,left:i,x:i*2,y:s*2}}if(typeof e=="object"){const s=Ts(e.top??e.y??0,r),i=Ts(e.bottom??e.y??0,r),o=Ts(e.left??e.x??0,t),c=Ts(e.right??e.x??0,t);return{top:s,right:c,bottom:i,left:o,x:o+c,y:s+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function yC(e,t,r,s,i,o){const{x:c,y:n}=fi(e,[t,r,s]),{x:a,y:p}=fi({x:e.x+e.width,y:e.y+e.height},[t,r,s]),_=i-a,l=o-p;return{left:Math.floor(c),top:Math.floor(n),right:Math.floor(_),bottom:Math.floor(l)}}const fh=(e,t,r,s,i,o)=>{const c=vC(o,t,r),n=(t-c.x)/e.width,a=(r-c.y)/e.height,p=Math.min(n,a),_=hi(p,s,i),l=e.x+e.width/2,g=e.y+e.height/2,v=t/2-l*_,w=r/2-g*_,m=yC(e,v,w,_,t,r),h={left:Math.min(m.left-c.left,0),top:Math.min(m.top-c.top,0),right:Math.min(m.right-c.right,0),bottom:Math.min(m.bottom-c.bottom,0)};return{x:v-h.left+h.right,y:w-h.top+h.bottom,zoom:_}},Cn=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Cs(e){return e!=null&&e!=="parent"}function br(e){var t,r;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}}function mm(e){var t,r;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight)!==void 0}function vm(e,t={width:0,height:0},r,s,i){const o={...e},c=s.get(r);if(c){const n=c.origin||i;o.x+=c.internals.positionAbsolute.x-(t.width??0)*n[0],o.y+=c.internals.positionAbsolute.y-(t.height??0)*n[1]}return o}function lf(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function wC(){let e,t;return{promise:new Promise((s,i)=>{e=s,t=i}),resolve:e,reject:t}}function SC(e){return{...cm,...e||{}}}function Yi(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:s,containerBounds:i}){const{x:o,y:c}=qt(e),n=yi({x:o-((i==null?void 0:i.left)??0),y:c-((i==null?void 0:i.top)??0)},s),{x:a,y:p}=r?On(n,t):n;return{xSnapped:a,ySnapped:p,...n}}const ph=e=>({width:e.offsetWidth,height:e.offsetHeight}),ym=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},xC=["INPUT","SELECT","TEXTAREA"];function wm(e){var s,i;const t=((i=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:xC.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Sm=e=>"clientX"in e,qt=(e,t)=>{var o,c;const r=Sm(e),s=r?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=r?e.clientY:(c=e.touches)==null?void 0:c[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},cf=(e,t,r,s,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(c=>{const n=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:i,position:c.getAttribute("data-handlepos"),x:(n.left-r.left)/s,y:(n.top-r.top)/s,...ph(c)}})};function xm({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:o,targetControlX:c,targetControlY:n}){const a=e*.125+i*.375+c*.375+r*.125,p=t*.125+o*.375+n*.375+s*.125,_=Math.abs(a-e),l=Math.abs(p-t);return[a,p,_,l]}function So(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function uf({pos:e,x1:t,y1:r,x2:s,y2:i,c:o}){switch(e){case he.Left:return[t-So(t-s,o),r];case he.Right:return[t+So(s-t,o),r];case he.Top:return[t,r-So(r-i,o)];case he.Bottom:return[t,r+So(i-r,o)]}}function gh({sourceX:e,sourceY:t,sourcePosition:r=he.Bottom,targetX:s,targetY:i,targetPosition:o=he.Top,curvature:c=.25}){const[n,a]=uf({pos:r,x1:e,y1:t,x2:s,y2:i,c}),[p,_]=uf({pos:o,x1:s,y1:i,x2:e,y2:t,c}),[l,g,v,w]=xm({sourceX:e,sourceY:t,targetX:s,targetY:i,sourceControlX:n,sourceControlY:a,targetControlX:p,targetControlY:_});return[`M${e},${t} C${n},${a} ${p},${_} ${s},${i}`,l,g,v,w]}function Cm({sourceX:e,sourceY:t,targetX:r,targetY:s}){const i=Math.abs(r-e)/2,o=r<e?r+i:r-i,c=Math.abs(s-t)/2,n=s<t?s+c:s-c;return[o,n,i,c]}function CC({sourceNode:e,targetNode:t,selected:r=!1,zIndex:s=0,elevateOnSelect:i=!1,zIndexMode:o="basic"}){if(o==="manual")return s;const c=i&&r?s+1e3:s,n=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return c+n}function bC({sourceNode:e,targetNode:t,width:r,height:s,transform:i}){const o=Ka(xa(e),xa(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const c={x:-i[0]/i[2],y:-i[1]/i[2],width:r/i[2],height:s/i[2]};return xn(c,Ga(o))>0}const EC=({source:e,sourceHandle:t,target:r,targetHandle:s})=>`xy-edge__${e}${t||""}-${r}${s||""}`,kC=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),LC=(e,t,r={})=>{var o;if(!e.source||!e.target)return(o=r.onError)==null||o.call(r,"006",Zt.error006()),t;const s=r.getEdgeId||EC;let i;return dm(e)?i={...e}:i={...e,id:s(e)},kC(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function bm({sourceX:e,sourceY:t,targetX:r,targetY:s}){const[i,o,c,n]=Cm({sourceX:e,sourceY:t,targetX:r,targetY:s});return[`M ${e},${t}L ${r},${s}`,i,o,c,n]}const hf={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},MC=({source:e,sourcePosition:t=he.Bottom,target:r})=>t===he.Left||t===he.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},df=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function RC({source:e,sourcePosition:t=he.Bottom,target:r,targetPosition:s=he.Top,center:i,offset:o,stepPosition:c}){const n=hf[t],a=hf[s],p={x:e.x+n.x*o,y:e.y+n.y*o},_={x:r.x+a.x*o,y:r.y+a.y*o},l=MC({source:p,sourcePosition:t,target:_}),g=l.x!==0?"x":"y",v=l[g];let w=[],m,h;const f={x:0,y:0},d={x:0,y:0},[,,u,y]=Cm({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(n[g]*a[g]===-1){g==="x"?(m=i.x??p.x+(_.x-p.x)*c,h=i.y??(p.y+_.y)/2):(m=i.x??(p.x+_.x)/2,h=i.y??p.y+(_.y-p.y)*c);const x=[{x:m,y:p.y},{x:m,y:_.y}],k=[{x:p.x,y:h},{x:_.x,y:h}];n[g]===v?w=g==="x"?x:k:w=g==="x"?k:x}else{const x=[{x:p.x,y:_.y}],k=[{x:_.x,y:p.y}];if(g==="x"?w=n.x===v?k:x:w=n.y===v?x:k,t===s){const A=Math.abs(e[g]-r[g]);if(A<=o){const j=Math.min(o-1,o-A);n[g]===v?f[g]=(p[g]>e[g]?-1:1)*j:d[g]=(_[g]>r[g]?-1:1)*j}}if(t!==s){const A=g==="x"?"y":"x",j=n[g]===a[A],$=p[A]>_[A],F=p[A]<_[A];(n[g]===1&&(!j&&$||j&&F)||n[g]!==1&&(!j&&F||j&&$))&&(w=g==="x"?x:k)}const M={x:p.x+f.x,y:p.y+f.y},D={x:_.x+d.x,y:_.y+d.y},R=Math.max(Math.abs(M.x-w[0].x),Math.abs(D.x-w[0].x)),T=Math.max(Math.abs(M.y-w[0].y),Math.abs(D.y-w[0].y));R>=T?(m=(M.x+D.x)/2,h=w[0].y):(m=w[0].x,h=(M.y+D.y)/2)}const C={x:p.x+f.x,y:p.y+f.y},S={x:_.x+d.x,y:_.y+d.y};return[[e,...C.x!==w[0].x||C.y!==w[0].y?[C]:[],...w,...S.x!==w[w.length-1].x||S.y!==w[w.length-1].y?[S]:[],r],m,h,u,y]}function DC(e,t,r,s){const i=Math.min(df(e,t)/2,df(t,r)/2,s),{x:o,y:c}=t;if(e.x===o&&o===r.x||e.y===c&&c===r.y)return`L${o} ${c}`;if(e.y===c){const p=e.x<r.x?-1:1,_=e.y<r.y?1:-1;return`L ${o+i*p},${c}Q ${o},${c} ${o},${c+i*_}`}const n=e.x<r.x?1:-1,a=e.y<r.y?-1:1;return`L ${o},${c+i*a}Q ${o},${c} ${o+i*n},${c}`}function Jc({sourceX:e,sourceY:t,sourcePosition:r=he.Bottom,targetX:s,targetY:i,targetPosition:o=he.Top,borderRadius:c=5,centerX:n,centerY:a,offset:p=20,stepPosition:_=.5}){const[l,g,v,w,m]=RC({source:{x:e,y:t},sourcePosition:r,target:{x:s,y:i},targetPosition:o,center:{x:n,y:a},offset:p,stepPosition:_});let h=`M${l[0].x} ${l[0].y}`;for(let f=1;f<l.length-1;f++)h+=DC(l[f-1],l[f],l[f+1],c);return h+=`L${l[l.length-1].x} ${l[l.length-1].y}`,[h,g,v,w,m]}function ff(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function AC(e){var l;const{sourceNode:t,targetNode:r}=e;if(!ff(t)||!ff(r))return null;const s=t.internals.handleBounds||pf(t.handles),i=r.internals.handleBounds||pf(r.handles),o=gf((s==null?void 0:s.source)??[],e.sourceHandle),c=gf(e.connectionMode===ui.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!c)return(l=e.onError)==null||l.call(e,"008",Zt.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const n=(o==null?void 0:o.position)||he.Bottom,a=(c==null?void 0:c.position)||he.Top,p=bs(t,o,n),_=bs(r,c,a);return{sourceX:p.x,sourceY:p.y,targetX:_.x,targetY:_.y,sourcePosition:n,targetPosition:a}}function pf(e){if(!e)return null;const t=[],r=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&r.push(s);return{source:t,target:r}}function bs(e,t,r=he.Left,s=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:c,height:n}=t??br(e);if(s)return{x:i+c/2,y:o+n/2};switch((t==null?void 0:t.position)??r){case he.Top:return{x:i+c/2,y:o};case he.Right:return{x:i+c,y:o+n/2};case he.Bottom:return{x:i+c/2,y:o+n};case he.Left:return{x:i,y:o+n/2}}}function gf(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function eu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function TC(e,{id:t,defaultColor:r,defaultMarkerStart:s,defaultMarkerEnd:i}){const o=new Set;return e.reduce((c,n)=>([n.markerStart||s,n.markerEnd||i].forEach(a=>{if(a&&typeof a=="object"){const p=eu(a,t);o.has(p)||(c.push({id:p,color:a.color||r,...a}),o.add(p))}}),c),[]).sort((c,n)=>c.id.localeCompare(n.id))}const Em=1e3,PC=10,_h={nodeOrigin:[0,0],nodeExtent:wn,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},NC={..._h,checkEquality:!0};function mh(e,t){const r={...e};for(const s in t)t[s]!==void 0&&(r[s]=t[s]);return r}function IC(e,t,r){const s=mh(_h,r);for(const i of e.values())if(i.parentId)yh(i,e,t,s);else{const o=In(i,s.nodeOrigin),c=Cs(i.extent)?i.extent:s.nodeExtent,n=xs(o,c,br(i));i.internals.positionAbsolute=n}}function BC(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const r=[],s=[];for(const i of e.handles){const o={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?r.push(o):i.type==="target"&&s.push(o)}return{source:r,target:s}}function vh(e){return e==="manual"}function tu(e,t,r,s={}){var _,l;const i=mh(NC,s),o={i:0},c=new Map(t),n=i!=null&&i.elevateNodesOnSelect&&!vh(i.zIndexMode)?Em:0;let a=e.length>0,p=!1;t.clear(),r.clear();for(const g of e){let v=c.get(g.id);if(i.checkEquality&&g===(v==null?void 0:v.internals.userNode))t.set(g.id,v);else{const w=In(g,i.nodeOrigin),m=Cs(g.extent)?g.extent:i.nodeExtent,h=xs(w,m,br(g));v={...i.defaults,...g,measured:{width:(_=g.measured)==null?void 0:_.width,height:(l=g.measured)==null?void 0:l.height},internals:{positionAbsolute:h,handleBounds:BC(g,v),z:km(g,n,i.zIndexMode),userNode:g}},t.set(g.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(a=!1),g.parentId&&yh(v,t,r,s,o),p||(p=g.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:p}}function OC(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function yh(e,t,r,s,i){const{elevateNodesOnSelect:o,nodeOrigin:c,nodeExtent:n,zIndexMode:a}=mh(_h,s),p=e.parentId,_=t.get(p);if(!_){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}OC(e,r),i&&!_.parentId&&_.internals.rootParentIndex===void 0&&a==="auto"&&(_.internals.rootParentIndex=++i.i,_.internals.z=_.internals.z+i.i*PC),i&&_.internals.rootParentIndex!==void 0&&(i.i=_.internals.rootParentIndex);const l=o&&!vh(a)?Em:0,{x:g,y:v,z:w}=$C(e,_,c,n,l,a),{positionAbsolute:m}=e.internals,h=g!==m.x||v!==m.y;(h||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:g,y:v}:m,z:w}})}function km(e,t,r){const s=Gt(e.zIndex)?e.zIndex:0;return vh(r)?s:s+(e.selected?t:0)}function $C(e,t,r,s,i,o){const{x:c,y:n}=t.internals.positionAbsolute,a=br(e),p=In(e,r),_=Cs(e.extent)?xs(p,e.extent,a):p;let l=xs({x:c+_.x,y:n+_.y},s,a);e.extent==="parent"&&(l=pm(l,a,t));const g=km(e,i,o),v=t.internals.z??0;return{x:l.x,y:l.y,z:v>=g?v+1:g}}function wh(e,t,r,s=[0,0]){var c;const i=[],o=new Map;for(const n of e){const a=t.get(n.parentId);if(!a)continue;const p=((c=o.get(n.parentId))==null?void 0:c.expandedRect)??di(a),_=gm(p,n.rect);o.set(n.parentId,{expandedRect:_,parent:a})}return o.size>0&&o.forEach(({expandedRect:n,parent:a},p)=>{var u;const _=a.internals.positionAbsolute,l=br(a),g=a.origin??s,v=n.x<_.x?Math.round(Math.abs(_.x-n.x)):0,w=n.y<_.y?Math.round(Math.abs(_.y-n.y)):0,m=Math.max(l.width,Math.round(n.width)),h=Math.max(l.height,Math.round(n.height)),f=(m-l.width)*g[0],d=(h-l.height)*g[1];(v>0||w>0||f||d)&&(i.push({id:p,type:"position",position:{x:a.position.x-v+f,y:a.position.y-w+d}}),(u=r.get(p))==null||u.forEach(y=>{e.some(C=>C.id===y.id)||i.push({id:y.id,type:"position",position:{x:y.position.x+v,y:y.position.y+w}})})),(l.width<n.width||l.height<n.height||v||w)&&i.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:m+(v?g[0]*v-f:0),height:h+(w?g[1]*w-d:0)}})}),i}function jC(e,t,r,s,i,o,c){const n=s==null?void 0:s.querySelector(".xyflow__viewport");let a=!1;if(!n)return{changes:[],updatedInternals:a};const p=[],_=window.getComputedStyle(n),{m22:l}=new window.DOMMatrixReadOnly(_.transform),g=[];for(const v of e.values()){const w=t.get(v.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),a=!0;continue}const m=ph(v.nodeElement),h=w.measured.width!==m.width||w.measured.height!==m.height;if(!!(m.width&&m.height&&(h||!w.internals.handleBounds||v.force))){const d=v.nodeElement.getBoundingClientRect(),u=Cs(w.extent)?w.extent:o;let{positionAbsolute:y}=w.internals;w.parentId&&w.extent==="parent"?y=pm(y,m,t.get(w.parentId)):u&&(y=xs(y,u,m));const C={...w,measured:m,internals:{...w.internals,positionAbsolute:y,handleBounds:{source:cf("source",v.nodeElement,d,l,w.id),target:cf("target",v.nodeElement,d,l,w.id)}}};t.set(w.id,C),w.parentId&&yh(C,t,r,{nodeOrigin:i,zIndexMode:c}),a=!0,h&&(p.push({id:w.id,type:"dimensions",dimensions:m}),w.expandParent&&w.parentId&&g.push({id:w.id,parentId:w.parentId,rect:di(C,i)}))}}if(g.length>0){const v=wh(g,t,r,i);p.push(...v)}return{changes:p,updatedInternals:a}}async function FC({delta:e,panZoom:t,transform:r,translateExtent:s,width:i,height:o}){if(!t||!e.x&&!e.y)return!1;const c=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[i,o]],s);return!!c&&(c.x!==r[0]||c.y!==r[1]||c.k!==r[2])}function _f(e,t,r,s,i,o){let c=i;const n=s.get(c)||new Map;s.set(c,n.set(r,t)),c=`${i}-${e}`;const a=s.get(c)||new Map;if(s.set(c,a.set(r,t)),o){c=`${i}-${e}-${o}`;const p=s.get(c)||new Map;s.set(c,p.set(r,t))}}function Lm(e,t,r){e.clear(),t.clear();for(const s of r){const{source:i,target:o,sourceHandle:c=null,targetHandle:n=null}=s,a={edgeId:s.id,source:i,target:o,sourceHandle:c,targetHandle:n},p=`${i}-${c}--${o}-${n}`,_=`${o}-${n}--${i}-${c}`;_f("source",a,_,e,i,c),_f("target",a,p,e,o,n),t.set(s.id,s)}}function Mm(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:Mm(r,t):!1}function mf(e,t,r){var i;let s=e;do{if((i=s==null?void 0:s.matches)!=null&&i.call(s,t))return!0;if(s===r)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function HC(e,t,r,s){const i=new Map;for(const[o,c]of e)if((c.selected||c.id===s)&&(!c.parentId||!Mm(c,e))&&(c.draggable||t&&typeof c.draggable>"u")){const n=e.get(o);n&&i.set(o,{id:o,position:n.position||{x:0,y:0},distance:{x:r.x-n.internals.positionAbsolute.x,y:r.y-n.internals.positionAbsolute.y},extent:n.extent,parentId:n.parentId,origin:n.origin,expandParent:n.expandParent,internals:{positionAbsolute:n.internals.positionAbsolute||{x:0,y:0}},measured:{width:n.measured.width??0,height:n.measured.height??0}})}return i}function Fl({nodeId:e,dragItems:t,nodeLookup:r,dragging:s=!0}){var c,n,a;const i=[];for(const[p,_]of t){const l=(c=r.get(p))==null?void 0:c.internals.userNode;l&&i.push({...l,position:_.position,dragging:s})}if(!e)return[i[0],i];const o=(n=r.get(e))==null?void 0:n.internals.userNode;return[o?{...o,position:((a=t.get(e))==null?void 0:a.position)||o.position,dragging:s}:i[0],i]}function zC({dragItems:e,snapGrid:t,x:r,y:s}){const i=e.values().next().value;if(!i)return null;const o={x:r-i.distance.x,y:s-i.distance.y},c=On(o,t);return{x:c.x-o.x,y:c.y-o.y}}function WC({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:s,onDragStop:i}){let o={x:null,y:null},c=0,n=new Map,a=!1,p={x:0,y:0},_=null,l=!1,g=null,v=!1,w=!1,m=null;function h({noDragClassName:d,handleSelector:u,domNode:y,isSelectable:C,nodeId:S,nodeClickDistance:b=0}){g=Et(y);function x({x:R,y:T}){const{nodeLookup:A,nodeExtent:j,snapGrid:$,snapToGrid:F,nodeOrigin:B,onNodeDrag:L,onSelectionDrag:P,onError:O,updateNodePositions:I}=t();o={x:R,y:T};let W=!1;const K=n.size>1,q=K&&j?Zc(Bn(n)):null,Z=K&&F?zC({dragItems:n,snapGrid:$,x:R,y:T}):null;for(const[z,N]of n){if(!A.has(z))continue;let U={x:R-N.distance.x,y:T-N.distance.y};F&&(U=Z?{x:Math.round(U.x+Z.x),y:Math.round(U.y+Z.y)}:On(U,$));let G=null;if(K&&j&&!N.extent&&q){const{positionAbsolute:ee}=N.internals,te=ee.x-q.x+j[0][0],le=ee.x+N.measured.width-q.x2+j[1][0],pe=ee.y-q.y+j[0][1],ne=ee.y+N.measured.height-q.y2+j[1][1];G=[[te,pe],[le,ne]]}const{position:Q,positionAbsolute:Y}=fm({nodeId:z,nextPosition:U,nodeLookup:A,nodeExtent:G||j,nodeOrigin:B,onError:O});W=W||N.position.x!==Q.x||N.position.y!==Q.y,N.position=Q,N.internals.positionAbsolute=Y}if(w=w||W,!!W&&(I(n,!0),m&&(s||L||!S&&P))){const[z,N]=Fl({nodeId:S,dragItems:n,nodeLookup:A});s==null||s(m,n,z,N),L==null||L(m,z,N),S||P==null||P(m,N)}}async function k(){if(!_)return;const{transform:R,panBy:T,autoPanSpeed:A,autoPanOnNodeDrag:j}=t();if(!j){a=!1,cancelAnimationFrame(c);return}const[$,F]=dh(p,_,A);($!==0||F!==0)&&(o.x=(o.x??0)-$/R[2],o.y=(o.y??0)-F/R[2],await T({x:$,y:F})&&x(o)),c=requestAnimationFrame(k)}function M(R){var K;const{nodeLookup:T,multiSelectionActive:A,nodesDraggable:j,transform:$,snapGrid:F,snapToGrid:B,selectNodesOnDrag:L,onNodeDragStart:P,onSelectionDragStart:O,unselectNodesAndEdges:I}=t();l=!0,(!L||!C)&&!A&&S&&((K=T.get(S))!=null&&K.selected||I()),C&&L&&S&&(e==null||e(S));const W=Yi(R.sourceEvent,{transform:$,snapGrid:F,snapToGrid:B,containerBounds:_});if(o=W,n=HC(T,j,W,S),n.size>0&&(r||P||!S&&O)){const[q,Z]=Fl({nodeId:S,dragItems:n,nodeLookup:T});r==null||r(R.sourceEvent,n,q,Z),P==null||P(R.sourceEvent,q,Z),S||O==null||O(R.sourceEvent,Z)}}const D=K_().clickDistance(b).on("start",R=>{const{domNode:T,nodeDragThreshold:A,transform:j,snapGrid:$,snapToGrid:F}=t();_=(T==null?void 0:T.getBoundingClientRect())||null,v=!1,w=!1,m=R.sourceEvent,A===0&&M(R),o=Yi(R.sourceEvent,{transform:j,snapGrid:$,snapToGrid:F,containerBounds:_}),p=qt(R.sourceEvent,_)}).on("drag",R=>{const{autoPanOnNodeDrag:T,transform:A,snapGrid:j,snapToGrid:$,nodeDragThreshold:F,nodeLookup:B}=t(),L=Yi(R.sourceEvent,{transform:A,snapGrid:j,snapToGrid:$,containerBounds:_});if(m=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||S&&!B.has(S))&&(v=!0),!v){if(!a&&T&&l&&(a=!0,k()),!l){const P=qt(R.sourceEvent,_),O=P.x-p.x,I=P.y-p.y;Math.sqrt(O*O+I*I)>F&&M(R)}(o.x!==L.xSnapped||o.y!==L.ySnapped)&&n&&l&&(p=qt(R.sourceEvent,_),x(L))}}).on("end",R=>{if(!l||v){v&&n.size>0&&t().updateNodePositions(n,!1);return}if(a=!1,l=!1,cancelAnimationFrame(c),n.size>0){const{nodeLookup:T,updateNodePositions:A,onNodeDragStop:j,onSelectionDragStop:$}=t();if(w&&(A(n,!1),w=!1),i||j||!S&&$){const[F,B]=Fl({nodeId:S,dragItems:n,nodeLookup:T,dragging:!1});i==null||i(R.sourceEvent,n,F,B),j==null||j(R.sourceEvent,F,B),S||$==null||$(R.sourceEvent,B)}}}).filter(R=>{const T=R.target;return!R.button&&(!d||!mf(T,`.${d}`,y))&&(!u||mf(T,u,y))});g.call(D)}function f(){g==null||g.on(".drag",null)}return{update:h,destroy:f}}function UC(e,t,r){const s=[],i={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const o of t.values())xn(i,di(o))>0&&s.push(o);return s}const VC=250;function KC(e,t,r,s){var n,a;let i=[],o=1/0;const c=UC(e,r,t+VC);for(const p of c){const _=[...((n=p.internals.handleBounds)==null?void 0:n.source)??[],...((a=p.internals.handleBounds)==null?void 0:a.target)??[]];for(const l of _){if(s.nodeId===l.nodeId&&s.type===l.type&&s.id===l.id)continue;const{x:g,y:v}=bs(p,l,l.position,!0),w=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));w>t||(w<o?(i=[{...l,x:g,y:v}],o=w):w===o&&i.push({...l,x:g,y:v}))}}if(!i.length)return null;if(i.length>1){const p=s.type==="source"?"target":"source";return i.find(_=>_.type===p)??i[0]}return i[0]}function Rm(e,t,r,s,i,o=!1){var p,_,l;const c=s.get(e);if(!c)return null;const n=i==="strict"?(p=c.internals.handleBounds)==null?void 0:p[t]:[...((_=c.internals.handleBounds)==null?void 0:_.source)??[],...((l=c.internals.handleBounds)==null?void 0:l.target)??[]],a=(r?n==null?void 0:n.find(g=>g.id===r):n==null?void 0:n[0])??null;return a&&o?{...a,...bs(c,a,a.position,!0)}:a}function Dm(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function GC(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const Am=()=>!0;function qC(e,{connectionMode:t,connectionRadius:r,handleId:s,nodeId:i,edgeUpdaterType:o,isTarget:c,domNode:n,nodeLookup:a,lib:p,autoPanOnConnect:_,flowId:l,panBy:g,cancelConnection:v,onConnectStart:w,onConnect:m,onConnectEnd:h,isValidConnection:f=Am,onReconnectEnd:d,updateConnection:u,getTransform:y,getFromHandle:C,autoPanSpeed:S,dragThreshold:b=1,handleDomNode:x}){const k=ym(e.target);let M=0,D;const{x:R,y:T}=qt(e),A=Dm(o,x),j=n==null?void 0:n.getBoundingClientRect();let $=!1;if(!j||!A)return;const F=Rm(i,A,s,a,t);if(!F)return;let B=qt(e,j),L=!1,P=null,O=!1,I=null;function W(){if(!_||!j)return;const[Q,Y]=dh(B,j,S);g({x:Q,y:Y}),M=requestAnimationFrame(W)}const K={...F,nodeId:i,type:A,position:F.position},q=a.get(i);let z={inProgress:!0,isValid:null,from:bs(q,K,he.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:q,to:B,toHandle:null,toPosition:nf[K.position],toNode:null,pointer:B};function N(){$=!0,u(z),w==null||w(e,{nodeId:i,handleId:s,handleType:A})}b===0&&N();function U(Q){if(!$){const{x:ne,y:Te}=qt(Q),We=ne-R,me=Te-T;if(!(We*We+me*me>b*b))return;N()}if(!C()||!K){G(Q);return}const Y=y();B=qt(Q,j),D=KC(yi(B,Y,!1,[1,1]),r,a,K),L||(W(),L=!0);const ee=Tm(Q,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:s,fromType:c?"target":"source",isValidConnection:f,doc:k,lib:p,flowId:l,nodeLookup:a});I=ee.handleDomNode,P=ee.connection,O=GC(!!D,ee.isValid);const te=a.get(i),le=te?bs(te,K,he.Left,!0):z.from,pe={...z,from:le,isValid:O,to:ee.toHandle&&O?fi({x:ee.toHandle.x,y:ee.toHandle.y},Y):B,toHandle:ee.toHandle,toPosition:O&&ee.toHandle?ee.toHandle.position:nf[K.position],toNode:ee.toHandle?a.get(ee.toHandle.nodeId):null,pointer:B};u(pe),z=pe}function G(Q){if(!("touches"in Q&&Q.touches.length>0)){if($){(D||I)&&P&&O&&(m==null||m(P));const{inProgress:Y,...ee}=z,te={...ee,toPosition:z.toHandle?z.toPosition:null};h==null||h(Q,te),o&&(d==null||d(Q,te))}v(),cancelAnimationFrame(M),L=!1,O=!1,P=null,I=null,k.removeEventListener("mousemove",U),k.removeEventListener("mouseup",G),k.removeEventListener("touchmove",U),k.removeEventListener("touchend",G)}}k.addEventListener("mousemove",U),k.addEventListener("mouseup",G),k.addEventListener("touchmove",U),k.addEventListener("touchend",G)}function Tm(e,{handle:t,connectionMode:r,fromNodeId:s,fromHandleId:i,fromType:o,doc:c,lib:n,flowId:a,isValidConnection:p=Am,nodeLookup:_}){const l=o==="target",g=t?c.querySelector(`.${n}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:w}=qt(e),m=c.elementFromPoint(v,w),h=m!=null&&m.classList.contains(`${n}-flow__handle`)?m:g,f={handleDomNode:h,isValid:!1,connection:null,toHandle:null};if(h){const d=Dm(void 0,h),u=h.getAttribute("data-nodeid"),y=h.getAttribute("data-handleid"),C=h.classList.contains("connectable"),S=h.classList.contains("connectableend");if(!u||!d)return f;const b={source:l?u:s,sourceHandle:l?y:i,target:l?s:u,targetHandle:l?i:y};f.connection=b;const k=C&&S&&(r===ui.Strict?l&&d==="source"||!l&&d==="target":u!==s||y!==i);f.isValid=k&&p(b),f.toHandle=Rm(u,d,y,_,r,!0)}return f}const ru={onPointerDown:qC,isValid:Tm};function XC({domNode:e,panZoom:t,getTransform:r,getViewScale:s}){const i=Et(e);function o({translateExtent:n,width:a,height:p,zoomStep:_=1,pannable:l=!0,zoomable:g=!0,inversePan:v=!1}){const w=u=>{if(u.sourceEvent.type!=="wheel"||!t)return;const y=r(),C=u.sourceEvent.ctrlKey&&Cn()?10:1,S=-u.sourceEvent.deltaY*(u.sourceEvent.deltaMode===1?.05:u.sourceEvent.deltaMode?1:.002)*_,b=y[2]*Math.pow(2,S*C);t.scaleTo(b)};let m=[0,0];const h=u=>{(u.sourceEvent.type==="mousedown"||u.sourceEvent.type==="touchstart")&&(m=[u.sourceEvent.clientX??u.sourceEvent.touches[0].clientX,u.sourceEvent.clientY??u.sourceEvent.touches[0].clientY])},f=u=>{const y=r();if(u.sourceEvent.type!=="mousemove"&&u.sourceEvent.type!=="touchmove"||!t)return;const C=[u.sourceEvent.clientX??u.sourceEvent.touches[0].clientX,u.sourceEvent.clientY??u.sourceEvent.touches[0].clientY],S=[C[0]-m[0],C[1]-m[1]];m=C;const b=s()*Math.max(y[2],Math.log(y[2]))*(v?-1:1),x={x:y[0]-S[0]*b,y:y[1]-S[1]*b},k=[[0,0],[a,p]];t.setViewportConstrained({x:x.x,y:x.y,zoom:y[2]},k,n)},d=am().on("start",h).on("zoom",l?f:null).on("zoom.wheel",g?w:null);i.call(d,{})}function c(){i.on("zoom",null)}return{update:o,destroy:c,pointer:Ut}}const qa=e=>({x:e.x,y:e.y,zoom:e.k}),Hl=({x:e,y:t,zoom:r})=>Va.translate(e,t).scale(r),Vs=(e,t)=>e.target.closest(`.${t}`),Pm=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),YC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,zl=(e,t=0,r=YC,s=()=>{})=>{const i=typeof t=="number"&&t>0;return i||s(),i?e.transition().duration(t).ease(r).on("end",s):e},Nm=e=>{const t=e.ctrlKey&&Cn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function QC({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:s,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:c,onPanZoomStart:n,onPanZoom:a,onPanZoomEnd:p}){return _=>{if(Vs(_,t))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const l=r.property("__zoom").k||1;if(_.ctrlKey&&c){const h=Ut(_),f=Nm(_),d=l*Math.pow(2,f);s.scaleTo(r,d,h,_);return}const g=_.deltaMode===1?20:1;let v=i===fs.Vertical?0:_.deltaX*g,w=i===fs.Horizontal?0:_.deltaY*g;!Cn()&&_.shiftKey&&i!==fs.Vertical&&(v=_.deltaY*g,w=0),s.translateBy(r,-(v/l)*o,-(w/l)*o,{internal:!0});const m=qa(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(a==null||a(_,m),e.panScrollTimeout=setTimeout(()=>{p==null||p(_,m),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,n==null||n(_,m))}}function ZC({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(s,i){const o=s.type==="wheel",c=!t&&o&&!s.ctrlKey,n=Vs(s,e);if(s.ctrlKey&&o&&n&&s.preventDefault(),c||n)return null;s.preventDefault(),r.call(this,s,i)}}function JC({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return s=>{var o,c,n;if((o=s.sourceEvent)!=null&&o.internal)return;const i=qa(s.transform);e.mouseButton=((c=s.sourceEvent)==null?void 0:c.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((n=s.sourceEvent)==null?void 0:n.type)==="mousedown"&&t(!0),r&&(r==null||r(s.sourceEvent,i))}}function eb({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:s,onPanZoom:i}){return o=>{var c,n;e.usedRightMouseButton=!!(r&&Pm(t,e.mouseButton??0)),(c=o.sourceEvent)!=null&&c.sync||s([o.transform.x,o.transform.y,o.transform.k]),i&&!((n=o.sourceEvent)!=null&&n.internal)&&(i==null||i(o.sourceEvent,qa(o.transform)))}}function tb({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:s,onPanZoomEnd:i,onPaneContextMenu:o}){return c=>{var n;if(!((n=c.sourceEvent)!=null&&n.internal)&&(e.isZoomingOrPanning=!1,o&&Pm(t,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&o(c.sourceEvent),e.usedRightMouseButton=!1,s(!1),i)){const a=qa(c.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(c.sourceEvent,a)},r?150:0)}}}function rb({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:s,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:c,noWheelClassName:n,noPanClassName:a,lib:p,connectionInProgress:_}){return l=>{var h;const g=e||t,v=r&&l.ctrlKey,w=l.type==="wheel";if(l.button===1&&l.type==="mousedown"&&(Vs(l,`${p}-flow__node`)||Vs(l,`${p}-flow__edge`)))return!0;if(!s&&!g&&!i&&!o&&!r||c||_&&!w||Vs(l,n)&&w||Vs(l,a)&&(!w||i&&w&&!e)||!r&&l.ctrlKey&&w)return!1;if(!r&&l.type==="touchstart"&&((h=l.touches)==null?void 0:h.length)>1)return l.preventDefault(),!1;if(!g&&!i&&!v&&w||!s&&(l.type==="mousedown"||l.type==="touchstart")||Array.isArray(s)&&!s.includes(l.button)&&l.type==="mousedown")return!1;const m=Array.isArray(s)&&s.includes(l.button)||!l.button||l.button<=1;return(!l.ctrlKey||w)&&m}}function sb({domNode:e,minZoom:t,maxZoom:r,translateExtent:s,viewport:i,onPanZoom:o,onPanZoomStart:c,onPanZoomEnd:n,onDraggingChange:a}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),l=am().scaleExtent([t,r]).translateExtent(s),g=Et(e).call(l);d({x:i.x,y:i.y,zoom:hi(i.zoom,t,r)},[[0,0],[_.width,_.height]],s);const v=g.on("wheel.zoom"),w=g.on("dblclick.zoom");l.wheelDelta(Nm);async function m(D,R){return g?new Promise(T=>{l==null||l.interpolate((R==null?void 0:R.interpolate)==="linear"?Xi:jo).transform(zl(g,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>T(!0)),D)}):!1}function h({noWheelClassName:D,noPanClassName:R,onPaneContextMenu:T,userSelectionActive:A,panOnScroll:j,panOnDrag:$,panOnScrollMode:F,panOnScrollSpeed:B,preventScrolling:L,zoomOnPinch:P,zoomOnScroll:O,zoomOnDoubleClick:I,zoomActivationKeyPressed:W,lib:K,onTransformChange:q,connectionInProgress:Z,paneClickDistance:z,selectionOnDrag:N}){A&&!p.isZoomingOrPanning&&f();const U=j&&!W&&!A;l.clickDistance(N?1/0:!Gt(z)||z<0?0:z);const G=U?QC({zoomPanValues:p,noWheelClassName:D,d3Selection:g,d3Zoom:l,panOnScrollMode:F,panOnScrollSpeed:B,zoomOnPinch:P,onPanZoomStart:c,onPanZoom:o,onPanZoomEnd:n}):ZC({noWheelClassName:D,preventScrolling:L,d3ZoomHandler:v});g.on("wheel.zoom",G,{passive:!1});const Q=JC({zoomPanValues:p,onDraggingChange:a,onPanZoomStart:c});l.on("start",Q);const Y=eb({zoomPanValues:p,panOnDrag:$,onPaneContextMenu:!!T,onPanZoom:o,onTransformChange:q});l.on("zoom",Y);const ee=tb({zoomPanValues:p,panOnDrag:$,panOnScroll:j,onPaneContextMenu:T,onPanZoomEnd:n,onDraggingChange:a});l.on("end",ee);const te=rb({zoomActivationKeyPressed:W,panOnDrag:$,zoomOnScroll:O,panOnScroll:j,zoomOnDoubleClick:I,zoomOnPinch:P,userSelectionActive:A,noPanClassName:R,noWheelClassName:D,lib:K,connectionInProgress:Z});l.filter(te),I?g.on("dblclick.zoom",w):g.on("dblclick.zoom",null)}function f(){l.on("zoom",null)}async function d(D,R,T){const A=Hl(D),j=l==null?void 0:l.constrain()(A,R,T);return j&&await m(j),j}async function u(D,R){const T=Hl(D);return await m(T,R),T}function y(D){if(g){const R=Hl(D),T=g.property("__zoom");(T.k!==D.zoom||T.x!==D.x||T.y!==D.y)&&(l==null||l.transform(g,R,null,{sync:!0}))}}function C(){const D=g?om(g.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}async function S(D,R){return g?new Promise(T=>{l==null||l.interpolate((R==null?void 0:R.interpolate)==="linear"?Xi:jo).scaleTo(zl(g,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>T(!0)),D)}):!1}async function b(D,R){return g?new Promise(T=>{l==null||l.interpolate((R==null?void 0:R.interpolate)==="linear"?Xi:jo).scaleBy(zl(g,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>T(!0)),D)}):!1}function x(D){l==null||l.scaleExtent(D)}function k(D){l==null||l.translateExtent(D)}function M(D){const R=!Gt(D)||D<0?0:D;l==null||l.clickDistance(R)}return{update:h,destroy:f,setViewport:u,setViewportConstrained:d,getViewport:C,scaleTo:S,scaleBy:b,setScaleExtent:x,setTranslateExtent:k,syncViewport:y,setClickDistance:M}}var pi;(function(e){e.Line="line",e.Handle="handle"})(pi||(pi={}));function ib({width:e,prevWidth:t,height:r,prevHeight:s,affectsX:i,affectsY:o}){const c=e-t,n=r-s,a=[c>0?1:c<0?-1:0,n>0?1:n<0?-1:0];return c&&i&&(a[0]=a[0]*-1),n&&o&&(a[1]=a[1]*-1),a}function vf(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),s=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:s,affectsY:i}}function Lr(e,t){return Math.max(0,t-e)}function Mr(e,t){return Math.max(0,e-t)}function xo(e,t,r){return Math.max(0,t-e,e-r)}function yf(e,t){return e?!t:t}function nb(e,t,r,s,i,o,c,n){let{affectsX:a,affectsY:p}=t;const{isHorizontal:_,isVertical:l}=t,g=_&&l,{xSnapped:v,ySnapped:w}=r,{minWidth:m,maxWidth:h,minHeight:f,maxHeight:d}=s,{x:u,y,width:C,height:S,aspectRatio:b}=e;let x=Math.floor(_?v-e.pointerX:0),k=Math.floor(l?w-e.pointerY:0);const M=C+(a?-x:x),D=S+(p?-k:k),R=-o[0]*C,T=-o[1]*S;let A=xo(M,m,h),j=xo(D,f,d);if(c){let B=0,L=0;a&&x<0?B=Lr(u+x+R,c[0][0]):!a&&x>0&&(B=Mr(u+M+R,c[1][0])),p&&k<0?L=Lr(y+k+T,c[0][1]):!p&&k>0&&(L=Mr(y+D+T,c[1][1])),A=Math.max(A,B),j=Math.max(j,L)}if(n){let B=0,L=0;a&&x>0?B=Mr(u+x,n[0][0]):!a&&x<0&&(B=Lr(u+M,n[1][0])),p&&k>0?L=Mr(y+k,n[0][1]):!p&&k<0&&(L=Lr(y+D,n[1][1])),A=Math.max(A,B),j=Math.max(j,L)}if(i){if(_){const B=xo(M/b,f,d)*b;if(A=Math.max(A,B),c){let L=0;!a&&!p||a&&!p&&g?L=Mr(y+T+M/b,c[1][1])*b:L=Lr(y+T+(a?x:-x)/b,c[0][1])*b,A=Math.max(A,L)}if(n){let L=0;!a&&!p||a&&!p&&g?L=Lr(y+M/b,n[1][1])*b:L=Mr(y+(a?x:-x)/b,n[0][1])*b,A=Math.max(A,L)}}if(l){const B=xo(D*b,m,h)/b;if(j=Math.max(j,B),c){let L=0;!a&&!p||p&&!a&&g?L=Mr(u+D*b+R,c[1][0])/b:L=Lr(u+(p?k:-k)*b+R,c[0][0])/b,j=Math.max(j,L)}if(n){let L=0;!a&&!p||p&&!a&&g?L=Lr(u+D*b,n[1][0])/b:L=Mr(u+(p?k:-k)*b,n[0][0])/b,j=Math.max(j,L)}}}k=k+(k<0?j:-j),x=x+(x<0?A:-A),i&&(g?M>D*b?k=(yf(a,p)?-x:x)/b:x=(yf(a,p)?-k:k)*b:_?(k=x/b,p=a):(x=k*b,a=p));const $=a?u+x:u,F=p?y+k:y;return{width:C+(a?-x:x),height:S+(p?-k:k),x:o[0]*x*(a?-1:1)+$,y:o[1]*k*(p?-1:1)+F}}const Im={width:0,height:0,x:0,y:0},ob={...Im,pointerX:0,pointerY:0,aspectRatio:1};function ab(e,t,r){const s=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,c=e.measured.height??0,n=r[0]*o,a=r[1]*c;return[[s-n,i-a],[s+o-n,i+c-a]]}function lb({domNode:e,nodeId:t,getStoreItems:r,onChange:s,onEnd:i}){const o=Et(e);let c={controlDirection:vf("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function n({controlPosition:p,boundaries:_,keepAspectRatio:l,resizeDirection:g,onResizeStart:v,onResize:w,onResizeEnd:m,shouldResize:h}){let f={...Im},d={...ob};c={boundaries:_,resizeDirection:g,keepAspectRatio:l,controlDirection:vf(p)};let u,y=null,C=[],S,b,x,k=!1;const M=K_().on("start",D=>{const{nodeLookup:R,transform:T,snapGrid:A,snapToGrid:j,nodeOrigin:$,paneDomNode:F}=r();if(u=R.get(t),!u)return;y=(F==null?void 0:F.getBoundingClientRect())??null;const{xSnapped:B,ySnapped:L}=Yi(D.sourceEvent,{transform:T,snapGrid:A,snapToGrid:j,containerBounds:y});f={width:u.measured.width??0,height:u.measured.height??0,x:u.position.x??0,y:u.position.y??0},d={...f,pointerX:B,pointerY:L,aspectRatio:f.width/f.height},S=void 0,b=Cs(u.extent)?u.extent:void 0,u.parentId&&(u.extent==="parent"||u.expandParent)&&(S=R.get(u.parentId)),S&&u.extent==="parent"&&(b=[[0,0],[S.measured.width,S.measured.height]]),C=[],x=void 0;for(const[P,O]of R)if(O.parentId===t&&(C.push({id:P,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const I=ab(O,u,O.origin??$);x?x=[[Math.min(I[0][0],x[0][0]),Math.min(I[0][1],x[0][1])],[Math.max(I[1][0],x[1][0]),Math.max(I[1][1],x[1][1])]]:x=I}v==null||v(D,{...f})}).on("drag",D=>{const{transform:R,snapGrid:T,snapToGrid:A,nodeOrigin:j}=r(),$=Yi(D.sourceEvent,{transform:R,snapGrid:T,snapToGrid:A,containerBounds:y}),F=[];if(!u)return;const{x:B,y:L,width:P,height:O}=f,I={},W=u.origin??j,{width:K,height:q,x:Z,y:z}=nb(d,c.controlDirection,$,c.boundaries,c.keepAspectRatio,W,b,x),N=K!==P,U=q!==O,G=Z!==B&&N,Q=z!==L&&U;if(!G&&!Q&&!N&&!U)return;if((G||Q||W[0]===1||W[1]===1)&&(I.x=G?Z:f.x,I.y=Q?z:f.y,f.x=I.x,f.y=I.y,C.length>0)){const le=Z-B,pe=z-L;for(const ne of C)ne.position={x:ne.position.x-le+W[0]*(K-P),y:ne.position.y-pe+W[1]*(q-O)},F.push(ne)}if((N||U)&&(I.width=N&&(!c.resizeDirection||c.resizeDirection==="horizontal")?K:f.width,I.height=U&&(!c.resizeDirection||c.resizeDirection==="vertical")?q:f.height,f.width=I.width,f.height=I.height),S&&u.expandParent){const le=W[0]*(I.width??0);I.x&&I.x<le&&(f.x=le,d.x=d.x-(I.x-le));const pe=W[1]*(I.height??0);I.y&&I.y<pe&&(f.y=pe,d.y=d.y-(I.y-pe))}const Y=ib({width:f.width,prevWidth:P,height:f.height,prevHeight:O,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),ee={...f,direction:Y};(h==null?void 0:h(D,ee))!==!1&&(k=!0,w==null||w(D,ee),s(I,F))}).on("end",D=>{k&&(m==null||m(D,{...f}),i==null||i({...f}),k=!1)});o.call(M)}function a(){o.on(".drag",null)}return{update:n,destroy:a}}var Bm={exports:{}},Om={},$m={exports:{}},jm={};/**
|
|
41
|
-
* @license React
|
|
42
|
-
* use-sync-external-store-shim.production.js
|
|
43
|
-
*
|
|
44
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the MIT license found in the
|
|
47
|
-
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var gi=H;function cb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ub=typeof Object.is=="function"?Object.is:cb,hb=gi.useState,db=gi.useEffect,fb=gi.useLayoutEffect,pb=gi.useDebugValue;function gb(e,t){var r=t(),s=hb({inst:{value:r,getSnapshot:t}}),i=s[0].inst,o=s[1];return fb(function(){i.value=r,i.getSnapshot=t,Wl(i)&&o({inst:i})},[e,r,t]),db(function(){return Wl(i)&&o({inst:i}),e(function(){Wl(i)&&o({inst:i})})},[e]),pb(r),r}function Wl(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!ub(e,r)}catch{return!0}}function _b(e,t){return t()}var mb=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_b:gb;jm.useSyncExternalStore=gi.useSyncExternalStore!==void 0?gi.useSyncExternalStore:mb;$m.exports=jm;var vb=$m.exports;/**
|
|
49
|
-
* @license React
|
|
50
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/var Xa=H,yb=vb;function wb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Sb=typeof Object.is=="function"?Object.is:wb,xb=yb.useSyncExternalStore,Cb=Xa.useRef,bb=Xa.useEffect,Eb=Xa.useMemo,kb=Xa.useDebugValue;Om.useSyncExternalStoreWithSelector=function(e,t,r,s,i){var o=Cb(null);if(o.current===null){var c={hasValue:!1,value:null};o.current=c}else c=o.current;o=Eb(function(){function a(v){if(!p){if(p=!0,_=v,v=s(v),i!==void 0&&c.hasValue){var w=c.value;if(i(w,v))return l=w}return l=v}if(w=l,Sb(_,v))return w;var m=s(v);return i!==void 0&&i(w,m)?(_=v,w):(_=v,l=m)}var p=!1,_,l,g=r===void 0?null:r;return[function(){return a(t())},g===null?void 0:function(){return a(g())}]},[t,r,s,i]);var n=xb(e,o[0],o[1]);return bb(function(){c.hasValue=!0,c.value=n},[n]),kb(n),n};Bm.exports=Om;var Lb=Bm.exports;const Mb=vp(Lb),Rb={},wf=e=>{let t;const r=new Set,s=(_,l)=>{const g=typeof _=="function"?_(t):_;if(!Object.is(g,t)){const v=t;t=l??(typeof g!="object"||g===null)?g:Object.assign({},t,g),r.forEach(w=>w(t,v))}},i=()=>t,a={setState:s,getState:i,getInitialState:()=>p,subscribe:_=>(r.add(_),()=>r.delete(_)),destroy:()=>{(Rb?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},p=t=e(s,i,a);return a},Db=e=>e?wf(e):wf,{useDebugValue:Ab}=Rp,{useSyncExternalStoreWithSelector:Tb}=Mb,Pb=e=>e;function Fm(e,t=Pb,r){const s=Tb(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Ab(s),s}const Sf=(e,t)=>{const r=Db(e),s=(i,o=t)=>Fm(r,i,o);return Object.assign(s,r),s},Nb=(e,t)=>e?Sf(e,t):Sf;function ze(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,i]of e)if(!Object.is(i,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const s of r)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const Ya=H.createContext(null),Ib=Ya.Provider,Hm=Zt.error001("react");function Le(e,t){const r=H.useContext(Ya);if(r===null)throw new Error(Hm);return Fm(r,e,t)}function Ke(){const e=H.useContext(Ya);if(e===null)throw new Error(Hm);return H.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const xf={display:"none"},Bb={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},zm="react-flow__node-desc",Wm="react-flow__edge-desc",Ob="react-flow__aria-live",$b=e=>e.ariaLiveMessage,jb=e=>e.ariaLabelConfig;function Fb({rfId:e}){const t=Le($b);return E.jsx("div",{id:`${Ob}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Bb,children:t})}function Hb({rfId:e,disableKeyboardA11y:t}){const r=Le(jb);return E.jsxs(E.Fragment,{children:[E.jsx("div",{id:`${zm}-${e}`,style:xf,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),E.jsx("div",{id:`${Wm}-${e}`,style:xf,children:r["edge.a11yDescription.default"]}),!t&&E.jsx(Fb,{rfId:e})]})}const Qa=H.forwardRef(({position:e="top-left",children:t,className:r,style:s,...i},o)=>{const c=`${e}`.split("-");return E.jsx("div",{className:tt(["react-flow__panel",r,...c]),style:s,ref:o,...i,children:t})});Qa.displayName="Panel";function zb({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:E.jsx(Qa,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:E.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Wb=e=>{const t=[],r=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&r.push(s);return{selectedNodes:t,selectedEdges:r}},Co=e=>e.id;function Ub(e,t){return ze(e.selectedNodes.map(Co),t.selectedNodes.map(Co))&&ze(e.selectedEdges.map(Co),t.selectedEdges.map(Co))}function Vb({onSelectionChange:e}){const t=Ke(),{selectedNodes:r,selectedEdges:s}=Le(Wb,Ub);return H.useEffect(()=>{const i={nodes:r,edges:s};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[r,s,e]),null}const Kb=e=>!!e.onSelectionChangeHandlers;function Gb({onSelectionChange:e}){const t=Le(Kb);return e||t?E.jsx(Vb,{onSelectionChange:e}):null}const Um=[0,0],qb={x:0,y:0,zoom:1},Xb=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Cf=[...Xb,"rfId"],Yb=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),bf={translateExtent:wn,nodeOrigin:Um,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Qb(e){const{setNodes:t,setEdges:r,setMinZoom:s,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:c,reset:n,setDefaultNodesAndEdges:a}=Le(Yb,ze),p=Ke();H.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{_.current=bf,n()}),[]);const _=H.useRef(bf);return H.useEffect(()=>{for(const l of Cf){const g=e[l],v=_.current[l];g!==v&&(typeof e[l]>"u"||(l==="nodes"?t(g):l==="edges"?r(g):l==="minZoom"?s(g):l==="maxZoom"?i(g):l==="translateExtent"?o(g):l==="nodeExtent"?c(g):l==="ariaLabelConfig"?p.setState({ariaLabelConfig:SC(g)}):l==="fitView"?p.setState({fitViewQueued:g}):l==="fitViewOptions"?p.setState({fitViewOptions:g}):p.setState({[l]:g})))}_.current=e},Cf.map(l=>e[l])),null}function Ef(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Zb(e){var s;const[t,r]=H.useState(e==="system"?null:e);return H.useEffect(()=>{if(e!=="system"){r(e);return}const i=Ef(),o=()=>r(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(s=Ef())!=null&&s.matches?"dark":"light"}const kf=typeof document<"u"?document:null;function bn(e=null,t={target:kf,actInsideInputWithModifier:!0}){const[r,s]=H.useState(!1),i=H.useRef(!1),o=H.useRef(new Set([])),[c,n]=H.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(l=>typeof l=="string").map(l=>l.replace("+",`
|
|
57
|
-
`).replace(`
|
|
58
|
-
|
|
59
|
-
`,`
|
|
60
|
-
+`).split(`
|
|
61
|
-
`)),_=p.reduce((l,g)=>l.concat(...g),[]);return[p,_]}return[[],[]]},[e]);return H.useEffect(()=>{const a=(t==null?void 0:t.target)??kf,p=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const _=v=>{var h,f;if(i.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!i.current||i.current&&!p)&&wm(v))return!1;const m=Mf(v.code,n);if(o.current.add(v[m]),Lf(c,o.current,!1)){const d=((f=(h=v.composedPath)==null?void 0:h.call(v))==null?void 0:f[0])||v.target,u=(d==null?void 0:d.nodeName)==="BUTTON"||(d==null?void 0:d.nodeName)==="A";t.preventDefault!==!1&&(i.current||!u)&&v.preventDefault(),s(!0)}},l=v=>{const w=Mf(v.code,n);Lf(c,o.current,!0)?(s(!1),o.current.clear()):o.current.delete(v[w]),v.key==="Meta"&&o.current.clear(),i.current=!1},g=()=>{o.current.clear(),s(!1)};return a==null||a.addEventListener("keydown",_),a==null||a.addEventListener("keyup",l),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{a==null||a.removeEventListener("keydown",_),a==null||a.removeEventListener("keyup",l),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,s]),r}function Lf(e,t,r){return e.filter(s=>r||s.length===t.size).some(s=>s.every(i=>t.has(i)))}function Mf(e,t){return t.includes(e)?"code":"key"}const Jb=()=>{const e=Ke();return H.useMemo(()=>({zoomIn:async t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,t):!1},zoomTo:async(t,r)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,r):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[s,i,o],panZoom:c}=e.getState();return c?(await c.setViewport({x:t.x??s,y:t.y??i,zoom:t.zoom??o},r),!0):!1},getViewport:()=>{const[t,r,s]=e.getState().transform;return{x:t,y:r,zoom:s}},setCenter:async(t,r,s)=>e.getState().setCenter(t,r,s),fitBounds:async(t,r)=>{const{width:s,height:i,minZoom:o,maxZoom:c,panZoom:n}=e.getState(),a=fh(t,s,i,o,c,(r==null?void 0:r.padding)??.1);return n?(await n.setViewport(a,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),!0):!1},screenToFlowPosition:(t,r={})=>{const{transform:s,snapGrid:i,snapToGrid:o,domNode:c}=e.getState();if(!c)return t;const{x:n,y:a}=c.getBoundingClientRect(),p={x:t.x-n,y:t.y-a},_=r.snapGrid??i,l=r.snapToGrid??o;return yi(p,s,l,_)},flowToScreenPosition:t=>{const{transform:r,domNode:s}=e.getState();if(!s)return t;const{x:i,y:o}=s.getBoundingClientRect(),c=fi(t,r);return{x:c.x+i,y:c.y+o}}}),[])};function Vm(e,t){const r=[],s=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")s.set(o.id,[o]);else{const c=s.get(o.id);c?c.push(o):s.set(o.id,[o])}for(const o of t){const c=s.get(o.id);if(!c){r.push(o);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){r.push({...c[0].item});continue}const n={...o};for(const a of c)e5(a,n);r.push(n)}return i.length&&i.forEach(o=>{o.index!==void 0?r.splice(o.index,0,{...o.item}):r.push({...o.item})}),r}function e5(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function t5(e,t){return Vm(e,t)}function r5(e,t){return Vm(e,t)}function ss(e,t){return{id:e,type:"select",selected:t}}function Ks(e,t=new Set,r=!1){const s=[];for(const[i,o]of e){const c=t.has(i);!(o.selected===void 0&&!c)&&o.selected!==c&&(r&&(o.selected=c),s.push(ss(o.id,c)))}return s}function Rf({items:e=[],lookup:t}){var i;const r=[],s=new Map(e.map(o=>[o.id,o]));for(const[o,c]of e.entries()){const n=t.get(c.id),a=((i=n==null?void 0:n.internals)==null?void 0:i.userNode)??n;a!==void 0&&a!==c&&r.push({id:c.id,item:c,type:"replace"}),a===void 0&&r.push({item:c,type:"add",index:o})}for(const[o]of t)s.get(o)===void 0&&r.push({id:o,type:"remove"});return r}function Df(e){return{id:e.id,type:"remove"}}const s5=_m();function i5(e,t,r={}){return LC(e,t,{...r,onError:r.onError??s5})}const Af=e=>dC(e),n5=e=>dm(e);function Km(e){return H.forwardRef(e)}const o5=typeof window<"u"?H.useLayoutEffect:H.useEffect;function Tf(e){const[t,r]=H.useState(BigInt(0)),[s]=H.useState(()=>a5(()=>r(i=>i+BigInt(1))));return o5(()=>{const i=s.get();i.length&&(e(i),s.reset())},[t]),s}function a5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const Gm=H.createContext(null);function l5({children:e}){const t=Ke(),r=H.useCallback(n=>{const{nodes:a=[],setNodes:p,hasDefaultNodes:_,onNodesChange:l,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=t.getState();let m=a;for(const f of n)m=typeof f=="function"?f(m):f;let h=Rf({items:m,lookup:g});for(const f of w.values())h=f(h);_&&p(m),h.length>0?l==null||l(h):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:f,nodes:d,setNodes:u}=t.getState();f&&u(d)})},[]),s=Tf(r),i=H.useCallback(n=>{const{edges:a=[],setEdges:p,hasDefaultEdges:_,onEdgesChange:l,edgeLookup:g}=t.getState();let v=a;for(const w of n)v=typeof w=="function"?w(v):w;_?p(v):l&&l(Rf({items:v,lookup:g}))},[]),o=Tf(i),c=H.useMemo(()=>({nodeQueue:s,edgeQueue:o}),[]);return E.jsx(Gm.Provider,{value:c,children:e})}function c5(){const e=H.useContext(Gm);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const u5=e=>!!e.panZoom;function $n(){const e=Jb(),t=Ke(),r=c5(),s=Le(u5),i=H.useMemo(()=>{const o=l=>t.getState().nodeLookup.get(l),c=l=>{r.nodeQueue.push(l)},n=l=>{r.edgeQueue.push(l)},a=l=>{var f,d;const{nodeLookup:g,nodeOrigin:v}=t.getState(),w=Af(l)?l:g.get(l.id),m=w.parentId?vm(w.position,w.measured,w.parentId,g,v):w.position,h={...w,position:m,width:((f=w.measured)==null?void 0:f.width)??w.width,height:((d=w.measured)==null?void 0:d.height)??w.height};return di(h)},p=(l,g,v={replace:!1})=>{c(w=>w.map(m=>{if(m.id===l){const h=typeof g=="function"?g(m):g;return v.replace&&Af(h)?h:{...m,...h}}return m}))},_=(l,g,v={replace:!1})=>{n(w=>w.map(m=>{if(m.id===l){const h=typeof g=="function"?g(m):g;return v.replace&&n5(h)?h:{...m,...h}}return m}))};return{getNodes:()=>t.getState().nodes.map(l=>({...l})),getNode:l=>{var g;return(g=o(l))==null?void 0:g.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:l=[]}=t.getState();return l.map(g=>({...g}))},getEdge:l=>t.getState().edgeLookup.get(l),setNodes:c,setEdges:n,addNodes:l=>{const g=Array.isArray(l)?l:[l];r.nodeQueue.push(v=>[...v,...g])},addEdges:l=>{const g=Array.isArray(l)?l:[l];r.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:l=[],edges:g=[],transform:v}=t.getState(),[w,m,h]=v;return{nodes:l.map(f=>({...f})),edges:g.map(f=>({...f})),viewport:{x:w,y:m,zoom:h}}},deleteElements:async({nodes:l=[],edges:g=[]})=>{const{nodes:v,edges:w,onNodesDelete:m,onEdgesDelete:h,triggerNodeChanges:f,triggerEdgeChanges:d,onDelete:u,onBeforeDelete:y}=t.getState(),{nodes:C,edges:S}=await mC({nodesToRemove:l,edgesToRemove:g,nodes:v,edges:w,onBeforeDelete:y}),b=S.length>0,x=C.length>0;if(b){const k=S.map(Df);h==null||h(S),d(k)}if(x){const k=C.map(Df);m==null||m(C),f(k)}return(x||b)&&(u==null||u({nodes:C,edges:S})),{deletedNodes:C,deletedEdges:S}},getIntersectingNodes:(l,g=!0,v)=>{const w=af(l),m=w?l:a(l),h=v!==void 0;return m?(v||t.getState().nodes).filter(f=>{const d=t.getState().nodeLookup.get(f.id);if(d&&!w&&(f.id===l.id||!d.internals.positionAbsolute))return!1;const u=di(h?f:d),y=xn(u,m);return g&&y>0||y>=u.width*u.height||y>=m.width*m.height}):[]},isNodeIntersecting:(l,g,v=!0)=>{const m=af(l)?l:a(l);if(!m)return!1;const h=xn(m,g);return v&&h>0||h>=g.width*g.height||h>=m.width*m.height},updateNode:p,updateNodeData:(l,g,v={replace:!1})=>{p(l,w=>{const m=typeof g=="function"?g(w):g;return v.replace?{...w,data:m}:{...w,data:{...w.data,...m}}},v)},updateEdge:_,updateEdgeData:(l,g,v={replace:!1})=>{_(l,w=>{const m=typeof g=="function"?g(w):g;return v.replace?{...w,data:m}:{...w,data:{...w.data,...m}}},v)},getNodesBounds:l=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return fC(l,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:l,id:g,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}-${l}${g?`-${g}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:l,handleId:g,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}${l?g?`-${l}-${g}`:`-${l}`:""}`))==null?void 0:w.values())??[])},fitView:async l=>{const g=t.getState().fitViewResolver??wC();return t.setState({fitViewQueued:!0,fitViewOptions:l,fitViewResolver:g}),r.nodeQueue.push(v=>[...v]),g.promise}}},[]);return H.useMemo(()=>({...i,...e,viewportInitialized:s}),[s])}const Pf=e=>e.selected,h5=typeof window<"u"?window:void 0;function d5({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=Ke(),{deleteElements:s}=$n(),i=bn(e,{actInsideInputWithModifier:!1}),o=bn(t,{target:h5});H.useEffect(()=>{if(i){const{edges:c,nodes:n}=r.getState();s({nodes:n.filter(Pf),edges:c.filter(Pf)}),r.setState({nodesSelectionActive:!1})}},[i]),H.useEffect(()=>{r.setState({multiSelectionActive:o})},[o])}function f5(e){const t=Ke();H.useEffect(()=>{const r=()=>{var i,o,c,n;if(!e.current||!(((o=(i=e.current).checkVisibility)==null?void 0:o.call(i))??!0))return!1;const s=ph(e.current);(s.height===0||s.width===0)&&((n=(c=t.getState()).onError)==null||n.call(c,"004",Zt.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){r(),window.addEventListener("resize",r);const s=new ResizeObserver(()=>r());return s.observe(e.current),()=>{window.removeEventListener("resize",r),s&&e.current&&s.unobserve(e.current)}}},[])}const Za={position:"absolute",width:"100%",height:"100%",top:0,left:0},p5=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function g5({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:s=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=fs.Free,zoomOnDoubleClick:c=!0,panOnDrag:n=!0,defaultViewport:a,translateExtent:p,minZoom:_,maxZoom:l,zoomActivationKeyCode:g,preventScrolling:v=!0,children:w,noWheelClassName:m,noPanClassName:h,onViewportChange:f,isControlledViewport:d,paneClickDistance:u,selectionOnDrag:y}){const C=Ke(),S=H.useRef(null),{userSelectionActive:b,lib:x,connectionInProgress:k}=Le(p5,ze),M=bn(g),D=H.useRef();f5(S);const R=H.useCallback(T=>{f==null||f({x:T[0],y:T[1],zoom:T[2]}),d||C.setState({transform:T})},[f,d]);return H.useEffect(()=>{if(S.current){D.current=sb({domNode:S.current,minZoom:_,maxZoom:l,translateExtent:p,viewport:a,onDraggingChange:$=>C.setState(F=>F.paneDragging===$?F:{paneDragging:$}),onPanZoomStart:($,F)=>{const{onViewportChangeStart:B,onMoveStart:L}=C.getState();L==null||L($,F),B==null||B(F)},onPanZoom:($,F)=>{const{onViewportChange:B,onMove:L}=C.getState();L==null||L($,F),B==null||B(F)},onPanZoomEnd:($,F)=>{const{onViewportChangeEnd:B,onMoveEnd:L}=C.getState();L==null||L($,F),B==null||B(F)}});const{x:T,y:A,zoom:j}=D.current.getViewport();return C.setState({panZoom:D.current,transform:[T,A,j],domNode:S.current.closest(".react-flow")}),()=>{var $;($=D.current)==null||$.destroy()}}},[]),H.useEffect(()=>{var T;(T=D.current)==null||T.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:s,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:c,panOnDrag:n,zoomActivationKeyPressed:M,preventScrolling:v,noPanClassName:h,userSelectionActive:b,noWheelClassName:m,lib:x,onTransformChange:R,connectionInProgress:k,selectionOnDrag:y,paneClickDistance:u})},[e,t,r,s,i,o,c,n,M,v,h,b,m,x,R,k,y,u]),E.jsx("div",{className:"react-flow__renderer",ref:S,style:Za,children:w})}const _5=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function m5(){const{userSelectionActive:e,userSelectionRect:t}=Le(_5,ze);return e&&t?E.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Ul=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},v5=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function y5({isSelecting:e,selectionKeyPressed:t,selectionMode:r=Sn.Full,panOnDrag:s,autoPanOnSelection:i,paneClickDistance:o,selectionOnDrag:c,onSelectionStart:n,onSelectionEnd:a,onPaneClick:p,onPaneContextMenu:_,onPaneScroll:l,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:w,children:m}){const h=H.useRef(0),f=Ke(),{userSelectionActive:d,elementsSelectable:u,dragging:y,connectionInProgress:C,panBy:S,autoPanSpeed:b}=Le(v5,ze),x=u&&(e||d),k=H.useRef(null),M=H.useRef(),D=H.useRef(new Set),R=H.useRef(new Set),T=H.useRef(!1),A=H.useRef({x:0,y:0}),j=H.useRef(!1),$=N=>{if(T.current||C){T.current=!1;return}p==null||p(N),f.getState().resetSelectedElements(),f.setState({nodesSelectionActive:!1})},F=N=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){N.preventDefault();return}_==null||_(N)},B=l?N=>l(N):void 0,L=N=>{T.current&&(N.stopPropagation(),T.current=!1)},P=N=>{var ne,Te;const{domNode:U,transform:G}=f.getState();if(M.current=U==null?void 0:U.getBoundingClientRect(),!M.current)return;const Q=N.target===k.current;if(!Q&&!!N.target.closest(".nokey")||!e||!(c&&Q||t)||N.button!==0||!N.isPrimary)return;(Te=(ne=N.target)==null?void 0:ne.setPointerCapture)==null||Te.call(ne,N.pointerId),T.current=!1;const{x:te,y:le}=qt(N.nativeEvent,M.current),pe=yi({x:te,y:le},G);f.setState({userSelectionRect:{width:0,height:0,startX:pe.x,startY:pe.y,x:te,y:le}}),Q||(N.stopPropagation(),N.preventDefault())};function O(N,U){const{userSelectionRect:G}=f.getState();if(!G)return;const{transform:Q,nodeLookup:Y,edgeLookup:ee,connectionLookup:te,triggerNodeChanges:le,triggerEdgeChanges:pe,defaultEdgeOptions:ne}=f.getState(),Te={x:G.startX,y:G.startY},{x:We,y:me}=fi(Te,Q),ge={startX:Te.x,startY:Te.y,x:N<We?N:We,y:U<me?U:me,width:Math.abs(N-We),height:Math.abs(U-me)},ye=D.current,oe=R.current;D.current=new Set(hh(Y,ge,Q,r===Sn.Partial,!0).map(xe=>xe.id)),R.current=new Set;const we=(ne==null?void 0:ne.selectable)??!0;for(const xe of D.current){const ae=te.get(xe);if(ae)for(const{edgeId:De}of ae.values()){const ce=ee.get(De);ce&&(ce.selectable??we)&&R.current.add(De)}}if(!lf(ye,D.current)){const xe=Ks(Y,D.current,!0);le(xe)}if(!lf(oe,R.current)){const xe=Ks(ee,R.current);pe(xe)}f.setState({userSelectionRect:ge,userSelectionActive:!0,nodesSelectionActive:!1})}function I(){if(!i||!M.current)return;const[N,U]=dh(A.current,M.current,b);S({x:N,y:U}).then(G=>{if(!T.current||!G){h.current=requestAnimationFrame(I);return}const{x:Q,y:Y}=A.current;O(Q,Y),h.current=requestAnimationFrame(I)})}const W=()=>{cancelAnimationFrame(h.current),h.current=0,j.current=!1};H.useEffect(()=>()=>W(),[]);const K=N=>{const{userSelectionRect:U,transform:G,resetSelectedElements:Q}=f.getState();if(!M.current||!U)return;const{x:Y,y:ee}=qt(N.nativeEvent,M.current);A.current={x:Y,y:ee};const te=fi({x:U.startX,y:U.startY},G);if(!T.current){const le=t?0:o;if(Math.hypot(Y-te.x,ee-te.y)<=le)return;Q(),n==null||n(N)}T.current=!0,j.current||(I(),j.current=!0),O(Y,ee)},q=N=>{var U,G;N.button===0&&((G=(U=N.target)==null?void 0:U.releasePointerCapture)==null||G.call(U,N.pointerId),!d&&N.target===k.current&&f.getState().userSelectionRect&&($==null||$(N)),f.setState({userSelectionActive:!1,userSelectionRect:null}),T.current&&(a==null||a(N),f.setState({nodesSelectionActive:D.current.size>0})),W())},Z=N=>{var U,G;(G=(U=N.target)==null?void 0:U.releasePointerCapture)==null||G.call(U,N.pointerId),W()},z=s===!0||Array.isArray(s)&&s.includes(0);return E.jsxs("div",{className:tt(["react-flow__pane",{draggable:z,dragging:y,selection:e}]),onClick:x?void 0:Ul($,k),onContextMenu:Ul(F,k),onWheel:Ul(B,k),onPointerEnter:x?void 0:g,onPointerMove:x?K:v,onPointerUp:x?q:void 0,onPointerCancel:x?Z:void 0,onPointerDownCapture:x?P:void 0,onClickCapture:x?L:void 0,onPointerLeave:w,ref:k,style:Za,children:[m,E.jsx(m5,{})]})}function su({id:e,store:t,unselect:r=!1,nodeRef:s}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:c,nodeLookup:n,onError:a}=t.getState(),p=n.get(e);if(!p){a==null||a("012",Zt.error012(e));return}t.setState({nodesSelectionActive:!1}),p.selected?(r||p.selected&&c)&&(o({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var _;return(_=s==null?void 0:s.current)==null?void 0:_.blur()})):i([e])}function qm({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:s,nodeId:i,isSelectable:o,nodeClickDistance:c}){const n=Ke(),[a,p]=H.useState(!1),_=H.useRef();return H.useEffect(()=>{_.current=WC({getStoreItems:()=>n.getState(),onNodeMouseDown:l=>{su({id:l,store:n,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),H.useEffect(()=>{if(!(t||!e.current||!_.current))return _.current.update({noDragClassName:r,handleSelector:s,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:c}),()=>{var l;(l=_.current)==null||l.destroy()}},[r,s,t,o,e,i,c]),a}const w5=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Xm(){const e=Ke();return H.useCallback(r=>{const{nodeExtent:s,snapToGrid:i,snapGrid:o,nodesDraggable:c,onError:n,updateNodePositions:a,nodeLookup:p,nodeOrigin:_}=e.getState(),l=new Map,g=w5(c),v=i?o[0]:5,w=i?o[1]:5,m=r.direction.x*v*r.factor,h=r.direction.y*w*r.factor;for(const[,f]of p){if(!g(f))continue;let d={x:f.internals.positionAbsolute.x+m,y:f.internals.positionAbsolute.y+h};i&&(d=On(d,o));const{position:u,positionAbsolute:y}=fm({nodeId:f.id,nextPosition:d,nodeLookup:p,nodeExtent:s,nodeOrigin:_,onError:n});f.position=u,f.internals.positionAbsolute=y,l.set(f.id,f)}a(l)},[])}const Sh=H.createContext(null),S5=Sh.Provider;Sh.Consumer;const Ym=()=>H.useContext(Sh),x5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),C5=(e,t,r)=>s=>{const{connectionClickStartHandle:i,connectionMode:o,connection:c}=s,{fromHandle:n,toHandle:a,isValid:p}=c,_=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===r;return{connectingFrom:(n==null?void 0:n.nodeId)===e&&(n==null?void 0:n.id)===t&&(n==null?void 0:n.type)===r,connectingTo:_,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===r,isPossibleEndHandle:o===ui.Strict?(n==null?void 0:n.type)!==r:e!==(n==null?void 0:n.nodeId)||t!==(n==null?void 0:n.id),connectionInProcess:!!n,clickConnectionInProcess:!!i,valid:_&&p}};function b5({type:e="source",position:t=he.Top,isValidConnection:r,isConnectable:s=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:c,onConnect:n,children:a,className:p,onMouseDown:_,onTouchStart:l,...g},v){var j,$;const w=c||null,m=e==="target",h=Ke(),f=Ym(),{connectOnClick:d,noPanClassName:u,rfId:y}=Le(x5,ze),{connectingFrom:C,connectingTo:S,clickConnecting:b,isPossibleEndHandle:x,connectionInProcess:k,clickConnectionInProcess:M,valid:D}=Le(C5(f,w,e),ze);f||($=(j=h.getState()).onError)==null||$.call(j,"010",Zt.error010());const R=F=>{const{defaultEdgeOptions:B,onConnect:L,hasDefaultEdges:P}=h.getState(),O={...B,...F};if(P){const{edges:I,setEdges:W,onError:K}=h.getState();W(i5(O,I,{onError:K}))}L==null||L(O),n==null||n(O)},T=F=>{if(!f)return;const B=Sm(F.nativeEvent);if(i&&(B&&F.button===0||!B)){const L=h.getState();ru.onPointerDown(F.nativeEvent,{handleDomNode:F.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:m,handleId:w,nodeId:f,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...P)=>{var O,I;return(I=(O=h.getState()).onConnectEnd)==null?void 0:I.call(O,...P)},updateConnection:L.updateConnection,onConnect:R,isValidConnection:r||((...P)=>{var O,I;return((I=(O=h.getState()).isValidConnection)==null?void 0:I.call(O,...P))??!0}),getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}B?_==null||_(F):l==null||l(F)},A=F=>{const{onClickConnectStart:B,onClickConnectEnd:L,connectionClickStartHandle:P,connectionMode:O,isValidConnection:I,lib:W,rfId:K,nodeLookup:q,connection:Z}=h.getState();if(!f||!P&&!i)return;if(!P){B==null||B(F.nativeEvent,{nodeId:f,handleId:w,handleType:e}),h.setState({connectionClickStartHandle:{nodeId:f,type:e,id:w}});return}const z=ym(F.target),N=r||I,{connection:U,isValid:G}=ru.isValid(F.nativeEvent,{handle:{nodeId:f,id:w,type:e},connectionMode:O,fromNodeId:P.nodeId,fromHandleId:P.id||null,fromType:P.type,isValidConnection:N,flowId:K,doc:z,lib:W,nodeLookup:q});G&&U&&R(U);const Q=structuredClone(Z);delete Q.inProgress,Q.toPosition=Q.toHandle?Q.toHandle.position:null,L==null||L(F,Q),h.setState({connectionClickStartHandle:null})};return E.jsx("div",{"data-handleid":w,"data-nodeid":f,"data-handlepos":t,"data-id":`${y}-${f}-${w}-${e}`,className:tt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",u,p,{source:!m,target:m,connectable:s,connectablestart:i,connectableend:o,clickconnecting:b,connectingfrom:C,connectingto:S,valid:D,connectionindicator:s&&(!k||x)&&(k||M?o:i)}]),onMouseDown:T,onTouchStart:T,onClick:d?A:void 0,ref:v,...g,children:a})}const Gr=H.memo(Km(b5));function E5({data:e,isConnectable:t,sourcePosition:r=he.Bottom}){return E.jsxs(E.Fragment,{children:[e==null?void 0:e.label,E.jsx(Gr,{type:"source",position:r,isConnectable:t})]})}function k5({data:e,isConnectable:t,targetPosition:r=he.Top,sourcePosition:s=he.Bottom}){return E.jsxs(E.Fragment,{children:[E.jsx(Gr,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,E.jsx(Gr,{type:"source",position:s,isConnectable:t})]})}function L5(){return null}function M5({data:e,isConnectable:t,targetPosition:r=he.Top}){return E.jsxs(E.Fragment,{children:[E.jsx(Gr,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label]})}const Ca={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Nf={input:E5,default:k5,output:M5,group:L5};function R5(e){var t,r,s,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((r=e.style)==null?void 0:r.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const D5=e=>{const{width:t,height:r,x:s,y:i}=Bn(e.nodeLookup,{filter:o=>!!o.selected});return{width:Gt(t)?t:null,height:Gt(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${i}px)`}};function A5({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const s=Ke(),{width:i,height:o,transformString:c,userSelectionActive:n}=Le(D5,ze),a=Xm(),p=H.useRef(null);H.useEffect(()=>{var v;r||(v=p.current)==null||v.focus({preventScroll:!0})},[r]);const _=!n&&i!==null&&o!==null;if(qm({nodeRef:p,disabled:!_}),!_)return null;const l=e?v=>{const w=s.getState().nodes.filter(m=>m.selected);e(v,w)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(Ca,v.key)&&(v.preventDefault(),a({direction:Ca[v.key],factor:v.shiftKey?4:1}))};return E.jsx("div",{className:tt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c},children:E.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:l,tabIndex:r?void 0:-1,onKeyDown:r?void 0:g,style:{width:i,height:o}})})}const If=typeof window<"u"?window:void 0,T5=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Qm({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:c,paneClickDistance:n,deleteKeyCode:a,selectionKeyCode:p,selectionOnDrag:_,selectionMode:l,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:m,zoomActivationKeyCode:h,elementsSelectable:f,zoomOnScroll:d,zoomOnPinch:u,panOnScroll:y,panOnScrollSpeed:C,panOnScrollMode:S,zoomOnDoubleClick:b,panOnDrag:x,autoPanOnSelection:k,defaultViewport:M,translateExtent:D,minZoom:R,maxZoom:T,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:$,noPanClassName:F,disableKeyboardA11y:B,onViewportChange:L,isControlledViewport:P}){const{nodesSelectionActive:O,userSelectionActive:I}=Le(T5,ze),W=bn(p,{target:If}),K=bn(m,{target:If}),q=K||x,Z=K||y,z=_&&q!==!0,N=W||I||z;return d5({deleteKeyCode:a,multiSelectionKeyCode:w}),E.jsx(g5,{onPaneContextMenu:o,elementsSelectable:f,zoomOnScroll:d,zoomOnPinch:u,panOnScroll:Z,panOnScrollSpeed:C,panOnScrollMode:S,zoomOnDoubleClick:b,panOnDrag:!W&&q,defaultViewport:M,translateExtent:D,minZoom:R,maxZoom:T,zoomActivationKeyCode:h,preventScrolling:A,noWheelClassName:$,noPanClassName:F,onViewportChange:L,isControlledViewport:P,paneClickDistance:n,selectionOnDrag:z,children:E.jsxs(y5,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:c,panOnDrag:q,autoPanOnSelection:k,isSelecting:!!N,selectionMode:l,selectionKeyPressed:W,paneClickDistance:n,selectionOnDrag:z,children:[e,O&&E.jsx(A5,{onSelectionContextMenu:j,noPanClassName:F,disableKeyboardA11y:B})]})})}Qm.displayName="FlowRenderer";const P5=H.memo(Qm),N5=e=>t=>e?hh(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function I5(e){return Le(H.useCallback(N5(e),[e]),ze)}const B5=e=>e.updateNodeInternals;function O5(){const e=Le(B5),[t]=H.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const s=new Map;r.forEach(i=>{const o=i.target.getAttribute("data-id");s.set(o,{id:o,nodeElement:i.target,force:!0})}),e(s)}));return H.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function $5({node:e,nodeType:t,hasDimensions:r,resizeObserver:s}){const i=Ke(),o=H.useRef(null),c=H.useRef(null),n=H.useRef(e.sourcePosition),a=H.useRef(e.targetPosition),p=H.useRef(t),_=r&&!!e.internals.handleBounds;return H.useEffect(()=>{o.current&&!e.hidden&&(!_||c.current!==o.current)&&(c.current&&(s==null||s.unobserve(c.current)),s==null||s.observe(o.current),c.current=o.current)},[_,e.hidden]),H.useEffect(()=>()=>{c.current&&(s==null||s.unobserve(c.current),c.current=null)},[]),H.useEffect(()=>{if(o.current){const l=p.current!==t,g=n.current!==e.sourcePosition,v=a.current!==e.targetPosition;(l||g||v)&&(p.current=t,n.current=e.sourcePosition,a.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function j5({id:e,onClick:t,onMouseEnter:r,onMouseMove:s,onMouseLeave:i,onContextMenu:o,onDoubleClick:c,nodesDraggable:n,elementsSelectable:a,nodesConnectable:p,nodesFocusable:_,resizeObserver:l,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:w,rfId:m,nodeTypes:h,nodeClickDistance:f,onError:d}){const{node:u,internals:y,isParent:C}=Le(N=>{const U=N.nodeLookup.get(e),G=N.parentLookup.has(e);return{node:U,internals:U.internals,isParent:G}},ze);let S=u.type||"default",b=(h==null?void 0:h[S])||Nf[S];b===void 0&&(d==null||d("003",Zt.error003(S)),S="default",b=(h==null?void 0:h.default)||Nf.default);const x=!!(u.draggable||n&&typeof u.draggable>"u"),k=!!(u.selectable||a&&typeof u.selectable>"u"),M=!!(u.connectable||p&&typeof u.connectable>"u"),D=!!(u.focusable||_&&typeof u.focusable>"u"),R=Ke(),T=mm(u),A=$5({node:u,nodeType:S,hasDimensions:T,resizeObserver:l}),j=qm({nodeRef:A,disabled:u.hidden||!x,noDragClassName:g,handleSelector:u.dragHandle,nodeId:e,isSelectable:k,nodeClickDistance:f}),$=Xm();if(u.hidden)return null;const F=br(u),B=R5(u),L=k||x||t||r||s||i,P=r?N=>r(N,{...y.userNode}):void 0,O=s?N=>s(N,{...y.userNode}):void 0,I=i?N=>i(N,{...y.userNode}):void 0,W=o?N=>o(N,{...y.userNode}):void 0,K=c?N=>c(N,{...y.userNode}):void 0,q=N=>{const{selectNodesOnDrag:U,nodeDragThreshold:G}=R.getState();k&&(!U||!x||G>0)&&su({id:e,store:R,nodeRef:A}),t&&t(N,{...y.userNode})},Z=N=>{if(!(wm(N.nativeEvent)||w)){if(lm.includes(N.key)&&k){const U=N.key==="Escape";su({id:e,store:R,unselect:U,nodeRef:A})}else if(x&&u.selected&&Object.prototype.hasOwnProperty.call(Ca,N.key)){N.preventDefault();const{ariaLabelConfig:U}=R.getState();R.setState({ariaLiveMessage:U["node.a11yDescription.ariaLiveMessage"]({direction:N.key.replace("Arrow","").toLowerCase(),x:~~y.positionAbsolute.x,y:~~y.positionAbsolute.y})}),$({direction:Ca[N.key],factor:N.shiftKey?4:1})}}},z=()=>{var te;if(w||!((te=A.current)!=null&&te.matches(":focus-visible")))return;const{transform:N,width:U,height:G,autoPanOnNodeFocus:Q,setCenter:Y}=R.getState();if(!Q)return;hh(new Map([[e,u]]),{x:0,y:0,width:U,height:G},N,!0).length>0||Y(u.position.x+F.width/2,u.position.y+F.height/2,{zoom:N[2]})};return E.jsx("div",{className:tt(["react-flow__node",`react-flow__node-${S}`,{[v]:x},u.className,{selected:u.selected,selectable:k,parent:C,draggable:x,dragging:j}]),ref:A,style:{zIndex:y.z,transform:`translate(${y.positionAbsolute.x}px,${y.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:T?"visible":"hidden",...u.style,...B},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:P,onMouseMove:O,onMouseLeave:I,onContextMenu:W,onClick:q,onDoubleClick:K,onKeyDown:D?Z:void 0,tabIndex:D?0:void 0,onFocus:D?z:void 0,role:u.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${zm}-${m}`,"aria-label":u.ariaLabel,...u.domAttributes,children:E.jsx(S5,{value:e,children:E.jsx(b,{id:e,data:u.data,type:S,positionAbsoluteX:y.positionAbsolute.x,positionAbsoluteY:y.positionAbsolute.y,selected:u.selected??!1,selectable:k,draggable:x,deletable:u.deletable??!0,isConnectable:M,sourcePosition:u.sourcePosition,targetPosition:u.targetPosition,dragging:j,dragHandle:u.dragHandle,zIndex:y.z,parentId:u.parentId,...F})})})}var F5=H.memo(j5);const H5=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Zm(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:s,elementsSelectable:i,onError:o}=Le(H5,ze),c=I5(e.onlyRenderVisibleElements),n=O5();return E.jsx("div",{className:"react-flow__nodes",style:Za,children:c.map(a=>E.jsx(F5,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:n,nodesDraggable:t,nodesConnectable:r,nodesFocusable:s,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:o},a))})}Zm.displayName="NodeRenderer";const z5=H.memo(Zm);function W5(e){return Le(H.useCallback(r=>{if(!e)return r.edges.map(i=>i.id);const s=[];if(r.width&&r.height)for(const i of r.edges){const o=r.nodeLookup.get(i.source),c=r.nodeLookup.get(i.target);o&&c&&bC({sourceNode:o,targetNode:c,width:r.width,height:r.height,transform:r.transform})&&s.push(i.id)}return s},[e]),ze)}const U5=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return E.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},V5=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return E.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Bf={[Ss.Arrow]:U5,[Ss.ArrowClosed]:V5};function K5(e){const t=Ke();return H.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(Bf,e)?Bf[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Zt.error009(e)),null)},[e])}const G5=({id:e,type:t,color:r,width:s=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:c,orient:n="auto-start-reverse"})=>{const a=K5(t);return a?E.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:n,refX:"0",refY:"0",children:E.jsx(a,{color:r,strokeWidth:c})}):null},Jm=({defaultColor:e,rfId:t})=>{const r=Le(o=>o.edges),s=Le(o=>o.defaultEdgeOptions),i=H.useMemo(()=>TC(r,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[r,s,t,e]);return i.length?E.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:E.jsx("defs",{children:i.map(o=>E.jsx(G5,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};Jm.displayName="MarkerDefinitions";var q5=H.memo(Jm);function ev({x:e,y:t,label:r,labelStyle:s,labelShowBg:i=!0,labelBgStyle:o,labelBgPadding:c=[2,4],labelBgBorderRadius:n=2,children:a,className:p,..._}){const[l,g]=H.useState({x:1,y:0,width:0,height:0}),v=tt(["react-flow__edge-textwrapper",p]),w=H.useRef(null);return H.useEffect(()=>{if(w.current){const m=w.current.getBBox();g({x:m.x,y:m.y,width:m.width,height:m.height})}},[r]),r?E.jsxs("g",{transform:`translate(${e-l.width/2} ${t-l.height/2})`,className:v,visibility:l.width?"visible":"hidden",..._,children:[i&&E.jsx("rect",{width:l.width+2*c[0],x:-c[0],y:-c[1],height:l.height+2*c[1],className:"react-flow__edge-textbg",style:o,rx:n,ry:n}),E.jsx("text",{className:"react-flow__edge-text",y:l.height/2,dy:"0.3em",ref:w,style:s,children:r}),a]}):null}ev.displayName="EdgeText";const X5=H.memo(ev);function jn({path:e,labelX:t,labelY:r,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:c,labelBgPadding:n,labelBgBorderRadius:a,interactionWidth:p=20,..._}){return E.jsxs(E.Fragment,{children:[E.jsx("path",{..._,d:e,fill:"none",className:tt(["react-flow__edge-path",_.className])}),p?E.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,s&&Gt(t)&&Gt(r)?E.jsx(X5,{x:t,y:r,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:c,labelBgPadding:n,labelBgBorderRadius:a}):null]})}function Of({pos:e,x1:t,y1:r,x2:s,y2:i}){return e===he.Left||e===he.Right?[.5*(t+s),r]:[t,.5*(r+i)]}function tv({sourceX:e,sourceY:t,sourcePosition:r=he.Bottom,targetX:s,targetY:i,targetPosition:o=he.Top}){const[c,n]=Of({pos:r,x1:e,y1:t,x2:s,y2:i}),[a,p]=Of({pos:o,x1:s,y1:i,x2:e,y2:t}),[_,l,g,v]=xm({sourceX:e,sourceY:t,targetX:s,targetY:i,sourceControlX:c,sourceControlY:n,targetControlX:a,targetControlY:p});return[`M${e},${t} C${c},${n} ${a},${p} ${s},${i}`,_,l,g,v]}function rv(e){return H.memo(({id:t,sourceX:r,sourceY:s,targetX:i,targetY:o,sourcePosition:c,targetPosition:n,label:a,labelStyle:p,labelShowBg:_,labelBgStyle:l,labelBgPadding:g,labelBgBorderRadius:v,style:w,markerEnd:m,markerStart:h,interactionWidth:f})=>{const[d,u,y]=tv({sourceX:r,sourceY:s,sourcePosition:c,targetX:i,targetY:o,targetPosition:n}),C=e.isInternal?void 0:t;return E.jsx(jn,{id:C,path:d,labelX:u,labelY:y,label:a,labelStyle:p,labelShowBg:_,labelBgStyle:l,labelBgPadding:g,labelBgBorderRadius:v,style:w,markerEnd:m,markerStart:h,interactionWidth:f})})}const Y5=rv({isInternal:!1}),sv=rv({isInternal:!0});Y5.displayName="SimpleBezierEdge";sv.displayName="SimpleBezierEdgeInternal";function iv(e){return H.memo(({id:t,sourceX:r,sourceY:s,targetX:i,targetY:o,label:c,labelStyle:n,labelShowBg:a,labelBgStyle:p,labelBgPadding:_,labelBgBorderRadius:l,style:g,sourcePosition:v=he.Bottom,targetPosition:w=he.Top,markerEnd:m,markerStart:h,pathOptions:f,interactionWidth:d})=>{const[u,y,C]=Jc({sourceX:r,sourceY:s,sourcePosition:v,targetX:i,targetY:o,targetPosition:w,borderRadius:f==null?void 0:f.borderRadius,offset:f==null?void 0:f.offset,stepPosition:f==null?void 0:f.stepPosition}),S=e.isInternal?void 0:t;return E.jsx(jn,{id:S,path:u,labelX:y,labelY:C,label:c,labelStyle:n,labelShowBg:a,labelBgStyle:p,labelBgPadding:_,labelBgBorderRadius:l,style:g,markerEnd:m,markerStart:h,interactionWidth:d})})}const nv=iv({isInternal:!1}),ov=iv({isInternal:!0});nv.displayName="SmoothStepEdge";ov.displayName="SmoothStepEdgeInternal";function av(e){return H.memo(({id:t,...r})=>{var i;const s=e.isInternal?void 0:t;return E.jsx(nv,{...r,id:s,pathOptions:H.useMemo(()=>{var o;return{borderRadius:0,offset:(o=r.pathOptions)==null?void 0:o.offset}},[(i=r.pathOptions)==null?void 0:i.offset])})})}const Q5=av({isInternal:!1}),lv=av({isInternal:!0});Q5.displayName="StepEdge";lv.displayName="StepEdgeInternal";function cv(e){return H.memo(({id:t,sourceX:r,sourceY:s,targetX:i,targetY:o,label:c,labelStyle:n,labelShowBg:a,labelBgStyle:p,labelBgPadding:_,labelBgBorderRadius:l,style:g,markerEnd:v,markerStart:w,interactionWidth:m})=>{const[h,f,d]=bm({sourceX:r,sourceY:s,targetX:i,targetY:o}),u=e.isInternal?void 0:t;return E.jsx(jn,{id:u,path:h,labelX:f,labelY:d,label:c,labelStyle:n,labelShowBg:a,labelBgStyle:p,labelBgPadding:_,labelBgBorderRadius:l,style:g,markerEnd:v,markerStart:w,interactionWidth:m})})}const Z5=cv({isInternal:!1}),uv=cv({isInternal:!0});Z5.displayName="StraightEdge";uv.displayName="StraightEdgeInternal";function hv(e){return H.memo(({id:t,sourceX:r,sourceY:s,targetX:i,targetY:o,sourcePosition:c=he.Bottom,targetPosition:n=he.Top,label:a,labelStyle:p,labelShowBg:_,labelBgStyle:l,labelBgPadding:g,labelBgBorderRadius:v,style:w,markerEnd:m,markerStart:h,pathOptions:f,interactionWidth:d})=>{const[u,y,C]=gh({sourceX:r,sourceY:s,sourcePosition:c,targetX:i,targetY:o,targetPosition:n,curvature:f==null?void 0:f.curvature}),S=e.isInternal?void 0:t;return E.jsx(jn,{id:S,path:u,labelX:y,labelY:C,label:a,labelStyle:p,labelShowBg:_,labelBgStyle:l,labelBgPadding:g,labelBgBorderRadius:v,style:w,markerEnd:m,markerStart:h,interactionWidth:d})})}const J5=hv({isInternal:!1}),dv=hv({isInternal:!0});J5.displayName="BezierEdge";dv.displayName="BezierEdgeInternal";const $f={default:dv,straight:uv,step:lv,smoothstep:ov,simplebezier:sv},jf={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},eE=(e,t,r)=>r===he.Left?e-t:r===he.Right?e+t:e,tE=(e,t,r)=>r===he.Top?e-t:r===he.Bottom?e+t:e,Ff="react-flow__edgeupdater";function Hf({position:e,centerX:t,centerY:r,radius:s=10,onMouseDown:i,onMouseEnter:o,onMouseOut:c,type:n}){return E.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:c,className:tt([Ff,`${Ff}-${n}`]),cx:eE(t,s,e),cy:tE(r,s,e),r:s,stroke:"transparent",fill:"transparent"})}function rE({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:s,sourceY:i,targetX:o,targetY:c,sourcePosition:n,targetPosition:a,onReconnect:p,onReconnectStart:_,onReconnectEnd:l,setReconnecting:g,setUpdateHover:v}){const w=Ke(),m=(y,C)=>{if(y.button!==0)return;const{autoPanOnConnect:S,domNode:b,connectionMode:x,connectionRadius:k,lib:M,onConnectStart:D,cancelConnection:R,nodeLookup:T,rfId:A,panBy:j,updateConnection:$}=w.getState(),F=C.type==="target",B=(O,I)=>{g(!1),l==null||l(O,r,C.type,I)},L=O=>p==null?void 0:p(r,O),P=(O,I)=>{g(!0),_==null||_(y,r,C.type),D==null||D(O,I)};ru.onPointerDown(y.nativeEvent,{autoPanOnConnect:S,connectionMode:x,connectionRadius:k,domNode:b,handleId:C.id,nodeId:C.nodeId,nodeLookup:T,isTarget:F,edgeUpdaterType:C.type,lib:M,flowId:A,cancelConnection:R,panBy:j,isValidConnection:(...O)=>{var I,W;return((W=(I=w.getState()).isValidConnection)==null?void 0:W.call(I,...O))??!0},onConnect:L,onConnectStart:P,onConnectEnd:(...O)=>{var I,W;return(W=(I=w.getState()).onConnectEnd)==null?void 0:W.call(I,...O)},onReconnectEnd:B,updateConnection:$,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:y.currentTarget})},h=y=>m(y,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),f=y=>m(y,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),d=()=>v(!0),u=()=>v(!1);return E.jsxs(E.Fragment,{children:[(e===!0||e==="source")&&E.jsx(Hf,{position:n,centerX:s,centerY:i,radius:t,onMouseDown:h,onMouseEnter:d,onMouseOut:u,type:"source"}),(e===!0||e==="target")&&E.jsx(Hf,{position:a,centerX:o,centerY:c,radius:t,onMouseDown:f,onMouseEnter:d,onMouseOut:u,type:"target"})]})}function sE({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:s,onClick:i,onDoubleClick:o,onContextMenu:c,onMouseEnter:n,onMouseMove:a,onMouseLeave:p,reconnectRadius:_,onReconnect:l,onReconnectStart:g,onReconnectEnd:v,rfId:w,edgeTypes:m,noPanClassName:h,onError:f,disableKeyboardA11y:d}){let u=Le(Y=>Y.edgeLookup.get(e));const y=Le(Y=>Y.defaultEdgeOptions);u=y?{...y,...u}:u;let C=u.type||"default",S=(m==null?void 0:m[C])||$f[C];S===void 0&&(f==null||f("011",Zt.error011(C)),C="default",S=(m==null?void 0:m.default)||$f.default);const b=!!(u.focusable||t&&typeof u.focusable>"u"),x=typeof l<"u"&&(u.reconnectable||r&&typeof u.reconnectable>"u"),k=!!(u.selectable||s&&typeof u.selectable>"u"),M=H.useRef(null),[D,R]=H.useState(!1),[T,A]=H.useState(!1),j=Ke(),{zIndex:$,sourceX:F,sourceY:B,targetX:L,targetY:P,sourcePosition:O,targetPosition:I}=Le(H.useCallback(Y=>{const ee=Y.nodeLookup.get(u.source),te=Y.nodeLookup.get(u.target);if(!ee||!te)return{zIndex:u.zIndex,...jf};const le=AC({id:e,sourceNode:ee,targetNode:te,sourceHandle:u.sourceHandle||null,targetHandle:u.targetHandle||null,connectionMode:Y.connectionMode,onError:f});return{zIndex:CC({selected:u.selected,zIndex:u.zIndex,sourceNode:ee,targetNode:te,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...le||jf}},[u.source,u.target,u.sourceHandle,u.targetHandle,u.selected,u.zIndex]),ze),W=H.useMemo(()=>u.markerStart?`url('#${eu(u.markerStart,w)}')`:void 0,[u.markerStart,w]),K=H.useMemo(()=>u.markerEnd?`url('#${eu(u.markerEnd,w)}')`:void 0,[u.markerEnd,w]);if(u.hidden||F===null||B===null||L===null||P===null)return null;const q=Y=>{var pe;const{addSelectedEdges:ee,unselectNodesAndEdges:te,multiSelectionActive:le}=j.getState();k&&(j.setState({nodesSelectionActive:!1}),u.selected&&le?(te({nodes:[],edges:[u]}),(pe=M.current)==null||pe.blur()):ee([e])),i&&i(Y,u)},Z=o?Y=>{o(Y,{...u})}:void 0,z=c?Y=>{c(Y,{...u})}:void 0,N=n?Y=>{n(Y,{...u})}:void 0,U=a?Y=>{a(Y,{...u})}:void 0,G=p?Y=>{p(Y,{...u})}:void 0,Q=Y=>{var ee;if(!d&&lm.includes(Y.key)&&k){const{unselectNodesAndEdges:te,addSelectedEdges:le}=j.getState();Y.key==="Escape"?((ee=M.current)==null||ee.blur(),te({edges:[u]})):le([e])}};return E.jsx("svg",{style:{zIndex:$},children:E.jsxs("g",{className:tt(["react-flow__edge",`react-flow__edge-${C}`,u.className,h,{selected:u.selected,animated:u.animated,inactive:!k&&!i,updating:D,selectable:k}]),onClick:q,onDoubleClick:Z,onContextMenu:z,onMouseEnter:N,onMouseMove:U,onMouseLeave:G,onKeyDown:b?Q:void 0,tabIndex:b?0:void 0,role:u.ariaRole??(b?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":u.ariaLabel===null?void 0:u.ariaLabel||`Edge from ${u.source} to ${u.target}`,"aria-describedby":b?`${Wm}-${w}`:void 0,ref:M,...u.domAttributes,children:[!T&&E.jsx(S,{id:e,source:u.source,target:u.target,type:u.type,selected:u.selected,animated:u.animated,selectable:k,deletable:u.deletable??!0,label:u.label,labelStyle:u.labelStyle,labelShowBg:u.labelShowBg,labelBgStyle:u.labelBgStyle,labelBgPadding:u.labelBgPadding,labelBgBorderRadius:u.labelBgBorderRadius,sourceX:F,sourceY:B,targetX:L,targetY:P,sourcePosition:O,targetPosition:I,data:u.data,style:u.style,sourceHandleId:u.sourceHandle,targetHandleId:u.targetHandle,markerStart:W,markerEnd:K,pathOptions:"pathOptions"in u?u.pathOptions:void 0,interactionWidth:u.interactionWidth}),x&&E.jsx(rE,{edge:u,isReconnectable:x,reconnectRadius:_,onReconnect:l,onReconnectStart:g,onReconnectEnd:v,sourceX:F,sourceY:B,targetX:L,targetY:P,sourcePosition:O,targetPosition:I,setUpdateHover:R,setReconnecting:A})]})})}var iE=H.memo(sE);const nE=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function fv({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:s,noPanClassName:i,onReconnect:o,onEdgeContextMenu:c,onEdgeMouseEnter:n,onEdgeMouseMove:a,onEdgeMouseLeave:p,onEdgeClick:_,reconnectRadius:l,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:m}){const{edgesFocusable:h,edgesReconnectable:f,elementsSelectable:d,onError:u}=Le(nE,ze),y=W5(t);return E.jsxs("div",{className:"react-flow__edges",children:[E.jsx(q5,{defaultColor:e,rfId:r}),y.map(C=>E.jsx(iE,{id:C,edgesFocusable:h,edgesReconnectable:f,elementsSelectable:d,noPanClassName:i,onReconnect:o,onContextMenu:c,onMouseEnter:n,onMouseMove:a,onMouseLeave:p,onClick:_,reconnectRadius:l,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:w,rfId:r,onError:u,edgeTypes:s,disableKeyboardA11y:m},C))]})}fv.displayName="EdgeRenderer";const oE=H.memo(fv),aE=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function lE({children:e}){const t=Le(aE);return E.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function cE(e){const t=$n(),r=H.useRef(!1);H.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const uE=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function hE(e){const t=Le(uE),r=Ke();return H.useEffect(()=>{e&&(t==null||t(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function dE(e){return e.connection.inProgress?{...e.connection,to:yi(e.connection.to,e.transform)}:{...e.connection}}function fE(e){return dE}function pE(e){const t=fE();return Le(t,ze)}const gE=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function _E({containerStyle:e,style:t,type:r,component:s}){const{nodesConnectable:i,width:o,height:c,isValid:n,inProgress:a}=Le(gE,ze);return!(o&&i&&a)?null:E.jsx("svg",{style:e,width:o,height:c,className:"react-flow__connectionline react-flow__container",children:E.jsx("g",{className:tt(["react-flow__connection",hm(n)]),children:E.jsx(pv,{style:t,type:r,CustomComponent:s,isValid:n})})})}const pv=({style:e,type:t=Pr.Bezier,CustomComponent:r,isValid:s})=>{const{inProgress:i,from:o,fromNode:c,fromHandle:n,fromPosition:a,to:p,toNode:_,toHandle:l,toPosition:g,pointer:v}=pE();if(!i)return;if(r)return E.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:c,fromHandle:n,fromX:o.x,fromY:o.y,toX:p.x,toY:p.y,fromPosition:a,toPosition:g,connectionStatus:hm(s),toNode:_,toHandle:l,pointer:v});let w="";const m={sourceX:o.x,sourceY:o.y,sourcePosition:a,targetX:p.x,targetY:p.y,targetPosition:g};switch(t){case Pr.Bezier:[w]=gh(m);break;case Pr.SimpleBezier:[w]=tv(m);break;case Pr.Step:[w]=Jc({...m,borderRadius:0});break;case Pr.SmoothStep:[w]=Jc(m);break;default:[w]=bm(m)}return E.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};pv.displayName="ConnectionLine";const mE={};function zf(e=mE){H.useRef(e),Ke(),H.useEffect(()=>{},[e])}function vE(){Ke(),H.useRef(!1),H.useEffect(()=>{},[])}function gv({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:s,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:c,onNodeMouseEnter:n,onNodeMouseMove:a,onNodeMouseLeave:p,onNodeContextMenu:_,onSelectionContextMenu:l,onSelectionStart:g,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:m,connectionLineComponent:h,connectionLineContainerStyle:f,selectionKeyCode:d,selectionOnDrag:u,selectionMode:y,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:b,deleteKeyCode:x,onlyRenderVisibleElements:k,elementsSelectable:M,defaultViewport:D,translateExtent:R,minZoom:T,maxZoom:A,preventScrolling:j,defaultMarkerColor:$,zoomOnScroll:F,zoomOnPinch:B,panOnScroll:L,panOnScrollSpeed:P,panOnScrollMode:O,zoomOnDoubleClick:I,panOnDrag:W,autoPanOnSelection:K,onPaneClick:q,onPaneMouseEnter:Z,onPaneMouseMove:z,onPaneMouseLeave:N,onPaneScroll:U,onPaneContextMenu:G,paneClickDistance:Q,nodeClickDistance:Y,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:le,onEdgeMouseLeave:pe,reconnectRadius:ne,onReconnect:Te,onReconnectStart:We,onReconnectEnd:me,noDragClassName:ge,noWheelClassName:ye,noPanClassName:oe,disableKeyboardA11y:we,nodeExtent:xe,rfId:ae,viewport:De,onViewportChange:ce}){return zf(e),zf(t),vE(),cE(r),hE(De),E.jsx(P5,{onPaneClick:q,onPaneMouseEnter:Z,onPaneMouseMove:z,onPaneMouseLeave:N,onPaneContextMenu:G,onPaneScroll:U,paneClickDistance:Q,deleteKeyCode:x,selectionKeyCode:d,selectionOnDrag:u,selectionMode:y,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:b,elementsSelectable:M,zoomOnScroll:F,zoomOnPinch:B,zoomOnDoubleClick:I,panOnScroll:L,panOnScrollSpeed:P,panOnScrollMode:O,panOnDrag:W,autoPanOnSelection:K,defaultViewport:D,translateExtent:R,minZoom:T,maxZoom:A,onSelectionContextMenu:l,preventScrolling:j,noDragClassName:ge,noWheelClassName:ye,noPanClassName:oe,disableKeyboardA11y:we,onViewportChange:ce,isControlledViewport:!!De,children:E.jsxs(lE,{children:[E.jsx(oE,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:c,onReconnect:Te,onReconnectStart:We,onReconnectEnd:me,onlyRenderVisibleElements:k,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:le,onEdgeMouseLeave:pe,reconnectRadius:ne,defaultMarkerColor:$,noPanClassName:oe,disableKeyboardA11y:we,rfId:ae}),E.jsx(_E,{style:m,type:w,component:h,containerStyle:f}),E.jsx("div",{className:"react-flow__edgelabel-renderer"}),E.jsx(z5,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:o,onNodeMouseEnter:n,onNodeMouseMove:a,onNodeMouseLeave:p,onNodeContextMenu:_,nodeClickDistance:Y,onlyRenderVisibleElements:k,noPanClassName:oe,noDragClassName:ge,disableKeyboardA11y:we,nodeExtent:xe,rfId:ae}),E.jsx("div",{className:"react-flow__viewport-portal"})]})})}gv.displayName="GraphView";const yE=H.memo(gv),wE=_m(),Wf=({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:o,fitView:c,fitViewOptions:n,minZoom:a=.5,maxZoom:p=2,nodeOrigin:_,nodeExtent:l,zIndexMode:g="basic"}={})=>{const v=new Map,w=new Map,m=new Map,h=new Map,f=s??t??[],d=r??e??[],u=_??[0,0],y=l??wn;Lm(m,h,f);const{nodesInitialized:C}=tu(d,v,w,{nodeOrigin:u,nodeExtent:y,zIndexMode:g});let S=[0,0,1];if(c&&i&&o){const b=Bn(v,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x,y:k,zoom:M}=fh(b,i,o,a,p,(n==null?void 0:n.padding)??.1);S=[x,k,M]}return{rfId:"1",width:i??0,height:o??0,transform:S,nodes:d,nodesInitialized:C,nodeLookup:v,parentLookup:w,edges:f,edgeLookup:h,connectionLookup:m,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:a,maxZoom:p,translateExtent:wn,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ui.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:u,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:n,fitViewResolver:null,connection:{...um},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:wE,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:cm,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},SE=({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:o,fitView:c,fitViewOptions:n,minZoom:a,maxZoom:p,nodeOrigin:_,nodeExtent:l,zIndexMode:g})=>Nb((v,w)=>{async function m(){const{nodeLookup:h,panZoom:f,fitViewOptions:d,fitViewResolver:u,width:y,height:C,minZoom:S,maxZoom:b}=w();f&&(await _C({nodes:h,width:y,height:C,panZoom:f,minZoom:S,maxZoom:b},d),u==null||u.resolve(!0),v({fitViewResolver:null}))}return{...Wf({nodes:e,edges:t,width:i,height:o,fitView:c,fitViewOptions:n,minZoom:a,maxZoom:p,nodeOrigin:_,nodeExtent:l,defaultNodes:r,defaultEdges:s,zIndexMode:g}),setNodes:h=>{const{nodeLookup:f,parentLookup:d,nodeOrigin:u,elevateNodesOnSelect:y,fitViewQueued:C,zIndexMode:S,nodesSelectionActive:b}=w(),{nodesInitialized:x,hasSelectedNodes:k}=tu(h,f,d,{nodeOrigin:u,nodeExtent:l,elevateNodesOnSelect:y,checkEquality:!0,zIndexMode:S}),M=b&&k;C&&x?(m(),v({nodes:h,nodesInitialized:x,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:M})):v({nodes:h,nodesInitialized:x,nodesSelectionActive:M})},setEdges:h=>{const{connectionLookup:f,edgeLookup:d}=w();Lm(f,d,h),v({edges:h})},setDefaultNodesAndEdges:(h,f)=>{if(h){const{setNodes:d}=w();d(h),v({hasDefaultNodes:!0})}if(f){const{setEdges:d}=w();d(f),v({hasDefaultEdges:!0})}},updateNodeInternals:h=>{const{triggerNodeChanges:f,nodeLookup:d,parentLookup:u,domNode:y,nodeOrigin:C,nodeExtent:S,debug:b,fitViewQueued:x,zIndexMode:k}=w(),{changes:M,updatedInternals:D}=jC(h,d,u,y,C,S,k);D&&(IC(d,u,{nodeOrigin:C,nodeExtent:S,zIndexMode:k}),x?(m(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(M==null?void 0:M.length)>0&&(b&&console.log("React Flow: trigger node changes",M),f==null||f(M)))},updateNodePositions:(h,f=!1)=>{const d=[];let u=[];const{nodeLookup:y,triggerNodeChanges:C,connection:S,updateConnection:b,onNodesChangeMiddlewareMap:x}=w();for(const[k,M]of h){const D=y.get(k),R=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(M!=null&&M.position)),T={id:k,type:"position",position:R?{x:Math.max(0,M.position.x),y:Math.max(0,M.position.y)}:M.position,dragging:f};if(D&&S.inProgress&&S.fromNode.id===D.id){const A=bs(D,S.fromHandle,he.Left,!0);b({...S,from:A})}R&&D.parentId&&d.push({id:k,parentId:D.parentId,rect:{...M.internals.positionAbsolute,width:M.measured.width??0,height:M.measured.height??0}}),u.push(T)}if(d.length>0){const{parentLookup:k,nodeOrigin:M}=w(),D=wh(d,y,k,M);u.push(...D)}for(const k of x.values())u=k(u);C(u)},triggerNodeChanges:h=>{const{onNodesChange:f,setNodes:d,nodes:u,hasDefaultNodes:y,debug:C}=w();if(h!=null&&h.length){if(y){const S=t5(h,u);d(S)}C&&console.log("React Flow: trigger node changes",h),f==null||f(h)}},triggerEdgeChanges:h=>{const{onEdgesChange:f,setEdges:d,edges:u,hasDefaultEdges:y,debug:C}=w();if(h!=null&&h.length){if(y){const S=r5(h,u);d(S)}C&&console.log("React Flow: trigger edge changes",h),f==null||f(h)}},addSelectedNodes:h=>{const{multiSelectionActive:f,edgeLookup:d,nodeLookup:u,triggerNodeChanges:y,triggerEdgeChanges:C}=w();if(f){const S=h.map(b=>ss(b,!0));y(S);return}y(Ks(u,new Set([...h]),!0)),C(Ks(d))},addSelectedEdges:h=>{const{multiSelectionActive:f,edgeLookup:d,nodeLookup:u,triggerNodeChanges:y,triggerEdgeChanges:C}=w();if(f){const S=h.map(b=>ss(b,!0));C(S);return}C(Ks(d,new Set([...h]))),y(Ks(u,new Set,!0))},unselectNodesAndEdges:({nodes:h,edges:f}={})=>{const{edges:d,nodes:u,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:S}=w(),b=h||u,x=f||d,k=[];for(const D of b){if(!D.selected)continue;const R=y.get(D.id);R&&(R.selected=!1),k.push(ss(D.id,!1))}const M=[];for(const D of x)D.selected&&M.push(ss(D.id,!1));C(k),S(M)},setMinZoom:h=>{const{panZoom:f,maxZoom:d}=w();f==null||f.setScaleExtent([h,d]),v({minZoom:h})},setMaxZoom:h=>{const{panZoom:f,minZoom:d}=w();f==null||f.setScaleExtent([d,h]),v({maxZoom:h})},setTranslateExtent:h=>{var f;(f=w().panZoom)==null||f.setTranslateExtent(h),v({translateExtent:h})},resetSelectedElements:()=>{const{edges:h,nodes:f,triggerNodeChanges:d,triggerEdgeChanges:u,elementsSelectable:y}=w();if(!y)return;const C=f.reduce((b,x)=>x.selected?[...b,ss(x.id,!1)]:b,[]),S=h.reduce((b,x)=>x.selected?[...b,ss(x.id,!1)]:b,[]);d(C),u(S)},setNodeExtent:h=>{const{nodes:f,nodeLookup:d,parentLookup:u,nodeOrigin:y,elevateNodesOnSelect:C,nodeExtent:S,zIndexMode:b}=w();h[0][0]===S[0][0]&&h[0][1]===S[0][1]&&h[1][0]===S[1][0]&&h[1][1]===S[1][1]||(tu(f,d,u,{nodeOrigin:y,nodeExtent:h,elevateNodesOnSelect:C,checkEquality:!1,zIndexMode:b}),v({nodeExtent:h}))},panBy:h=>{const{transform:f,width:d,height:u,panZoom:y,translateExtent:C}=w();return FC({delta:h,panZoom:y,transform:f,translateExtent:C,width:d,height:u})},setCenter:async(h,f,d)=>{const{width:u,height:y,maxZoom:C,panZoom:S}=w();if(!S)return!1;const b=typeof(d==null?void 0:d.zoom)<"u"?d.zoom:C;return await S.setViewport({x:u/2-h*b,y:y/2-f*b,zoom:b},{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),!0},cancelConnection:()=>{v({connection:{...um}})},updateConnection:h=>{v({connection:h})},reset:()=>v({...Wf()})}},Object.is);function xh({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:o,initialMinZoom:c,initialMaxZoom:n,initialFitViewOptions:a,fitView:p,nodeOrigin:_,nodeExtent:l,zIndexMode:g,children:v}){const[w]=H.useState(()=>SE({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:o,fitView:p,minZoom:c,maxZoom:n,fitViewOptions:a,nodeOrigin:_,nodeExtent:l,zIndexMode:g}));return E.jsx(Ib,{value:w,children:E.jsx(l5,{children:v})})}function xE({children:e,nodes:t,edges:r,defaultNodes:s,defaultEdges:i,width:o,height:c,fitView:n,fitViewOptions:a,minZoom:p,maxZoom:_,nodeOrigin:l,nodeExtent:g,zIndexMode:v}){return H.useContext(Ya)?E.jsx(E.Fragment,{children:e}):E.jsx(xh,{initialNodes:t,initialEdges:r,defaultNodes:s,defaultEdges:i,initialWidth:o,initialHeight:c,fitView:n,initialFitViewOptions:a,initialMinZoom:p,initialMaxZoom:_,nodeOrigin:l,nodeExtent:g,zIndexMode:v,children:e})}const CE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function bE({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,className:i,nodeTypes:o,edgeTypes:c,onNodeClick:n,onEdgeClick:a,onInit:p,onMove:_,onMoveStart:l,onMoveEnd:g,onConnect:v,onConnectStart:w,onConnectEnd:m,onClickConnectStart:h,onClickConnectEnd:f,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:y,onNodeContextMenu:C,onNodeDoubleClick:S,onNodeDragStart:b,onNodeDrag:x,onNodeDragStop:k,onNodesDelete:M,onEdgesDelete:D,onDelete:R,onSelectionChange:T,onSelectionDragStart:A,onSelectionDrag:j,onSelectionDragStop:$,onSelectionContextMenu:F,onSelectionStart:B,onSelectionEnd:L,onBeforeDelete:P,connectionMode:O,connectionLineType:I=Pr.Bezier,connectionLineStyle:W,connectionLineComponent:K,connectionLineContainerStyle:q,deleteKeyCode:Z="Backspace",selectionKeyCode:z="Shift",selectionOnDrag:N=!1,selectionMode:U=Sn.Full,panActivationKeyCode:G="Space",multiSelectionKeyCode:Q=Cn()?"Meta":"Control",zoomActivationKeyCode:Y=Cn()?"Meta":"Control",snapToGrid:ee,snapGrid:te,onlyRenderVisibleElements:le=!1,selectNodesOnDrag:pe,nodesDraggable:ne,autoPanOnNodeFocus:Te,nodesConnectable:We,nodesFocusable:me,nodeOrigin:ge=Um,edgesFocusable:ye,edgesReconnectable:oe,elementsSelectable:we=!0,defaultViewport:xe=qb,minZoom:ae=.5,maxZoom:De=2,translateExtent:ce=wn,preventScrolling:Be=!0,nodeExtent:Ae,defaultMarkerColor:be="#b1b1b7",zoomOnScroll:ve=!0,zoomOnPinch:Tt=!0,panOnScroll:Pt=!1,panOnScrollSpeed:re=.5,panOnScrollMode:de=fs.Free,zoomOnDoubleClick:fe=!0,panOnDrag:ke=!0,onPaneClick:Oe,onPaneMouseEnter:J,onPaneMouseMove:Ge,onPaneMouseLeave:Pe,onPaneScroll:Zr,onPaneContextMenu:Si,paneClickDistance:Hn=1,nodeClickDistance:el=0,children:tl,onReconnect:zn,onReconnectStart:xi,onReconnectEnd:Wn,onEdgeContextMenu:Un,onEdgeDoubleClick:Vn,onEdgeMouseEnter:Kn,onEdgeMouseMove:Jr,onEdgeMouseLeave:rl,reconnectRadius:Ms=10,onNodesChange:Gn,onEdgesChange:sl,noDragClassName:il="nodrag",noWheelClassName:nl="nowheel",noPanClassName:V="nopan",fitView:X,fitViewOptions:ie,connectOnClick:_e,attributionPosition:Se,proOptions:Ce,defaultEdgeOptions:Ue,elevateNodesOnSelect:$e=!0,elevateEdgesOnSelect:je=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:Er,autoPanOnNodeDrag:Rs,autoPanOnSelection:cr=!0,autoPanSpeed:qn,connectionRadius:Xn,isValidConnection:ol,onError:al,style:Yn,id:Nt,nodeDragThreshold:Ds,connectionDragThreshold:ll,viewport:Yv,onViewportChange:Qv,width:Zv,height:Jv,colorMode:e0="light",debug:t0,onScroll:Qn,ariaLabelConfig:r0,zIndexMode:Dh="basic",...s0},i0){const cl=Nt||"1",n0=Zb(e0),o0=H.useCallback(Ah=>{Ah.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Qn==null||Qn(Ah)},[Qn]);return E.jsx("div",{"data-testid":"rf__wrapper",...s0,onScroll:o0,style:{...Yn,...CE},ref:i0,className:tt(["react-flow",i,n0]),id:Nt,role:"application",children:E.jsxs(xE,{nodes:e,edges:t,width:Zv,height:Jv,fitView:X,fitViewOptions:ie,minZoom:ae,maxZoom:De,nodeOrigin:ge,nodeExtent:Ae,zIndexMode:Dh,children:[E.jsx(Qb,{nodes:e,edges:t,defaultNodes:r,defaultEdges:s,onConnect:v,onConnectStart:w,onConnectEnd:m,onClickConnectStart:h,onClickConnectEnd:f,nodesDraggable:ne,autoPanOnNodeFocus:Te,nodesConnectable:We,nodesFocusable:me,edgesFocusable:ye,edgesReconnectable:oe,elementsSelectable:we,elevateNodesOnSelect:$e,elevateEdgesOnSelect:je,minZoom:ae,maxZoom:De,nodeExtent:Ae,onNodesChange:Gn,onEdgesChange:sl,snapToGrid:ee,snapGrid:te,connectionMode:O,translateExtent:ce,connectOnClick:_e,defaultEdgeOptions:Ue,fitView:X,fitViewOptions:ie,onNodesDelete:M,onEdgesDelete:D,onDelete:R,onNodeDragStart:b,onNodeDrag:x,onNodeDragStop:k,onSelectionDrag:j,onSelectionDragStart:A,onSelectionDragStop:$,onMove:_,onMoveStart:l,onMoveEnd:g,noPanClassName:V,nodeOrigin:ge,rfId:cl,autoPanOnConnect:Er,autoPanOnNodeDrag:Rs,autoPanSpeed:qn,onError:al,connectionRadius:Xn,isValidConnection:ol,selectNodesOnDrag:pe,nodeDragThreshold:Ds,connectionDragThreshold:ll,onBeforeDelete:P,debug:t0,ariaLabelConfig:r0,zIndexMode:Dh}),E.jsx(yE,{onInit:p,onNodeClick:n,onEdgeClick:a,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:y,onNodeContextMenu:C,onNodeDoubleClick:S,nodeTypes:o,edgeTypes:c,connectionLineType:I,connectionLineStyle:W,connectionLineComponent:K,connectionLineContainerStyle:q,selectionKeyCode:z,selectionOnDrag:N,selectionMode:U,deleteKeyCode:Z,multiSelectionKeyCode:Q,panActivationKeyCode:G,zoomActivationKeyCode:Y,onlyRenderVisibleElements:le,defaultViewport:xe,translateExtent:ce,minZoom:ae,maxZoom:De,preventScrolling:Be,zoomOnScroll:ve,zoomOnPinch:Tt,zoomOnDoubleClick:fe,panOnScroll:Pt,panOnScrollSpeed:re,panOnScrollMode:de,panOnDrag:ke,autoPanOnSelection:cr,onPaneClick:Oe,onPaneMouseEnter:J,onPaneMouseMove:Ge,onPaneMouseLeave:Pe,onPaneScroll:Zr,onPaneContextMenu:Si,paneClickDistance:Hn,nodeClickDistance:el,onSelectionContextMenu:F,onSelectionStart:B,onSelectionEnd:L,onReconnect:zn,onReconnectStart:xi,onReconnectEnd:Wn,onEdgeContextMenu:Un,onEdgeDoubleClick:Vn,onEdgeMouseEnter:Kn,onEdgeMouseMove:Jr,onEdgeMouseLeave:rl,reconnectRadius:Ms,defaultMarkerColor:be,noDragClassName:il,noWheelClassName:nl,noPanClassName:V,rfId:cl,disableKeyboardA11y:Je,nodeExtent:Ae,viewport:Yv,onViewportChange:Qv}),E.jsx(Gb,{onSelectionChange:T}),tl,E.jsx(zb,{proOptions:Ce,position:Se}),E.jsx(Hb,{rfId:cl,disableKeyboardA11y:Je})]})})}var _v=Km(bE);function Uf(e){return Le(H.useCallback(r=>r.nodeLookup.get(e),[e]),ze)}function EE({dimensions:e,lineWidth:t,variant:r,className:s}){return E.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:tt(["react-flow__background-pattern",r,s])})}function kE({radius:e,className:t}){return E.jsx("circle",{cx:e,cy:e,r:e,className:tt(["react-flow__background-pattern","dots",t])})}var Ur;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ur||(Ur={}));const LE={[Ur.Dots]:1,[Ur.Lines]:1,[Ur.Cross]:6},ME=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function mv({id:e,variant:t=Ur.Dots,gap:r=20,size:s,lineWidth:i=1,offset:o=0,color:c,bgColor:n,style:a,className:p,patternClassName:_}){const l=H.useRef(null),{transform:g,patternId:v}=Le(ME,ze),w=s||LE[t],m=t===Ur.Dots,h=t===Ur.Cross,f=Array.isArray(r)?r:[r,r],d=[f[0]*g[2]||1,f[1]*g[2]||1],u=w*g[2],y=Array.isArray(o)?o:[o,o],C=h?[u,u]:d,S=[y[0]*g[2]||1+C[0]/2,y[1]*g[2]||1+C[1]/2],b=`${v}${e||""}`;return E.jsxs("svg",{className:tt(["react-flow__background",p]),style:{...a,...Za,"--xy-background-color-props":n,"--xy-background-pattern-color-props":c},ref:l,"data-testid":"rf__background",children:[E.jsx("pattern",{id:b,x:g[0]%d[0],y:g[1]%d[1],width:d[0],height:d[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:m?E.jsx(kE,{radius:u/2,className:_}):E.jsx(EE,{dimensions:C,lineWidth:i,variant:t,className:_})}),E.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${b})`})]})}mv.displayName="Background";const vv=H.memo(mv);function RE(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:E.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function DE(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:E.jsx("path",{d:"M0 0h32v4.2H0z"})})}function AE(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:E.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function TE(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function PE(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function bo({children:e,className:t,...r}){return E.jsx("button",{type:"button",className:tt(["react-flow__controls-button",t]),...r,children:e})}const NE=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function yv({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:s=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:c,onFitView:n,onInteractiveChange:a,className:p,children:_,position:l="bottom-left",orientation:g="vertical","aria-label":v}){const w=Ke(),{isInteractive:m,minZoomReached:h,maxZoomReached:f,ariaLabelConfig:d}=Le(NE,ze),{zoomIn:u,zoomOut:y,fitView:C}=$n(),S=()=>{u(),o==null||o()},b=()=>{y(),c==null||c()},x=()=>{C(i),n==null||n()},k=()=>{w.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),a==null||a(!m)},M=g==="horizontal"?"horizontal":"vertical";return E.jsxs(Qa,{className:tt(["react-flow__controls",M,p]),position:l,style:e,"data-testid":"rf__controls","aria-label":v??d["controls.ariaLabel"],children:[t&&E.jsxs(E.Fragment,{children:[E.jsx(bo,{onClick:S,className:"react-flow__controls-zoomin",title:d["controls.zoomIn.ariaLabel"],"aria-label":d["controls.zoomIn.ariaLabel"],disabled:f,children:E.jsx(RE,{})}),E.jsx(bo,{onClick:b,className:"react-flow__controls-zoomout",title:d["controls.zoomOut.ariaLabel"],"aria-label":d["controls.zoomOut.ariaLabel"],disabled:h,children:E.jsx(DE,{})})]}),r&&E.jsx(bo,{className:"react-flow__controls-fitview",onClick:x,title:d["controls.fitView.ariaLabel"],"aria-label":d["controls.fitView.ariaLabel"],children:E.jsx(AE,{})}),s&&E.jsx(bo,{className:"react-flow__controls-interactive",onClick:k,title:d["controls.interactive.ariaLabel"],"aria-label":d["controls.interactive.ariaLabel"],children:m?E.jsx(PE,{}):E.jsx(TE,{})}),_]})}yv.displayName="Controls";H.memo(yv);function IE({id:e,x:t,y:r,width:s,height:i,style:o,color:c,strokeColor:n,strokeWidth:a,className:p,borderRadius:_,shapeRendering:l,selected:g,onClick:v}){const{background:w,backgroundColor:m}=o||{},h=c||w||m;return E.jsx("rect",{className:tt(["react-flow__minimap-node",{selected:g},p]),x:t,y:r,rx:_,ry:_,width:s,height:i,style:{fill:h,stroke:n,strokeWidth:a},shapeRendering:l,onClick:v?f=>v(f,e):void 0})}const BE=H.memo(IE),OE=e=>e.nodes.map(t=>t.id),Vl=e=>e instanceof Function?e:()=>e;function $E({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:i,nodeComponent:o=BE,onClick:c}){const n=Le(OE,ze),a=Vl(t),p=Vl(e),_=Vl(r),l=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return E.jsx(E.Fragment,{children:n.map(g=>E.jsx(FE,{id:g,nodeColorFunc:a,nodeStrokeColorFunc:p,nodeClassNameFunc:_,nodeBorderRadius:s,nodeStrokeWidth:i,NodeComponent:o,onClick:c,shapeRendering:l},g))})}function jE({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:s,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:c,NodeComponent:n,onClick:a}){const{node:p,x:_,y:l,width:g,height:v}=Le(w=>{const m=w.nodeLookup.get(e);if(!m)return{node:void 0,x:0,y:0,width:0,height:0};const h=m.internals.userNode,{x:f,y:d}=m.internals.positionAbsolute,{width:u,height:y}=br(h);return{node:h,x:f,y:d,width:u,height:y}},ze);return!p||p.hidden||!mm(p)?null:E.jsx(n,{x:_,y:l,width:g,height:v,style:p.style,selected:!!p.selected,className:s(p),color:t(p),borderRadius:i,strokeColor:r(p),strokeWidth:o,shapeRendering:c,onClick:a,id:p.id})}const FE=H.memo(jE);var HE=H.memo($E);const zE=200,WE=150,UE=e=>!e.hidden,VE=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?gm(Bn(e.nodeLookup,{filter:UE}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},KE="react-flow__minimap-desc";function wv({style:e,className:t,nodeStrokeColor:r,nodeColor:s,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:c,nodeComponent:n,bgColor:a,maskColor:p,maskStrokeColor:_,maskStrokeWidth:l,position:g="bottom-right",onClick:v,onNodeClick:w,pannable:m=!1,zoomable:h=!1,ariaLabel:f,inversePan:d,zoomStep:u=1,offsetScale:y=5}){const C=Ke(),S=H.useRef(null),{boundingRect:b,viewBB:x,rfId:k,panZoom:M,translateExtent:D,flowWidth:R,flowHeight:T,ariaLabelConfig:A}=Le(VE,ze),j=(e==null?void 0:e.width)??zE,$=(e==null?void 0:e.height)??WE,F=b.width/j,B=b.height/$,L=Math.max(F,B),P=L*j,O=L*$,I=y*L,W=b.x-(P-b.width)/2-I,K=b.y-(O-b.height)/2-I,q=P+I*2,Z=O+I*2,z=`${KE}-${k}`,N=H.useRef(0),U=H.useRef();N.current=L,H.useEffect(()=>{if(S.current&&M)return U.current=XC({domNode:S.current,panZoom:M,getTransform:()=>C.getState().transform,getViewScale:()=>N.current}),()=>{var ee;(ee=U.current)==null||ee.destroy()}},[M]),H.useEffect(()=>{var ee;(ee=U.current)==null||ee.update({translateExtent:D,width:R,height:T,inversePan:d,pannable:m,zoomStep:u,zoomable:h})},[m,h,d,u,D,R,T]);const G=v?ee=>{var pe;const[te,le]=((pe=U.current)==null?void 0:pe.pointer(ee))||[0,0];v(ee,{x:te,y:le})}:void 0,Q=w?H.useCallback((ee,te)=>{const le=C.getState().nodeLookup.get(te).internals.userNode;w(ee,le)},[]):void 0,Y=f??A["minimap.ariaLabel"];return E.jsx(Qa,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof l=="number"?l*L:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:tt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:E.jsxs("svg",{width:j,height:$,viewBox:`${W} ${K} ${q} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":z,ref:S,onClick:G,children:[Y&&E.jsx("title",{id:z,children:Y}),E.jsx(HE,{onClick:Q,nodeColor:s,nodeStrokeColor:r,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:c,nodeComponent:n}),E.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-I},${K-I}h${q+I*2}v${Z+I*2}h${-q-I*2}z
|
|
62
|
-
M${x.x},${x.y}h${x.width}v${x.height}h${-x.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wv.displayName="MiniMap";H.memo(wv);const GE=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,qE={[pi.Line]:"right",[pi.Handle]:"bottom-right"};function XE({nodeId:e,position:t,variant:r=pi.Handle,className:s,style:i=void 0,children:o,color:c,minWidth:n=10,minHeight:a=10,maxWidth:p=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:l=!1,resizeDirection:g,autoScale:v=!0,shouldResize:w,onResizeStart:m,onResize:h,onResizeEnd:f}){const d=Ym(),u=typeof e=="string"?e:d,y=Ke(),C=H.useRef(null),S=r===pi.Handle,b=Le(H.useCallback(GE(S&&v),[S,v]),ze),x=H.useRef(null),k=t??qE[r];H.useEffect(()=>{if(!(!C.current||!u))return x.current||(x.current=lb({domNode:C.current,nodeId:u,getStoreItems:()=>{const{nodeLookup:D,transform:R,snapGrid:T,snapToGrid:A,nodeOrigin:j,domNode:$}=y.getState();return{nodeLookup:D,transform:R,snapGrid:T,snapToGrid:A,nodeOrigin:j,paneDomNode:$}},onChange:(D,R)=>{const{triggerNodeChanges:T,nodeLookup:A,parentLookup:j,nodeOrigin:$}=y.getState(),F=[],B={x:D.x,y:D.y},L=A.get(u);if(L&&L.expandParent&&L.parentId){const P=L.origin??$,O=D.width??L.measured.width??0,I=D.height??L.measured.height??0,W={id:L.id,parentId:L.parentId,rect:{width:O,height:I,...vm({x:D.x??L.position.x,y:D.y??L.position.y},{width:O,height:I},L.parentId,A,P)}},K=wh([W],A,j,$);F.push(...K),B.x=D.x?Math.max(P[0]*O,D.x):void 0,B.y=D.y?Math.max(P[1]*I,D.y):void 0}if(B.x!==void 0&&B.y!==void 0){const P={id:u,type:"position",position:{...B}};F.push(P)}if(D.width!==void 0&&D.height!==void 0){const O={id:u,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};F.push(O)}for(const P of R){const O={...P,type:"position"};F.push(O)}T(F)},onEnd:({width:D,height:R})=>{const T={id:u,type:"dimensions",resizing:!1,dimensions:{width:D,height:R}};y.getState().triggerNodeChanges([T])}})),x.current.update({controlPosition:k,boundaries:{minWidth:n,minHeight:a,maxWidth:p,maxHeight:_},keepAspectRatio:l,resizeDirection:g,onResizeStart:m,onResize:h,onResizeEnd:f,shouldResize:w}),()=>{var D;(D=x.current)==null||D.destroy()}},[k,n,a,p,_,l,m,h,f,w]);const M=k.split("-");return E.jsx("div",{className:tt(["react-flow__resize-control","nodrag",...M,r,s]),ref:C,style:{...i,scale:b,...c&&{[S?"backgroundColor":"borderColor"]:c}},children:o})}H.memo(XE);function Sv(e){let t=2166136261;for(let r=0;r<(e||"").length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t>>>0}function xv(e){return Sv(e)%360}function YE(e){const t=xv(e);return{bg:`hsl(${t} 55% 42%)`,fg:`hsl(${t} 70% 92%)`}}function qr(e){return`hsl(${xv(e)} 65% 50%)`}const Vf=["◆","▲","●","■","★","✦","⬟","⬢","❖","◈","✸","⟡","✚","❂","◐","◑","⬣","▰","✶","⬤","✹","◇","⊛","✺"],Kf=["circle","rounded","square","hex"];function Cv(e){const t=Sv(e);return{kind:"generated",seed:e,glyph:Vf[(t>>>9)%Vf.length],shape:Kf[(t>>>17)%Kf.length],...YE(e)}}const QE=[Cv];function ZE(e){for(const t of QE){const r=t(e);if(r)return r}return Cv(e)}function wi({seed:e,status:t,title:r,size:s=16}){const i=ZE(e),o={width:s,height:s},c=i.kind==="image"?E.jsx("img",{className:"av-face av-img",src:i.src,alt:"",style:o}):E.jsx("span",{className:`av-face av-gen av-${i.shape}`,style:{...o,background:i.bg,color:i.fg,fontSize:s*.62},children:i.glyph});return E.jsx("span",{className:`avatar av-st-${t||"none"}`,title:r,style:o,children:c})}const Ch={common:{new:"new",none:"none",idle:"idle",sessions:"sessions",session:"session",loading:"loading…",noVersions:"no versions yet — this spec is the latest ground truth.",cancel:"cancel",save:"save",close:"close"},status:{working:"working",idle:"idle",offline:"offline",starting:"starting",review:"review",done:"done","close-pending":"close-pending",parked:"parked",error:"error",asking:"asking",queued:"queued",merged:"merged",active:"active",drift:"drift",pending:"pending"},hud:{helpTitle:"help — keymap & legend (?)",graphTitle:"session relationships — open the live monitor graph in the session board",loading:"loading specs from git…"},time:{justNow:"just now",minutes:({n:e})=>`${e}m ago`,hours:({n:e})=>`${e}h ago`,days:({n:e})=>`${e}d ago`,weeks:({n:e})=>`${e}w ago`},legend:{title:"help · keymap & legend",close:"close (esc or ?)",secBoard:"board keys",secPopup:"node-info popup",secStatus:"status dot",secOp:"overlay op",secOpSub:"(a worktree's pending change)",secBadges:"badges",secRing:"node ring",board:{move:"move up / down the focused column (siblings)",parent:"to the parent",child:"to the nearest child",zoom:"zoom in / out · reset to overview",info:"open the node-info popup (or double-click a node)",search:"search & jump across nodes, sessions, issues & scenarios",overlayCycle:"cycle through nodes a worktree is changing (⇧ reverse)",enter:"cross into the focus node’s live session",fresh:"start a fresh session on the focus node",newChild:"new child node under the focus (chord)",del:"delete the focused node (chord)",settings:"open settings (language…)",help:"open this help"},popup:{switch:"switch pane (spec / history)",scroll:"scroll · reveal the next version",enter:"cross to the node’s session",esc:"close the popup"},statusRows:{merged:"spec & code in sync",active:"in-flight — the dot pulses",drift:"governed code is ahead of its spec",pending:"no committed version yet"},opRows:{added:"added",edited:"edited",deleted:"deleted",moved:"moved"},badgeDrift:"drift: N commits of code ahead of the spec",badgeVer:"version: N content commits to the node's spec.md",ringDashed:"dashed = uncommitted overlay",ringSolid:"solid = committed; ring colour = the author session",ringGhost:"translucent “ghost” = an added node not yet on main"},sessionWindow:{rowTitle:"click to lock the graph onto this session · double-click to open it · right-click to rename or close",lockedTitle:"graph locked to this session — click again to release",emptyBefore:"no live worktrees — press ",emptyAfter:" to start one",rename:"rename",resetOrder:"reset order",close:"close",closeTitle:"close “{name}”?",closeConfirm:"This closes the session and removes its worktree. Any uncommitted changes are lost.",renameTitle:"rename “{name}”",renamePlaceholder:"display name (blank to reset)"},lockHint:{cycleBefore:"press ",cycleAfter:({n:e})=>` to cycle its ${e} changed node${e===1?"":"s"}`,empty:"this session has no pending spec changes",release:"release",releaseTitle:"release the lock (or click the session again)"},nodeView:{paneSpec:"spec",paneHistory:"history",paneIssues:"issues",paneEval:"eval",paneEdit:"edit",noEdit:"no pending change — this node has no live edit in flight.",editCommitted:"committed",editDirty:"uncommitted",pendingEdits:({n:e})=>`${e} session${e===1?"":"s"} editing this node`,openIssues:({n:e})=>`${e} open`,closedIssues:({n:e})=>`${e} closed`,noIssues:"no issues linked to this node yet.",hint:"←→/hl/tab switch · j/k/↑↓ scroll · ⏎ session · esc back",statusLabel:"status:",versionLabel:"version:",lastEditedBy:"last edited by:",governs:"// governs",proseNode:"// no file owned · prose node",rawTitle:"raw source",rawOwner:"human",rawNote:"rarely changed · needs approval",expandedTitle:"expanded spec",expandedOwner:"agent",expandedNote:"versioned often · must match raw source",filesChanged:({n:e})=>`${e} file${e===1?"":"s"} changed`,loadingChange:"loading diff…",noChange:"no recorded change yet — this spec is the latest ground truth.",diffLabel:"spec line diff",loadingHistory:"loading history…",eval:{noScenarios:"no scenarios declared — this node has no yatsu.md to measure.",noReadings:"no measurements yet — run `spex yatsu eval` to file one. The declared scenarios:",staleAxes:({axes:e})=>`stale: ${e} moved since this reading`,pass:"✓ pass",fail:"✗ fail",note:"≈ note",legacy:"legacy",expected:"expected:",noteLabel:"how far off:",loadingTranscript:"loading transcript…",miss:"miss original file — the evidence was pruned from the cache.",noImage:"no evidence — the agent attested without a capture.",shotAlt:({scenario:e})=>`captured evidence for ${e}`}},stats:{aria:"board statistics",totalTitle:({n:e})=>`${e} spec node${e===1?"":"s"} in the tree`,statusTitle:({n:e,status:t})=>`${e} ${t} — click to walk them`,driftTitle:({n:e})=>`${e} node${e===1?"":"s"} whose code is ahead of its spec — click to walk them`,issueTitle:({n:e})=>`${e} distinct open issue${e===1?"":"s"} linked to the tree — click to walk the nodes carrying them`,scorePass:({n:e})=>`${e} scenario${e===1?"":"s"} measured fresh & passing — click to walk the nodes carrying them`,scoreFail:({n:e})=>`${e} scenario${e===1?"":"s"} measured fresh & failing — click to walk the nodes carrying them`,scoreStalePass:({n:e})=>`${e} scenario${e===1?"":"s"} with a stale pass (code moved since the last passing measurement) — click to walk the nodes carrying them`,scoreStaleFail:({n:e})=>`${e} scenario${e===1?"":"s"} with a stale fail (code moved since the last failing measurement) — click to walk the nodes carrying them`,scoreEmpty:({n:e})=>`${e} unmeasured or unscored scenario${e===1?"":"s"} (a blind spot) — click to walk the nodes carrying them`},score:{pass:"current pass — measured, fresh, and passing",fail:"current fail — measured, fresh, and failing",stalePass:"stale — last measured a pass, now out of date",staleFail:"stale — last measured a fail, now out of date",empty:"no current score — never measured, or no pass/fail verdict",missing:"not measured yet — no reading filed for this scenario",count:({satisfied:e,total:t,outstanding:r})=>`${e} of ${t} scenario${t===1?"":"s"} satisfied (fresh & passing)`+(r?` · ${r} outstanding — failing, stale, or unmeasured`:"")},focusPanel:{focus:"focus",scenarios:"scenarios",issues:"issues",noScenarios:"no scenarios — this node declares no yatsu.md to measure.",noIssues:"no issues linked to this node.",noFocus:"no node focused.",openEval:"open this node’s eval tab — the full reading timeline",open:({n:e})=>`${e} open`,closed:({n:e})=>`${e} closed`,tracks:({files:e})=>`tracks ${e}`},specNode:{lastEdited:"last edited",noVersions:"no versions yet",liveEditors:({n:e})=>`${e} live editor${e===1?"":"s"}`,more:({n:e})=>`${e} more`,editorTitle:({node:e,status:t,id:r})=>`${e} · ${t} — ${r}`,driftAhead:({n:e})=>`${e} ahead`,opTitle:({op:e,label:t,uncommitted:r})=>`${e} · ${t}${r?" (uncommitted)":""}`,openIssues:({n:e})=>`${e} open issue${e===1?"":"s"} — focus the node to list them in the panel`,expandable:({n:e})=>`${e} child${e===1?"":"ren"} — focus to drill in`},sessionGraph:{helpTitle:"keymap & legend (?)",asked:({a:e,b:t})=>`asked ${e} to monitor ${t}`,picked:"right-click another node for this one to monitor",needSource:"left-click a node first, then right-click another to monitor it",monitorPrompt:({label:e,id:t})=>`Please monitor session ${e} (${t}): run \`spex watch ${t}\` in the background and keep it running so its transitions surface to me.`,legend:{title:"session relationships",close:"close (esc or ?)",secKeys:"keys",move:"move the cursor to the nearest session",open:"open the focused session",leave:"back to New Session",secMouse:"mouse",gDblClick:"double-click",gClickRight:"click → right-click",openMouse:"double-click a session to open it",monitor:"left-click a node, then right-click another to ask the first to monitor it",secEdges:"edges",edgesDesc:"each arrow A→B is a live monitor — agent A is running `spex watch B` right now."}},session:{opsTitle:"nodes this session is changing — double-click the tab to lock + focus them",dragHandle:"drag to reorder",newSession:"New Session",newSessionTitle:"New Session (⌃/⌘+N · also ⌃/⌘+↑)",relationshipTitle:"View Session Relationship — the live monitor graph (→ from an empty New Session, ← back)",ask:"What would you like to do?",inputPlaceholder:"describe the work · @ spec · / command · ⏎ to launch · ⇧⏎ newline",menuCommands:"commands",menuPresets:"config presets",menuSpecNodes:"spec nodes",menuHint:"↑↓ pick · ⏎ insert",hint:{before:"type ",mid:" to reference a spec · ",after:" to apply a config preset"},harnessLabel:"agent launcher",navBtn:"nav",navTitle:"nav mode — forward raw keystrokes incl. ⌃/⌥/⌘ combos to drive the agent's terminal (⌥/⌘+I)",relaunch:"relaunch",merge:"merge",relaunchResume:"⏵ relaunch & resume",merges:({n:e})=>`merged ×${e}`,mergesTitle:"times merged to main",offlineMsg:"⏻ offline — no live process for this worktree.",offlineSubBefore:"the worktree and its session ",offlineSubAfter:" are intact. relaunch to resume the same conversation.",navInd:"⌨ nav mode",navHelp:"keys (incl. ⌃/⌥/⌘ combos) go to the session · ⌥/⌘+I, Esc-Esc, or click to exit",navExit:"click to exit nav mode",msgOffline:"relaunch to message this session",msgPlaceholder:"message this session · ⏎ to send",msgError:"⚠ not delivered — retry",attachTitle:"attach a file (or paste / drop) — uploaded to the session machine, its /tmp path inserted",attachError:"⚠ upload failed",cmd:{navDesc:"nav mode — forward raw keystrokes to the agent",proofDesc:"this session's proof of work — yatsu, diff, merge gates",mergeTitle:"merge this session to main",mergeDesc:"merge this session to main",exitTitle:"exit this session (stop the agent, keep the worktree — resumable)",exitDesc:"exit — stop the agent + tmux but KEEP the worktree, so it can be resumed",closeTitle:"close this session (removes the worktree)",closeDesc:"close — remove the worktree + branch, discarding the work (= row menu → Close)"}},proof:{btn:"proof",btnTitle:"open this session's proof of work — the measured yatsu evidence, the diff, and the merge gates",title:"review proof",newTab:"open in new tab",close:"close (esc)"},settings:{title:"settings",close:"close (esc or ,)",secLanguage:"language",languageHint:"choose the dashboard language. detected from your browser by default; your choice is remembered.",secShortcuts:"shortcuts",bindPrompt:"press a key…",shortcutsHint:"click a key to rebind it. nav & chord keys are fixed. (game-controller mapping lives outside the browser, as a separate extension.)",reset:"reset to defaults"},search:{title:"search nodes, sessions, issues & scenarios",placeholder:"search nodes, sessions, issues, scenarios…",empty:"no match",hint:"↑↓ pick · ⏎ jump · esc close",kind:{spec:"node",session:"session",issue:"issue",scenario:"scenario"}},mobile:{specsTab:"specs",sessionsTab:"sessions",childrenTab:({n:e})=>`children ${e}`,liveEditors:({n:e})=>`${e} live editor${e===1?"":"s"}`,changing:({n:e})=>`changing ${e} node${e===1?"":"s"}`,noChanges:"no pending spec changes",noSessions:"no live sessions — start one from a desktop board",back:"back"}},JE={common:{new:"新建",none:"无",idle:"空闲",sessions:"会话",session:"会话",loading:"加载中…",noVersions:"尚无版本——此规格即最新的事实依据。",cancel:"取消",save:"保存",close:"关闭"},status:{working:"工作中",idle:"空闲",offline:"离线",starting:"启动中",review:"待审查",done:"已完成","close-pending":"待关闭",parked:"驻留",error:"错误",asking:"待答",queued:"排队中",merged:"已合并",active:"进行中",drift:"偏移",pending:"待定"},hud:{helpTitle:"帮助 — 按键与图例(?)",graphTitle:"会话关系 — 在会话面板中打开实时监视图",loading:"正在从 git 加载规格…"},time:{justNow:"刚刚",minutes:({n:e})=>`${e} 分钟前`,hours:({n:e})=>`${e} 小时前`,days:({n:e})=>`${e} 天前`,weeks:({n:e})=>`${e} 周前`},legend:{title:"帮助 · 按键与图例",close:"关闭(esc 或 ?)",secBoard:"面板按键",secPopup:"节点信息弹窗",secStatus:"状态点",secOp:"叠加操作",secOpSub:"(工作树的待定改动)",secBadges:"徽标",secRing:"节点边框",board:{move:"在聚焦列内上/下移动(同级节点)",parent:"前往父节点",child:"前往最近的子节点",zoom:"放大 / 缩小 · 重置为概览",info:"打开节点信息弹窗(或双击节点)",search:"跨节点、会话、议题与场景搜索并跳转",overlayCycle:"在工作树正在修改的节点间循环(⇧ 反向)",enter:"进入聚焦节点的实时会话",fresh:"在聚焦节点上开启一个全新会话",newChild:"在聚焦节点下新建子节点(连击)",del:"删除聚焦节点(连击)",settings:"打开设置(语言…)",help:"打开此帮助"},popup:{switch:"切换页签(规格 / 历史)",scroll:"滚动 · 展开下一版本",enter:"进入该节点的会话",esc:"关闭弹窗"},statusRows:{merged:"规格与代码一致",active:"进行中——状态点会闪动",drift:"受管代码领先于其规格",pending:"尚无已提交的版本"},opRows:{added:"新增",edited:"编辑",deleted:"删除",moved:"移动"},badgeDrift:"偏移:代码领先于规格 N 次提交",badgeVer:"版本:该节点 spec.md 的 N 次内容提交",ringDashed:"虚线 = 未提交的叠加",ringSolid:"实线 = 已提交;边框颜色 = 作者会话",ringGhost:"半透明“幽灵” = 尚未进入 main 的新增节点"},sessionWindow:{rowTitle:"单击将图锁定到此会话 · 双击打开它 · 右键重命名或关闭",lockedTitle:"图已锁定到此会话——再次单击解除",emptyBefore:"没有活动的工作树——按 ",emptyAfter:" 开始一个",rename:"重命名",resetOrder:"恢复默认顺序",close:"关闭",closeTitle:"关闭“{name}”?",closeConfirm:"这将关闭会话并删除其工作树。任何未提交的更改都会丢失。",renameTitle:"重命名“{name}”",renamePlaceholder:"显示名称(留空以重置)"},lockHint:{cycleBefore:"按 ",cycleAfter:({n:e})=>` 循环浏览它更改的 ${e} 个节点`,empty:"此会话没有待处理的规格更改",release:"解除",releaseTitle:"解除锁定(或再次单击该会话)"},nodeView:{paneSpec:"规格",paneHistory:"历史",paneIssues:"issue",paneEval:"评测",paneEdit:"改动",noEdit:"暂无进行中的改动 —— 此节点没有正在编辑的会话。",editCommitted:"已提交",editDirty:"未提交",pendingEdits:({n:e})=>`${e} 个会话正在编辑此节点`,openIssues:({n:e})=>`${e} 个待办`,closedIssues:({n:e})=>`${e} 个已关闭`,noIssues:"尚无关联到此节点的 issue。",hint:"←→/hl/tab 切换 · j/k/↑↓ 滚动 · ⏎ 会话 · esc 返回",statusLabel:"状态:",versionLabel:"版本:",lastEditedBy:"最后编辑者:",governs:"// 管辖",proseNode:"// 无管辖文件 · 纯文档节点",rawTitle:"原始来源",rawOwner:"人工",rawNote:"极少改动 · 需要审批",expandedTitle:"展开规格",expandedOwner:"智能体",expandedNote:"经常更新版本 · 须与原始来源一致",filesChanged:({n:e})=>`改动 ${e} 个文件`,loadingChange:"正在加载差异…",noChange:"尚无记录的改动——此规格即最新的事实依据。",diffLabel:"规格行差异",loadingHistory:"正在加载历史…",eval:{noScenarios:"尚未声明场景 —— 此节点没有可测量的 yatsu.md。",noReadings:"尚无测量 —— 运行 `spex yatsu eval` 归档一次。已声明的场景:",staleAxes:({axes:e})=>`已过期:自本次读取以来 ${e} 已变动`,pass:"✓ 通过",fail:"✗ 未通过",note:"≈ 备注",legacy:"旧版",expected:"预期:",noteLabel:"偏差:",loadingTranscript:"正在加载文本记录…",miss:"原始文件缺失 —— 证据已从缓存中清除。",noImage:"无证据 —— 代理未捕获即作出判定。",shotAlt:({scenario:e})=>`${e} 的捕获证据`}},stats:{aria:"看板统计",totalTitle:({n:e})=>`树中共有 ${e} 个规格节点`,statusTitle:({n:e,status:t})=>`${e} 个${t} —— 点击逐个走查`,driftTitle:({n:e})=>`${e} 个节点的代码领先于其规格 —— 点击逐个走查`,issueTitle:({n:e})=>`链接到树上的不同未关闭议题共 ${e} 个 —— 点击逐个走查承载它们的节点`,scorePass:({n:e})=>`${e} 个场景测量为最新且通过 —— 点击逐个走查承载它们的节点`,scoreFail:({n:e})=>`${e} 个场景测量为最新且未通过 —— 点击逐个走查承载它们的节点`,scoreStalePass:({n:e})=>`${e} 个场景为过期通过(最近一次通过测量后代码有变动)—— 点击逐个走查承载它们的节点`,scoreStaleFail:({n:e})=>`${e} 个场景为过期未通过(最近一次未通过测量后代码有变动)—— 点击逐个走查承载它们的节点`,scoreEmpty:({n:e})=>`${e} 个场景未测量或未评分(盲点)—— 点击逐个走查承载它们的节点`},score:{pass:"当前通过 —— 已测量、最新且通过",fail:"当前未通过 —— 已测量、最新且未通过",stalePass:"已过期 —— 上次测量为通过,现已过时",staleFail:"已过期 —— 上次测量为未通过,现已过时",empty:"暂无当前评分 —— 从未测量,或无通过/未通过判定",missing:"尚未测量 —— 该场景还没有任何读数",count:({satisfied:e,total:t,outstanding:r})=>`${t} 个场景中有 ${e} 个已满足(最新且通过)`+(r?` · ${r} 个待处理 —— 未通过、已过期或未测量`:"")},focusPanel:{focus:"聚焦",scenarios:"场景",issues:"issue",noScenarios:"无场景 —— 该节点没有用于测量的 yatsu.md。",noIssues:"该节点暂无关联 issue。",noFocus:"未聚焦任何节点。",openEval:"打开该节点的 eval 标签页 —— 完整的读数时间线",open:({n:e})=>`${e} 个待办`,closed:({n:e})=>`${e} 个已关闭`,tracks:({files:e})=>`跟踪 ${e}`},specNode:{lastEdited:"最后编辑于",noVersions:"尚无版本",liveEditors:({n:e})=>`${e} 个实时编辑者`,more:({n:e})=>`还有 ${e} 个`,editorTitle:({node:e,status:t,id:r})=>`${e} · ${t} — ${r}`,driftAhead:({n:e})=>`领先 ${e}`,opTitle:({op:e,label:t,uncommitted:r})=>`${e} · ${t}${r?"(未提交)":""}`,openIssues:({n:e})=>`${e} 个待办 issue——聚焦该节点后在面板中查看`,expandable:({n:e})=>`${e} 个子节点——聚焦展开`},sessionGraph:{helpTitle:"快捷键与图例(?)",asked:({a:e,b:t})=>`已请求 ${e} 监视 ${t}`,picked:"右键点击另一个节点,让此节点监视它",needSource:"请先左键选中一个节点,再右键另一个建立监视",monitorPrompt:({label:e,id:t})=>`请监视会话 ${e}(${t}):在后台运行 \`spex watch ${t}\` 并保持运行,让其状态变化反馈给我。`,legend:{title:"会话关系",close:"关闭(esc 或 ?)",secKeys:"快捷键",move:"将光标移到最近的会话",open:"打开聚焦的会话",leave:"返回新建会话",secMouse:"鼠标",gDblClick:"双击",gClickRight:"左键 → 右键",openMouse:"双击会话即可打开",monitor:"左键选中一个节点,再右键另一个,让前者监视后者",secEdges:"连线",edgesDesc:"每条箭头 A→B 都是一个实时监视——智能体 A 正在运行 `spex watch B`。"}},session:{opsTitle:"此会话正在改动的节点 —— 双击标签锁定并聚焦它们",dragHandle:"拖动以排序",newSession:"新建会话",newSessionTitle:"新建会话(⌃/⌘+N · 或 ⌃/⌘+↑)",relationshipTitle:"查看会话关系 — 实时监视图(在空的新建会话框按 → 进入,← 返回)",ask:"你想做点什么?",inputPlaceholder:"描述工作 · @ 规格 · / 命令 · ⏎ 启动 · ⇧⏎ 换行",menuCommands:"命令",menuPresets:"配置预设",menuSpecNodes:"规格节点",menuHint:"↑↓ 选择 · ⏎ 插入",hint:{before:"输入 ",mid:" 以引用规格 · ",after:" 以套用配置预设"},harnessLabel:"启动智能体",navBtn:"导航",navTitle:"导航模式——转发原始按键(含 ⌃/⌥/⌘ 组合键)以驱动智能体的终端(⌥/⌘+I)",relaunch:"重新启动",merge:"合并",relaunchResume:"⏵ 重新启动并恢复",merges:({n:e})=>`已合并 ×${e}`,mergesTitle:"合并到 main 的次数",offlineMsg:"⏻ 离线——此工作树没有活动进程。",offlineSubBefore:"工作树及其会话 ",offlineSubAfter:" 仍然完好。重新启动以恢复同一对话。",navInd:"⌨ 导航模式",navHelp:"按键(含 ⌃/⌥/⌘ 组合键)将发送给会话 · ⌥/⌘+I、Esc-Esc 或点击退出",navExit:"点击退出导航模式",msgOffline:"重新启动以向此会话发送消息",msgPlaceholder:"向此会话发送消息 · ⏎ 发送",msgError:"⚠ 未送达 — 重试",attachTitle:"附加文件(或粘贴 / 拖入)—— 上传到会话所在机器,并插入其 /tmp 路径",attachError:"⚠ 上传失败",cmd:{navDesc:"导航模式 —— 转发原始按键给智能体",proofDesc:"此会话的工作证明 —— yatsu、改动、合并门禁",mergeTitle:"将此会话合并到 main",mergeDesc:"将此会话合并到 main",exitTitle:"退出此会话(停止智能体,保留工作树 —— 可恢复)",exitDesc:"退出 —— 停止智能体与 tmux,但保留工作树,之后可恢复",closeTitle:"关闭此会话(移除工作树)",closeDesc:"关闭 —— 移除工作树与分支,丢弃此工作(等同右键菜单 → 关闭)"}},proof:{btn:"证明",btnTitle:"打开此会话的工作证明 —— 测得的 yatsu 证据、改动与合并门禁",title:"评审证明",newTab:"在新标签页打开",close:"关闭(esc)"},settings:{title:"设置",close:"关闭(esc 或 ,)",secLanguage:"语言",languageHint:"选择仪表盘语言。默认根据浏览器检测;你的选择会被记住。",secShortcuts:"快捷键",bindPrompt:"按一个键…",shortcutsHint:"点击某个键即可重绑定。导航键与连击键固定不可改。(手柄映射在浏览器之外,是一个独立的 extension。)",reset:"恢复默认"},search:{title:"搜索节点、会话、议题与场景",placeholder:"搜索节点、会话、议题、场景…",empty:"没有匹配项",hint:"↑↓ 选择 · ⏎ 跳转 · esc 关闭",kind:{spec:"节点",session:"会话",issue:"议题",scenario:"场景"}},mobile:{specsTab:"规格",sessionsTab:"会话",childrenTab:({n:e})=>`子节点 ${e}`,liveEditors:({n:e})=>`${e} 个在线编辑者`,changing:({n:e})=>`正在修改 ${e} 个节点`,noChanges:"没有待提交的规格更改",noSessions:"没有运行中的会话 —— 请在桌面看板上启动",back:"返回"}},iu={en:Ch,zh:JE},bv="spexcode.lang",e2=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function t2(){return(typeof navigator<"u"&&navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function r2(){try{const e=localStorage.getItem(bv);if(e&&iu[e])return e}catch{}return t2()}function Gf(e,t){if(typeof t=="string")return t.split(".").reduce((r,s)=>r==null?void 0:r[s],e)}function s2(e,t){return t?e.replace(/\{(\w+)\}/g,(r,s)=>t[s]!=null?t[s]:`{${s}}`):e}function i2(e,t,r){let s=Gf(e,t);return s===void 0&&(s=Gf(Ch,t)),typeof s=="function"?s(r||{}):typeof s=="string"?s2(s,r):t}const Ev=H.createContext(null);function n2({children:e}){const[t,r]=H.useState(r2);H.useEffect(()=>{try{document.documentElement.lang=t}catch{}},[t]);const s=H.useCallback(o=>{if(iu[o]){try{localStorage.setItem(bv,o)}catch{}r(o)}},[]),i=H.useMemo(()=>{const o=iu[t]||Ch;return{lang:t,setLang:s,t:(c,n)=>i2(o,c,n)}},[t,s]);return E.jsx(Ev.Provider,{value:i,children:e})}function kv(){const e=H.useContext(Ev);if(!e)throw new Error("useI18n must be used within <I18nProvider>");return e}function Me(){return kv().t}function o2(e){var t,r;return((t=e==null?void 0:e.verdict)==null?void 0:t.status)==="pass"?"check":((r=e==null?void 0:e.verdict)==null?void 0:r.status)==="fail"?"cross":null}const a2={pass:"✓",fail:"✗",stalePass:"✓",staleFail:"✗",empty:""};function Lv(e){const t=o2(e);return t?e.fresh?t==="cross"?"fail":"pass":t==="cross"?"staleFail":"stalePass":"empty"}function Fn(e,t){if(!e)return[];const r=new Map;for(const s of t||[])r.has(s.scenario)||r.set(s.scenario,s);return e.map(s=>{const i=r.get(s.name)||null;return{...s,reading:i,state:i?Lv(i):"missing"}})}function Mv(e){return e.length?e.some(t=>t.state==="fail")?"fail":e.some(t=>t.state==="staleFail")?"staleFail":e.some(t=>t.state==="stalePass")?"stalePass":e.some(t=>t.state==="empty"||t.state==="missing")?"empty":"pass":null}function Rv({scenarios:e,evals:t}){const r=Me(),s=Fn(e,t);if(!s.length)return null;const i=Mv(s),o=s.filter(a=>a.state==="pass").length,c=s.length,n=r("score.count",{satisfied:o,total:c,outstanding:c-o});return E.jsxs("span",{className:`scenario-count ${i}`,title:n,"aria-label":n,children:["✓",o,"/",c]})}function bh({state:e,title:t}){const r=Me();if(!e)return null;const s=t??r(`score.${e}`);return E.jsx("span",{className:`score-badge ${e}`,title:s,"aria-label":s,children:a2[e]})}function l2(e,t){if(!e)return null;const r=Date.parse(e);if(Number.isNaN(r))return null;const s=Math.max(0,(Date.now()-r)/1e3);if(s<45)return t("time.justNow");const i=s/60,o=i/60,c=o/24;return i<45?t("time.minutes",{n:Math.round(i)}):o<22?t("time.hours",{n:Math.round(o)}):c<7?t("time.days",{n:Math.round(c)}):t("time.weeks",{n:Math.round(c/7)})}const c2=4,xr={merged:{color:"#859900"},active:{color:"#cb4b16"},drift:{color:"#b58900"},pending:{color:"#93a1a1"}},Ja={added:"+",edited:"~",deleted:"✕",moved:"→"};function u2({data:e}){const t=Me(),r=e.editors||[];if(r.length>0){const i=r.slice(0,c2),o=r.length-i.length;return E.jsxs("span",{className:"node-editors",title:t("specNode.liveEditors",{n:r.length}),children:[i.map(c=>E.jsx(wi,{seed:c.id,status:c.status,title:t("specNode.editorTitle",{node:c.node||t("common.session"),status:t(`status.${c.status}`),id:c.id.slice(0,8)})},c.id)),o>0&&E.jsxs("span",{className:"av-more",title:t("specNode.more",{n:o}),children:["+",o]})]})}const s=l2(e.lastEdited,t);return E.jsx("span",{className:"node-lastedit",children:s?E.jsxs(E.Fragment,{children:[t("specNode.lastEdited")," ",E.jsx("b",{children:s})]}):t("specNode.noVersions")})}function h2({issues:e,t}){return!e||e.length===0?null:E.jsxs("span",{className:"issue-badge",title:t("specNode.openIssues",{n:e.length}),children:["◆",e.length]})}function d2({data:e,selected:t}){const r=Me(),s=xr[e.status]||xr.pending,i=e.overlays||[],o=i[0],c=i.some(_=>_.op==="deleted"),n=o&&!o.committed,a=[...new Set(i.map(_=>_.op))],p=["spec-node",e.status,t?"focused":"",e.ghost?"ghost":"",c?"deleted":"",i.length?"has-overlay":"",n?"ov-dirty":""].filter(Boolean).join(" ");return E.jsxs("div",{className:p,style:o?{"--ov":qr(o.seed)}:void 0,children:[E.jsx(Gr,{type:"target",position:he.Left}),E.jsxs("div",{className:"node-row1",children:[E.jsx("span",{className:"node-dot",style:{background:s.color},children:e.status==="active"&&E.jsx("span",{className:"pulse",style:{background:s.color}})}),E.jsx("span",{className:"node-title",children:e.title}),e.drift>0&&E.jsxs("span",{className:"drift-badge",title:(e.driftFiles||[]).map(_=>`${_.file}: ${r("specNode.driftAhead",{n:_.behind})}`).join(`
|
|
63
|
-
`),children:["⚠",e.drift]}),E.jsx(h2,{issues:e.openIssues,t:r}),E.jsx(Rv,{scenarios:e.scenarios,evals:e.evals}),E.jsx("span",{className:"node-ver",children:e.version?`v${e.version}`:""}),a.length>0&&E.jsx("span",{className:"ov-marks",title:i.map(_=>r("specNode.opTitle",{op:r(`legend.opRows.${_.op}`),label:_.label,uncommitted:!_.committed})).join(`
|
|
64
|
-
`),children:a.map(_=>E.jsx("span",{className:`ov-mark ov-${_}`,children:Ja[_]},_))})]}),E.jsx("div",{className:"node-row2",children:E.jsx(u2,{data:e})}),e.collapsed&&E.jsxs("span",{className:"node-expand",title:r("specNode.expandable",{n:e.childCount}),children:["▸",e.childCount]}),E.jsx(Gr,{type:"source",position:he.Right})]})}const qf=[{key:"spec",label:"spec"},{key:"history",label:"history"},{key:"issues",label:"issues"},{key:"eval",label:"eval"}];function Eh(e){var t;return(t=e==null?void 0:e.overlays)!=null&&t.length?[{key:"edit",label:"edit"},...qf]:qf}const f2={added:"+",edited:"~",deleted:"✕",moved:"→"};function Pi(e){const t=[],r=/`([^`]+)`|\*\*([^*]+)\*\*|\[\[([^\]]+)\]\]/g;let s=0,i,o=0;for(;i=r.exec(e);)i.index>s&&t.push(e.slice(s,i.index)),i[1]!=null?t.push(E.jsx("code",{children:i[1]},o++)):i[2]!=null?t.push(E.jsx("strong",{children:i[2]},o++)):t.push(E.jsx("span",{className:"doc-link",children:i[3]},o++)),s=r.lastIndex;return s<e.length&&t.push(e.slice(s)),t}function Xf(e){const t=e.trim();return t.includes("|")&&/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/.test(t)}function Kl(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|").map(r=>r.trim())}function p2(e){const t=e.startsWith(":"),r=e.endsWith(":");return t&&r?"center":r?"right":null}function nu({body:e}){if(!e)return null;const t=e.replace(/^#\s+[^\n]*\n+/,"").split(`
|
|
65
|
-
`),r=[];let s=0,i=0;for(;s<t.length;){const o=t[s].trim();if(/^```/.test(o)){const c=[];for(s++;s<t.length&&!/^```/.test(t[s].trim());)c.push(t[s++]);s++,r.push(E.jsx("pre",{className:"doc-pre",children:E.jsx("code",{children:c.join(`
|
|
66
|
-
`)})},i++))}else if(/^#{1,6}\s+/.test(t[s]))r.push(E.jsx("h4",{className:"doc-h",children:Pi(t[s].replace(/^#+\s+/,""))},i++)),s++;else if(o.includes("|")&&s+1<t.length&&Xf(t[s+1])){const c=Kl(t[s]),n=Kl(t[s+1]).map(p2);s+=2;const a=[];for(;s<t.length&&t[s].includes("|")&&t[s].trim()!==""&&!/^```/.test(t[s].trim());)a.push(Kl(t[s])),s++;r.push(E.jsxs("table",{className:"doc-table",children:[E.jsx("thead",{children:E.jsx("tr",{children:c.map((p,_)=>E.jsx("th",{style:n[_]?{textAlign:n[_]}:void 0,children:Pi(p)},_))})}),E.jsx("tbody",{children:a.map((p,_)=>E.jsx("tr",{children:c.map((l,g)=>E.jsx("td",{style:n[g]?{textAlign:n[g]}:void 0,children:Pi(p[g]??"")},g))},_))})]},i++))}else if(/^-\s+/.test(o)){const c=[];for(;s<t.length&&/^-\s+/.test(t[s].trim());)c.push(t[s++].trim().replace(/^-\s+/,""));r.push(E.jsx("ul",{children:c.map((n,a)=>E.jsx("li",{children:Pi(n)},a))},i++))}else if(o==="")s++;else{const c=[];for(;s<t.length;){const n=t[s];if(n.trim()===""||/^```/.test(n.trim())||/^#{1,6}\s+/.test(n)||/^-\s+/.test(n.trim())||n.includes("|")&&s+1<t.length&&Xf(t[s+1]))break;c.push(n),s++}r.push(E.jsx("p",{children:Pi(c.join(" "))},i++))}}return E.jsx("div",{className:"doc-body",children:r})}function Yf({kind:e,title:t,owner:r,ownerLabel:s,note:i,children:o}){return E.jsxs("section",{className:`spec-part part-${e}`,children:[E.jsxs("header",{className:"part-head",children:[E.jsx("span",{className:"part-title",children:t}),E.jsx("span",{className:`part-owner owner-${r}`,children:s}),i&&E.jsx("span",{className:"part-note",children:i})]}),E.jsx("div",{className:"part-body",children:o})]})}function g2({parts:e}){const t=Me();return E.jsxs("div",{className:"spec-parts",children:[E.jsx(Yf,{kind:"raw",title:t("nodeView.rawTitle"),owner:"human",ownerLabel:t("nodeView.rawOwner"),note:t("nodeView.rawNote"),children:E.jsx(nu,{body:e.rawSource})}),E.jsx(Yf,{kind:"expanded",title:t("nodeView.expandedTitle"),owner:"agent",ownerLabel:t("nodeView.expandedOwner"),note:t("nodeView.expandedNote"),children:E.jsx(nu,{body:e.expandedSpec})})]})}function Dv({node:e}){var s;const t=Me(),r=(e.driftFiles||[]).map(i=>`${i.file}: ${t("specNode.driftAhead",{n:i.behind})}`).join(`
|
|
67
|
-
`);return E.jsxs("div",{className:"pane-doc",children:[E.jsxs("h1",{children:["# ",e.title]}),E.jsx("blockquote",{children:e.desc}),E.jsxs("div",{className:"doc-stat",children:[E.jsxs("span",{className:`stat-status st-${e.status}`,title:t("nodeView.statusLabel"),children:[E.jsx("i",{className:"stat-dot"}),t(`status.${e.status}`)]}),E.jsxs("span",{className:"stat-chip",title:t("nodeView.versionLabel"),children:["v",e.version||0]}),E.jsx(Rv,{scenarios:e.scenarios,evals:e.evals}),e.drift>0&&E.jsxs("span",{className:"stat-chip stat-drift",title:r,children:["⚠",e.drift]}),E.jsxs("span",{className:"stat-sess",title:t("nodeView.lastEditedBy"),children:["✎ ",E.jsx("b",{children:e.session||t("common.none")})]})]}),((s=e.code)==null?void 0:s.length)>0?E.jsxs("div",{className:"doc-gov",children:[E.jsxs("span",{className:"doc-gov-h",children:[t("nodeView.governs")," ",E.jsx("b",{children:e.code.length})]}),E.jsx("div",{className:"doc-gov-files",children:e.code.map(i=>E.jsx("code",{className:"gov-f",children:i},i))})]}):E.jsx("div",{className:"doc-gov prose",children:E.jsx("span",{className:"doc-gov-h",children:t("nodeView.proseNode")})}),e.parts?E.jsx(g2,{parts:e.parts}):E.jsx(nu,{body:e.body})]})}function Av(e){const[t,r]=H.useState(null);return H.useEffect(()=>{let s=!0;return fetch(`/api/specs/${e}/history`).then(i=>i.json()).then(i=>{s&&r(i)}).catch(()=>s&&r([])),()=>{s=!1}},[e]),t}const Gl=new Map;function _2(e,t,r){const s=`${e}/${t}`,[i,o]=H.useState(()=>Gl.get(s)??null);return H.useEffect(()=>{const c=Gl.get(s);if(c){o(c);return}let n=!0;return fetch(`/api/specs/${e}/diff/${t}`).then(a=>a.json()).then(a=>{Gl.set(s,a),n&&o(a)}).catch(()=>n&&o({patch:""})),()=>{n=!1}},[e,t,r,s]),i}function m2(e){const t=[];let r=!1;for(const s of e.split(`
|
|
68
|
-
`)){if(s.startsWith("@@")){r=!0,t.push({t:"hunk",s});continue}!r||s.startsWith("\\")||(s.startsWith("+")?t.push({t:"add",s:s.slice(1)}):s.startsWith("-")?t.push({t:"del",s:s.slice(1)}):t.push({t:"ctx",s:s.slice(1)}))}for(;t.length&&t[t.length-1].t==="ctx"&&t[t.length-1].s==="";)t.pop();return t}function Tv({diff:e}){const t=Me();if(e==null)return E.jsx("figcaption",{className:"ev-note",children:t("nodeView.loadingChange")});const r=e.patch?m2(e.patch):[];return r.length?E.jsxs(E.Fragment,{children:[E.jsx("figcaption",{className:"ev-difflabel",children:t("nodeView.diffLabel")}),E.jsx("pre",{className:"ev-diff",children:r.map((s,i)=>E.jsx("div",{className:`dl dl-${s.t}`,children:s.s||" "},i))})]}):E.jsx("figcaption",{className:"ev-note",children:t("nodeView.noChange")})}function Pv({items:e,itemKey:t,classes:r,rowClass:s,renderHeader:i,renderEvidence:o,leading:c}){const n=H.useRef(null),[a,p]=H.useState(()=>new Set([0])),_=H.useCallback(g=>p(v=>{const w=new Set(v);return w.has(g)?w.delete(g):w.add(g),w}),[]),l=H.useCallback(()=>p(g=>{const v=n.current;if(!v)return g;let w=-1;for(;g.has(w+1);)w++;if(w<0||w>=e.length-1)return g;const m=v.querySelector(`[data-i="${w}"]`);return!m||m.getBoundingClientRect().bottom-v.getBoundingClientRect().top>v.clientHeight+40?g:new Set(g).add(w+1)}),[e]);return H.useEffect(()=>{const g=n.current;if(!g)return;let v=g.scrollTop;const w=()=>{const h=g.scrollTop,f=h>v;v=h,f&&l()},m=h=>{h.key!=="j"&&h.key!=="ArrowDown"||g.scrollHeight-g.clientHeight-g.scrollTop>1||l()};return g.addEventListener("scroll",w,{passive:!0}),window.addEventListener("keydown",m,!0),()=>{g.removeEventListener("scroll",w),window.removeEventListener("keydown",m,!0)}},[l]),E.jsxs("div",{className:r.pane,ref:n,children:[c,e.map((g,v)=>{const w=a.has(v),m=s?s(g,v):"";return E.jsxs("div",{"data-i":v,className:`${r.row}${m?` ${m}`:""}${w?" open":""}`,children:[E.jsx("button",{className:r.head,onClick:()=>_(v),"aria-expanded":w,children:i(g,v,w)}),w&&E.jsx("figure",{className:r.evidence,children:o(g,v)})]},t(g,v))})]})}function v2({node:e,r:t,latest:r}){const s=_2(e.id,t.hash,!0);return E.jsx(Tv,{diff:s})}function Nv({node:e,rows:t}){const r=Me();return t?t.length?E.jsx(Pv,{items:t,itemKey:s=>s.hash,classes:{pane:"pane-hist",row:"ver-row",head:"rec-toggle",evidence:"rec-evidence"},rowClass:(s,i)=>i===0?"latest":"",renderHeader:(s,i,o)=>E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"rec-head",children:[E.jsx("span",{className:"rec-caret",children:o?"▾":"▸"}),E.jsxs("span",{className:"rec-v",children:["v",t.length-i]}),E.jsx("code",{className:"rec-hash",children:s.hash.slice(0,7)}),E.jsx("span",{className:"rec-date",children:(s.date||"").slice(0,10)}),E.jsxs("span",{className:"rec-diff",children:[E.jsxs("b",{className:"rec-add",children:["+",s.additions??0]}),E.jsxs("b",{className:"rec-del",children:["−",s.deletions??0]})]})]}),E.jsx("div",{className:"rec-msg",children:s.reason}),E.jsxs("div",{className:"rec-sub",children:[r("nodeView.filesChanged",{n:s.files??0})," · ",s.session||r("common.idle")]})]}),renderEvidence:(s,i)=>E.jsx(v2,{node:e,r:s,latest:i===0})}):E.jsx("div",{className:"pane-hist empty",children:r("common.noVersions")}):E.jsx("div",{className:"pane-hist empty",children:r("nodeView.loadingHistory")})}function Qf({i:e}){return E.jsxs("a",{className:"issue-card",href:e.url,target:"_blank",rel:"noreferrer",children:[E.jsxs("span",{className:"issue-card-top",children:[E.jsxs("span",{className:"issue-num",children:["#",e.number]}),E.jsx("span",{className:`issue-state st-${(e.state||"").toLowerCase()}`,children:e.state})]}),E.jsx("span",{className:"issue-card-title",children:e.title})]})}function Iv({node:e}){const t=Me(),r=e.issues||[];if(!r.length)return E.jsx("div",{className:"pane-issues empty",children:t("nodeView.noIssues")});const s=r.filter(o=>(o.state||"").toLowerCase()==="open"),i=r.filter(o=>(o.state||"").toLowerCase()!=="open");return E.jsxs("div",{className:"pane-issues",children:[s.length>0&&E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"issue-group-head",children:t("nodeView.openIssues",{n:s.length})}),s.map(o=>E.jsx(Qf,{i:o},o.number))]}),i.length>0&&E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"issue-group-head closed",children:t("nodeView.closedIssues",{n:i.length})}),i.map(o=>E.jsx(Qf,{i:o},o.number))]})]})}const ql=new Map;function y2(e,t,r){const s=`${e} ${t}`,[i,o]=H.useState(()=>ql.get(s)??null);return H.useEffect(()=>{if(!e||!t)return;const c=ql.get(s);c&&o(c);let n=!0;return fetch(`/api/edit?source=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`).then(a=>a.json()).then(a=>{ql.set(s,a),n&&o(a)}).catch(()=>n&&o(a=>a??{patch:""})),()=>{n=!1}},[e,t,r,s]),i}function w2({node:e,ov:t}){const r=Me(),s=y2(t.source,e.path,!0);return E.jsxs("figure",{className:"edit-rev",children:[E.jsxs("figcaption",{className:"edit-by",children:[E.jsx("span",{className:`ov-mark ov-${t.op}`,children:f2[t.op]||"•"}),E.jsx("span",{className:"edit-by-label",children:t.label}),E.jsx("span",{className:"edit-state",children:t.committed?r("nodeView.editCommitted"):r("nodeView.editDirty")})]}),E.jsx(Tv,{diff:s})]})}function Bv({node:e}){const t=Me(),r=e.overlays||[];return r.length?E.jsx("div",{className:"pane-edit",children:r.map((s,i)=>E.jsx(w2,{node:e,ov:s},i))}):E.jsx("div",{className:"pane-edit empty",children:t("nodeView.noEdit")})}function S2({verdict:e}){const t=Me();return e?e.status==="pass"?E.jsx("span",{className:"eval-verdict pass",children:t("nodeView.eval.pass")}):e.status==="fail"?E.jsx("span",{className:"eval-verdict fail",children:t("nodeView.eval.fail")}):E.jsx("span",{className:"eval-verdict note",title:e.note,children:t("nodeView.eval.note")}):E.jsx("span",{className:"eval-verdict legacy",children:t("nodeView.eval.legacy")})}function x2({hash:e}){const t=Me(),[r,s]=H.useState(null);return H.useEffect(()=>{let i=!0;return fetch(`/api/yatsu/blob/${e}`).then(o=>o.ok?o.text():Promise.reject(new Error("miss"))).then(o=>{i&&s(o)}).catch(()=>{i&&s("")}),()=>{i=!1}},[e]),r===null?E.jsx("pre",{className:"eval-transcript loading",children:t("nodeView.eval.loadingTranscript")}):E.jsx("pre",{className:"eval-transcript",children:r})}function C2({r:e}){var r;const t=Me();return E.jsxs(E.Fragment,{children:[e.expected&&E.jsxs("div",{className:"eval-expected",children:[E.jsx("span",{className:"eval-expected-label",children:t("nodeView.eval.expected")})," ",e.expected]}),((r=e.verdict)==null?void 0:r.status)==="note"&&e.verdict.note&&E.jsxs("div",{className:"eval-note",children:[E.jsx("span",{className:"eval-expected-label",children:t("nodeView.eval.noteLabel")})," ",e.verdict.note]}),e.blobState==="present"?e.blobKind==="transcript"?E.jsx(x2,{hash:e.blob}):E.jsx("img",{src:`/api/yatsu/blob/${e.blob}`,alt:t("nodeView.eval.shotAlt",{scenario:e.scenario}),loading:"lazy"}):E.jsx("figcaption",{className:"eval-noimg",children:e.blobState==="miss"?t("nodeView.eval.miss"):t("nodeView.eval.noImage")})]})}function Zf({s:e}){var r;const t=Me();return E.jsxs("div",{className:"eval-row eval-declared-row",children:[E.jsxs("span",{className:"eval-top",children:[E.jsx(bh,{state:"empty",title:t("score.missing")}),E.jsx("span",{className:"eval-scenario",children:e.name}),((r=e.code)==null?void 0:r.length)>0&&E.jsx("code",{className:"eval-tracks",children:e.code.join(", ")})]}),e.expected&&E.jsxs("div",{className:"eval-expected",children:[E.jsx("span",{className:"eval-expected-label",children:t("nodeView.eval.expected")})," ",e.expected]})]})}function b2({node:e}){const t=Me(),r=e.evals;if(!r)return E.jsx("div",{className:"pane-eval empty",children:t("nodeView.eval.noScenarios")});const s=Fn(e.scenarios,r).filter(i=>!i.reading);return r.length?E.jsx(Pv,{items:r,leading:s.map(i=>E.jsx(Zf,{s:i},i.name)),itemKey:(i,o)=>`${i.scenario}-${i.ts}-${o}`,classes:{pane:"pane-eval",row:"eval-row",head:"eval-head",evidence:"eval-shot"},renderHeader:(i,o,c)=>E.jsxs(E.Fragment,{children:[E.jsxs("span",{className:"eval-top",children:[E.jsx("span",{className:"eval-caret",children:c?"▾":"▸"}),E.jsx("span",{className:"eval-scenario",children:i.scenario}),E.jsx(S2,{verdict:i.verdict}),E.jsx(bh,{state:Lv(i),title:i.fresh?void 0:t("nodeView.eval.staleAxes",{axes:i.staleAxes.join(", ")})})]}),E.jsxs("span",{className:"eval-meta",children:[E.jsx("span",{className:"eval-evaluator",children:i.evaluator}),E.jsx("code",{className:"eval-sha",children:i.codeSha.slice(0,7)}),E.jsx("span",{className:"eval-ts",children:i.ts.replace("T"," ").slice(0,16)})]})]}),renderEvidence:i=>E.jsx(C2,{r:i})}):E.jsxs("div",{className:"pane-eval pane-eval-declared",children:[E.jsx("div",{className:"eval-todo-note",children:t("nodeView.eval.noReadings")}),s.map(i=>E.jsx(Zf,{s:i},i.name))]})}const E2={spec:"nodeView.paneSpec",history:"nodeView.paneHistory",issues:"nodeView.paneIssues",eval:"nodeView.paneEval",edit:"nodeView.paneEdit"};function k2({node:e,pane:t,setPane:r,onClose:s}){const i=Me(),o=Av(e.id),c=e.issues||[],n=c.filter(g=>(g.state||"").toLowerCase()==="open").length,a=c.length-n,p=(e.overlays||[]).length,_=Eh(e),l=_.some(g=>g.key===t)?t:_[0].key;return E.jsx("div",{className:"ov-backdrop",onMouseDown:s,children:E.jsxs("div",{className:"ov-panel",onMouseDown:g=>g.stopPropagation(),children:[E.jsxs("div",{className:"ov-head",children:[E.jsx("span",{className:"ov-title",children:e.title}),E.jsx("div",{className:"ov-tabs",children:_.map((g,v)=>E.jsxs("button",{className:g.key===l?"ov-tab on":"ov-tab",onClick:()=>r(g.key),children:[E.jsx("kbd",{children:v+1})," ",i(E2[g.key]),g.key==="issues"&&(n>0||a>0)&&E.jsxs("span",{className:"ov-tab-counts",children:[n>0&&E.jsx("span",{className:"ovc st-open",title:i("nodeView.openIssues",{n}),children:n}),a>0&&E.jsx("span",{className:"ovc st-closed",title:i("nodeView.closedIssues",{n:a}),children:a})]}),g.key==="edit"&&p>0&&E.jsx("span",{className:"ov-tab-counts",children:E.jsx("span",{className:"ovc st-edit",title:i("nodeView.pendingEdits",{n:p}),children:p})})]},g.key))}),E.jsx("span",{className:"ov-hint",children:i("nodeView.hint")})]}),E.jsxs("div",{className:"ov-body",children:[l==="spec"&&E.jsx("div",{className:"pane-solo",children:E.jsx(Dv,{node:e})}),l==="history"&&E.jsx(Nv,{node:e,rows:o}),l==="issues"&&E.jsx(Iv,{node:e}),l==="eval"&&E.jsx(b2,{node:e}),l==="edit"&&E.jsx(Bv,{node:e})]})]})})}const L2={pass:"✓",fail:"✗",stalePass:"✓",staleFail:"✗",empty:"○",missing:"·"};function M2({s:e,t,onOpenEval:r}){var s;return E.jsxs("button",{type:"button",className:`fp-scenario ${e.state}`,onClick:r,title:t("focusPanel.openEval"),children:[E.jsx("span",{className:"fp-sc-mark",title:t(`score.${e.state}`),children:L2[e.state]}),E.jsxs("span",{className:"fp-sc-body",children:[E.jsx("span",{className:"fp-sc-name",children:e.name}),e.expected&&E.jsx("span",{className:"fp-sc-expected",children:e.expected}),((s=e.code)==null?void 0:s.length)>0&&E.jsx("span",{className:"fp-sc-code",children:t("focusPanel.tracks",{files:e.code.join(", ")})})]})]})}function Jf({i:e}){return E.jsxs("a",{className:"issue-card",href:e.url,target:"_blank",rel:"noreferrer",children:[E.jsxs("span",{className:"issue-card-top",children:[E.jsxs("span",{className:"issue-num",children:["#",e.number]}),E.jsx("span",{className:`issue-state st-${(e.state||"").toLowerCase()}`,children:e.state})]}),E.jsx("span",{className:"issue-card-title",children:e.title})]})}function R2({node:e,onOpenEval:t}){const r=Me(),s=Fn(e==null?void 0:e.scenarios,e==null?void 0:e.evals),i=s.filter(a=>a.state==="pass").length,o=(e==null?void 0:e.issues)||[],c=o.filter(a=>(a.state||"").toLowerCase()==="open"),n=o.filter(a=>(a.state||"").toLowerCase()!=="open");return E.jsxs("aside",{className:"focus-panel",children:[E.jsxs("div",{className:"fp-head",children:[E.jsx("span",{className:"fp-eyebrow",children:r("focusPanel.focus")}),E.jsx("span",{className:"fp-title",children:e?e.title:r("focusPanel.noFocus")}),(e==null?void 0:e.desc)&&E.jsx("span",{className:"fp-desc",title:e.desc,children:e.desc})]}),E.jsxs("section",{className:"fp-sec",children:[E.jsxs("div",{className:"fp-sec-head",children:[E.jsx("span",{children:r("focusPanel.scenarios")}),s.length>0&&E.jsxs("span",{className:`fp-count ${Mv(s)}`,children:["✓",i,"/",s.length]})]}),s.length?s.map(a=>E.jsx(M2,{s:a,t:r,onOpenEval:t},a.name)):E.jsx("div",{className:"fp-empty",children:r("focusPanel.noScenarios")})]}),E.jsxs("section",{className:"fp-sec",children:[E.jsxs("div",{className:"fp-sec-head",children:[E.jsx("span",{children:r("focusPanel.issues")}),o.length>0&&E.jsxs("span",{className:"fp-issue-counts",children:[c.length>0&&E.jsx("span",{className:"issue-state st-open",children:r("focusPanel.open",{n:c.length})}),n.length>0&&E.jsx("span",{className:"issue-state st-closed",children:r("focusPanel.closed",{n:n.length})})]})]}),o.length?E.jsxs(E.Fragment,{children:[c.map(a=>E.jsx(Jf,{i:a},a.number)),n.length>0&&E.jsx("div",{className:"issue-group-head closed",children:r("focusPanel.closed",{n:n.length})}),n.map(a=>E.jsx(Jf,{i:a},a.number))]}):E.jsx("div",{className:"fp-empty",children:r("focusPanel.noIssues")})]})]})}const ir={working:"var(--green)",parked:"var(--green)",asking:"var(--yellow)",review:"var(--yellow)",done:"var(--yellow)",error:"var(--red)",idle:"var(--muted)",starting:"var(--muted)",queued:"var(--muted)","close-pending":"var(--muted)",offline:"var(--muted)"},Ls=e=>(e==null?void 0:e.name)||(e==null?void 0:e.node)||(e==null?void 0:e.title)||(e==null?void 0:e.branch)||(e==null?void 0:e.id),En=e=>(e==null?void 0:e.name)||(e==null?void 0:e.activity)||(e==null?void 0:e.promptPreview)||(e==null?void 0:e.node)||(e==null?void 0:e.title)||(e==null?void 0:e.branch)||(e==null?void 0:e.id),Ov=({size:e=12})=>E.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[E.jsx("rect",{x:"3.5",y:"7",width:"9",height:"6.5",rx:"1.2"}),E.jsx("path",{d:"M5.5 7 V5 a2.5 2.5 0 0 1 5 0 V7"})]});function D2(e){if(!e.length)return null;const t={};return e.forEach(r=>{t[r.op]=(t[r.op]||0)+1}),Object.entries(t).map(([r,s])=>`${Ja[r]}${s}`).join(" ")}function kh({s:e,locked:t,handle:r}){const s=Me(),i=D2(e.ops),o=En(e);return E.jsxs(E.Fragment,{children:[E.jsx(wi,{seed:e.id,status:e.status,title:`${Ls(e)} · ${s(`status.${e.status}`)} — ${e.id.slice(0,8)}`}),E.jsx("span",{className:"sess-id",title:o,children:o}),t&&E.jsx("span",{className:"sess-lock",title:s("sessionWindow.lockedTitle"),children:E.jsx(Ov,{})}),E.jsxs("span",{className:"sess-meta",children:[E.jsx("span",{className:"sess-status",style:{color:ir[e.status]},children:s(`status.${e.status}`)}),i&&E.jsx("span",{className:"sess-ops",children:i}),r]})]})}function A2({sessions:e,activeId:t,onPick:r,onOpenSession:s}){const i=Me();return E.jsx("div",{className:"sesswin",children:e.length===0?E.jsxs("div",{className:"sesswin-empty",children:[i("sessionWindow.emptyBefore"),E.jsx("kbd",{children:"⏎"}),i("sessionWindow.emptyAfter")]}):e.map(o=>{const c=o.source===t;return E.jsx("button",{className:c?"sess-row locked":"sess-row",style:{"--ov":qr(o.id)},onClick:()=>r(o),onDoubleClick:()=>s(o.id),title:i("sessionWindow.rowTitle"),children:E.jsx(kh,{s:o,locked:c})},o.id)})})}var $v={exports:{}};(function(e,t){(function(r,s){e.exports=s()})(globalThis,()=>(()=>{var r={4567:function(c,n,a){var p=this&&this.__decorate||function(d,u,y,C){var S,b=arguments.length,x=b<3?u:C===null?C=Object.getOwnPropertyDescriptor(u,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(d,u,y,C);else for(var k=d.length-1;k>=0;k--)(S=d[k])&&(x=(b<3?S(x):b>3?S(u,y,x):S(u,y))||x);return b>3&&x&&Object.defineProperty(u,y,x),x},_=this&&this.__param||function(d,u){return function(y,C){u(y,C,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const l=a(9042),g=a(9924),v=a(844),w=a(4725),m=a(2585),h=a(3656);let f=n.AccessibilityManager=class extends v.Disposable{constructor(d,u,y,C){super(),this._terminal=d,this._coreBrowserService=y,this._renderService=C,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,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 g.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(S=>this._handleResize(S.rows))),this.register(this._terminal.onRender(S=>this._refreshRows(S.start,S.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(S=>this._handleChar(S))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
69
|
-
`))),this.register(this._terminal.onA11yTab(S=>this._handleTab(S))),this.register(this._terminal.onKey(S=>this._handleKey(S.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,h.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,v.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let u=0;u<d;u++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
|
70
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,u){this._liveRegionDebouncer.refresh(d,u,this._terminal.rows)}_renderRows(d,u){const y=this._terminal.buffer,C=y.lines.length.toString();for(let S=d;S<=u;S++){const b=y.lines.get(y.ydisp+S),x=[],k=(b==null?void 0:b.translateToString(!0,void 0,void 0,x))||"",M=(y.ydisp+S+1).toString(),D=this._rowElements[S];D&&(k.length===0?(D.innerText=" ",this._rowColumns.set(D,[0,1])):(D.textContent=k,this._rowColumns.set(D,x)),D.setAttribute("aria-posinset",M),D.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,u){const y=d.target,C=this._rowElements[u===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(u===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==C)return;let S,b;if(u===0?(S=y,b=this._rowElements.pop(),this._rowContainer.removeChild(b)):(S=this._rowElements.shift(),b=y,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),b.removeEventListener("focus",this._bottomBoundaryFocusListener),u===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(u===0?-1:1),this._rowElements[u===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var k;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let u={node:d.anchorNode,offset:d.anchorOffset},y={node:d.focusNode,offset:d.focusOffset};if((u.node.compareDocumentPosition(y.node)&Node.DOCUMENT_POSITION_PRECEDING||u.node===y.node&&u.offset>y.offset)&&([u,y]=[y,u]),u.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(u={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(u.node))return;const C=this._rowElements.slice(-1)[0];if(y.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(y={node:C,offset:((k=C.textContent)==null?void 0:k.length)??0}),!this._rowContainer.contains(y.node))return;const S=({node:M,offset:D})=>{const R=M instanceof Text?M.parentNode:M;let T=parseInt(R==null?void 0:R.getAttribute("aria-posinset"),10)-1;if(isNaN(T))return console.warn("row is invalid. Race condition?"),null;const A=this._rowColumns.get(R);if(!A)return console.warn("columns is null. Race condition?"),null;let j=D<A.length?A[D]:A.slice(-1)[0]+1;return j>=this._terminal.cols&&(++T,j=0),{row:T,column:j}},b=S(u),x=S(y);if(b&&x){if(b.row>x.row||b.row===x.row&&b.column>=x.column)throw new Error("invalid range");this._terminal.select(b.column,b.row,(x.row-b.row)*this._terminal.cols-b.column+x.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let u=this._rowContainer.children.length;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_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 d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=f=p([_(1,m.IInstantiationService),_(2,w.ICoreBrowserService),_(3,w.IRenderService)],f)},3614:(c,n)=>{function a(g){return g.replace(/\r?\n/g,"\r")}function p(g,v){return v?"\x1B[200~"+g+"\x1B[201~":g}function _(g,v,w,m){g=p(g=a(g),w.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(g,!0),v.value=""}function l(g,v,w){const m=w.getBoundingClientRect(),h=g.clientX-m.left-10,f=g.clientY-m.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${h}px`,v.style.top=`${f}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=a,n.bracketTextForPaste=p,n.copyHandler=function(g,v){g.clipboardData&&g.clipboardData.setData("text/plain",v.selectionText),g.preventDefault()},n.handlePasteEvent=function(g,v,w,m){g.stopPropagation(),g.clipboardData&&_(g.clipboardData.getData("text/plain"),v,w,m)},n.paste=_,n.moveTextAreaUnderMouseCursor=l,n.rightClickHandler=function(g,v,w,m,h){l(g,v,w),h&&m.rightClickSelect(g),v.value=m.selectionText,v.select()}},7239:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const p=a(1505);n.ColorContrastCache=class{constructor(){this._color=new p.TwoKeyMap,this._css=new p.TwoKeyMap}setCss(_,l,g){this._css.set(_,l,g)}getCss(_,l){return this._css.get(_,l)}setColor(_,l,g){this._color.set(_,l,g)}getColor(_,l){return this._color.get(_,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(a,p,_,l){a.addEventListener(p,_,l);let g=!1;return{dispose:()=>{g||(g=!0,a.removeEventListener(p,_,l))}}}},3551:function(c,n,a){var p=this&&this.__decorate||function(f,d,u,y){var C,S=arguments.length,b=S<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,u):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(f,d,u,y);else for(var x=f.length-1;x>=0;x--)(C=f[x])&&(b=(S<3?C(b):S>3?C(d,u,b):C(d,u))||b);return S>3&&b&&Object.defineProperty(d,u,b),b},_=this&&this.__param||function(f,d){return function(u,y){d(u,y,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const l=a(3656),g=a(8460),v=a(844),w=a(2585),m=a(4725);let h=n.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(f,d,u,y,C){super(),this._element=f,this._mouseService=d,this._renderService=u,this._bufferService=y,this._linkProviderService=C,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)(()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(f){this._lastMouseEvent=f;const d=this._positionFromMouseEvent(f,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const u=f.composedPath();for(let y=0;y<u.length;y++){const C=u[y];if(C.classList.contains("xterm"))break;if(C.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(f){if(this._activeLine!==f.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(f,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,f)||(this._clearCurrentLink(),this._askForLink(f,!0))}_askForLink(f,d){var y,C;this._activeProviderReplies&&d||((y=this._activeProviderReplies)==null||y.forEach(S=>{S==null||S.forEach(b=>{b.link.dispose&&b.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=f.y);let u=!1;for(const[S,b]of this._linkProviderService.linkProviders.entries())d?(C=this._activeProviderReplies)!=null&&C.get(S)&&(u=this._checkLinkProviderResult(S,f,u)):b.provideLinks(f.y,x=>{var M,D;if(this._isMouseOut)return;const k=x==null?void 0:x.map(R=>({link:R}));(M=this._activeProviderReplies)==null||M.set(S,k),u=this._checkLinkProviderResult(S,f,u),((D=this._activeProviderReplies)==null?void 0:D.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(f.y,this._activeProviderReplies)})}_removeIntersectingLinks(f,d){const u=new Set;for(let y=0;y<d.size;y++){const C=d.get(y);if(C)for(let S=0;S<C.length;S++){const b=C[S],x=b.link.range.start.y<f?0:b.link.range.start.x,k=b.link.range.end.y>f?this._bufferService.cols:b.link.range.end.x;for(let M=x;M<=k;M++){if(u.has(M)){C.splice(S--,1);break}u.add(M)}}}}_checkLinkProviderResult(f,d,u){var S;if(!this._activeProviderReplies)return u;const y=this._activeProviderReplies.get(f);let C=!1;for(let b=0;b<f;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(C=!0);if(!C&&y){const b=y.find(x=>this._linkAtPosition(x.link,d));b&&(u=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!u)for(let b=0;b<this._activeProviderReplies.size;b++){const x=(S=this._activeProviderReplies.get(b))==null?void 0:S.find(k=>this._linkAtPosition(k.link,d));if(x){u=!0,this._handleNewLink(x);break}}return u}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(f){if(!this._currentLink)return;const d=this._positionFromMouseEvent(f,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(f,this._currentLink.link.text)}_clearCurrentLink(f,d){this._currentLink&&this._lastMouseEvent&&(!f||!d||this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(f){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(f.link,d)&&(this._currentLink=f,this._currentLink.state={decorations:{underline:f.link.decorations===void 0||f.link.decorations.underline,pointerCursor:f.link.decorations===void 0||f.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,f.link,this._lastMouseEvent),f.link.decorations={},Object.defineProperties(f.link.decorations,{pointerCursor:{get:()=>{var u,y;return(y=(u=this._currentLink)==null?void 0:u.state)==null?void 0:y.decorations.pointerCursor},set:u=>{var y;(y=this._currentLink)!=null&&y.state&&this._currentLink.state.decorations.pointerCursor!==u&&(this._currentLink.state.decorations.pointerCursor=u,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",u))}},underline:{get:()=>{var u,y;return(y=(u=this._currentLink)==null?void 0:u.state)==null?void 0:y.decorations.underline},set:u=>{var y,C,S;(y=this._currentLink)!=null&&y.state&&((S=(C=this._currentLink)==null?void 0:C.state)==null?void 0:S.decorations.underline)!==u&&(this._currentLink.state.decorations.underline=u,this._currentLink.state.isHovered&&this._fireUnderlineEvent(f.link,u))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(u=>{if(!this._currentLink)return;const y=u.start===0?0:u.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+u.end;if(this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=C&&(this._clearCurrentLink(y,C),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}})))}_linkHover(f,d,u){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&f.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(u,d.text)}_fireUnderlineEvent(f,d){const u=f.range,y=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(u.start.x-1,u.start.y-y-1,u.end.x,u.end.y-y-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(f,d,u){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&f.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(u,d.text)}_linkAtPosition(f,d){const u=f.range.start.y*this._bufferService.cols+f.range.start.x,y=f.range.end.y*this._bufferService.cols+f.range.end.x,C=d.y*this._bufferService.cols+d.x;return u<=C&&C<=y}_positionFromMouseEvent(f,d,u){const y=u.getCoords(f,d,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(f,d,u,y,C){return{x1:f,y1:d,x2:u,y2:y,cols:this._bufferService.cols,fg:C}}};n.Linkifier=h=p([_(1,m.IMouseService),_(2,m.IRenderService),_(3,w.IBufferService),_(4,m.ILinkProviderService)],h)},9042:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(c,n,a){var p=this&&this.__decorate||function(m,h,f,d){var u,y=arguments.length,C=y<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,h,f,d);else for(var S=m.length-1;S>=0;S--)(u=m[S])&&(C=(y<3?u(C):y>3?u(h,f,C):u(h,f))||C);return y>3&&C&&Object.defineProperty(h,f,C),C},_=this&&this.__param||function(m,h){return function(f,d){h(f,d,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const l=a(511),g=a(2585);let v=n.OscLinkProvider=class{constructor(m,h,f){this._bufferService=m,this._optionsService=h,this._oscLinkService=f}provideLinks(m,h){var k;const f=this._bufferService.buffer.lines.get(m-1);if(!f)return void h(void 0);const d=[],u=this._optionsService.rawOptions.linkHandler,y=new l.CellData,C=f.getTrimmedLength();let S=-1,b=-1,x=!1;for(let M=0;M<C;M++)if(b!==-1||f.hasContent(M)){if(f.loadCell(M,y),y.hasExtendedAttrs()&&y.extended.urlId){if(b===-1){b=M,S=y.extended.urlId;continue}x=y.extended.urlId!==S}else b!==-1&&(x=!0);if(x||b!==-1&&M===C-1){const D=(k=this._oscLinkService.getLinkData(S))==null?void 0:k.uri;if(D){const R={start:{x:b+1,y:m},end:{x:M+(x||M!==C-1?0:1),y:m}};let T=!1;if(!(u!=null&&u.allowNonHttpProtocols))try{const A=new URL(D);["http:","https:"].includes(A.protocol)||(T=!0)}catch{T=!0}T||d.push({text:D,range:R,activate:(A,j)=>u?u.activate(A,j,R):w(0,j),hover:(A,j)=>{var $;return($=u==null?void 0:u.hover)==null?void 0:$.call(u,A,j,R)},leave:(A,j)=>{var $;return($=u==null?void 0:u.leave)==null?void 0:$.call(u,A,j,R)}})}x=!1,y.hasExtendedAttrs()&&y.extended.urlId?(b=M,S=y.extended.urlId):(b=-1,S=-1)}}h(d)}};function w(m,h){if(confirm(`Do you want to navigate to ${h}?
|
|
71
|
-
|
|
72
|
-
WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=v=p([_(0,g.IBufferService),_(1,g.IOptionsService),_(2,g.IOscLinkService)],v)},6193:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(a,p){this._renderCallback=a,this._coreBrowserService=p,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,p,_){this._rowCount=_,a=a!==void 0?a:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,p),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const p=a(3614),_=a(3656),l=a(3551),g=a(9042),v=a(3730),w=a(1680),m=a(3107),h=a(5744),f=a(2950),d=a(1296),u=a(428),y=a(4269),C=a(5114),S=a(8934),b=a(3230),x=a(9312),k=a(4725),M=a(6731),D=a(8055),R=a(8969),T=a(8460),A=a(844),j=a(6114),$=a(8437),F=a(2584),B=a(7399),L=a(5941),P=a(9074),O=a(2585),I=a(5435),W=a(4567),K=a(779);class q extends R.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(z={}){super(z),this.browser=j,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new A.MutableDisposable),this._onCursorMove=this.register(new T.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new T.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new T.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new T.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new T.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new T.EventEmitter),this._onBlur=this.register(new T.EventEmitter),this._onA11yCharEmitter=this.register(new T.EventEmitter),this._onA11yTabEmitter=this.register(new T.EventEmitter),this._onWillOpen=this.register(new T.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(P.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(K.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((N,U)=>this.refresh(N,U))),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,T.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,T.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(N=>this._afterResize(N.cols,N.rows))),this.register((0,A.toDisposable)(()=>{var N,U;this._customKeyEventHandler=void 0,(U=(N=this.element)==null?void 0:N.parentNode)==null||U.removeChild(this.element)}))}_handleColorEvent(z){if(this._themeService)for(const N of z){let U,G="";switch(N.index){case 256:U="foreground",G="10";break;case 257:U="background",G="11";break;case 258:U="cursor",G="12";break;default:U="ansi",G="4;"+N.index}switch(N.type){case 0:const Q=D.color.toColorRGB(U==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[U]);this.coreService.triggerDataEvent(`${F.C0.ESC}]${G};${(0,L.toRgbString)(Q)}${F.C1_ESCAPED.ST}`);break;case 1:if(U==="ansi")this._themeService.modifyColors(Y=>Y.ansi[N.index]=D.channels.toColor(...N.color));else{const Y=U;this._themeService.modifyColors(ee=>ee[Y]=D.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(z){z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(F.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var z;return(z=this.textarea)==null?void 0:z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(F.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 z=this.buffer.ybase+this.buffer.y,N=this.buffer.lines.get(z);if(!N)return;const U=Math.min(this.buffer.x,this.cols-1),G=this._renderService.dimensions.css.cell.height,Q=N.getWidth(U),Y=this._renderService.dimensions.css.cell.width*Q,ee=this.buffer.y*this._renderService.dimensions.css.cell.height,te=U*this._renderService.dimensions.css.cell.width;this.textarea.style.left=te+"px",this.textarea.style.top=ee+"px",this.textarea.style.width=Y+"px",this.textarea.style.height=G+"px",this.textarea.style.lineHeight=G+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",N=>{this.hasSelection()&&(0,p.copyHandler)(N,this._selectionService)}));const z=N=>(0,p.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",z)),this.register((0,_.addDisposableDomListener)(this.element,"paste",z)),j.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",N=>{N.button===2&&(0,p.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",N=>{(0,p.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),j.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",N=>{N.button===1&&(0,p.moveTextAreaUnderMouseCursor)(N,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",z=>this._keyUp(z),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",z=>this._keyDown(z),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",z=>this._keyPress(z),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",z=>this._compositionHelper.compositionupdate(z))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",z=>this._inputEvent(z),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(z){var U;if(!z)throw new Error("Terminal requires a parent element.");if(z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((U=this.element)==null?void 0:U.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=z.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"),z.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",G=>this.updateCursorStyle(G))),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",g.promptLabel),j.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(C.CoreBrowserService,this.textarea,z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",G=>this._handleTextAreaFocus(G))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(u.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(M.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(y.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(G=>this._onRender.fire(G))),this.onResize(G=>this._renderService.resize(G.cols,G.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.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(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(G=>this.scrollLines(G.amount,G.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(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(G=>this.scrollLines(G.amount,G.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(G=>this._renderService.handleSelectionChanged(G.start,G.end,G.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(G=>{this.textarea.value=G,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(G=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",G=>this._selectionService.handleMouseDown(G))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",G=>this._handleScreenReaderModeOptionChange(G))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",G=>{!this._overviewRulerRenderer&&G&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const z=this,N=this.element;function U(Y){const ee=z._mouseService.getMouseReportCoords(Y,z.screenElement);if(!ee)return!1;let te,le;switch(Y.overrideType||Y.type){case"mousemove":le=32,Y.buttons===void 0?(te=3,Y.button!==void 0&&(te=Y.button<3?Y.button:3)):te=1&Y.buttons?0:4&Y.buttons?1:2&Y.buttons?2:3;break;case"mouseup":le=0,te=Y.button<3?Y.button:3;break;case"mousedown":le=1,te=Y.button<3?Y.button:3;break;case"wheel":if(z._customWheelEventHandler&&z._customWheelEventHandler(Y)===!1||z.viewport.getLinesScrolled(Y)===0)return!1;le=Y.deltaY<0?0:1,te=4;break;default:return!1}return!(le===void 0||te===void 0||te>4)&&z.coreMouseService.triggerMouseEvent({col:ee.col,row:ee.row,x:ee.x,y:ee.y,button:te,action:le,ctrl:Y.ctrlKey,alt:Y.altKey,shift:Y.shiftKey})}const G={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Q={mouseup:Y=>(U(Y),Y.buttons||(this._document.removeEventListener("mouseup",G.mouseup),G.mousedrag&&this._document.removeEventListener("mousemove",G.mousedrag)),this.cancel(Y)),wheel:Y=>(U(Y),this.cancel(Y,!0)),mousedrag:Y=>{Y.buttons&&U(Y)},mousemove:Y=>{Y.buttons||U(Y)}};this.register(this.coreMouseService.onProtocolChange(Y=>{Y?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Y)),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&Y?G.mousemove||(N.addEventListener("mousemove",Q.mousemove),G.mousemove=Q.mousemove):(N.removeEventListener("mousemove",G.mousemove),G.mousemove=null),16&Y?G.wheel||(N.addEventListener("wheel",Q.wheel,{passive:!1}),G.wheel=Q.wheel):(N.removeEventListener("wheel",G.wheel),G.wheel=null),2&Y?G.mouseup||(G.mouseup=Q.mouseup):(this._document.removeEventListener("mouseup",G.mouseup),G.mouseup=null),4&Y?G.mousedrag||(G.mousedrag=Q.mousedrag):(this._document.removeEventListener("mousemove",G.mousedrag),G.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(N,"mousedown",Y=>{if(Y.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Y))return U(Y),G.mouseup&&this._document.addEventListener("mouseup",G.mouseup),G.mousedrag&&this._document.addEventListener("mousemove",G.mousedrag),this.cancel(Y)})),this.register((0,_.addDisposableDomListener)(N,"wheel",Y=>{if(!G.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Y)===!1)return!1;if(!this.buffer.hasScrollback){const ee=this.viewport.getLinesScrolled(Y);if(ee===0)return;const te=F.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Y.deltaY<0?"A":"B");let le="";for(let pe=0;pe<Math.abs(ee);pe++)le+=te;return this.coreService.triggerDataEvent(le,!0),this.cancel(Y,!0)}return this.viewport.handleWheel(Y)?this.cancel(Y):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(N,"touchstart",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Y),this.cancel(Y)},{passive:!0})),this.register((0,_.addDisposableDomListener)(N,"touchmove",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Y)?void 0:this.cancel(Y)},{passive:!1}))}refresh(z,N){var U;(U=this._renderService)==null||U.refreshRows(z,N)}updateCursorStyle(z){var N;(N=this._selectionService)!=null&&N.shouldColumnSelect(z)?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(z,N,U=0){var G;U===1?(super.scrollLines(z,N,U),this.refresh(0,this.rows-1)):(G=this.viewport)==null||G.scrollLines(z)}paste(z){(0,p.paste)(z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(z){this._customKeyEventHandler=z}attachCustomWheelEventHandler(z){this._customWheelEventHandler=z}registerLinkProvider(z){return this._linkProviderService.registerLinkProvider(z)}registerCharacterJoiner(z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const N=this._characterJoinerService.register(z);return this.refresh(0,this.rows-1),N}deregisterCharacterJoiner(z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+z)}registerDecoration(z){return this._decorationService.registerDecoration(z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(z,N,U){this._selectionService.setSelection(z,N,U)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var z;(z=this._selectionService)==null||z.clearSelection()}selectAll(){var z;(z=this._selectionService)==null||z.selectAll()}selectLines(z,N){var U;(U=this._selectionService)==null||U.selectLines(z,N)}_keyDown(z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1)return!1;const N=this.browser.isMac&&this.options.macOptionIsMeta&&z.altKey;if(!N&&!this._compositionHelper.keydown(z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;N||z.key!=="Dead"&&z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const U=(0,B.evaluateKeyboardEvent)(z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(z),U.type===3||U.type===2){const G=this.rows-1;return this.scrollLines(U.type===2?-G:G),this.cancel(z,!0)}return U.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,z)||(U.cancel&&this.cancel(z,!0),!U.key||!!(z.key&&!z.ctrlKey&&!z.altKey&&!z.metaKey&&z.key.length===1&&z.key.charCodeAt(0)>=65&&z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(U.key!==F.C0.ETX&&U.key!==F.C0.CR||(this.textarea.value=""),this._onKey.fire({key:U.key,domEvent:z}),this._showCursor(),this.coreService.triggerDataEvent(U.key,!0),!this.optionsService.rawOptions.screenReaderMode||z.altKey||z.ctrlKey?this.cancel(z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(z,N){const U=z.isMac&&!this.options.macOptionIsMeta&&N.altKey&&!N.ctrlKey&&!N.metaKey||z.isWindows&&N.altKey&&N.ctrlKey&&!N.metaKey||z.isWindows&&N.getModifierState("AltGraph");return N.type==="keypress"?U:U&&(!N.keyCode||N.keyCode>47)}_keyUp(z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1||(function(N){return N.keyCode===16||N.keyCode===17||N.keyCode===18}(z)||this.focus(),this.updateCursorStyle(z),this._keyPressHandled=!1)}_keyPress(z){let N;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1)return!1;if(this.cancel(z),z.charCode)N=z.charCode;else if(z.which===null||z.which===void 0)N=z.keyCode;else{if(z.which===0||z.charCode===0)return!1;N=z.which}return!(!N||(z.altKey||z.ctrlKey||z.metaKey)&&!this._isThirdLevelShift(this.browser,z)||(N=String.fromCharCode(N),this._onKey.fire({key:N,domEvent:z}),this._showCursor(),this.coreService.triggerDataEvent(N,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(z){if(z.data&&z.inputType==="insertText"&&(!z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const N=z.data;return this.coreService.triggerDataEvent(N,!0),this.cancel(z),!0}return!1}resize(z,N){z!==this.cols||N!==this.rows?super.resize(z,N):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(z,N){var U,G;(U=this._charSizeService)==null||U.measure(),(G=this.viewport)==null||G.syncScrollArea(!0)}clear(){var z;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($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(z=this.viewport)==null||z.reset(),this.refresh(0,this.rows-1)}}reset(){var N,U;this.options.rows=this.rows,this.options.cols=this.cols;const z=this._customKeyEventHandler;this._setup(),super.reset(),(N=this._selectionService)==null||N.reset(),this._decorationService.reset(),(U=this.viewport)==null||U.reset(),this._customKeyEventHandler=z,this.refresh(0,this.rows-1)}clearTextureAtlas(){var z;(z=this._renderService)==null||z.clearTextureAtlas()}_reportFocus(){var z;(z=this.element)!=null&&z.classList.contains("focus")?this.coreService.triggerDataEvent(F.C0.ESC+"[I"):this.coreService.triggerDataEvent(F.C0.ESC+"[O")}_reportWindowsOptions(z){if(this._renderService)switch(z){case I.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),U=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${F.C0.ESC}[4;${U};${N}t`);break;case I.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const G=this._renderService.dimensions.css.cell.width.toFixed(0),Q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${F.C0.ESC}[6;${Q};${G}t`)}}cancel(z,N){if(this.options.cancelEvents||N)return z.preventDefault(),z.stopPropagation(),!1}}n.Terminal=q},9924:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(a,p=1e3){this._renderCallback=a,this._debounceThresholdMS=p,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,p,_){this._rowCount=_,a=a!==void 0?a:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=l-this._lastRefreshMs,v=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,p)}}},1680:function(c,n,a){var p=this&&this.__decorate||function(f,d,u,y){var C,S=arguments.length,b=S<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,u):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(f,d,u,y);else for(var x=f.length-1;x>=0;x--)(C=f[x])&&(b=(S<3?C(b):S>3?C(d,u,b):C(d,u))||b);return S>3&&b&&Object.defineProperty(d,u,b),b},_=this&&this.__param||function(f,d){return function(u,y){d(u,y,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const l=a(3656),g=a(4725),v=a(8460),w=a(844),m=a(2585);let h=n.Viewport=class extends w.Disposable{constructor(f,d,u,y,C,S,b,x){super(),this._viewportElement=f,this._scrollArea=d,this._bufferService=u,this._optionsService=y,this._charSizeService=C,this._renderService=S,this._coreBrowserService=b,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 v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(x.colors),this.register(x.onChangeColors(k=>this._handleThemeChange(k))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(f){this._viewportElement.style.backgroundColor=f.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(f){if(f)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 d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const f=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==f&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=f),this._refreshAnimationFrame=null}syncScrollArea(f=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(f);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(f)}_handleScroll(f){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 d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const f=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(f*(this._smoothScrollState.target-this._smoothScrollState.origin)),f<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(f,d){const u=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&u<this._lastRecordedBufferHeight)||(f.cancelable&&f.preventDefault(),!1)}handleWheel(f){const d=this._getPixelsScrolled(f);return d!==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+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}scrollLines(f){if(f!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=f*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!1})}_getPixelsScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(f,d){var x;let u,y="";const C=[],S=d??this._bufferService.buffer.lines.length,b=this._bufferService.buffer.lines;for(let k=f;k<S;k++){const M=b.get(k);if(!M)continue;const D=(x=b.get(k+1))==null?void 0:x.isWrapped;if(y+=M.translateToString(!D),!D||k===b.length-1){const R=document.createElement("div");R.textContent=y,C.push(R),y.length>0&&(u=R),y=""}}return{bufferElements:C,cursorElement:u}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(f,d){const u=this._optionsService.rawOptions.fastScrollModifier;return u==="alt"&&d.altKey||u==="ctrl"&&d.ctrlKey||u==="shift"&&d.shiftKey?f*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:f*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(f){this._lastTouchY=f.touches[0].pageY}handleTouchMove(f){const d=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}};n.Viewport=h=p([_(2,m.IBufferService),_(3,m.IOptionsService),_(4,g.ICharSizeService),_(5,g.IRenderService),_(6,g.ICoreBrowserService),_(7,g.IThemeService)],h)},3107:function(c,n,a){var p=this&&this.__decorate||function(m,h,f,d){var u,y=arguments.length,C=y<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,h,f,d);else for(var S=m.length-1;S>=0;S--)(u=m[S])&&(C=(y<3?u(C):y>3?u(h,f,C):u(h,f))||C);return y>3&&C&&Object.defineProperty(h,f,C),C},_=this&&this.__param||function(m,h){return function(f,d){h(f,d,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const l=a(4725),g=a(844),v=a(2585);let w=n.BufferDecorationRenderer=class extends g.Disposable{constructor(m,h,f,d,u){super(),this._screenElement=m,this._bufferService=h,this._coreBrowserService=f,this._decorationService=d,this._renderService=u,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(y=>this._removeDecoration(y))),this.register((0,g.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 m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var d;const h=this._coreBrowserService.mainDocument.createElement("div");h.classList.add("xterm-decoration"),h.classList.toggle("xterm-decoration-top-layer",((d=m==null?void 0:m.options)==null?void 0:d.layer)==="top"),h.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=m.options.x??0;return f&&f>this._bufferService.cols&&(h.style.display="none"),this._refreshXPosition(m,h),h}_refreshStyle(m){const h=m.marker.line-this._bufferService.buffers.active.ydisp;if(h<0||h>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let f=this._decorationElements.get(m);f||(f=this._createElement(m),m.element=f,this._decorationElements.set(m,f),this._container.appendChild(f),m.onDispose(()=>{this._decorationElements.delete(m),f.remove()})),f.style.top=h*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(f)}}_refreshXPosition(m,h=m.element){if(!h)return;const f=m.options.x??0;(m.options.anchor||"left")==="right"?h.style.right=f?f*this._renderService.dimensions.css.cell.width+"px":"":h.style.left=f?f*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var h;(h=this._decorationElements.get(m))==null||h.remove(),this._decorationElements.delete(m),m.dispose()}};n.BufferDecorationRenderer=w=p([_(1,v.IBufferService),_(2,l.ICoreBrowserService),_(3,v.IDecorationService),_(4,l.IRenderService)],w)},5871:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const p of this._zones)if(p.color===a.options.overviewRulerOptions.color&&p.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(p,a.marker.line))return;if(this._lineAdjacentToZone(p,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(p,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,p){return p>=a.startBufferLine&&p<=a.endBufferLine}_lineAdjacentToZone(a,p,_){return p>=a.startBufferLine-this._linePadding[_||"full"]&&p<=a.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(a,p){a.startBufferLine=Math.min(a.startBufferLine,p),a.endBufferLine=Math.max(a.endBufferLine,p)}}},5744:function(c,n,a){var p=this&&this.__decorate||function(u,y,C,S){var b,x=arguments.length,k=x<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,C):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(u,y,C,S);else for(var M=u.length-1;M>=0;M--)(b=u[M])&&(k=(x<3?b(k):x>3?b(y,C,k):b(y,C))||k);return x>3&&k&&Object.defineProperty(y,C,k),k},_=this&&this.__param||function(u,y){return function(C,S){y(C,S,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const l=a(5871),g=a(4725),v=a(844),w=a(2585),m={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let d=n.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(u,y,C,S,b,x,k){var D;super(),this._viewportElement=u,this._screenElement=y,this._bufferService=C,this._decorationService=S,this._renderService=b,this._optionsService=x,this._coreBrowserService=k,this._colorZoneStore=new l.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(D=this._viewportElement.parentElement)==null||D.insertBefore(this._canvas,this._viewportElement);const M=this._canvas.getContext("2d");if(!M)throw new Error("Ctx cannot be null");this._ctx=M,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)(()=>{var R;(R=this._canvas)==null||R.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 u=Math.floor(this._canvas.width/3),y=Math.ceil(this._canvas.width/3);h.full=this._canvas.width,h.left=u,h.center=y,h.right=u,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=h.left,f.right=h.left+h.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const u=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(u,12),6)*this._coreBrowserService.dpr);m.left=y,m.center=y,m.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.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 y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const u=this._colorZoneStore.zones;for(const y of u)y.position!=="full"&&this._renderColorZone(y);for(const y of u)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(u){this._ctx.fillStyle=u.color,this._ctx.fillRect(f[u.position||"full"],Math.round((this._canvas.height-1)*(u.startBufferLine/this._bufferService.buffers.active.lines.length)-m[u.position||"full"]/2),h[u.position||"full"],Math.round((this._canvas.height-1)*((u.endBufferLine-u.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[u.position||"full"]))}_queueRefresh(u,y){this._shouldUpdateDimensions=u||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};n.OverviewRulerRenderer=d=p([_(2,w.IBufferService),_(3,w.IDecorationService),_(4,g.IRenderService),_(5,w.IOptionsService),_(6,g.ICoreBrowserService)],d)},2950:function(c,n,a){var p=this&&this.__decorate||function(m,h,f,d){var u,y=arguments.length,C=y<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,h,f,d);else for(var S=m.length-1;S>=0;S--)(u=m[S])&&(C=(y<3?u(C):y>3?u(h,f,C):u(h,f))||C);return y>3&&C&&Object.defineProperty(h,f,C),C},_=this&&this.__param||function(m,h){return function(f,d){h(f,d,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const l=a(4725),g=a(2585),v=a(2584);let w=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,h,f,d,u,y){this._textarea=m,this._compositionView=h,this._bufferService=f,this._optionsService=d,this._coreService=u,this._renderService=y,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(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let f;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),f.length>0&&this._coreService.triggerDataEvent(f,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,f=h.replace(m,"");this._dataAlreadySent=f,h.length>m.length?this._coreService.triggerDataEvent(f,!0):h.length<m.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):h.length===m.length&&h!==m&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),f=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,u=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=u+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=f+"px",this._compositionView.style.lineHeight=f+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const y=this._compositionView.getBoundingClientRect();this._textarea.style.left=u+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(y.width,1)+"px",this._textarea.style.height=Math.max(y.height,1)+"px",this._textarea.style.lineHeight=y.height+"px"}m||setTimeout(()=>this.updateCompositionElements(!0),0)}}};n.CompositionHelper=w=p([_(2,g.IBufferService),_(3,g.IOptionsService),_(4,g.ICoreService),_(5,l.IRenderService)],w)},9806:(c,n)=>{function a(p,_,l){const g=l.getBoundingClientRect(),v=p.getComputedStyle(l),w=parseInt(v.getPropertyValue("padding-left")),m=parseInt(v.getPropertyValue("padding-top"));return[_.clientX-g.left-w,_.clientY-g.top-m]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=a,n.getCoords=function(p,_,l,g,v,w,m,h,f){if(!w)return;const d=a(p,_,l);return d?(d[0]=Math.ceil((d[0]+(f?m/2:0))/m),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),g+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),v),d):void 0}},9504:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const p=a(2584);function _(h,f,d,u){const y=h-l(h,d),C=f-l(f,d),S=Math.abs(y-C)-function(b,x,k){let M=0;const D=b-l(b,k),R=x-l(x,k);for(let T=0;T<Math.abs(D-R);T++){const A=g(b,x)==="A"?-1:1,j=k.buffer.lines.get(D+A*T);j!=null&&j.isWrapped&&M++}return M}(h,f,d);return m(S,w(g(h,f),u))}function l(h,f){let d=0,u=f.buffer.lines.get(h),y=u==null?void 0:u.isWrapped;for(;y&&h>=0&&h<f.rows;)d++,u=f.buffer.lines.get(--h),y=u==null?void 0:u.isWrapped;return d}function g(h,f){return h>f?"A":"B"}function v(h,f,d,u,y,C){let S=h,b=f,x="";for(;S!==d||b!==u;)S+=y?1:-1,y&&S>C.cols-1?(x+=C.buffer.translateBufferLineToString(b,!1,h,S),S=0,h=0,b++):!y&&S<0&&(x+=C.buffer.translateBufferLineToString(b,!1,0,h+1),S=C.cols-1,h=S,b--);return x+C.buffer.translateBufferLineToString(b,!1,h,S)}function w(h,f){const d=f?"O":"[";return p.C0.ESC+d+h}function m(h,f){h=Math.floor(h);let d="";for(let u=0;u<h;u++)d+=f;return d}n.moveToCellSequence=function(h,f,d,u){const y=d.buffer.x,C=d.buffer.y;if(!d.buffer.hasScrollback)return function(x,k,M,D,R,T){return _(k,D,R,T).length===0?"":m(v(x,k,x,k-l(k,R),!1,R).length,w("D",T))}(y,C,0,f,d,u)+_(C,f,d,u)+function(x,k,M,D,R,T){let A;A=_(k,D,R,T).length>0?D-l(D,R):k;const j=D,$=function(F,B,L,P,O,I){let W;return W=_(L,P,O,I).length>0?P-l(P,O):B,F<L&&W<=P||F>=L&&W<P?"C":"D"}(x,k,M,D,R,T);return m(v(x,A,M,j,$==="C",R).length,w($,T))}(y,C,h,f,d,u);let S;if(C===f)return S=y>h?"D":"C",m(Math.abs(y-h),w(S,u));S=C>f?"D":"C";const b=Math.abs(C-f);return m(function(x,k){return k.cols-x}(C>f?h:y,d)+(b-1)*d.cols+1+((C>f?y:h)-1),w(S,u))}},1296:function(c,n,a){var p=this&&this.__decorate||function(T,A,j,$){var F,B=arguments.length,L=B<3?A:$===null?$=Object.getOwnPropertyDescriptor(A,j):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(T,A,j,$);else for(var P=T.length-1;P>=0;P--)(F=T[P])&&(L=(B<3?F(L):B>3?F(A,j,L):F(A,j))||L);return B>3&&L&&Object.defineProperty(A,j,L),L},_=this&&this.__param||function(T,A){return function(j,$){A(j,$,T)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const l=a(3787),g=a(2550),v=a(2223),w=a(6171),m=a(6052),h=a(4725),f=a(8055),d=a(8460),u=a(844),y=a(2585),C="xterm-dom-renderer-owner-",S="xterm-rows",b="xterm-fg-",x="xterm-bg-",k="xterm-focus",M="xterm-selection";let D=1,R=n.DomRenderer=class extends u.Disposable{constructor(T,A,j,$,F,B,L,P,O,I,W,K,q){super(),this._terminal=T,this._document=A,this._element=j,this._screenElement=$,this._viewportElement=F,this._helperContainer=B,this._linkifier2=L,this._charSizeService=O,this._optionsService=I,this._bufferService=W,this._coreBrowserService=K,this._themeService=q,this._terminalClass=D++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),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(M),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Z=>this._injectCss(Z))),this._injectCss(this._themeService.colors),this._rowFactory=P.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(C+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Z=>this._handleLinkHover(Z))),this.register(this._linkifier2.onHideLinkUnderline(Z=>this._handleLinkLeave(Z))),this.register((0,u.toDisposable)(()=>{this._element.classList.remove(C+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new g.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const j of this._rowElements)j.style.width=`${this.dimensions.css.canvas.width}px`,j.style.height=`${this.dimensions.css.cell.height}px`,j.style.lineHeight=`${this.dimensions.css.cell.height}px`,j.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const A=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=A,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(T){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let A=`${this._terminalSelector} .${S} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;A+=`${this._terminalSelector} .${S} .xterm-dim { color: ${f.color.multiplyOpacity(T.foreground,.5).css};}`,A+=`${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 j=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,F=`blink_block_${this._terminalClass}`;A+=`@keyframes ${j} { 50% { border-bottom-style: hidden; }}`,A+=`@keyframes ${$} { 50% { box-shadow: none; }}`,A+=`@keyframes ${F} { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,A+=`${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${T.cursor.css} !important; color: ${T.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,A+=`${this._terminalSelector} .${M} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${M} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${M} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[B,L]of T.ansi.entries())A+=`${this._terminalSelector} .${b}${B} { color: ${L.css}; }${this._terminalSelector} .${b}${B}.xterm-dim { color: ${f.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${x}${B} { background-color: ${L.css}; }`;A+=`${this._terminalSelector} .${b}${v.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(T.background).css}; }${this._terminalSelector} .${b}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${x}${v.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=A}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,A){for(let j=this._rowElements.length;j<=A;j++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>A;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,A){this._refreshRowElements(T,A),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(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(T,A,j){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,A,j),this.renderRows(0,this._bufferService.rows-1),!T||!A)return;this._selectionRenderModel.update(this._terminal,T,A,j);const $=this._selectionRenderModel.viewportStartRow,F=this._selectionRenderModel.viewportEndRow,B=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(B>=this._bufferService.rows||L<0)return;const P=this._document.createDocumentFragment();if(j){const O=T[0]>A[0];P.appendChild(this._createSelectionElement(B,O?A[0]:T[0],O?T[0]:A[0],L-B+1))}else{const O=$===B?T[0]:0,I=B===F?A[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(B,O,I));const W=L-B-1;if(P.appendChild(this._createSelectionElement(B+1,0,this._bufferService.cols,W)),B!==L){const K=F===L?A[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(L,0,K))}}this._selectionContainer.appendChild(P)}_createSelectionElement(T,A,j,$=1){const F=this._document.createElement("div"),B=A*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(j-A);return B+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-B),F.style.height=$*this.dimensions.css.cell.height+"px",F.style.top=T*this.dimensions.css.cell.height+"px",F.style.left=`${B}px`,F.style.width=`${L}px`,F}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const T of this._rowElements)T.replaceChildren()}renderRows(T,A){const j=this._bufferService.buffer,$=j.ybase+j.y,F=Math.min(j.x,this._bufferService.cols-1),B=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,P=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=T;O<=A;O++){const I=O+j.ydisp,W=this._rowElements[O],K=j.lines.get(I);if(!W||!K)break;W.replaceChildren(...this._rowFactory.createRow(K,I,I===$,L,P,F,B,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,A,j,$,F,B){j<0&&(T=0),$<0&&(A=0);const L=this._bufferService.rows-1;j=Math.max(Math.min(j,L),0),$=Math.max(Math.min($,L),0),F=Math.min(F,this._bufferService.cols);const P=this._bufferService.buffer,O=P.ybase+P.y,I=Math.min(P.x,F-1),W=this._optionsService.rawOptions.cursorBlink,K=this._optionsService.rawOptions.cursorStyle,q=this._optionsService.rawOptions.cursorInactiveStyle;for(let Z=j;Z<=$;++Z){const z=Z+P.ydisp,N=this._rowElements[Z],U=P.lines.get(z);if(!N||!U)break;N.replaceChildren(...this._rowFactory.createRow(U,z,z===O,K,q,I,W,this.dimensions.css.cell.width,this._widthCache,B?Z===j?T:0:-1,B?(Z===$?A:F)-1:-1))}}};n.DomRenderer=R=p([_(7,y.IInstantiationService),_(8,h.ICharSizeService),_(9,y.IOptionsService),_(10,y.IBufferService),_(11,h.ICoreBrowserService),_(12,h.IThemeService)],R)},3787:function(c,n,a){var p=this&&this.__decorate||function(S,b,x,k){var M,D=arguments.length,R=D<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,b,x,k);else for(var T=S.length-1;T>=0;T--)(M=S[T])&&(R=(D<3?M(R):D>3?M(b,x,R):M(b,x))||R);return D>3&&R&&Object.defineProperty(b,x,R),R},_=this&&this.__param||function(S,b){return function(x,k){b(x,k,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const l=a(2223),g=a(643),v=a(511),w=a(2585),m=a(8055),h=a(4725),f=a(4269),d=a(6171),u=a(3734);let y=n.DomRendererRowFactory=class{constructor(S,b,x,k,M,D,R){this._document=S,this._characterJoinerService=b,this._optionsService=x,this._coreBrowserService=k,this._coreService=M,this._decorationService=D,this._themeService=R,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,b,x){this._selectionStart=S,this._selectionEnd=b,this._columnSelectMode=x}createRow(S,b,x,k,M,D,R,T,A,j,$){const F=[],B=this._characterJoinerService.getJoinedCharacters(b),L=this._themeService.colors;let P,O=S.getNoBgTrimmedLength();x&&O<D+1&&(O=D+1);let I=0,W="",K=0,q=0,Z=0,z=!1,N=0,U=!1,G=0;const Q=[],Y=j!==-1&&$!==-1;for(let ee=0;ee<O;ee++){S.loadCell(ee,this._workCell);let te=this._workCell.getWidth();if(te===0)continue;let le=!1,pe=ee,ne=this._workCell;if(B.length>0&&ee===B[0][0]){le=!0;const ve=B.shift();ne=new f.JoinedCellData(this._workCell,S.translateToString(!0,ve[0],ve[1]),ve[1]-ve[0]),pe=ve[1]-1,te=ne.getWidth()}const Te=this._isCellInSelection(ee,b),We=x&&ee===D,me=Y&&ee>=j&&ee<=$;let ge=!1;this._decorationService.forEachDecorationAtCell(ee,b,void 0,ve=>{ge=!0});let ye=ne.getChars()||g.WHITESPACE_CELL_CHAR;if(ye===" "&&(ne.isUnderline()||ne.isOverline())&&(ye=" "),G=te*T-A.get(ye,ne.isBold(),ne.isItalic()),P){if(I&&(Te&&U||!Te&&!U&&ne.bg===K)&&(Te&&U&&L.selectionForeground||ne.fg===q)&&ne.extended.ext===Z&&me===z&&G===N&&!We&&!le&&!ge){ne.isInvisible()?W+=g.WHITESPACE_CELL_CHAR:W+=ye,I++;continue}I&&(P.textContent=W),P=this._document.createElement("span"),I=0,W=""}else P=this._document.createElement("span");if(K=ne.bg,q=ne.fg,Z=ne.extended.ext,z=me,N=G,U=Te,le&&D>=ee&&D<=pe&&(D=ee),!this._coreService.isCursorHidden&&We&&this._coreService.isCursorInitialized){if(Q.push("xterm-cursor"),this._coreBrowserService.isFocused)R&&Q.push("xterm-cursor-blink"),Q.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(M)switch(M){case"outline":Q.push("xterm-cursor-outline");break;case"block":Q.push("xterm-cursor-block");break;case"bar":Q.push("xterm-cursor-bar");break;case"underline":Q.push("xterm-cursor-underline")}}if(ne.isBold()&&Q.push("xterm-bold"),ne.isItalic()&&Q.push("xterm-italic"),ne.isDim()&&Q.push("xterm-dim"),W=ne.isInvisible()?g.WHITESPACE_CELL_CHAR:ne.getChars()||g.WHITESPACE_CELL_CHAR,ne.isUnderline()&&(Q.push(`xterm-underline-${ne.extended.underlineStyle}`),W===" "&&(W=" "),!ne.isUnderlineColorDefault()))if(ne.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${u.AttributeData.toColorRGB(ne.getUnderlineColor()).join(",")})`;else{let ve=ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ne.isBold()&&ve<8&&(ve+=8),P.style.textDecorationColor=L.ansi[ve].css}ne.isOverline()&&(Q.push("xterm-overline"),W===" "&&(W=" ")),ne.isStrikethrough()&&Q.push("xterm-strikethrough"),me&&(P.style.textDecoration="underline");let oe=ne.getFgColor(),we=ne.getFgColorMode(),xe=ne.getBgColor(),ae=ne.getBgColorMode();const De=!!ne.isInverse();if(De){const ve=oe;oe=xe,xe=ve;const Tt=we;we=ae,ae=Tt}let ce,Be,Ae,be=!1;switch(this._decorationService.forEachDecorationAtCell(ee,b,void 0,ve=>{ve.options.layer!=="top"&&be||(ve.backgroundColorRGB&&(ae=50331648,xe=ve.backgroundColorRGB.rgba>>8&16777215,ce=ve.backgroundColorRGB),ve.foregroundColorRGB&&(we=50331648,oe=ve.foregroundColorRGB.rgba>>8&16777215,Be=ve.foregroundColorRGB),be=ve.options.layer==="top")}),!be&&Te&&(ce=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,xe=ce.rgba>>8&16777215,ae=50331648,be=!0,L.selectionForeground&&(we=50331648,oe=L.selectionForeground.rgba>>8&16777215,Be=L.selectionForeground)),be&&Q.push("xterm-decoration-top"),ae){case 16777216:case 33554432:Ae=L.ansi[xe],Q.push(`xterm-bg-${xe}`);break;case 50331648:Ae=m.channels.toColor(xe>>16,xe>>8&255,255&xe),this._addStyle(P,`background-color:#${C((xe>>>0).toString(16),"0",6)}`);break;default:De?(Ae=L.foreground,Q.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):Ae=L.background}switch(ce||ne.isDim()&&(ce=m.color.multiplyOpacity(Ae,.5)),we){case 16777216:case 33554432:ne.isBold()&&oe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(oe+=8),this._applyMinimumContrast(P,Ae,L.ansi[oe],ne,ce,void 0)||Q.push(`xterm-fg-${oe}`);break;case 50331648:const ve=m.channels.toColor(oe>>16&255,oe>>8&255,255&oe);this._applyMinimumContrast(P,Ae,ve,ne,ce,Be)||this._addStyle(P,`color:#${C(oe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,Ae,L.foreground,ne,ce,Be)||De&&Q.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}Q.length&&(P.className=Q.join(" "),Q.length=0),We||le||ge?P.textContent=W:I++,G!==this.defaultSpacing&&(P.style.letterSpacing=`${G}px`),F.push(P),ee=pe}return P&&I&&(P.textContent=W),F}_applyMinimumContrast(S,b,x,k,M,D){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const R=this._getContrastCache(k);let T;if(M||D||(T=R.getColor(b.rgba,x.rgba)),T===void 0){const A=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);T=m.color.ensureContrastRatio(M||b,D||x,A),R.setColor((M||b).rgba,(D||x).rgba,T??null)}return!!T&&(this._addStyle(S,`color:${T.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,b){S.setAttribute("style",`${S.getAttribute("style")||""}${b};`)}_isCellInSelection(S,b){const x=this._selectionStart,k=this._selectionEnd;return!(!x||!k)&&(this._columnSelectMode?x[0]<=k[0]?S>=x[0]&&b>=x[1]&&S<k[0]&&b<=k[1]:S<x[0]&&b>=x[1]&&S>=k[0]&&b<=k[1]:b>x[1]&&b<k[1]||x[1]===k[1]&&b===x[1]&&S>=x[0]&&S<k[0]||x[1]<k[1]&&b===k[1]&&S<k[0]||x[1]<k[1]&&b===x[1]&&S>=x[0])}};function C(S,b,x){for(;S.length<x;)S=b+S;return S}n.DomRendererRowFactory=y=p([_(1,h.ICharacterJoinerService),_(2,w.IOptionsService),_(3,h.ICoreBrowserService),_(4,w.ICoreService),_(5,w.IDecorationService),_(6,h.IThemeService)],y)},2550:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(a,p){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=a.createElement("span");_.classList.add("xterm-char-measure-element");const l=a.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const g=a.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const v=a.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[_,l,g,v],this._container.appendChild(_),this._container.appendChild(l),this._container.appendChild(g),this._container.appendChild(v),p.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,p,_,l){a===this._font&&p===this._fontSize&&_===this._weight&&l===this._weightBold||(this._font=a,this._fontSize=p,this._weight=_,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(a,p,_){let l=0;if(!p&&!_&&a.length===1&&(l=a.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const w=this._measure(a,0);return w>0&&(this._flat[l]=w),w}let g=a;p&&(g+="B"),_&&(g+="I");let v=this._holey.get(g);if(v===void 0){let w=0;p&&(w|=1),_&&(w|=2),v=this._measure(a,w),v>0&&this._holey.set(g,v)}return v}_measure(a,p){const _=this._measureElements[p];return _.textContent=a.repeat(32),_.offsetWidth/32}}},2223:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const p=a(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=p.isFirefox||p.isLegacyEdge?"bottom":"ideographic"},6171:(c,n)=>{function a(_){return 57508<=_&&_<=57558}function p(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=a,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=p,n.allowRescaling=function(_,l,g,v){return l===1&&g>Math.ceil(1.5*v)&&_!==void 0&&_>255&&!p(_)&&!a(_)&&!function(w){return 57344<=w&&w<=63743}(_)},n.treatGlyphAsBackgroundColor=function(_){return a(_)||function(l){return 9472<=l&&l<=9631}(_)},n.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}}}},n.computeNextVariantOffset=function(_,l,g=0){return(_-(2*Math.round(l)-g))%(2*Math.round(l))}},6052:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,l,g,v=!1){if(this.selectionStart=l,this.selectionEnd=g,!l||!g||l[0]===g[0]&&l[1]===g[1])return void this.clear();const w=_.buffers.active.ydisp,m=l[1]-w,h=g[1]-w,f=Math.max(m,0),d=Math.min(h,_.rows-1);f>=_.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=m,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=l[0],this.endCol=g[0])}isCellSelected(_,l,g){return!!this.hasSelection&&(g-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&g>=this.viewportCappedStartRow&&l<this.endCol&&g<=this.viewportCappedEndRow:l<this.startCol&&g>=this.viewportCappedStartRow&&l>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol)}}n.createSelectionRenderModel=function(){return new a}},456:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,p=this.selectionEnd;return!(!a||!p)&&(a[1]>p[1]||a[1]===p[1]&&a[0]>p[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(c,n,a){var p=this&&this.__decorate||function(d,u,y,C){var S,b=arguments.length,x=b<3?u:C===null?C=Object.getOwnPropertyDescriptor(u,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(d,u,y,C);else for(var k=d.length-1;k>=0;k--)(S=d[k])&&(x=(b<3?S(x):b>3?S(u,y,x):S(u,y))||x);return b>3&&x&&Object.defineProperty(u,y,x),x},_=this&&this.__param||function(d,u){return function(y,C){u(y,C,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const l=a(2585),g=a(8460),v=a(844);let w=n.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,u,y){super(),this._optionsService=y,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new f(this._optionsService))}catch{this._measureStrategy=this.register(new h(d,u,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};n.CharSizeService=w=p([_(2,l.IOptionsService)],w);class m extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(u,y){u!==void 0&&u>0&&y!==void 0&&y>0&&(this._result.width=u,this._result.height=y)}}class h extends m{constructor(u,y,C){super(),this._document=u,this._parentElement=y,this._optionsService=C,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class f extends m{constructor(u){super(),this._optionsService=u,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const y=this._ctx.measureText("W");if(!("width"in y&&"fontBoundingBoxAscent"in y&&"fontBoundingBoxDescent"in y))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const u=this._ctx.measureText("W");return this._validateAndSet(u.width,u.fontBoundingBoxAscent+u.fontBoundingBoxDescent),this._result}}},4269:function(c,n,a){var p=this&&this.__decorate||function(f,d,u,y){var C,S=arguments.length,b=S<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,u):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(f,d,u,y);else for(var x=f.length-1;x>=0;x--)(C=f[x])&&(b=(S<3?C(b):S>3?C(d,u,b):C(d,u))||b);return S>3&&b&&Object.defineProperty(d,u,b),b},_=this&&this.__param||function(f,d){return function(u,y){d(u,y,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const l=a(3734),g=a(643),v=a(511),w=a(2585);class m extends l.AttributeData{constructor(d,u,y){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=u,this._width=y}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=m;let h=n.CharacterJoinerService=class jv{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(d){const u={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(u),u.id}deregister(d){for(let u=0;u<this._characterJoiners.length;u++)if(this._characterJoiners[u].id===d)return this._characterJoiners.splice(u,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const u=this._bufferService.buffer.lines.get(d);if(!u||u.length===0)return[];const y=[],C=u.translateToString(!0);let S=0,b=0,x=0,k=u.getFg(0),M=u.getBg(0);for(let D=0;D<u.getTrimmedLength();D++)if(u.loadCell(D,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==M){if(D-S>1){const R=this._getJoinedRanges(C,x,b,u,S);for(let T=0;T<R.length;T++)y.push(R[T])}S=D,x=b,k=this._workCell.fg,M=this._workCell.bg}b+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const D=this._getJoinedRanges(C,x,b,u,S);for(let R=0;R<D.length;R++)y.push(D[R])}return y}_getJoinedRanges(d,u,y,C,S){const b=d.substring(u,y);let x=[];try{x=this._characterJoiners[0].handler(b)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const M=this._characterJoiners[k].handler(b);for(let D=0;D<M.length;D++)jv._mergeRanges(x,M[D])}catch(M){console.error(M)}return this._stringRangesToCellRanges(x,C,S),x}_stringRangesToCellRanges(d,u,y){let C=0,S=!1,b=0,x=d[C];if(x){for(let k=y;k<this._bufferService.cols;k++){const M=u.getWidth(k),D=u.getString(k).length||g.WHITESPACE_CELL_CHAR.length;if(M!==0){if(!S&&x[0]<=b&&(x[0]=k,S=!0),x[1]<=b){if(x[1]=k,x=d[++C],!x)break;x[0]<=b?(x[0]=k,S=!0):S=!1}b+=D}}x&&(x[1]=this._bufferService.cols)}}static _mergeRanges(d,u){let y=!1;for(let C=0;C<d.length;C++){const S=d[C];if(y){if(u[1]<=S[0])return d[C-1][1]=u[1],d;if(u[1]<=S[1])return d[C-1][1]=Math.max(u[1],S[1]),d.splice(C,1),d;d.splice(C,1),C--}else{if(u[1]<=S[0])return d.splice(C,0,u),d;if(u[1]<=S[1])return S[0]=Math.min(u[0],S[0]),d;u[0]<S[1]&&(S[0]=Math.min(u[0],S[0]),y=!0)}}return y?d[d.length-1][1]=u[1]:d.push(u),d}};n.CharacterJoinerService=h=p([_(0,w.IBufferService)],h)},5114:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const p=a(844),_=a(8460),l=a(3656);class g extends p.Disposable{constructor(m,h,f){super(),this._textarea=m,this._window=h,this.mainDocument=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(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(d=>this._screenDprMonitor.setWindow(d))),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(m){this._window!==m&&(this._window=m,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}}n.CoreBrowserService=g;class v extends p.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new p.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,p.toDisposable)(()=>this.clearListener()))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)==null||m.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:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const p=a(844);class _ extends p.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,p.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const v=this.linkProviders.indexOf(g);v!==-1&&this.linkProviders.splice(v,1)}}}}n.LinkProviderService=_},8934:function(c,n,a){var p=this&&this.__decorate||function(w,m,h,f){var d,u=arguments.length,y=u<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,h):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(w,m,h,f);else for(var C=w.length-1;C>=0;C--)(d=w[C])&&(y=(u<3?d(y):u>3?d(m,h,y):d(m,h))||y);return u>3&&y&&Object.defineProperty(m,h,y),y},_=this&&this.__param||function(w,m){return function(h,f){m(h,f,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const l=a(4725),g=a(9806);let v=n.MouseService=class{constructor(w,m){this._renderService=w,this._charSizeService=m}getCoords(w,m,h,f,d){return(0,g.getCoords)(window,w,m,h,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(w,m){const h=(0,g.getCoordsRelativeToElement)(window,w,m);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};n.MouseService=v=p([_(0,l.IRenderService),_(1,l.ICharSizeService)],v)},3230:function(c,n,a){var p=this&&this.__decorate||function(d,u,y,C){var S,b=arguments.length,x=b<3?u:C===null?C=Object.getOwnPropertyDescriptor(u,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(d,u,y,C);else for(var k=d.length-1;k>=0;k--)(S=d[k])&&(x=(b<3?S(x):b>3?S(u,y,x):S(u,y))||x);return b>3&&x&&Object.defineProperty(u,y,x),x},_=this&&this.__param||function(d,u){return function(y,C){u(y,C,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const l=a(6193),g=a(4725),v=a(8460),w=a(844),m=a(7226),h=a(2585);let f=n.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,u,y,C,S,b,x,k){super(),this._rowCount=d,this._charSizeService=C,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer((M,D)=>this._renderRows(M,D),x),this.register(this._renderDebouncer),this.register(x.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(b.onResize(()=>this._fullRefresh())),this.register(b.buffers.onBufferActivate(()=>{var M;return(M=this._renderer.value)==null?void 0:M.clear()})),this.register(y.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(y.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(b.cols,b.rows),this._fullRefresh()})),this.register(y.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(b.buffer.y,b.buffer.y,!0))),this.register(k.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(x.window,u),this.register(x.onWindowChange(M=>this._registerIntersectionObserver(M,u)))}_registerIntersectionObserver(d,u){if("IntersectionObserver"in d){const y=new d.IntersectionObserver(C=>this._handleIntersectionChange(C[C.length-1]),{threshold:0});y.observe(u),this._observerDisposable.value=(0,w.toDisposable)(()=>y.disconnect())}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.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(d,u,y=!1){this._isPaused?this._needsFullRefresh=!0:(y||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,u,this._rowCount))}_renderRows(d,u){this._renderer.value&&(d=Math.min(d,this._rowCount-1),u=Math.min(u,this._rowCount-1),this._renderer.value.renderRows(d,u),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:u}),this._onRender.fire({start:d,end:u}),this._isNextRenderRedrawOnly=!0)}resize(d,u){this._rowCount=u,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(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw(u=>this.refreshRows(u.start,u.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,u;this._renderer.value&&((u=(d=this._renderer.value).clearTextureAtlas)==null||u.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,u){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var y;return(y=this._renderer.value)==null?void 0:y.handleResize(d,u)}):this._renderer.value.handleResize(d,u),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,u,y){var C;this._selectionState.start=d,this._selectionState.end=u,this._selectionState.columnSelectMode=y,(C=this._renderer.value)==null||C.handleSelectionChanged(d,u,y)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};n.RenderService=f=p([_(2,h.IOptionsService),_(3,g.ICharSizeService),_(4,h.IDecorationService),_(5,h.IBufferService),_(6,g.ICoreBrowserService),_(7,g.IThemeService)],f)},9312:function(c,n,a){var p=this&&this.__decorate||function(x,k,M,D){var R,T=arguments.length,A=T<3?k:D===null?D=Object.getOwnPropertyDescriptor(k,M):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,k,M,D);else for(var j=x.length-1;j>=0;j--)(R=x[j])&&(A=(T<3?R(A):T>3?R(k,M,A):R(k,M))||A);return T>3&&A&&Object.defineProperty(k,M,A),A},_=this&&this.__param||function(x,k){return function(M,D){k(M,D,x)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const l=a(9806),g=a(9504),v=a(456),w=a(4725),m=a(8460),h=a(844),f=a(6114),d=a(4841),u=a(511),y=a(2585),C=" ",S=new RegExp(C,"g");let b=n.SelectionService=class extends h.Disposable{constructor(x,k,M,D,R,T,A,j,$){super(),this._element=x,this._screenElement=k,this._linkifier=M,this._bufferService=D,this._coreService=R,this._mouseService=T,this._optionsService=A,this._renderService=j,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new u.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=F=>this._handleMouseMove(F),this._mouseUpListener=F=>this._handleMouseUp(F),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(F=>this._handleTrim(F)),this.register(this._bufferService.buffers.onBufferActivate(F=>this._handleBufferActivate(F))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.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,k=this._model.finalSelectionEnd;return!(!x||!k||x[0]===k[0]&&x[1]===k[1])}get selectionText(){const x=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!x||!k)return"";const M=this._bufferService.buffer,D=[];if(this._activeSelectionMode===3){if(x[0]===k[0])return"";const R=x[0]<k[0]?x[0]:k[0],T=x[0]<k[0]?k[0]:x[0];for(let A=x[1];A<=k[1];A++){const j=M.translateBufferLineToString(A,!0,R,T);D.push(j)}}else{const R=x[1]===k[1]?k[0]:void 0;D.push(M.translateBufferLineToString(x[1],!0,x[0],R));for(let T=x[1]+1;T<=k[1]-1;T++){const A=M.lines.get(T),j=M.translateBufferLineToString(T,!0);A!=null&&A.isWrapped?D[D.length-1]+=j:D.push(j)}if(x[1]!==k[1]){const T=M.lines.get(k[1]),A=M.translateBufferLineToString(k[1],!0,0,k[0]);T&&T.isWrapped?D[D.length-1]+=A:D.push(A)}}return D.map(R=>R.replace(S," ")).join(f.isWindows?`\r
|
|
73
|
-
`:`
|
|
74
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(x){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),f.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 k=this._getMouseBufferCoords(x),M=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!!(M&&D&&k)&&this._areCoordsInSelection(k,M,D)}isCellInSelection(x,k){const M=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!M||!D)&&this._areCoordsInSelection([x,k],M,D)}_areCoordsInSelection(x,k,M){return x[1]>k[1]&&x[1]<M[1]||k[1]===M[1]&&x[1]===k[1]&&x[0]>=k[0]&&x[0]<M[0]||k[1]<M[1]&&x[1]===M[1]&&x[0]<M[0]||k[1]<M[1]&&x[1]===k[1]&&x[0]>=k[0]}_selectWordAtCursor(x,k){var R,T;const M=(T=(R=this._linkifier.currentLink)==null?void 0:R.link)==null?void 0:T.range;if(M)return this._model.selectionStart=[M.start.x-1,M.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(M,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(x);return!!D&&(this._selectWordAt(D,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(x,k){this._model.clearSelection(),x=Math.max(x,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,x],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(x){this._model.handleTrim(x)&&this.refresh()}_getMouseBufferCoords(x){const k=this._mouseService.getCoords(x,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(x){let k=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,x,this._screenElement)[1];const M=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=M?0:(k>M&&(k-=M),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(x){return f.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 k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(x){this._selectWordAtCursor(x,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(x){const k=this._getMouseBufferCoords(x);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(x){return x.altKey&&!(f.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(x){if(x.stopImmediatePropagation(),!this._model.selectionStart)return;const k=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 M=this._bufferService.buffer;if(this._model.selectionEnd[1]<M.lines.length){const D=M.lines.get(this._model.selectionEnd[1]);D&&D.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 k=x.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&x.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const M=this._mouseService.getCoords(x,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(M&&M[0]!==void 0&&M[1]!==void 0){const D=(0,g.moveToCellSequence)(M[0]-1,M[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(D,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const x=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,M=!(!x||!k||x[0]===k[0]&&x[1]===k[1]);M?x&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&x[0]===this._oldSelectionStart[0]&&x[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(x,k,M)):this._oldHasSelection&&this._fireOnSelectionChange(x,k,M)}_fireOnSelectionChange(x,k,M){this._oldSelectionStart=x,this._oldSelectionEnd=k,this._oldHasSelection=M,this._onSelectionChange.fire()}_handleBufferActivate(x){this.clearSelection(),this._trimListener.dispose(),this._trimListener=x.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(x,k){let M=k;for(let D=0;k>=D;D++){const R=x.loadCell(D,this._workCell).getChars().length;this._workCell.getWidth()===0?M--:R>1&&k!==D&&(M+=R-1)}return M}setSelection(x,k,M){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[x,k],this._model.selectionStartLength=M,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(x){this._isClickInSelection(x)||(this._selectWordAtCursor(x,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(x,k,M=!0,D=!0){if(x[0]>=this._bufferService.cols)return;const R=this._bufferService.buffer,T=R.lines.get(x[1]);if(!T)return;const A=R.translateBufferLineToString(x[1],!1);let j=this._convertViewportColToCharacterIndex(T,x[0]),$=j;const F=x[0]-j;let B=0,L=0,P=0,O=0;if(A.charAt(j)===" "){for(;j>0&&A.charAt(j-1)===" ";)j--;for(;$<A.length&&A.charAt($+1)===" ";)$++}else{let K=x[0],q=x[0];T.getWidth(K)===0&&(B++,K--),T.getWidth(q)===2&&(L++,q++);const Z=T.getString(q).length;for(Z>1&&(O+=Z-1,$+=Z-1);K>0&&j>0&&!this._isCharWordSeparator(T.loadCell(K-1,this._workCell));){T.loadCell(K-1,this._workCell);const z=this._workCell.getChars().length;this._workCell.getWidth()===0?(B++,K--):z>1&&(P+=z-1,j-=z-1),j--,K--}for(;q<T.length&&$+1<A.length&&!this._isCharWordSeparator(T.loadCell(q+1,this._workCell));){T.loadCell(q+1,this._workCell);const z=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,q++):z>1&&(O+=z-1,$+=z-1),$++,q++}}$++;let I=j+F-B+P,W=Math.min(this._bufferService.cols,$-j+B+L-P-O);if(k||A.slice(j,$).trim()!==""){if(M&&I===0&&T.getCodePoint(0)!==32){const K=R.lines.get(x[1]-1);if(K&&T.isWrapped&&K.getCodePoint(this._bufferService.cols-1)!==32){const q=this._getWordAt([this._bufferService.cols-1,x[1]-1],!1,!0,!1);if(q){const Z=this._bufferService.cols-q.start;I-=Z,W+=Z}}}if(D&&I+W===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){const K=R.lines.get(x[1]+1);if(K!=null&&K.isWrapped&&K.getCodePoint(0)!==32){const q=this._getWordAt([0,x[1]+1],!1,!1,!0);q&&(W+=q.length)}}return{start:I,length:W}}}_selectWordAt(x,k){const M=this._getWordAt(x,k);if(M){for(;M.start<0;)M.start+=this._bufferService.cols,x[1]--;this._model.selectionStart=[M.start,x[1]],this._model.selectionStartLength=M.length}}_selectToWordAt(x){const k=this._getWordAt(x,!0);if(k){let M=x[1];for(;k.start<0;)k.start+=this._bufferService.cols,M--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,M++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,M]}}_isCharWordSeparator(x){return x.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(x.getChars())>=0}_selectLineAt(x){const k=this._bufferService.buffer.getWrappedRangeForLine(x),M={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(M,this._bufferService.cols)}};n.SelectionService=b=p([_(3,y.IBufferService),_(4,y.ICoreService),_(5,w.IMouseService),_(6,y.IOptionsService),_(7,w.IRenderService),_(8,w.ICoreBrowserService)],b)},4725:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const p=a(8343);n.ICharSizeService=(0,p.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,p.createDecorator)("CoreBrowserService"),n.IMouseService=(0,p.createDecorator)("MouseService"),n.IRenderService=(0,p.createDecorator)("RenderService"),n.ISelectionService=(0,p.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,p.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,p.createDecorator)("ThemeService"),n.ILinkProviderService=(0,p.createDecorator)("LinkProviderService")},6731:function(c,n,a){var p=this&&this.__decorate||function(b,x,k,M){var D,R=arguments.length,T=R<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,x,k,M);else for(var A=b.length-1;A>=0;A--)(D=b[A])&&(T=(R<3?D(T):R>3?D(x,k,T):D(x,k))||T);return R>3&&T&&Object.defineProperty(x,k,T),T},_=this&&this.__param||function(b,x){return function(k,M){x(k,M,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const l=a(7239),g=a(8055),v=a(8460),w=a(844),m=a(2585),h=g.css.toColor("#ffffff"),f=g.css.toColor("#000000"),d=g.css.toColor("#ffffff"),u=g.css.toColor("#000000"),y={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const b=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],x=[0,95,135,175,215,255];for(let k=0;k<216;k++){const M=x[k/36%6|0],D=x[k/6%6|0],R=x[k%6];b.push({css:g.channels.toCss(M,D,R),rgba:g.channels.toRgba(M,D,R)})}for(let k=0;k<24;k++){const M=8+10*k;b.push({css:g.channels.toCss(M,M,M),rgba:g.channels.toRgba(M,M,M)})}return b})());let C=n.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(b){super(),this._optionsService=b,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:f,cursor:d,cursorAccent:u,selectionForeground:void 0,selectionBackgroundTransparent:y,selectionBackgroundOpaque:g.color.blend(f,y),selectionInactiveBackgroundTransparent:y,selectionInactiveBackgroundOpaque:g.color.blend(f,y),ansi:n.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(b={}){const x=this._colors;if(x.foreground=S(b.foreground,h),x.background=S(b.background,f),x.cursor=S(b.cursor,d),x.cursorAccent=S(b.cursorAccent,u),x.selectionBackgroundTransparent=S(b.selectionBackground,y),x.selectionBackgroundOpaque=g.color.blend(x.background,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundTransparent=S(b.selectionInactiveBackground,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundOpaque=g.color.blend(x.background,x.selectionInactiveBackgroundTransparent),x.selectionForeground=b.selectionForeground?S(b.selectionForeground,g.NULL_COLOR):void 0,x.selectionForeground===g.NULL_COLOR&&(x.selectionForeground=void 0),g.color.isOpaque(x.selectionBackgroundTransparent)&&(x.selectionBackgroundTransparent=g.color.opacity(x.selectionBackgroundTransparent,.3)),g.color.isOpaque(x.selectionInactiveBackgroundTransparent)&&(x.selectionInactiveBackgroundTransparent=g.color.opacity(x.selectionInactiveBackgroundTransparent,.3)),x.ansi=n.DEFAULT_ANSI_COLORS.slice(),x.ansi[0]=S(b.black,n.DEFAULT_ANSI_COLORS[0]),x.ansi[1]=S(b.red,n.DEFAULT_ANSI_COLORS[1]),x.ansi[2]=S(b.green,n.DEFAULT_ANSI_COLORS[2]),x.ansi[3]=S(b.yellow,n.DEFAULT_ANSI_COLORS[3]),x.ansi[4]=S(b.blue,n.DEFAULT_ANSI_COLORS[4]),x.ansi[5]=S(b.magenta,n.DEFAULT_ANSI_COLORS[5]),x.ansi[6]=S(b.cyan,n.DEFAULT_ANSI_COLORS[6]),x.ansi[7]=S(b.white,n.DEFAULT_ANSI_COLORS[7]),x.ansi[8]=S(b.brightBlack,n.DEFAULT_ANSI_COLORS[8]),x.ansi[9]=S(b.brightRed,n.DEFAULT_ANSI_COLORS[9]),x.ansi[10]=S(b.brightGreen,n.DEFAULT_ANSI_COLORS[10]),x.ansi[11]=S(b.brightYellow,n.DEFAULT_ANSI_COLORS[11]),x.ansi[12]=S(b.brightBlue,n.DEFAULT_ANSI_COLORS[12]),x.ansi[13]=S(b.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),x.ansi[14]=S(b.brightCyan,n.DEFAULT_ANSI_COLORS[14]),x.ansi[15]=S(b.brightWhite,n.DEFAULT_ANSI_COLORS[15]),b.extendedAnsi){const k=Math.min(x.ansi.length-16,b.extendedAnsi.length);for(let M=0;M<k;M++)x.ansi[M+16]=S(b.extendedAnsi[M],n.DEFAULT_ANSI_COLORS[M+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(b){this._restoreColor(b),this._onChangeColors.fire(this.colors)}_restoreColor(b){if(b!==void 0)switch(b){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[b]=this._restoreColors.ansi[b]}else for(let x=0;x<this._restoreColors.ansi.length;++x)this._colors.ansi[x]=this._restoreColors.ansi[x]}modifyColors(b){b(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 S(b,x){if(b!==void 0)try{return g.css.toColor(b)}catch{}return x}n.ThemeService=C=p([_(0,m.IOptionsService)],C)},6349:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const p=a(8460),_=a(844);class l extends _.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new p.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new p.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new p.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const w=new Array(v);for(let m=0;m<Math.min(v,this.length);m++)w[m]=this._array[this._getCyclicIndex(m)];this._array=w,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let w=this._length;w<v;w++)this._array[w]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,w){this._array[this._getCyclicIndex(v)]=w}push(v){this._array[this._getCyclicIndex(this._length)]=v,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(v,w,...m){if(w){for(let h=v;h<this._length-w;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+w)];this._length-=w,this.onDeleteEmitter.fire({index:v,amount:w})}for(let h=this._length-1;h>=v;h--)this._array[this._getCyclicIndex(h+m.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<m.length;h++)this._array[this._getCyclicIndex(v+h)]=m[h];if(m.length&&this.onInsertEmitter.fire({index:v,amount:m.length}),this._length+m.length>this._maxLength){const h=this._length+m.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=m.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,w,m){if(!(w<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let f=w-1;f>=0;f--)this.set(v+f+m,this.get(v+f));const h=v+w+m-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<w;h++)this.set(v+h+m,this.get(v+h))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}n.CircularList=l},1439:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function a(p,_=5){if(typeof p!="object")return p;const l=Array.isArray(p)?[]:{};for(const g in p)l[g]=_<=1?p[g]:p[g]&&a(p[g],_-1);return l}},8055:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let a=0,p=0,_=0,l=0;var g,v,w,m,h;function f(u){const y=u.toString(16);return y.length<2?"0"+y:y}function d(u,y){return u<y?(y+.05)/(u+.05):(u+.05)/(y+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},function(u){u.toCss=function(y,C,S,b){return b!==void 0?`#${f(y)}${f(C)}${f(S)}${f(b)}`:`#${f(y)}${f(C)}${f(S)}`},u.toRgba=function(y,C,S,b=255){return(y<<24|C<<16|S<<8|b)>>>0},u.toColor=function(y,C,S,b){return{css:u.toCss(y,C,S,b),rgba:u.toRgba(y,C,S,b)}}}(g||(n.channels=g={})),function(u){function y(C,S){return l=Math.round(255*S),[a,p,_]=h.toChannels(C.rgba),{css:g.toCss(a,p,_,l),rgba:g.toRgba(a,p,_,l)}}u.blend=function(C,S){if(l=(255&S.rgba)/255,l===1)return{css:S.css,rgba:S.rgba};const b=S.rgba>>24&255,x=S.rgba>>16&255,k=S.rgba>>8&255,M=C.rgba>>24&255,D=C.rgba>>16&255,R=C.rgba>>8&255;return a=M+Math.round((b-M)*l),p=D+Math.round((x-D)*l),_=R+Math.round((k-R)*l),{css:g.toCss(a,p,_),rgba:g.toRgba(a,p,_)}},u.isOpaque=function(C){return(255&C.rgba)==255},u.ensureContrastRatio=function(C,S,b){const x=h.ensureContrastRatio(C.rgba,S.rgba,b);if(x)return g.toColor(x>>24&255,x>>16&255,x>>8&255)},u.opaque=function(C){const S=(255|C.rgba)>>>0;return[a,p,_]=h.toChannels(S),{css:g.toCss(a,p,_),rgba:S}},u.opacity=y,u.multiplyOpacity=function(C,S){return l=255&C.rgba,y(C,l*S/255)},u.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(v||(n.color=v={})),function(u){let y,C;try{const S=document.createElement("canvas");S.width=1,S.height=1;const b=S.getContext("2d",{willReadFrequently:!0});b&&(y=b,y.globalCompositeOperation="copy",C=y.createLinearGradient(0,0,1,1))}catch{}u.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return a=parseInt(S.slice(1,2).repeat(2),16),p=parseInt(S.slice(2,3).repeat(2),16),_=parseInt(S.slice(3,4).repeat(2),16),g.toColor(a,p,_);case 5:return a=parseInt(S.slice(1,2).repeat(2),16),p=parseInt(S.slice(2,3).repeat(2),16),_=parseInt(S.slice(3,4).repeat(2),16),l=parseInt(S.slice(4,5).repeat(2),16),g.toColor(a,p,_,l);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const b=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(b)return a=parseInt(b[1]),p=parseInt(b[2]),_=parseInt(b[3]),l=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),g.toColor(a,p,_,l);if(!y||!C)throw new Error("css.toColor: Unsupported css format");if(y.fillStyle=C,y.fillStyle=S,typeof y.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(y.fillRect(0,0,1,1),[a,p,_,l]=y.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(a,p,_,l),css:S}}}(w||(n.css=w={})),function(u){function y(C,S,b){const x=C/255,k=S/255,M=b/255;return .2126*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))}u.relativeLuminance=function(C){return y(C>>16&255,C>>8&255,255&C)},u.relativeLuminance2=y}(m||(n.rgb=m={})),function(u){function y(S,b,x){const k=S>>24&255,M=S>>16&255,D=S>>8&255;let R=b>>24&255,T=b>>16&255,A=b>>8&255,j=d(m.relativeLuminance2(R,T,A),m.relativeLuminance2(k,M,D));for(;j<x&&(R>0||T>0||A>0);)R-=Math.max(0,Math.ceil(.1*R)),T-=Math.max(0,Math.ceil(.1*T)),A-=Math.max(0,Math.ceil(.1*A)),j=d(m.relativeLuminance2(R,T,A),m.relativeLuminance2(k,M,D));return(R<<24|T<<16|A<<8|255)>>>0}function C(S,b,x){const k=S>>24&255,M=S>>16&255,D=S>>8&255;let R=b>>24&255,T=b>>16&255,A=b>>8&255,j=d(m.relativeLuminance2(R,T,A),m.relativeLuminance2(k,M,D));for(;j<x&&(R<255||T<255||A<255);)R=Math.min(255,R+Math.ceil(.1*(255-R))),T=Math.min(255,T+Math.ceil(.1*(255-T))),A=Math.min(255,A+Math.ceil(.1*(255-A))),j=d(m.relativeLuminance2(R,T,A),m.relativeLuminance2(k,M,D));return(R<<24|T<<16|A<<8|255)>>>0}u.blend=function(S,b){if(l=(255&b)/255,l===1)return b;const x=b>>24&255,k=b>>16&255,M=b>>8&255,D=S>>24&255,R=S>>16&255,T=S>>8&255;return a=D+Math.round((x-D)*l),p=R+Math.round((k-R)*l),_=T+Math.round((M-T)*l),g.toRgba(a,p,_)},u.ensureContrastRatio=function(S,b,x){const k=m.relativeLuminance(S>>8),M=m.relativeLuminance(b>>8);if(d(k,M)<x){if(M<k){const T=y(S,b,x),A=d(k,m.relativeLuminance(T>>8));if(A<x){const j=C(S,b,x);return A>d(k,m.relativeLuminance(j>>8))?T:j}return T}const D=C(S,b,x),R=d(k,m.relativeLuminance(D>>8));if(R<x){const T=y(S,b,x);return R>d(k,m.relativeLuminance(T>>8))?D:T}return D}},u.reduceLuminance=y,u.increaseLuminance=C,u.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}}(h||(n.rgba=h={})),n.toPaddedHex=f,n.contrastRatio=d},8969:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const p=a(844),_=a(2585),l=a(4348),g=a(7866),v=a(744),w=a(7302),m=a(6975),h=a(8460),f=a(1753),d=a(1480),u=a(7994),y=a(9282),C=a(5435),S=a(5981),b=a(2660);let x=!1;class k extends p.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(D=>{var R;(R=this._onScrollApi)==null||R.fire(D.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(D){for(const R in D)this.optionsService.options[R]=D[R]}constructor(D){super(),this._windowsWrappingHeuristics=this.register(new p.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new w.OptionsService(D)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(f.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(u.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(b.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new C.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.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(R=>{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(R=>{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 S.WriteBuffer((R,T)=>this._inputHandler.parse(R,T))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(D,R){this._writeBuffer.write(D,R)}writeSync(D,R){this._logService.logLevel<=_.LogLevelEnum.WARN&&!x&&(this._logService.warn("writeSync is unreliable and will be removed soon."),x=!0),this._writeBuffer.writeSync(D,R)}input(D,R=!0){this.coreService.triggerDataEvent(D,R)}resize(D,R){isNaN(D)||isNaN(R)||(D=Math.max(D,v.MINIMUM_COLS),R=Math.max(R,v.MINIMUM_ROWS),this._bufferService.resize(D,R))}scroll(D,R=!1){this._bufferService.scroll(D,R)}scrollLines(D,R,T){this._bufferService.scrollLines(D,R,T)}scrollPages(D){this.scrollLines(D*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(D){const R=D-this._bufferService.buffer.ydisp;R!==0&&this.scrollLines(R)}registerEscHandler(D,R){return this._inputHandler.registerEscHandler(D,R)}registerDcsHandler(D,R){return this._inputHandler.registerDcsHandler(D,R)}registerCsiHandler(D,R){return this._inputHandler.registerCsiHandler(D,R)}registerOscHandler(D,R){return this._inputHandler.registerOscHandler(D,R)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let D=!1;const R=this.optionsService.rawOptions.windowsPty;R&&R.buildNumber!==void 0&&R.buildNumber!==void 0?D=R.backend==="conpty"&&R.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(D=!0),D?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const D=[];D.push(this.onLineFeed(y.updateWindowsModeWrappedState.bind(null,this._bufferService))),D.push(this.registerCsiHandler({final:"H"},()=>((0,y.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,p.toDisposable)(()=>{for(const R of D)R.dispose()})}}}n.CoreTerminal=k},8460:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let p=0;p<this._listeners.length;p++)if(this._listeners[p]===a)return void this._listeners.splice(p,1)}}})),this._event}fire(a,p){const _=[];for(let l=0;l<this._listeners.length;l++)_.push(this._listeners[l]);for(let l=0;l<_.length;l++)_[l].call(void 0,a,p)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(a,p){return a(_=>p.fire(_))},n.runAndSubscribe=function(a,p){return p(void 0),a(_=>p(_))}},5435:function(c,n,a){var p=this&&this.__decorate||function(B,L,P,O){var I,W=arguments.length,K=W<3?L:O===null?O=Object.getOwnPropertyDescriptor(L,P):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(B,L,P,O);else for(var q=B.length-1;q>=0;q--)(I=B[q])&&(K=(W<3?I(K):W>3?I(L,P,K):I(L,P))||K);return W>3&&K&&Object.defineProperty(L,P,K),K},_=this&&this.__param||function(B,L){return function(P,O){L(P,O,B)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const l=a(2584),g=a(7116),v=a(2015),w=a(844),m=a(482),h=a(8437),f=a(8460),d=a(643),u=a(511),y=a(3734),C=a(2585),S=a(1480),b=a(6242),x=a(6351),k=a(5941),M={"(":0,")":1,"*":2,"+":3,"-":1,".":2},D=131072;function R(B,L){if(B>24)return L.setWinLines||!1;switch(B){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var T;(function(B){B[B.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",B[B.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(n.WindowsOptionsReportType=T={}));let A=0;class j extends w.Disposable{getAttrData(){return this._curAttrData}constructor(L,P,O,I,W,K,q,Z,z=new v.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=P,this._coreService=O,this._logService=I,this._optionsService=W,this._oscLinkService=K,this._coreMouseService=q,this._unicodeService=Z,this._parser=z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new u.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new f.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new f.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new f.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new f.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new f.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new f.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new f.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new f.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new f.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new f.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new f.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 $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(N=>this._activeBuffer=N.activeBuffer)),this._parser.setCsiHandlerFallback((N,U)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(N),params:U.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,U,G)=>{this._logService.debug("Unknown OSC code: ",{identifier:N,action:U,data:G})}),this._parser.setDcsHandlerFallback((N,U,G)=>{U==="HOOK"&&(G=G.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(N),action:U,payload:G})}),this._parser.setPrintHandler((N,U,G)=>this.print(N,U,G)),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(l.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(l.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(l.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(l.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(l.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(l.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(l.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(l.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(l.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(l.C1.IND,()=>this.index()),this._parser.setExecuteHandler(l.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(l.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new b.OscHandler(N=>(this.setTitle(N),this.setIconName(N),!0))),this._parser.registerOscHandler(1,new b.OscHandler(N=>this.setIconName(N))),this._parser.registerOscHandler(2,new b.OscHandler(N=>this.setTitle(N))),this._parser.registerOscHandler(4,new b.OscHandler(N=>this.setOrReportIndexedColor(N))),this._parser.registerOscHandler(8,new b.OscHandler(N=>this.setHyperlink(N))),this._parser.registerOscHandler(10,new b.OscHandler(N=>this.setOrReportFgColor(N))),this._parser.registerOscHandler(11,new b.OscHandler(N=>this.setOrReportBgColor(N))),this._parser.registerOscHandler(12,new b.OscHandler(N=>this.setOrReportCursorColor(N))),this._parser.registerOscHandler(104,new b.OscHandler(N=>this.restoreIndexedColor(N))),this._parser.registerOscHandler(110,new b.OscHandler(N=>this.restoreFgColor(N))),this._parser.registerOscHandler(111,new b.OscHandler(N=>this.restoreBgColor(N))),this._parser.registerOscHandler(112,new b.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 g.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,U)=>this.requestStatusString(N,U)))}_preserveStack(L,P,O,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=P,this._parseStack.decodedLength=O,this._parseStack.position=I}_logSlowResolvingAsync(L){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([L,new Promise((P,O)=>setTimeout(()=>O("#SLOW_TIMEOUT"),5e3))]).catch(P=>{if(P!=="#SLOW_TIMEOUT")throw P;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,P){let O,I=this._activeBuffer.x,W=this._activeBuffer.y,K=0;const q=this._parseStack.paused;if(q){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,P))return this._logSlowResolvingAsync(O),O;I=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>D&&(K=this._parseStack.position+D)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,N=>String.fromCharCode(N)).join("")}"`),typeof L=="string"?L.split("").map(N=>N.charCodeAt(0)):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<D&&(this._parseBuffer=new Uint32Array(Math.min(L.length,D))),q||this._dirtyRowTracker.clearRange(),L.length>D)for(let N=K;N<L.length;N+=D){const U=N+D<L.length?N+D:L.length,G=typeof L=="string"?this._stringDecoder.decode(L.substring(N,U),this._parseBuffer):this._utf8Decoder.decode(L.subarray(N,U),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,G))return this._preserveStack(I,W,G,N),this._logSlowResolvingAsync(O),O}else if(!q){const N=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,N))return this._preserveStack(I,W,N,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===I&&this._activeBuffer.y===W||this._onCursorMove.fire();const Z=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(z,this._bufferService.rows-1),Math.min(Z,this._bufferService.rows-1))}print(L,P,O){let I,W;const K=this._charsetService.charset,q=this._optionsService.rawOptions.screenReaderMode,Z=this._bufferService.cols,z=this._coreService.decPrivateModes.wraparound,N=this._coreService.modes.insertMode,U=this._curAttrData;let G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-P>0&&G.getWidth(this._activeBuffer.x-1)===2&&G.setCellFromCodepoint(this._activeBuffer.x-1,0,1,U);let Q=this._parser.precedingJoinState;for(let Y=P;Y<O;++Y){if(I=L[Y],I<127&&K){const pe=K[String.fromCharCode(I)];pe&&(I=pe.charCodeAt(0))}const ee=this._unicodeService.charProperties(I,Q);W=S.UnicodeService.extractWidth(ee);const te=S.UnicodeService.extractShouldJoin(ee),le=te?S.UnicodeService.extractWidth(Q):0;if(Q=ee,q&&this._onA11yChar.fire((0,m.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-le>Z){if(z){const pe=G;let ne=this._activeBuffer.x-le;for(this._activeBuffer.x=le,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),G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),le>0&&G instanceof h.BufferLine&&G.copyCellsFrom(pe,ne,0,le,!1);ne<Z;)pe.setCellFromCodepoint(ne++,0,1,U)}else if(this._activeBuffer.x=Z-1,W===2)continue}if(te&&this._activeBuffer.x){const pe=G.getWidth(this._activeBuffer.x-1)?1:2;G.addCodepointToCell(this._activeBuffer.x-pe,I,W);for(let ne=W-le;--ne>=0;)G.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}else if(N&&(G.insertCells(this._activeBuffer.x,W-le,this._activeBuffer.getNullCell(U)),G.getWidth(Z-1)===2&&G.setCellFromCodepoint(Z-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,U)),G.setCellFromCodepoint(this._activeBuffer.x++,I,W,U),W>0)for(;--W;)G.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}this._parser.precedingJoinState=Q,this._activeBuffer.x<Z&&O-P>0&&G.getWidth(this._activeBuffer.x)===0&&!G.hasContent(this._activeBuffer.x)&&G.setCellFromCodepoint(this._activeBuffer.x,0,1,U),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,P){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,P):this._parser.registerCsiHandler(L,O=>!R(O.params[0],this._optionsService.rawOptions.windowOptions)||P(O))}registerDcsHandler(L,P){return this._parser.registerDcsHandler(L,new x.DcsHandler(P))}registerEscHandler(L,P){return this._parser.registerEscHandler(L,P)}registerOscHandler(L,P){return this._parser.registerOscHandler(L,new b.OscHandler(P))}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 L;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&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,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(L,P){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+P):(this._activeBuffer.x=L,this._activeBuffer.y=P),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,P){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+P)}cursorUp(L){const P=this._activeBuffer.y-this._activeBuffer.scrollTop;return P>=0?this._moveCursor(0,-Math.min(P,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const P=this._activeBuffer.scrollBottom-this._activeBuffer.y;return P>=0?this._moveCursor(0,Math.min(P,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const P=L.params[0];return P===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:P===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=L.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=L.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const P=L.params[0];return P===1&&(this._curAttrData.bg|=536870912),P!==2&&P!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,P,O,I=!1,W=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);K.replaceCells(P,O,this._activeBuffer.getNullCell(this._eraseAttrData()),W),I&&(K.isWrapped=!1)}_resetBufferLine(L,P=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),P),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),O.isWrapped=!1)}eraseInDisplay(L,P=!1){let O;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);O<this._bufferService.rows;O++)this._resetBufferLine(O,P);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,P),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,P);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,P);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(L,P=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,P);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,P)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let P=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;P--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let P=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;P--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let P=L.params[0]||1;for(;P--;)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(L){let P=L.params[0]||1;for(;P--;)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(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);I.deleteCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);I.insertCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);I.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);I.deleteCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const P=this._parser.precedingJoinState;if(!P)return!0;const O=L.params[0]||1,I=S.UnicodeService.extractWidth(P),W=this._activeBuffer.x-I,K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),q=new Uint32Array(K.length*O);let Z=0;for(let N=0;N<K.length;){const U=K.codePointAt(N)||0;q[Z++]=U,N+=U>65535?2:1}let z=Z;for(let N=1;N<O;++N)q.copyWithin(z,0,Z),z+=Z;return this.print(q,0,z),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let P=0;P<L.length;P++)switch(L.params[P]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let P=0;P<L.length;P++)switch(L.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(L){for(let P=0;P<L.length;P++)switch(L.params[P]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let P=0;P<L.length;P++)switch(L.params[P]){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(),L.params[P]===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(L,P){const O=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:W}=this._coreMouseService,K=this._coreService,{buffers:q,cols:Z}=this._bufferService,{active:z,alt:N}=q,U=this._optionsService.rawOptions,G=te=>te?1:2,Q=L.params[0];return Y=Q,ee=P?Q===2?4:Q===4?G(K.modes.insertMode):Q===12?3:Q===20?G(U.convertEol):0:Q===1?G(O.applicationCursorKeys):Q===3?U.windowOptions.setWinLines?Z===80?2:Z===132?1:0:0:Q===6?G(O.origin):Q===7?G(O.wraparound):Q===8?3:Q===9?G(I==="X10"):Q===12?G(U.cursorBlink):Q===25?G(!K.isCursorHidden):Q===45?G(O.reverseWraparound):Q===66?G(O.applicationKeypad):Q===67?4:Q===1e3?G(I==="VT200"):Q===1002?G(I==="DRAG"):Q===1003?G(I==="ANY"):Q===1004?G(O.sendFocus):Q===1005?4:Q===1006?G(W==="SGR"):Q===1015?4:Q===1016?G(W==="SGR_PIXELS"):Q===1048?1:Q===47||Q===1047||Q===1049?G(z===N):Q===2004?G(O.bracketedPasteMode):0,K.triggerDataEvent(`${l.C0.ESC}[${P?"":"?"}${Y};${ee}$y`),!0;var Y,ee}_updateAttrColor(L,P,O,I,W){return P===2?(L|=50331648,L&=-16777216,L|=y.AttributeData.fromColorRGB([O,I,W])):P===5&&(L&=-50331904,L|=33554432|255&O),L}_extractColor(L,P,O){const I=[0,0,-1,0,0,0];let W=0,K=0;do{if(I[K+W]=L.params[P+K],L.hasSubParams(P+K)){const q=L.getSubParams(P+K);let Z=0;do I[1]===5&&(W=1),I[K+Z+1+W]=q[Z];while(++Z<q.length&&Z+K+1+W<I.length);break}if(I[1]===5&&K+W>=2||I[1]===2&&K+W>=5)break;I[1]&&(W=1)}while(++K+P<L.length&&K+W<I.length);for(let q=2;q<I.length;++q)I[q]===-1&&(I[q]=0);switch(I[0]){case 38:O.fg=this._updateAttrColor(O.fg,I[1],I[3],I[4],I[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,I[1],I[3],I[4],I[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,I[1],I[3],I[4],I[5])}return K}_processUnderline(L,P){P.extended=P.extended.clone(),(!~L||L>5)&&(L=1),P.extended.underlineStyle=L,P.fg|=268435456,L===0&&(P.fg&=-268435457),P.updateExtended()}_processSGR0(L){L.fg=h.DEFAULT_ATTR_DATA.fg,L.bg=h.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const P=L.length;let O;const I=this._curAttrData;for(let W=0;W<P;W++)O=L.params[W],O>=30&&O<=37?(I.fg&=-50331904,I.fg|=16777216|O-30):O>=40&&O<=47?(I.bg&=-50331904,I.bg|=16777216|O-40):O>=90&&O<=97?(I.fg&=-50331904,I.fg|=16777224|O-90):O>=100&&O<=107?(I.bg&=-50331904,I.bg|=16777224|O-100):O===0?this._processSGR0(I):O===1?I.fg|=134217728:O===3?I.bg|=67108864:O===4?(I.fg|=268435456,this._processUnderline(L.hasSubParams(W)?L.getSubParams(W)[0]:1,I)):O===5?I.fg|=536870912:O===7?I.fg|=67108864:O===8?I.fg|=1073741824:O===9?I.fg|=2147483648:O===2?I.bg|=134217728:O===21?this._processUnderline(2,I):O===22?(I.fg&=-134217729,I.bg&=-134217729):O===23?I.bg&=-67108865:O===24?(I.fg&=-268435457,this._processUnderline(0,I)):O===25?I.fg&=-536870913:O===27?I.fg&=-67108865:O===28?I.fg&=-1073741825:O===29?I.fg&=2147483647:O===39?(I.fg&=-67108864,I.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):O===49?(I.bg&=-67108864,I.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?W+=this._extractColor(L,W,I):O===53?I.bg|=1073741824:O===55?I.bg&=-1073741825:O===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):O===100?(I.fg&=-67108864,I.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const P=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${P};${O}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const P=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${P};${O}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.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(L){const P=L.params[0]||1;switch(P){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 O=P%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(L){const P=L.params[0]||1;let O;return(L.length<2||(O=L.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>P&&(this._activeBuffer.scrollTop=P-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(L){if(!R(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const P=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:P!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:P!==0&&P!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),P!==0&&P!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:P!==0&&P!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),P!==0&&P!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){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(L){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(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const P=[],O=L.split(";");for(;O.length>1;){const I=O.shift(),W=O.shift();if(/^\d+$/.exec(I)){const K=parseInt(I);if(F(K))if(W==="?")P.push({type:0,index:K});else{const q=(0,k.parseColor)(W);q&&P.push({type:1,index:K,color:q})}}}return P.length&&this._onColor.fire(P),!0}setHyperlink(L){const P=L.split(";");return!(P.length<2)&&(P[1]?this._createHyperlink(P[0],P[1]):!P[0]&&this._finishHyperlink())}_createHyperlink(L,P){this._getCurrentLinkId()&&this._finishHyperlink();const O=L.split(":");let I;const W=O.findIndex(K=>K.startsWith("id="));return W!==-1&&(I=O[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:P}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,P){const O=L.split(";");for(let I=0;I<O.length&&!(P>=this._specialColors.length);++I,++P)if(O[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[P]}]);else{const W=(0,k.parseColor)(O[I]);W&&this._onColor.fire([{type:1,index:this._specialColors[P],color:W}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const P=[],O=L.split(";");for(let I=0;I<O.length;++I)if(/^\d+$/.exec(O[I])){const W=parseInt(O[I]);F(W)&&P.push({type:2,index:W})}return P.length&&this._onColor.fire(P),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){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,g.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(M[L[0]],g.CHARSETS[L[1]]||g.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 L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,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=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new u.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let P=0;P<this._bufferService.rows;++P){const O=this._activeBuffer.ybase+this._activeBuffer.y+P,I=this._activeBuffer.lines.get(O);I&&(I.fill(L),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,P){const O=this._bufferService.buffer,I=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${W}${l.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,P){this._dirtyRowTracker.markRangeDirty(L,P)}}n.InputHandler=j;let $=class{constructor(B){this._bufferService=B,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(B){B<this.start?this.start=B:B>this.end&&(this.end=B)}markRangeDirty(B,L){B>L&&(A=B,B=L,L=A),B<this.start&&(this.start=B),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function F(B){return 0<=B&&B<256}$=p([_(0,C.IBufferService)],$)},844:(c,n)=>{function a(p){for(const _ of p)_.dispose();p.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const p of this._disposables)p.dispose();this._disposables.length=0}register(p){return this._disposables.push(p),p}unregister(p){const _=this._disposables.indexOf(p);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(p){var _;this._isDisposed||p===this._value||((_=this._value)==null||_.dispose(),this._value=p)}clear(){this.value=void 0}dispose(){var p;this._isDisposed=!0,(p=this._value)==null||p.dispose(),this._value=void 0}},n.toDisposable=function(p){return{dispose:p}},n.disposeArray=a,n.getDisposeArrayDisposable=function(p){return{dispose:()=>a(p)}}},1505:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(_,l,g){this._data[_]||(this._data[_]={}),this._data[_][l]=g}get(_,l){return this._data[_]?this._data[_][l]:void 0}clear(){this._data={}}}n.TwoKeyMap=a,n.FourKeyMap=class{constructor(){this._data=new a}set(p,_,l,g,v){this._data.get(p,_)||this._data.set(p,_,new a),this._data.get(p,_).set(l,g,v)}get(p,_,l,g){var v;return(v=this._data.get(p,_))==null?void 0:v.get(l,g)}clear(){this._data.clear()}}},6114:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const a=n.isNode?"node":navigator.userAgent,p=n.isNode?"node":navigator.platform;n.isFirefox=a.includes("Firefox"),n.isLegacyEdge=a.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(a),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=a.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p),n.isIpad=p==="iPad",n.isIphone=p==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(p),n.isLinux=p.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(a)},6106:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let a=0;n.SortedList=class{constructor(p){this._getKey=p,this._array=[]}clear(){this._array.length=0}insert(p){this._array.length!==0?(a=this._search(this._getKey(p)),this._array.splice(a,0,p)):this._array.push(p)}delete(p){if(this._array.length===0)return!1;const _=this._getKey(p);if(_===void 0||(a=this._search(_),a===-1)||this._getKey(this._array[a])!==_)return!1;do if(this._array[a]===p)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===_);return!1}*getKeyIterator(p){if(this._array.length!==0&&(a=this._search(p),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===p))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===p)}forEachByKey(p,_){if(this._array.length!==0&&(a=this._search(p),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===p))do _(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===p)}values(){return[...this._array].values()}_search(p){let _=0,l=this._array.length-1;for(;l>=_;){let g=_+l>>1;const v=this._getKey(this._array[g]);if(v>p)l=g-1;else{if(!(v<p)){for(;g>0&&this._getKey(this._array[g-1])===p;)g--;return g}_=g+1}}return _}}},7226:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const p=a(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),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(v){this._idleCallback=void 0;let w=0,m=0,h=v.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),m=Math.max(w,m),f=v.timeRemaining(),1.5*m>f)return h-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-w))}ms`),void this._start();h=f}this.clear()}}class l extends _{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const w=Date.now()+v;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}n.PriorityTaskQueue=l,n.IdleTaskQueue=!p.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:l,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const p=a(643);n.updateWindowsModeWrappedState=function(_){const l=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),g=l==null?void 0:l.get(_.cols-1),v=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);v&&g&&(v.isWrapped=g[p.CHAR_DATA_CODE_INDEX]!==p.NULL_CELL_CODE&&g[p.CHAR_DATA_CODE_INDEX]!==p.WHITESPACE_CELL_CODE)}},3734:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new p}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new a;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=a;class p{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,g=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=g}clone(){return new p(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=p},9092:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const p=a(6349),_=a(7226),l=a(3734),g=a(8437),v=a(4634),w=a(511),m=a(643),h=a(4863),f=a(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(d,u,y){this._hasScrollback=d,this._optionsService=u,this._bufferService=y,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=f.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.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 p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,u){return new g.BufferLine(this._bufferService.cols,this.getNullCell(d),u)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const u=d+this._optionsService.rawOptions.scrollback;return u>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:u}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=g.DEFAULT_ATTR_DATA);let u=this._rows;for(;u--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,u){const y=this.getNullCell(g.DEFAULT_ATTR_DATA);let C=0;const S=this._getCorrectBufferLength(u);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<d)for(let x=0;x<this.lines.length;x++)C+=+this.lines.get(x).resize(d,y);let b=0;if(this._rows<u)for(let x=this._rows;x<u;x++)this.lines.length<u+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(d,y)):this.ybase>0&&this.lines.length<=this.ybase+this.y+b+1?(this.ybase--,b++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(d,y)));else for(let x=this._rows;x>u;x--)this.lines.length>u+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const x=this.lines.length-S;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=S}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,u-1),b&&(this.y+=b),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=u-1,this._isReflowEnabled&&(this._reflow(d,u),this._cols>d))for(let b=0;b<this.lines.length;b++)C+=+this.lines.get(b).resize(d,y);this._cols=d,this._rows=u,this._memoryCleanupQueue.clear(),C>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let u=0;for(;this._memoryCleanupPosition<this.lines.length;)if(u+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),u>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,u){this._cols!==d&&(d>this._cols?this._reflowLarger(d,u):this._reflowSmaller(d,u))}_reflowLarger(d,u){const y=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(y.length>0){const C=(0,v.reflowLargerCreateNewLayout)(this.lines,y);(0,v.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(d,u,C.countRemoved)}}_reflowLargerAdjustViewport(d,u,y){const C=this.getNullCell(g.DEFAULT_ATTR_DATA);let S=y;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<u&&this.lines.push(new g.BufferLine(d,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-y,0)}_reflowSmaller(d,u){const y=this.getNullCell(g.DEFAULT_ATTR_DATA),C=[];let S=0;for(let b=this.lines.length-1;b>=0;b--){let x=this.lines.get(b);if(!x||!x.isWrapped&&x.getTrimmedLength()<=d)continue;const k=[x];for(;x.isWrapped&&b>0;)x=this.lines.get(--b),k.unshift(x);const M=this.ybase+this.y;if(M>=b&&M<b+k.length)continue;const D=k[k.length-1].getTrimmedLength(),R=(0,v.reflowSmallerGetNewLineLengths)(k,this._cols,d),T=R.length-k.length;let A;A=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const j=[];for(let O=0;O<T;O++){const I=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);j.push(I)}j.length>0&&(C.push({start:b+k.length+S,newLines:j}),S+=j.length),k.push(...j);let $=R.length-1,F=R[$];F===0&&($--,F=R[$]);let B=k.length-T-1,L=D;for(;B>=0;){const O=Math.min(L,F);if(k[$]===void 0)break;if(k[$].copyCellsFrom(k[B],L-O,F-O,O,!0),F-=O,F===0&&($--,F=R[$]),L-=O,L===0){B--;const I=Math.max(B,0);L=(0,v.getWrappedLineTrimmedLength)(k,I,this._cols)}}for(let O=0;O<k.length;O++)R[O]<d&&k[O].setCell(R[O],y);let P=T-A;for(;P-- >0;)this.ybase===0?this.y<u-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-u&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+T,this.ybase+u-1)}if(C.length>0){const b=[],x=[];for(let $=0;$<this.lines.length;$++)x.push(this.lines.get($));const k=this.lines.length;let M=k-1,D=0,R=C[D];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let T=0;for(let $=Math.min(this.lines.maxLength-1,k+S-1);$>=0;$--)if(R&&R.start>M+T){for(let F=R.newLines.length-1;F>=0;F--)this.lines.set($--,R.newLines[F]);$++,b.push({index:M+1,amount:R.newLines.length}),T+=R.newLines.length,R=C[++D]}else this.lines.set($,x[M--]);let A=0;for(let $=b.length-1;$>=0;$--)b[$].index+=A,this.lines.onInsertEmitter.fire(b[$]),A+=b[$].amount;const j=Math.max(0,k+S-this.lines.maxLength);j>0&&this.lines.onTrimEmitter.fire(j)}}translateBufferLineToString(d,u,y=0,C){const S=this.lines.get(d);return S?S.translateToString(u,y,C):""}getWrappedRangeForLine(d){let u=d,y=d;for(;u>0&&this.lines.get(u).isWrapped;)u--;for(;y+1<this.lines.length&&this.lines.get(y+1).isWrapped;)y++;return{first:u,last:y}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let u=0;u<this.markers.length;u++)this.markers[u].line===d&&(this.markers[u].dispose(),this.markers.splice(u--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const u=new h.Marker(d);return this.markers.push(u),u.register(this.lines.onTrim(y=>{u.line-=y,u.line<0&&u.dispose()})),u.register(this.lines.onInsert(y=>{u.line>=y.index&&(u.line+=y.amount)})),u.register(this.lines.onDelete(y=>{u.line>=y.index&&u.line<y.index+y.amount&&u.dispose(),u.line>y.index&&(u.line-=y.amount)})),u.register(u.onDispose(()=>this._removeMarker(u))),u}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const p=a(3734),_=a(511),l=a(643),g=a(482);n.DEFAULT_ATTR_DATA=Object.freeze(new p.AttributeData);let v=0;class w{constructor(h,f,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const u=f||_.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let y=0;y<h;++y)this.setCell(y,u);this.length=h}get(h){const f=this._data[3*h+0],d=2097151&f;return[this._data[3*h+1],2097152&f?this._combined[h]:d?(0,g.stringFromCodePoint)(d):"",f>>22,2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):d]}set(h,f){this._data[3*h+1]=f[l.CHAR_DATA_ATTR_INDEX],f[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=f[1],this._data[3*h+0]=2097152|h|f[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=f[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&f}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h]:2097151&f?(0,g.stringFromCodePoint)(2097151&f):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,f){return v=3*h,f.content=this._data[v+0],f.fg=this._data[v+1],f.bg=this._data[v+2],2097152&f.content&&(f.combinedData=this._combined[h]),268435456&f.bg&&(f.extended=this._extendedAttrs[h]),f}setCell(h,f){2097152&f.content&&(this._combined[h]=f.combinedData),268435456&f.bg&&(this._extendedAttrs[h]=f.extended),this._data[3*h+0]=f.content,this._data[3*h+1]=f.fg,this._data[3*h+2]=f.bg}setCellFromCodepoint(h,f,d,u){268435456&u.bg&&(this._extendedAttrs[h]=u.extended),this._data[3*h+0]=f|d<<22,this._data[3*h+1]=u.fg,this._data[3*h+2]=u.bg}addCodepointToCell(h,f,d){let u=this._data[3*h+0];2097152&u?this._combined[h]+=(0,g.stringFromCodePoint)(f):2097151&u?(this._combined[h]=(0,g.stringFromCodePoint)(2097151&u)+(0,g.stringFromCodePoint)(f),u&=-2097152,u|=2097152):u=f|4194304,d&&(u&=-12582913,u|=d<<22),this._data[3*h+0]=u}insertCells(h,f,d){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length-h){const u=new _.CellData;for(let y=this.length-h-f-1;y>=0;--y)this.setCell(h+f+y,this.loadCell(h+y,u));for(let y=0;y<f;++y)this.setCell(h+y,d)}else for(let u=h;u<this.length;++u)this.setCell(u,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(h,f,d){if(h%=this.length,f<this.length-h){const u=new _.CellData;for(let y=0;y<this.length-h-f;++y)this.setCell(h+y,this.loadCell(h+f+y,u));for(let y=this.length-f;y<this.length;++y)this.setCell(y,d)}else for(let u=h;u<this.length;++u)this.setCell(u,d);h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodepoint(h,0,1,d)}replaceCells(h,f,d,u=!1){if(u)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&!this.isProtected(f)&&this.setCellFromCodepoint(f,0,1,d);h<f&&h<this.length;)this.isProtected(h)||this.setCell(h,d),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f,0,1,d);h<f&&h<this.length;)this.setCell(h++,d)}resize(h,f){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const u=new Uint32Array(d);u.set(this._data),this._data=u}for(let u=this.length;u<h;++u)this.setCell(u,f)}else{this._data=this._data.subarray(0,d);const u=Object.keys(this._combined);for(let C=0;C<u.length;C++){const S=parseInt(u[C],10);S>=h&&delete this._combined[S]}const y=Object.keys(this._extendedAttrs);for(let C=0;C<y.length;C++){const S=parseInt(y[C],10);S>=h&&delete this._extendedAttrs[S]}}return this.length=h,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,f=!1){if(f)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,h);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const f in h._combined)this._combined[f]=h._combined[f];this._extendedAttrs={};for(const f in h._extendedAttrs)this._extendedAttrs[f]=h._extendedAttrs[f];this.isWrapped=h.isWrapped}clone(){const h=new w(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const f in this._combined)h._combined[f]=this._combined[f];for(const f in this._extendedAttrs)h._extendedAttrs[f]=this._extendedAttrs[f];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,f,d,u,y){const C=h._data;if(y)for(let b=u-1;b>=0;b--){for(let x=0;x<3;x++)this._data[3*(d+b)+x]=C[3*(f+b)+x];268435456&C[3*(f+b)+2]&&(this._extendedAttrs[d+b]=h._extendedAttrs[f+b])}else for(let b=0;b<u;b++){for(let x=0;x<3;x++)this._data[3*(d+b)+x]=C[3*(f+b)+x];268435456&C[3*(f+b)+2]&&(this._extendedAttrs[d+b]=h._extendedAttrs[f+b])}const S=Object.keys(h._combined);for(let b=0;b<S.length;b++){const x=parseInt(S[b],10);x>=f&&(this._combined[x-f+d]=h._combined[x])}}translateToString(h,f,d,u){f=f??0,d=d??this.length,h&&(d=Math.min(d,this.getTrimmedLength())),u&&(u.length=0);let y="";for(;f<d;){const C=this._data[3*f+0],S=2097151&C,b=2097152&C?this._combined[f]:S?(0,g.stringFromCodePoint)(S):l.WHITESPACE_CELL_CHAR;if(y+=b,u)for(let x=0;x<b.length;++x)u.push(f);f+=C>>22||1}return u&&u.push(f),y}}n.BufferLine=w},4841:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(a,p){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return p*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(c,n)=>{function a(p,_,l){if(_===p.length-1)return p[_].getTrimmedLength();const g=!p[_].hasContent(l-1)&&p[_].getWidth(l-1)===1,v=p[_+1].getWidth(0)===2;return g&&v?l-1:l}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(p,_,l,g,v){const w=[];for(let m=0;m<p.length-1;m++){let h=m,f=p.get(++h);if(!f.isWrapped)continue;const d=[p.get(m)];for(;h<p.length&&f.isWrapped;)d.push(f),f=p.get(++h);if(g>=m&&g<h){m+=d.length-1;continue}let u=0,y=a(d,u,_),C=1,S=0;for(;C<d.length;){const x=a(d,C,_),k=x-S,M=l-y,D=Math.min(k,M);d[u].copyCellsFrom(d[C],S,y,D,!1),y+=D,y===l&&(u++,y=0),S+=D,S===x&&(C++,S=0),y===0&&u!==0&&d[u-1].getWidth(l-1)===2&&(d[u].copyCellsFrom(d[u-1],l-1,y++,1,!1),d[u-1].setCell(l-1,v))}d[u].replaceCells(y,l,v);let b=0;for(let x=d.length-1;x>0&&(x>u||d[x].getTrimmedLength()===0);x--)b++;b>0&&(w.push(m+d.length-b),w.push(b)),m+=d.length-1}return w},n.reflowLargerCreateNewLayout=function(p,_){const l=[];let g=0,v=_[g],w=0;for(let m=0;m<p.length;m++)if(v===m){const h=_[++g];p.onDeleteEmitter.fire({index:m-w,amount:h}),m+=h-1,w+=h,v=_[++g]}else l.push(m);return{layout:l,countRemoved:w}},n.reflowLargerApplyNewLayout=function(p,_){const l=[];for(let g=0;g<_.length;g++)l.push(p.get(_[g]));for(let g=0;g<l.length;g++)p.set(g,l[g]);p.length=_.length},n.reflowSmallerGetNewLineLengths=function(p,_,l){const g=[],v=p.map((f,d)=>a(p,d,_)).reduce((f,d)=>f+d);let w=0,m=0,h=0;for(;h<v;){if(v-h<l){g.push(v-h);break}w+=l;const f=a(p,m,_);w>f&&(w-=f,m++);const d=p[m].getWidth(w-1)===2;d&&w--;const u=d?l-1:l;g.push(u),h+=u}return g},n.getWrappedLineTrimmedLength=a},5295:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const p=a(8460),_=a(844),l=a(9092);class g extends _.Disposable{constructor(w,m){super(),this._optionsService=w,this._bufferService=m,this._onBufferActivate=this.register(new p.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,m){this._normal.resize(w,m),this._alt.resize(w,m),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}n.BufferSet=g},511:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const p=a(482),_=a(643),l=a(3734);class g extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const m=new g;return m.setFromCharData(w),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,p.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(w[_.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(w[_.CHAR_DATA_CHAR_INDEX].length===2){const h=w[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const f=w[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(h-55296)+f-56320+65536|w[_.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=w[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[_.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=w[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=g},643:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const p=a(8460),_=a(844);class l{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}n.Marker=l,l._nextId=1},7116:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(c,n)=>{var a,p,_;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
|
|
75
|
-
`,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""}(a||(n.C0=a={})),function(l){l.PAD="",l.HOP="",l.BPH="",l.NBH="",l.IND="",l.NEL="
",l.SSA="",l.ESA="",l.HTS="",l.HTJ="",l.VTS="",l.PLD="",l.PLU="",l.RI="",l.SS2="",l.SS3="",l.DCS="",l.PU1="",l.PU2="",l.STS="",l.CCH="",l.MW="",l.SPA="",l.EPA="",l.SOS="",l.SGCI="",l.SCI="",l.CSI="",l.ST="",l.OSC="",l.PM="",l.APC=""}(p||(n.C1=p={})),function(l){l.ST=`${a.ESC}\\`}(_||(n.C1_ESCAPED=_={}))},7399:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const p=a(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};n.evaluateKeyboardEvent=function(l,g,v,w){const m={type:0,cancel:!1,key:void 0},h=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?m.key=g?p.C0.ESC+"OA":p.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?m.key=g?p.C0.ESC+"OD":p.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?m.key=g?p.C0.ESC+"OC":p.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(m.key=g?p.C0.ESC+"OB":p.C0.ESC+"[B");break;case 8:m.key=l.ctrlKey?"\b":p.C0.DEL,l.altKey&&(m.key=p.C0.ESC+m.key);break;case 9:if(l.shiftKey){m.key=p.C0.ESC+"[Z";break}m.key=p.C0.HT,m.cancel=!0;break;case 13:m.key=l.altKey?p.C0.ESC+p.C0.CR:p.C0.CR,m.cancel=!0;break;case 27:m.key=p.C0.ESC,l.altKey&&(m.key=p.C0.ESC+p.C0.ESC),m.cancel=!0;break;case 37:if(l.metaKey)break;h?(m.key=p.C0.ESC+"[1;"+(h+1)+"D",m.key===p.C0.ESC+"[1;3D"&&(m.key=p.C0.ESC+(v?"b":"[1;5D"))):m.key=g?p.C0.ESC+"OD":p.C0.ESC+"[D";break;case 39:if(l.metaKey)break;h?(m.key=p.C0.ESC+"[1;"+(h+1)+"C",m.key===p.C0.ESC+"[1;3C"&&(m.key=p.C0.ESC+(v?"f":"[1;5C"))):m.key=g?p.C0.ESC+"OC":p.C0.ESC+"[C";break;case 38:if(l.metaKey)break;h?(m.key=p.C0.ESC+"[1;"+(h+1)+"A",v||m.key!==p.C0.ESC+"[1;3A"||(m.key=p.C0.ESC+"[1;5A")):m.key=g?p.C0.ESC+"OA":p.C0.ESC+"[A";break;case 40:if(l.metaKey)break;h?(m.key=p.C0.ESC+"[1;"+(h+1)+"B",v||m.key!==p.C0.ESC+"[1;3B"||(m.key=p.C0.ESC+"[1;5B")):m.key=g?p.C0.ESC+"OB":p.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(m.key=p.C0.ESC+"[2~");break;case 46:m.key=h?p.C0.ESC+"[3;"+(h+1)+"~":p.C0.ESC+"[3~";break;case 36:m.key=h?p.C0.ESC+"[1;"+(h+1)+"H":g?p.C0.ESC+"OH":p.C0.ESC+"[H";break;case 35:m.key=h?p.C0.ESC+"[1;"+(h+1)+"F":g?p.C0.ESC+"OF":p.C0.ESC+"[F";break;case 33:l.shiftKey?m.type=2:l.ctrlKey?m.key=p.C0.ESC+"[5;"+(h+1)+"~":m.key=p.C0.ESC+"[5~";break;case 34:l.shiftKey?m.type=3:l.ctrlKey?m.key=p.C0.ESC+"[6;"+(h+1)+"~":m.key=p.C0.ESC+"[6~";break;case 112:m.key=h?p.C0.ESC+"[1;"+(h+1)+"P":p.C0.ESC+"OP";break;case 113:m.key=h?p.C0.ESC+"[1;"+(h+1)+"Q":p.C0.ESC+"OQ";break;case 114:m.key=h?p.C0.ESC+"[1;"+(h+1)+"R":p.C0.ESC+"OR";break;case 115:m.key=h?p.C0.ESC+"[1;"+(h+1)+"S":p.C0.ESC+"OS";break;case 116:m.key=h?p.C0.ESC+"[15;"+(h+1)+"~":p.C0.ESC+"[15~";break;case 117:m.key=h?p.C0.ESC+"[17;"+(h+1)+"~":p.C0.ESC+"[17~";break;case 118:m.key=h?p.C0.ESC+"[18;"+(h+1)+"~":p.C0.ESC+"[18~";break;case 119:m.key=h?p.C0.ESC+"[19;"+(h+1)+"~":p.C0.ESC+"[19~";break;case 120:m.key=h?p.C0.ESC+"[20;"+(h+1)+"~":p.C0.ESC+"[20~";break;case 121:m.key=h?p.C0.ESC+"[21;"+(h+1)+"~":p.C0.ESC+"[21~";break;case 122:m.key=h?p.C0.ESC+"[23;"+(h+1)+"~":p.C0.ESC+"[23~";break;case 123:m.key=h?p.C0.ESC+"[24;"+(h+1)+"~":p.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(v&&!w||!l.altKey||l.metaKey)!v||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?m.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(m.key=p.C0.US),l.key==="@"&&(m.key=p.C0.NUL)):l.keyCode===65&&(m.type=1);else{const f=_[l.keyCode],d=f==null?void 0:f[l.shiftKey?1:0];if(d)m.key=p.C0.ESC+d;else if(l.keyCode>=65&&l.keyCode<=90){const u=l.ctrlKey?l.keyCode-64:l.keyCode+32;let y=String.fromCharCode(u);l.shiftKey&&(y=y.toUpperCase()),m.key=p.C0.ESC+y}else if(l.keyCode===32)m.key=p.C0.ESC+(l.ctrlKey?p.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let u=l.code.slice(3,4);l.shiftKey||(u=u.toLowerCase()),m.key=p.C0.ESC+u,m.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?m.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?m.key=p.C0.NUL:l.keyCode>=51&&l.keyCode<=55?m.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?m.key=p.C0.DEL:l.keyCode===219?m.key=p.C0.ESC:l.keyCode===220?m.key=p.C0.FS:l.keyCode===221&&(m.key=p.C0.GS)}return m}},482:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},n.utf32ToString=function(a,p=0,_=a.length){let l="";for(let g=p;g<_;++g){let v=a[g];v>65535?(v-=65536,l+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):l+=String.fromCharCode(v)}return l},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,p){const _=a.length;if(!_)return 0;let l=0,g=0;if(this._interim){const v=a.charCodeAt(g++);56320<=v&&v<=57343?p[l++]=1024*(this._interim-55296)+v-56320+65536:(p[l++]=this._interim,p[l++]=v),this._interim=0}for(let v=g;v<_;++v){const w=a.charCodeAt(v);if(55296<=w&&w<=56319){if(++v>=_)return this._interim=w,l;const m=a.charCodeAt(v);56320<=m&&m<=57343?p[l++]=1024*(w-55296)+m-56320+65536:(p[l++]=w,p[l++]=m)}else w!==65279&&(p[l++]=w)}return l}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,p){const _=a.length;if(!_)return 0;let l,g,v,w,m=0,h=0,f=0;if(this.interim[0]){let y=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let S,b=0;for(;(S=63&this.interim[++b])&&b<4;)C<<=6,C|=S;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=x-b;for(;f<k;){if(f>=_)return 0;if(S=a[f++],(192&S)!=128){f--,y=!0;break}this.interim[b++]=S,C<<=6,C|=63&S}y||(x===2?C<128?f--:p[m++]=C:x===3?C<2048||C>=55296&&C<=57343||C===65279||(p[m++]=C):C<65536||C>1114111||(p[m++]=C)),this.interim.fill(0)}const d=_-4;let u=f;for(;u<_;){for(;!(!(u<d)||128&(l=a[u])||128&(g=a[u+1])||128&(v=a[u+2])||128&(w=a[u+3]));)p[m++]=l,p[m++]=g,p[m++]=v,p[m++]=w,u+=4;if(l=a[u++],l<128)p[m++]=l;else if((224&l)==192){if(u>=_)return this.interim[0]=l,m;if(g=a[u++],(192&g)!=128){u--;continue}if(h=(31&l)<<6|63&g,h<128){u--;continue}p[m++]=h}else if((240&l)==224){if(u>=_)return this.interim[0]=l,m;if(g=a[u++],(192&g)!=128){u--;continue}if(u>=_)return this.interim[0]=l,this.interim[1]=g,m;if(v=a[u++],(192&v)!=128){u--;continue}if(h=(15&l)<<12|(63&g)<<6|63&v,h<2048||h>=55296&&h<=57343||h===65279)continue;p[m++]=h}else if((248&l)==240){if(u>=_)return this.interim[0]=l,m;if(g=a[u++],(192&g)!=128){u--;continue}if(u>=_)return this.interim[0]=l,this.interim[1]=g,m;if(v=a[u++],(192&v)!=128){u--;continue}if(u>=_)return this.interim[0]=l,this.interim[1]=g,this.interim[2]=v,m;if(w=a[u++],(192&w)!=128){u--;continue}if(h=(7&l)<<18|(63&g)<<12|(63&v)<<6|63&w,h<65536||h>1114111)continue;p[m++]=h}}return m}}},225:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const p=a(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],l=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;n.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let v=0;v<_.length;++v)g.fill(0,_[v][0],_[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?g[v]:function(w,m){let h,f=0,d=m.length-1;if(w<m[0][0]||w>m[d][1])return!1;for(;d>=f;)if(h=f+d>>1,w>m[h][1])f=h+1;else{if(!(w<m[h][0]))return!0;d=h-1}return!1}(v,l)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,w){let m=this.wcwidth(v),h=m===0&&w!==0;if(h){const f=p.UnicodeService.extractWidth(w);f===0?h=!1:f>m&&(m=f)}return p.UnicodeService.createPropertyValue(0,m,h)}}},5981:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const p=a(8460),_=a(844);class l extends _.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const h=this._callbacks.shift();h&&h()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w)}_innerWrite(v=0,w=!0){const m=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const h=this._writeBuffer[this._bufferOffset],f=this._action(h,w);if(f){const u=y=>Date.now()-m>=12?setTimeout(()=>this._innerWrite(0,y)):this._innerWrite(m,y);return void f.catch(y=>(queueMicrotask(()=>{throw y}),Promise.resolve(!1))).then(u)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=h.length,Date.now()-m>=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()}}n.WriteBuffer=l},5941:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,p=/^[\da-f]+$/;function _(l,g){const v=l.toString(16),w=v.length<2?"0"+v:v;switch(g){case 4:return v[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}n.parseColor=function(l){if(!l)return;let g=l.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const v=a.exec(g);if(v){const w=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/w*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/w*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/w*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),p.exec(g)&&[3,6,9,12].includes(g.length))){const v=g.length/3,w=[0,0,0];for(let m=0;m<3;++m){const h=parseInt(g.slice(v*m,v*m+v),16);w[m]=v===1?h<<4:v===2?h:v===3?h>>4:h>>8}return w}},n.toRgbString=function(l,g=16){const[v,w,m]=l;return`rgb:${_(v,g)}/${_(w,g)}/${_(m,g)}`}},5770:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const p=a(482),_=a(8742),l=a(5770),g=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(w,m){this._handlers[w]===void 0&&(this._handlers[w]=[]);const h=this._handlers[w];return h.push(m),{dispose:()=>{const f=h.indexOf(m);f!==-1&&h.splice(f,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(w,m){if(this.reset(),this._ident=w,this._active=this._handlers[w]||g,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(w,m,h){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(w,m,h);else this._handlerFb(this._ident,"PUT",(0,p.utf32ToString)(w,m,h))}unhook(w,m=!0){if(this._active.length){let h=!1,f=this._active.length-1,d=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,h=m,d=this._stack.fallThrough,this._stack.paused=!1),!d&&h===!1){for(;f>=0&&(h=this._active[f].unhook(w),h!==!0);f--)if(h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,h;f--}for(;f>=0;f--)if(h=this._active[f].unhook(!1),h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,h}else this._handlerFb(this._ident,"UNHOOK",w);this._active=g,this._ident=0}};const v=new _.Params;v.addParam(0),n.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=v,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():v,this._data="",this._hitLimit=!1}put(w,m,h){this._hitLimit||(this._data+=(0,p.utf32ToString)(w,m,h),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let m=!1;if(this._hitLimit)m=!1;else if(w&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then(h=>(this._params=v,this._data="",this._hitLimit=!1,h));return this._params=v,this._data="",this._hitLimit=!1,m}}},2015:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const p=a(844),_=a(8742),l=a(6242),g=a(6351);class v{constructor(f){this.table=new Uint8Array(f)}setDefault(f,d){this.table.fill(f<<4|d)}add(f,d,u,y){this.table[d<<8|f]=u<<4|y}addMany(f,d,u,y){for(let C=0;C<f.length;C++)this.table[d<<8|f[C]]=u<<4|y}}n.TransitionTable=v;const w=160;n.VT500_TRANSITION_TABLE=function(){const h=new v(4095),f=Array.apply(null,Array(256)).map((b,x)=>x),d=(b,x)=>f.slice(b,x),u=d(32,127),y=d(0,24);y.push(25),y.push.apply(y,d(28,32));const C=d(0,14);let S;for(S in h.setDefault(1,0),h.addMany(u,0,2,0),C)h.addMany([24,26,153,154],S,3,0),h.addMany(d(128,144),S,3,0),h.addMany(d(144,152),S,3,0),h.add(156,S,0,0),h.add(27,S,11,1),h.add(157,S,4,8),h.addMany([152,158,159],S,0,7),h.add(155,S,11,3),h.add(144,S,11,9);return h.addMany(y,0,3,0),h.addMany(y,1,3,1),h.add(127,1,0,1),h.addMany(y,8,0,8),h.addMany(y,3,3,3),h.add(127,3,0,3),h.addMany(y,4,3,4),h.add(127,4,0,4),h.addMany(y,6,3,6),h.addMany(y,5,3,5),h.add(127,5,0,5),h.addMany(y,2,3,2),h.add(127,2,0,2),h.add(93,1,4,8),h.addMany(u,8,5,8),h.add(127,8,5,8),h.addMany([156,27,24,26,7],8,6,0),h.addMany(d(28,32),8,0,8),h.addMany([88,94,95],1,0,7),h.addMany(u,7,0,7),h.addMany(y,7,0,7),h.add(156,7,0,0),h.add(127,7,0,7),h.add(91,1,11,3),h.addMany(d(64,127),3,7,0),h.addMany(d(48,60),3,8,4),h.addMany([60,61,62,63],3,9,4),h.addMany(d(48,60),4,8,4),h.addMany(d(64,127),4,7,0),h.addMany([60,61,62,63],4,0,6),h.addMany(d(32,64),6,0,6),h.add(127,6,0,6),h.addMany(d(64,127),6,0,0),h.addMany(d(32,48),3,9,5),h.addMany(d(32,48),5,9,5),h.addMany(d(48,64),5,0,6),h.addMany(d(64,127),5,7,0),h.addMany(d(32,48),4,9,5),h.addMany(d(32,48),1,9,2),h.addMany(d(32,48),2,9,2),h.addMany(d(48,127),2,10,0),h.addMany(d(48,80),1,10,0),h.addMany(d(81,88),1,10,0),h.addMany([89,90,92],1,10,0),h.addMany(d(96,127),1,10,0),h.add(80,1,11,9),h.addMany(y,9,0,9),h.add(127,9,0,9),h.addMany(d(28,32),9,0,9),h.addMany(d(32,48),9,9,12),h.addMany(d(48,60),9,8,10),h.addMany([60,61,62,63],9,9,10),h.addMany(y,11,0,11),h.addMany(d(32,128),11,0,11),h.addMany(d(28,32),11,0,11),h.addMany(y,10,0,10),h.add(127,10,0,10),h.addMany(d(28,32),10,0,10),h.addMany(d(48,60),10,8,10),h.addMany([60,61,62,63],10,0,11),h.addMany(d(32,48),10,9,12),h.addMany(y,12,0,12),h.add(127,12,0,12),h.addMany(d(28,32),12,0,12),h.addMany(d(32,48),12,9,12),h.addMany(d(48,64),12,0,11),h.addMany(d(64,127),12,12,13),h.addMany(d(64,127),10,12,13),h.addMany(d(64,127),9,12,13),h.addMany(y,13,13,13),h.addMany(u,13,13,13),h.add(127,13,0,13),h.addMany([27,156,24,26],13,14,0),h.add(w,0,2,0),h.add(w,8,5,8),h.add(w,6,0,6),h.add(w,11,0,11),h.add(w,13,13,13),h}();class m extends p.Disposable{constructor(f=n.VT500_TRANSITION_TABLE){super(),this._transitions=f,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=(d,u,y)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,u)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,p.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(f,d=[64,126]){let u=0;if(f.prefix){if(f.prefix.length>1)throw new Error("only one byte as prefix supported");if(u=f.prefix.charCodeAt(0),u&&60>u||u>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(f.intermediates){if(f.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<f.intermediates.length;++C){const S=f.intermediates.charCodeAt(C);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");u<<=8,u|=S}}if(f.final.length!==1)throw new Error("final must be a single byte");const y=f.final.charCodeAt(0);if(d[0]>y||y>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return u<<=8,u|=y,u}identToString(f){const d=[];for(;f;)d.push(String.fromCharCode(255&f)),f>>=8;return d.reverse().join("")}setPrintHandler(f){this._printHandler=f}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(f,d){const u=this._identifier(f,[48,126]);this._escHandlers[u]===void 0&&(this._escHandlers[u]=[]);const y=this._escHandlers[u];return y.push(d),{dispose:()=>{const C=y.indexOf(d);C!==-1&&y.splice(C,1)}}}clearEscHandler(f){this._escHandlers[this._identifier(f,[48,126])]&&delete this._escHandlers[this._identifier(f,[48,126])]}setEscHandlerFallback(f){this._escHandlerFb=f}setExecuteHandler(f,d){this._executeHandlers[f.charCodeAt(0)]=d}clearExecuteHandler(f){this._executeHandlers[f.charCodeAt(0)]&&delete this._executeHandlers[f.charCodeAt(0)]}setExecuteHandlerFallback(f){this._executeHandlerFb=f}registerCsiHandler(f,d){const u=this._identifier(f);this._csiHandlers[u]===void 0&&(this._csiHandlers[u]=[]);const y=this._csiHandlers[u];return y.push(d),{dispose:()=>{const C=y.indexOf(d);C!==-1&&y.splice(C,1)}}}clearCsiHandler(f){this._csiHandlers[this._identifier(f)]&&delete this._csiHandlers[this._identifier(f)]}setCsiHandlerFallback(f){this._csiHandlerFb=f}registerDcsHandler(f,d){return this._dcsParser.registerHandler(this._identifier(f),d)}clearDcsHandler(f){this._dcsParser.clearHandler(this._identifier(f))}setDcsHandlerFallback(f){this._dcsParser.setHandlerFallback(f)}registerOscHandler(f,d){return this._oscParser.registerHandler(f,d)}clearOscHandler(f){this._oscParser.clearHandler(f)}setOscHandlerFallback(f){this._oscParser.setHandlerFallback(f)}setErrorHandler(f){this._errorHandler=f}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(f,d,u,y,C){this._parseStack.state=f,this._parseStack.handlers=d,this._parseStack.handlerPos=u,this._parseStack.transition=y,this._parseStack.chunkPos=C}parse(f,d,u){let y,C=0,S=0,b=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,b=this._parseStack.chunkPos+1;else{if(u===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 k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(u===!1&&k>-1){for(;k>=0&&(y=x[k](this._params),y!==!0);k--)if(y instanceof Promise)return this._parseStack.handlerPos=k,y}this._parseStack.handlers=[];break;case 4:if(u===!1&&k>-1){for(;k>=0&&(y=x[k](),y!==!0);k--)if(y instanceof Promise)return this._parseStack.handlerPos=k,y}this._parseStack.handlers=[];break;case 6:if(C=f[this._parseStack.chunkPos],y=this._dcsParser.unhook(C!==24&&C!==26,u),y)return y;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=f[this._parseStack.chunkPos],y=this._oscParser.end(C!==24&&C!==26,u),y)return y;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,b=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let x=b;x<d;++x){switch(C=f[x],S=this._transitions.table[this.currentState<<8|(C<160?C:w)],S>>4){case 2:for(let T=x+1;;++T){if(T>=d||(C=f[T])<32||C>126&&C<w){this._printHandler(f,x,T),x=T-1;break}if(++T>=d||(C=f[T])<32||C>126&&C<w){this._printHandler(f,x,T),x=T-1;break}if(++T>=d||(C=f[T])<32||C>126&&C<w){this._printHandler(f,x,T),x=T-1;break}if(++T>=d||(C=f[T])<32||C>126&&C<w){this._printHandler(f,x,T),x=T-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|C];let M=k?k.length-1:-1;for(;M>=0&&(y=k[M](this._params),y!==!0);M--)if(y instanceof Promise)return this._preserveStack(3,k,M,S,x),y;M<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++x<d&&(C=f[x])>47&&C<60);x--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const D=this._escHandlers[this._collect<<8|C];let R=D?D.length-1:-1;for(;R>=0&&(y=D[R](),y!==!0);R--)if(y instanceof Promise)return this._preserveStack(4,D,R,S,x),y;R<0&&this._escHandlerFb(this._collect<<8|C),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|C,this._params);break;case 13:for(let T=x+1;;++T)if(T>=d||(C=f[T])===24||C===26||C===27||C>127&&C<w){this._dcsParser.put(f,x,T),x=T-1;break}break;case 14:if(y=this._dcsParser.unhook(C!==24&&C!==26),y)return this._preserveStack(6,[],0,S,x),y;C===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let T=x+1;;T++)if(T>=d||(C=f[T])<32||C>127&&C<w){this._oscParser.put(f,x,T),x=T-1;break}break;case 6:if(y=this._oscParser.end(C!==24&&C!==26),y)return this._preserveStack(5,[],0,S,x),y;C===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}n.EscapeSequenceParser=m},6242:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const p=a(5770),_=a(482),l=[];n.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,v){this._handlers[g]===void 0&&(this._handlers[g]=[]);const w=this._handlers[g];return w.push(v),{dispose:()=>{const m=w.indexOf(v);m!==-1&&w.splice(m,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,v,w){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(g,v,w);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(g,v,w))}start(){this.reset(),this._state=1}put(g,v,w){if(this._state!==3){if(this._state===1)for(;v<w;){const m=g[v++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&w-v>0&&this._put(g,v,w)}}end(g,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,m=this._active.length-1,h=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,w=v,h=this._stack.fallThrough,this._stack.paused=!1),!h&&w===!1){for(;m>=0&&(w=this._active[m].end(g),w!==!0);m--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,w;m--}for(;m>=0;m--)if(w=this._active[m].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",g);this._active=l,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,v,w){this._hitLimit||(this._data+=(0,_.utf32ToString)(g,v,w),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let v=!1;if(this._hitLimit)v=!1;else if(g&&(v=this._handler(this._data),v instanceof Promise))return v.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,v}}},8742:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const a=2147483647;class p{static fromArray(l){const g=new p;if(!l.length)return g;for(let v=Array.isArray(l[0])?1:0;v<l.length;++v){const w=l[v];if(Array.isArray(w))for(let m=0;m<w.length;++m)g.addSubParam(w[m]);else g.addParam(w)}return g}constructor(l=32,g=32){if(this.maxLength=l,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new p(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let g=0;g<this.length;++g){l.push(this.params[g]);const v=this._subParamsIdx[g]>>8,w=255&this._subParamsIdx[g];w-v>0&&l.push(Array.prototype.slice.call(this._subParams,v,w))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>a?a:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>a?a:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const g=this._subParamsIdx[l]>>8,v=255&this._subParamsIdx[l];return v-g>0?this._subParams.subarray(g,v):null}getSubParamsAll(){const l={};for(let g=0;g<this.length;++g){const v=this._subParamsIdx[g]>>8,w=255&this._subParamsIdx[g];w-v>0&&(l[g]=this._subParams.slice(v,w))}return l}addDigit(l){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,w=v[g-1];v[g-1]=~w?Math.min(10*w+l,a):l}}n.Params=p},5741:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,p){const _={instance:p,dispose:p.dispose,isDisposed:!1};this._addons.push(_),p.dispose=()=>this._wrappedAddonDispose(_),p.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let p=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===a){p=_;break}if(p===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(p,1)}}},8771:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const p=a(3785),_=a(511);n.BufferApiView=class{constructor(l,g){this._buffer=l,this.type=g}init(l){return this._buffer=l,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(l){const g=this._buffer.lines.get(l);if(g)return new p.BufferLineApiView(g)}getNullCell(){return new _.CellData}}},3785:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const p=a(511);n.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,l){if(!(_<0||_>=this._line.length))return l?(this._line.loadCell(_,l),l):this._line.loadCell(_,new p.CellData)}translateToString(_,l,g){return this._line.translateToString(_,l,g)}}},8285:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const p=a(8771),_=a(8460),l=a(844);class g extends l.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new p.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new p.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}n.BufferNamespaceApi=g},7975:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,p){return this._core.registerCsiHandler(a,_=>p(_.toArray()))}addCsiHandler(a,p){return this.registerCsiHandler(a,p)}registerDcsHandler(a,p){return this._core.registerDcsHandler(a,(_,l)=>p(_,l.toArray()))}addDcsHandler(a,p){return this.registerDcsHandler(a,p)}registerEscHandler(a,p){return this._core.registerEscHandler(a,p)}addEscHandler(a,p){return this.registerEscHandler(a,p)}registerOscHandler(a,p){return this._core.registerOscHandler(a,p)}addOscHandler(a,p){return this.registerOscHandler(a,p)}}},7090:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(c,n,a){var p=this&&this.__decorate||function(h,f,d,u){var y,C=arguments.length,S=C<3?f:u===null?u=Object.getOwnPropertyDescriptor(f,d):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(h,f,d,u);else for(var b=h.length-1;b>=0;b--)(y=h[b])&&(S=(C<3?y(S):C>3?y(f,d,S):y(f,d))||S);return C>3&&S&&Object.defineProperty(f,d,S),S},_=this&&this.__param||function(h,f){return function(d,u){f(d,u,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const l=a(8460),g=a(844),v=a(5295),w=a(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let m=n.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(h){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(h.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(h.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(h,this))}resize(h,f){this.cols=h,this.rows=f,this.buffers.resize(h,f),this._onResize.fire({cols:h,rows:f})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(h,f=!1){const d=this.buffer;let u;u=this._cachedBlankLine,u&&u.length===this.cols&&u.getFg(0)===h.fg&&u.getBg(0)===h.bg||(u=d.getBlankLine(h,f),this._cachedBlankLine=u),u.isWrapped=f;const y=d.ybase+d.scrollTop,C=d.ybase+d.scrollBottom;if(d.scrollTop===0){const S=d.lines.isFull;C===d.lines.length-1?S?d.lines.recycle().copyFrom(u):d.lines.push(u.clone()):d.lines.splice(C+1,0,u.clone()),S?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const S=C-y+1;d.lines.shiftElements(y+1,S-1,-1),d.lines.set(C,u.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(h,f,d){const u=this.buffer;if(h<0){if(u.ydisp===0)return;this.isUserScrolling=!0}else h+u.ydisp>=u.ybase&&(this.isUserScrolling=!1);const y=u.ydisp;u.ydisp=Math.max(Math.min(u.ydisp+h,u.ybase),0),y!==u.ydisp&&(f||this._onScroll.fire(u.ydisp))}};n.BufferService=m=p([_(0,w.IOptionsService)],m)},7994:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,p){this._charsets[a]=p,this.glevel===a&&(this.charset=p)}}},1753:function(c,n,a){var p=this&&this.__decorate||function(u,y,C,S){var b,x=arguments.length,k=x<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,C):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(u,y,C,S);else for(var M=u.length-1;M>=0;M--)(b=u[M])&&(k=(x<3?b(k):x>3?b(y,C,k):b(y,C))||k);return x>3&&k&&Object.defineProperty(y,C,k),k},_=this&&this.__param||function(u,y){return function(C,S){y(C,S,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const l=a(2585),g=a(8460),v=a(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:u=>u.button!==4&&u.action===1&&(u.ctrl=!1,u.alt=!1,u.shift=!1,!0)},VT200:{events:19,restrict:u=>u.action!==32},DRAG:{events:23,restrict:u=>u.action!==32||u.button!==3},ANY:{events:31,restrict:u=>!0}};function m(u,y){let C=(u.ctrl?16:0)|(u.shift?4:0)|(u.alt?8:0);return u.button===4?(C|=64,C|=u.action):(C|=3&u.button,4&u.button&&(C|=64),8&u.button&&(C|=128),u.action===32?C|=32:u.action!==0||y||(C|=3)),C}const h=String.fromCharCode,f={DEFAULT:u=>{const y=[m(u,!1)+32,u.col+32,u.row+32];return y[0]>255||y[1]>255||y[2]>255?"":`\x1B[M${h(y[0])}${h(y[1])}${h(y[2])}`},SGR:u=>{const y=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${m(u,!0)};${u.col};${u.row}${y}`},SGR_PIXELS:u=>{const y=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${m(u,!0)};${u.x};${u.y}${y}`}};let d=n.CoreMouseService=class extends v.Disposable{constructor(u,y){super(),this._bufferService=u,this._coreService=y,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(w))this.addProtocol(C,w[C]);for(const C of Object.keys(f))this.addEncoding(C,f[C]);this.reset()}addProtocol(u,y){this._protocols[u]=y}addEncoding(u,y){this._encodings[u]=y}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(u){if(!this._protocols[u])throw new Error(`unknown protocol "${u}"`);this._activeProtocol=u,this._onProtocolChange.fire(this._protocols[u].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(u){if(!this._encodings[u])throw new Error(`unknown encoding "${u}"`);this._activeEncoding=u}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(u){if(u.col<0||u.col>=this._bufferService.cols||u.row<0||u.row>=this._bufferService.rows||u.button===4&&u.action===32||u.button===3&&u.action!==32||u.button!==4&&(u.action===2||u.action===3)||(u.col++,u.row++,u.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,u,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(u))return!1;const y=this._encodings[this._activeEncoding](u);return y&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(y):this._coreService.triggerDataEvent(y,!0)),this._lastEvent=u,!0}explainEvents(u){return{down:!!(1&u),up:!!(2&u),drag:!!(4&u),move:!!(8&u),wheel:!!(16&u)}}_equalEvents(u,y,C){if(C){if(u.x!==y.x||u.y!==y.y)return!1}else if(u.col!==y.col||u.row!==y.row)return!1;return u.button===y.button&&u.action===y.action&&u.ctrl===y.ctrl&&u.alt===y.alt&&u.shift===y.shift}};n.CoreMouseService=d=p([_(0,l.IBufferService),_(1,l.ICoreService)],d)},6975:function(c,n,a){var p=this&&this.__decorate||function(d,u,y,C){var S,b=arguments.length,x=b<3?u:C===null?C=Object.getOwnPropertyDescriptor(u,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(d,u,y,C);else for(var k=d.length-1;k>=0;k--)(S=d[k])&&(x=(b<3?S(x):b>3?S(u,y,x):S(u,y))||x);return b>3&&x&&Object.defineProperty(u,y,x),x},_=this&&this.__param||function(d,u){return function(y,C){u(y,C,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const l=a(1439),g=a(8460),v=a(844),w=a(2585),m=Object.freeze({insertMode:!1}),h=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let f=n.CoreService=class extends v.Disposable{constructor(d,u,y){super(),this._bufferService=d,this._logService=u,this._optionsService=y,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(m),this.decPrivateModes=(0,l.clone)(h)}reset(){this.modes=(0,l.clone)(m),this.decPrivateModes=(0,l.clone)(h)}triggerDataEvent(d,u=!1){if(this._optionsService.rawOptions.disableStdin)return;const y=this._bufferService.buffer;u&&this._optionsService.rawOptions.scrollOnUserInput&&y.ybase!==y.ydisp&&this._onRequestScrollToBottom.fire(),u&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,()=>d.split("").map(C=>C.charCodeAt(0))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,()=>d.split("").map(u=>u.charCodeAt(0))),this._onBinary.fire(d))}};n.CoreService=f=p([_(0,w.IBufferService),_(1,w.ILogService),_(2,w.IOptionsService)],f)},9074:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const p=a(8055),_=a(8460),l=a(844),g=a(6106);let v=0,w=0;class m extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList(d=>d==null?void 0:d.marker.line),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)(()=>this.reset()))}registerDecoration(d){if(d.marker.isDisposed)return;const u=new h(d);if(u){const y=u.marker.onDispose(()=>u.dispose());u.onDispose(()=>{u&&(this._decorations.delete(u)&&this._onDecorationRemoved.fire(u),y.dispose())}),this._decorations.insert(u),this._onDecorationRegistered.fire(u)}return u}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,u,y){let C=0,S=0;for(const b of this._decorations.getKeyIterator(u))C=b.options.x??0,S=C+(b.options.width??1),d>=C&&d<S&&(!y||(b.options.layer??"bottom")===y)&&(yield b)}forEachDecorationAtCell(d,u,y,C){this._decorations.forEachByKey(u,S=>{v=S.options.x??0,w=v+(S.options.width??1),d>=v&&d<w&&(!y||(S.options.layer??"bottom")===y)&&C(S)})}}n.DecorationService=m;class h extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=p.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=p.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,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=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const p=a(2585),_=a(8343);class l{constructor(...v){this._entries=new Map;for(const[w,m]of v)this.set(w,m)}set(v,w){const m=this._entries.get(v);return this._entries.set(v,w),m}forEach(v){for(const[w,m]of this._entries.entries())v(w,m)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}n.ServiceCollection=l,n.InstantiationService=class{constructor(){this._services=new l,this._services.set(p.IInstantiationService,this)}setService(g,v){this._services.set(g,v)}getService(g){return this._services.get(g)}createInstance(g,...v){const w=(0,_.getServiceDependencies)(g).sort((f,d)=>f.index-d.index),m=[];for(const f of w){const d=this._services.get(f.id);if(!d)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${f.id}.`);m.push(d)}const h=w.length>0?w[0].index:v.length;if(v.length!==h)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${h+1} conflicts with ${v.length} static arguments`);return new g(...v,...m)}}},7866:function(c,n,a){var p=this&&this.__decorate||function(h,f,d,u){var y,C=arguments.length,S=C<3?f:u===null?u=Object.getOwnPropertyDescriptor(f,d):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(h,f,d,u);else for(var b=h.length-1;b>=0;b--)(y=h[b])&&(S=(C<3?y(S):C>3?y(f,d,S):y(f,d))||S);return C>3&&S&&Object.defineProperty(f,d,S),S},_=this&&this.__param||function(h,f){return function(d,u){f(d,u,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const l=a(844),g=a(2585),v={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let w,m=n.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let f=0;f<h.length;f++)typeof h[f]=="function"&&(h[f]=h[f]())}_log(h,f,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(h,...f){var d;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,f)}debug(h,...f){var d;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,f)}info(h,...f){var d;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,f)}warn(h,...f){var d;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,f)}error(h,...f){var d;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,f)}};n.LogService=m=p([_(0,g.IOptionsService)],m),n.setTraceLogger=function(h){w=h},n.traceCall=function(h,f,d){if(typeof d.value!="function")throw new Error("not supported");const u=d.value;d.value=function(...y){if(w.logLevel!==g.LogLevelEnum.TRACE)return u.apply(this,y);w.trace(`GlyphRenderer#${u.name}(${y.map(S=>JSON.stringify(S)).join(", ")})`);const C=u.apply(this,y);return w.trace(`GlyphRenderer#${u.name} return`,C),C}}},7302:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const p=a(8460),_=a(844),l=a(6114);n.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends _.Disposable{constructor(m){super(),this._onOptionChange=this.register(new p.EventEmitter),this.onOptionChange=this._onOptionChange.event;const h={...n.DEFAULT_OPTIONS};for(const f in m)if(f in h)try{const d=m[f];h[f]=this._sanitizeAndValidateOption(f,d)}catch(d){console.error(d)}this.rawOptions=h,this.options={...h},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(m,h){return this.onOptionChange(f=>{f===m&&h(this.rawOptions[m])})}onMultipleOptionChange(m,h){return this.onOptionChange(f=>{m.indexOf(f)!==-1&&h()})}_setupOptions(){const m=f=>{if(!(f in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);return this.rawOptions[f]},h=(f,d)=>{if(!(f in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);d=this._sanitizeAndValidateOption(f,d),this.rawOptions[f]!==d&&(this.rawOptions[f]=d,this._onOptionChange.fire(f))};for(const f in this.rawOptions){const d={get:m.bind(this,f),set:h.bind(this,f)};Object.defineProperty(this.options,f,d)}}_sanitizeAndValidateOption(m,h){switch(m){case"cursorStyle":if(h||(h=n.DEFAULT_OPTIONS[m]),!function(f){return f==="block"||f==="underline"||f==="bar"}(h))throw new Error(`"${h}" is not a valid value for ${m}`);break;case"wordSeparator":h||(h=n.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof h=="number"&&1<=h&&h<=1e3)break;h=g.includes(h)?h:n.DEFAULT_OPTIONS[m];break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(`${m} cannot be less than 1, value: ${h}`);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${h}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${h}`);break;case"rows":case"cols":if(!h&&h!==0)throw new Error(`${m} must be numeric, value: ${h}`);break;case"windowsPty":h=h??{}}return h}}n.OptionsService=v},2660:function(c,n,a){var p=this&&this.__decorate||function(v,w,m,h){var f,d=arguments.length,u=d<3?w:h===null?h=Object.getOwnPropertyDescriptor(w,m):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(v,w,m,h);else for(var y=v.length-1;y>=0;y--)(f=v[y])&&(u=(d<3?f(u):d>3?f(w,m,u):f(w,m))||u);return d>3&&u&&Object.defineProperty(w,m,u),u},_=this&&this.__param||function(v,w){return function(m,h){w(m,h,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const l=a(2585);let g=n.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const w=this._bufferService.buffer;if(v.id===void 0){const y=w.addMarker(w.ybase+w.y),C={data:v,id:this._nextId++,lines:[y]};return y.onDispose(()=>this._removeMarkerFromLink(C,y)),this._dataByLinkId.set(C.id,C),C.id}const m=v,h=this._getEntryIdKey(m),f=this._entriesWithId.get(h);if(f)return this.addLineToLink(f.id,w.ybase+w.y),f.id;const d=w.addMarker(w.ybase+w.y),u={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(u,d)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(v,w){const m=this._dataByLinkId.get(v);if(m&&m.lines.every(h=>h.line!==w)){const h=this._bufferService.buffer.addMarker(w);m.lines.push(h),h.onDispose(()=>this._removeMarkerFromLink(m,h))}}getLinkData(v){var w;return(w=this._dataByLinkId.get(v))==null?void 0:w.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,w){const m=v.lines.indexOf(w);m!==-1&&(v.lines.splice(m,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};n.OscLinkService=g=p([_(0,l.IBufferService)],g)},8343:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const a="di$target",p="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[p]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const l=function(g,v,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,h,f){h[a]===h?h[p].push({id:m,index:f}):(h[p]=[{id:m,index:f}],h[a]=h)})(l,g,w)};return l.toString=()=>_,n.serviceRegistry.set(_,l),l}},2585:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const p=a(8343);var _;n.IBufferService=(0,p.createDecorator)("BufferService"),n.ICoreMouseService=(0,p.createDecorator)("CoreMouseService"),n.ICoreService=(0,p.createDecorator)("CoreService"),n.ICharsetService=(0,p.createDecorator)("CharsetService"),n.IInstantiationService=(0,p.createDecorator)("InstantiationService"),function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"}(_||(n.LogLevelEnum=_={})),n.ILogService=(0,p.createDecorator)("LogService"),n.IOptionsService=(0,p.createDecorator)("OptionsService"),n.IOscLinkService=(0,p.createDecorator)("OscLinkService"),n.IUnicodeService=(0,p.createDecorator)("UnicodeService"),n.IDecorationService=(0,p.createDecorator)("DecorationService")},1480:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const p=a(8460),_=a(225);class l{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,w,m=!1){return(16777215&v)<<3|(3&w)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new p.EventEmitter,this.onChange=this._onChange.event;const v=new _.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let w=0,m=0;const h=v.length;for(let f=0;f<h;++f){let d=v.charCodeAt(f);if(55296<=d&&d<=56319){if(++f>=h)return w+this.wcwidth(d);const C=v.charCodeAt(f);56320<=C&&C<=57343?d=1024*(d-55296)+C-56320+65536:w+=this.wcwidth(C)}const u=this.charProperties(d,m);let y=l.extractWidth(u);l.extractShouldJoin(u)&&(y-=l.extractWidth(m)),w+=y,m=u}return w}charProperties(v,w){return this._activeProvider.charProperties(v,w)}}n.UnicodeService=l}},s={};function i(c){var n=s[c];if(n!==void 0)return n.exports;var a=s[c]={exports:{}};return r[c].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var c=o;Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const n=i(9042),a=i(3236),p=i(844),_=i(5741),l=i(8285),g=i(7975),v=i(7090),w=["cols","rows"];class m extends p.Disposable{constructor(f){super(),this._core=this.register(new a.Terminal(f)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const d=y=>this._core.options[y],u=(y,C)=>{this._checkReadonlyOptions(y),this._core.options[y]=C};for(const y in this._core.options){const C={get:d.bind(this,y),set:u.bind(this,y)};Object.defineProperty(this._publicOptions,y,C)}}_checkReadonlyOptions(f){if(w.includes(f))throw new Error(`Option "${f}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const d in f)this._publicOptions[d]=f[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(f,d=!0){this._core.input(f,d)}resize(f,d){this._verifyIntegers(f,d),this._core.resize(f,d)}open(f){this._core.open(f)}attachCustomKeyEventHandler(f){this._core.attachCustomKeyEventHandler(f)}attachCustomWheelEventHandler(f){this._core.attachCustomWheelEventHandler(f)}registerLinkProvider(f){return this._core.registerLinkProvider(f)}registerCharacterJoiner(f){return this._checkProposedApi(),this._core.registerCharacterJoiner(f)}deregisterCharacterJoiner(f){this._checkProposedApi(),this._core.deregisterCharacterJoiner(f)}registerMarker(f=0){return this._verifyIntegers(f),this._core.registerMarker(f)}registerDecoration(f){return this._checkProposedApi(),this._verifyPositiveIntegers(f.x??0,f.width??0,f.height??0),this._core.registerDecoration(f)}hasSelection(){return this._core.hasSelection()}select(f,d,u){this._verifyIntegers(f,d,u),this._core.select(f,d,u)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,d){this._verifyIntegers(f,d),this._core.selectLines(f,d)}dispose(){super.dispose()}scrollLines(f){this._verifyIntegers(f),this._core.scrollLines(f)}scrollPages(f){this._verifyIntegers(f),this._core.scrollPages(f)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(f){this._verifyIntegers(f),this._core.scrollToLine(f)}clear(){this._core.clear()}write(f,d){this._core.write(f,d)}writeln(f,d){this._core.write(f),this._core.write(`\r
|
|
76
|
-
`,d)}paste(f){this._core.paste(f)}refresh(f,d){this._verifyIntegers(f,d),this._core.refresh(f,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(f){this._addonManager.loadAddon(this,f)}static get strings(){return n}_verifyIntegers(...f){for(const d of f)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...f){for(const d of f)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}c.Terminal=m})(),o})())})($v);var T2=$v.exports,Fv={exports:{}};(function(e,t){(function(r,s){e.exports=s()})(self,()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const o=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(o._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,o=i._renderService.dimensions;if(o.css.cell.width===0||o.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(n.getPropertyValue("height")),p=Math.max(0,parseInt(n.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),l=a-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),g=p-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(g/o.css.cell.width)),rows:Math.max(1,Math.floor(l/o.css.cell.height))}}}})(),r})())})(Fv);var P2=Fv.exports,Hv={exports:{}};(function(e,t){(function(r,s){e.exports=s()})(self,()=>(()=>{var r={965:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlyphRenderer=void 0;const p=a(374),_=a(509),l=a(855),g=a(859),v=a(381),w=11,m=w*Float32Array.BYTES_PER_ELEMENT;let h,f=0,d=0,u=0;class y extends g.Disposable{constructor(S,b,x,k){super(),this._terminal=S,this._gl=b,this._dimensions=x,this._optionsService=k,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const M=this._gl;_.TextureAtlas.maxAtlasPages===void 0&&(_.TextureAtlas.maxAtlasPages=Math.min(32,(0,p.throwIfFalsy)(M.getParameter(M.MAX_TEXTURE_IMAGE_UNITS))),_.TextureAtlas.maxTextureSize=(0,p.throwIfFalsy)(M.getParameter(M.MAX_TEXTURE_SIZE))),this._program=(0,p.throwIfFalsy)((0,v.createProgram)(M,`#version 300 es
|
|
77
|
-
layout (location = 0) in vec2 a_unitquad;
|
|
78
|
-
layout (location = 1) in vec2 a_cellpos;
|
|
79
|
-
layout (location = 2) in vec2 a_offset;
|
|
80
|
-
layout (location = 3) in vec2 a_size;
|
|
81
|
-
layout (location = 4) in float a_texpage;
|
|
82
|
-
layout (location = 5) in vec2 a_texcoord;
|
|
83
|
-
layout (location = 6) in vec2 a_texsize;
|
|
84
|
-
|
|
85
|
-
uniform mat4 u_projection;
|
|
86
|
-
uniform vec2 u_resolution;
|
|
87
|
-
|
|
88
|
-
out vec2 v_texcoord;
|
|
89
|
-
flat out int v_texpage;
|
|
90
|
-
|
|
91
|
-
void main() {
|
|
92
|
-
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
93
|
-
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
94
|
-
v_texpage = int(a_texpage);
|
|
95
|
-
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
96
|
-
}`,function($){let F="";for(let B=1;B<$;B++)F+=` else if (v_texpage == ${B}) { outColor = texture(u_texture[${B}], v_texcoord); }`;return`#version 300 es
|
|
97
|
-
precision lowp float;
|
|
98
|
-
|
|
99
|
-
in vec2 v_texcoord;
|
|
100
|
-
flat in int v_texpage;
|
|
101
|
-
|
|
102
|
-
uniform sampler2D u_texture[${$}];
|
|
103
|
-
|
|
104
|
-
out vec4 outColor;
|
|
105
|
-
|
|
106
|
-
void main() {
|
|
107
|
-
if (v_texpage == 0) {
|
|
108
|
-
outColor = texture(u_texture[0], v_texcoord);
|
|
109
|
-
} ${F}
|
|
110
|
-
}`}(_.TextureAtlas.maxAtlasPages))),this.register((0,g.toDisposable)(()=>M.deleteProgram(this._program))),this._projectionLocation=(0,p.throwIfFalsy)(M.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,p.throwIfFalsy)(M.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,p.throwIfFalsy)(M.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=M.createVertexArray(),M.bindVertexArray(this._vertexArrayObject);const D=new Float32Array([0,0,1,0,0,1,1,1]),R=M.createBuffer();this.register((0,g.toDisposable)(()=>M.deleteBuffer(R))),M.bindBuffer(M.ARRAY_BUFFER,R),M.bufferData(M.ARRAY_BUFFER,D,M.STATIC_DRAW),M.enableVertexAttribArray(0),M.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const T=new Uint8Array([0,1,2,3]),A=M.createBuffer();this.register((0,g.toDisposable)(()=>M.deleteBuffer(A))),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,A),M.bufferData(M.ELEMENT_ARRAY_BUFFER,T,M.STATIC_DRAW),this._attributesBuffer=(0,p.throwIfFalsy)(M.createBuffer()),this.register((0,g.toDisposable)(()=>M.deleteBuffer(this._attributesBuffer))),M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.enableVertexAttribArray(2),M.vertexAttribPointer(2,2,M.FLOAT,!1,m,0),M.vertexAttribDivisor(2,1),M.enableVertexAttribArray(3),M.vertexAttribPointer(3,2,M.FLOAT,!1,m,2*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(3,1),M.enableVertexAttribArray(4),M.vertexAttribPointer(4,1,M.FLOAT,!1,m,4*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(4,1),M.enableVertexAttribArray(5),M.vertexAttribPointer(5,2,M.FLOAT,!1,m,5*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(5,1),M.enableVertexAttribArray(6),M.vertexAttribPointer(6,2,M.FLOAT,!1,m,7*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(6,1),M.enableVertexAttribArray(1),M.vertexAttribPointer(1,2,M.FLOAT,!1,m,9*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(1,1),M.useProgram(this._program);const j=new Int32Array(_.TextureAtlas.maxAtlasPages);for(let $=0;$<_.TextureAtlas.maxAtlasPages;$++)j[$]=$;M.uniform1iv(this._textureLocation,j),M.uniformMatrix4fv(this._projectionLocation,!1,v.PROJECTION_MATRIX),this._atlasTextures=[];for(let $=0;$<_.TextureAtlas.maxAtlasPages;$++){const F=new v.GLTexture((0,p.throwIfFalsy)(M.createTexture()));this.register((0,g.toDisposable)(()=>M.deleteTexture(F.texture))),M.activeTexture(M.TEXTURE0+$),M.bindTexture(M.TEXTURE_2D,F.texture),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_S,M.CLAMP_TO_EDGE),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_T,M.CLAMP_TO_EDGE),M.texImage2D(M.TEXTURE_2D,0,M.RGBA,1,1,0,M.RGBA,M.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[$]=F}M.enable(M.BLEND),M.blendFunc(M.SRC_ALPHA,M.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(S,b,x,k,M,D,R,T,A){this._updateCell(this._vertices.attributes,S,b,x,k,M,D,R,T,A)}_updateCell(S,b,x,k,M,D,R,T,A,j){f=(x*this._terminal.cols+b)*w,k!==l.NULL_CELL_CODE&&k!==void 0?this._atlas&&(h=T&&T.length>1?this._atlas.getRasterizedGlyphCombinedChar(T,M,D,R,!1):this._atlas.getRasterizedGlyph(k,M,D,R,!1),d=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),M!==j&&h.offset.x>d?(u=h.offset.x-d,S[f]=-(h.offset.x-u)+this._dimensions.device.char.left,S[f+1]=-h.offset.y+this._dimensions.device.char.top,S[f+2]=(h.size.x-u)/this._dimensions.device.canvas.width,S[f+3]=h.size.y/this._dimensions.device.canvas.height,S[f+4]=h.texturePage,S[f+5]=h.texturePositionClipSpace.x+u/this._atlas.pages[h.texturePage].canvas.width,S[f+6]=h.texturePositionClipSpace.y,S[f+7]=h.sizeClipSpace.x-u/this._atlas.pages[h.texturePage].canvas.width,S[f+8]=h.sizeClipSpace.y):(S[f]=-h.offset.x+this._dimensions.device.char.left,S[f+1]=-h.offset.y+this._dimensions.device.char.top,S[f+2]=h.size.x/this._dimensions.device.canvas.width,S[f+3]=h.size.y/this._dimensions.device.canvas.height,S[f+4]=h.texturePage,S[f+5]=h.texturePositionClipSpace.x,S[f+6]=h.texturePositionClipSpace.y,S[f+7]=h.sizeClipSpace.x,S[f+8]=h.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,p.allowRescaling)(k,A,h.size.x,this._dimensions.device.cell.width)&&(S[f+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):S.fill(0,f,f+w-1-2)}clear(){const S=this._terminal,b=S.cols*S.rows*w;this._vertices.count!==b?this._vertices.attributes=new Float32Array(b):this._vertices.attributes.fill(0);let x=0;for(;x<this._vertices.attributesBuffers.length;x++)this._vertices.count!==b?this._vertices.attributesBuffers[x]=new Float32Array(b):this._vertices.attributesBuffers[x].fill(0);this._vertices.count=b,x=0;for(let k=0;k<S.rows;k++)for(let M=0;M<S.cols;M++)this._vertices.attributes[x+9]=M/S.cols,this._vertices.attributes[x+10]=k/S.rows,x+=w}handleResize(){const S=this._gl;S.useProgram(this._program),S.viewport(0,0,S.canvas.width,S.canvas.height),S.uniform2f(this._resolutionLocation,S.canvas.width,S.canvas.height),this.clear()}render(S){if(!this._atlas)return;const b=this._gl;b.useProgram(this._program),b.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const x=this._vertices.attributesBuffers[this._activeBuffer];let k=0;for(let M=0;M<S.lineLengths.length;M++){const D=M*this._terminal.cols*w,R=this._vertices.attributes.subarray(D,D+S.lineLengths[M]*w);x.set(R,k),k+=R.length}b.bindBuffer(b.ARRAY_BUFFER,this._attributesBuffer),b.bufferData(b.ARRAY_BUFFER,x.subarray(0,k),b.STREAM_DRAW);for(let M=0;M<this._atlas.pages.length;M++)this._atlas.pages[M].version!==this._atlasTextures[M].version&&this._bindAtlasPageTexture(b,this._atlas,M);b.drawElementsInstanced(b.TRIANGLE_STRIP,4,b.UNSIGNED_BYTE,0,k/w)}setAtlas(S){this._atlas=S;for(const b of this._atlasTextures)b.version=-1}_bindAtlasPageTexture(S,b,x){S.activeTexture(S.TEXTURE0+x),S.bindTexture(S.TEXTURE_2D,this._atlasTextures[x].texture),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,S.RGBA,S.UNSIGNED_BYTE,b.pages[x].canvas),S.generateMipmap(S.TEXTURE_2D),this._atlasTextures[x].version=b.pages[x].version}setDimensions(S){this._dimensions=S}}n.GlyphRenderer=y},742:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RectangleRenderer=void 0;const p=a(374),_=a(859),l=a(310),g=a(381),v=8*Float32Array.BYTES_PER_ELEMENT;class w{constructor(){this.attributes=new Float32Array(160),this.count=0}}let m=0,h=0,f=0,d=0,u=0,y=0,C=0;class S extends _.Disposable{constructor(x,k,M,D){super(),this._terminal=x,this._gl=k,this._dimensions=M,this._themeService=D,this._vertices=new w,this._verticesCursor=new w;const R=this._gl;this._program=(0,p.throwIfFalsy)((0,g.createProgram)(R,`#version 300 es
|
|
111
|
-
layout (location = 0) in vec2 a_position;
|
|
112
|
-
layout (location = 1) in vec2 a_size;
|
|
113
|
-
layout (location = 2) in vec4 a_color;
|
|
114
|
-
layout (location = 3) in vec2 a_unitquad;
|
|
115
|
-
|
|
116
|
-
uniform mat4 u_projection;
|
|
117
|
-
|
|
118
|
-
out vec4 v_color;
|
|
119
|
-
|
|
120
|
-
void main() {
|
|
121
|
-
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
122
|
-
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
123
|
-
v_color = a_color;
|
|
124
|
-
}`,`#version 300 es
|
|
125
|
-
precision lowp float;
|
|
126
|
-
|
|
127
|
-
in vec4 v_color;
|
|
128
|
-
|
|
129
|
-
out vec4 outColor;
|
|
130
|
-
|
|
131
|
-
void main() {
|
|
132
|
-
outColor = v_color;
|
|
133
|
-
}`)),this.register((0,_.toDisposable)(()=>R.deleteProgram(this._program))),this._projectionLocation=(0,p.throwIfFalsy)(R.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=R.createVertexArray(),R.bindVertexArray(this._vertexArrayObject);const T=new Float32Array([0,0,1,0,0,1,1,1]),A=R.createBuffer();this.register((0,_.toDisposable)(()=>R.deleteBuffer(A))),R.bindBuffer(R.ARRAY_BUFFER,A),R.bufferData(R.ARRAY_BUFFER,T,R.STATIC_DRAW),R.enableVertexAttribArray(3),R.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const j=new Uint8Array([0,1,2,3]),$=R.createBuffer();this.register((0,_.toDisposable)(()=>R.deleteBuffer($))),R.bindBuffer(R.ELEMENT_ARRAY_BUFFER,$),R.bufferData(R.ELEMENT_ARRAY_BUFFER,j,R.STATIC_DRAW),this._attributesBuffer=(0,p.throwIfFalsy)(R.createBuffer()),this.register((0,_.toDisposable)(()=>R.deleteBuffer(this._attributesBuffer))),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.enableVertexAttribArray(0),R.vertexAttribPointer(0,2,R.FLOAT,!1,v,0),R.vertexAttribDivisor(0,1),R.enableVertexAttribArray(1),R.vertexAttribPointer(1,2,R.FLOAT,!1,v,2*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(1,1),R.enableVertexAttribArray(2),R.vertexAttribPointer(2,4,R.FLOAT,!1,v,4*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(2,1),this._updateCachedColors(D.colors),this.register(this._themeService.onChangeColors(F=>{this._updateCachedColors(F),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(x){const k=this._gl;k.useProgram(this._program),k.bindVertexArray(this._vertexArrayObject),k.uniformMatrix4fv(this._projectionLocation,!1,g.PROJECTION_MATRIX),k.bindBuffer(k.ARRAY_BUFFER,this._attributesBuffer),k.bufferData(k.ARRAY_BUFFER,x.attributes,k.DYNAMIC_DRAW),k.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,k.UNSIGNED_BYTE,0,x.count)}handleResize(){this._updateViewportRectangle()}setDimensions(x){this._dimensions=x}_updateCachedColors(x){this._bgFloat=this._colorToFloat32Array(x.background),this._cursorFloat=this._colorToFloat32Array(x.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(x){const k=this._terminal,M=this._vertices;let D,R,T,A,j,$,F,B,L,P,O,I=1;for(D=0;D<k.rows;D++){for(T=-1,A=0,j=0,$=!1,R=0;R<k.cols;R++)F=(D*k.cols+R)*l.RENDER_MODEL_INDICIES_PER_CELL,B=x.cells[F+l.RENDER_MODEL_BG_OFFSET],L=x.cells[F+l.RENDER_MODEL_FG_OFFSET],P=!!(67108864&L),(B!==A||L!==j&&($||P))&&((A!==0||$&&j!==0)&&(O=8*I++,this._updateRectangle(M,O,j,A,T,R,D)),T=R,A=B,j=L,$=P);(A!==0||$&&j!==0)&&(O=8*I++,this._updateRectangle(M,O,j,A,T,k.cols,D))}M.count=I}updateCursor(x){const k=this._verticesCursor,M=x.cursor;if(!M||M.style==="block")return void(k.count=0);let D,R=0;M.style!=="bar"&&M.style!=="outline"||(D=8*R++,this._addRectangleFloat(k.attributes,D,M.x*this._dimensions.device.cell.width,M.y*this._dimensions.device.cell.height,M.style==="bar"?M.dpr*M.cursorWidth:M.dpr,this._dimensions.device.cell.height,this._cursorFloat)),M.style!=="underline"&&M.style!=="outline"||(D=8*R++,this._addRectangleFloat(k.attributes,D,M.x*this._dimensions.device.cell.width,(M.y+1)*this._dimensions.device.cell.height-M.dpr,M.width*this._dimensions.device.cell.width,M.dpr,this._cursorFloat)),M.style==="outline"&&(D=8*R++,this._addRectangleFloat(k.attributes,D,M.x*this._dimensions.device.cell.width,M.y*this._dimensions.device.cell.height,M.width*this._dimensions.device.cell.width,M.dpr,this._cursorFloat),D=8*R++,this._addRectangleFloat(k.attributes,D,(M.x+M.width)*this._dimensions.device.cell.width-M.dpr,M.y*this._dimensions.device.cell.height,M.dpr,this._dimensions.device.cell.height,this._cursorFloat)),k.count=R}_updateRectangle(x,k,M,D,R,T,A){if(67108864&M)switch(50331648&M){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&M].rgba;break;case 50331648:m=(16777215&M)<<8;break;default:m=this._themeService.colors.foreground.rgba}else switch(50331648&D){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&D].rgba;break;case 50331648:m=(16777215&D)<<8;break;default:m=this._themeService.colors.background.rgba}x.attributes.length<k+4&&(x.attributes=(0,g.expandFloat32Array)(x.attributes,this._terminal.rows*this._terminal.cols*8)),h=R*this._dimensions.device.cell.width,f=A*this._dimensions.device.cell.height,d=(m>>24&255)/255,u=(m>>16&255)/255,y=(m>>8&255)/255,C=1,this._addRectangle(x.attributes,k,h,f,(T-R)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,d,u,y,C)}_addRectangle(x,k,M,D,R,T,A,j,$,F){x[k]=M/this._dimensions.device.canvas.width,x[k+1]=D/this._dimensions.device.canvas.height,x[k+2]=R/this._dimensions.device.canvas.width,x[k+3]=T/this._dimensions.device.canvas.height,x[k+4]=A,x[k+5]=j,x[k+6]=$,x[k+7]=F}_addRectangleFloat(x,k,M,D,R,T,A){x[k]=M/this._dimensions.device.canvas.width,x[k+1]=D/this._dimensions.device.canvas.height,x[k+2]=R/this._dimensions.device.canvas.width,x[k+3]=T/this._dimensions.device.canvas.height,x[k+4]=A[0],x[k+5]=A[1],x[k+6]=A[2],x[k+7]=A[3]}_colorToFloat32Array(x){return new Float32Array([(x.rgba>>24&255)/255,(x.rgba>>16&255)/255,(x.rgba>>8&255)/255,(255&x.rgba)/255])}}n.RectangleRenderer=S},310:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderModel=n.COMBINED_CHAR_BIT_MASK=n.RENDER_MODEL_EXT_OFFSET=n.RENDER_MODEL_FG_OFFSET=n.RENDER_MODEL_BG_OFFSET=n.RENDER_MODEL_INDICIES_PER_CELL=void 0;const p=a(296);n.RENDER_MODEL_INDICIES_PER_CELL=4,n.RENDER_MODEL_BG_OFFSET=1,n.RENDER_MODEL_FG_OFFSET=2,n.RENDER_MODEL_EXT_OFFSET=3,n.COMBINED_CHAR_BIT_MASK=2147483648,n.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,p.createSelectionRenderModel)()}resize(_,l){const g=_*l*n.RENDER_MODEL_INDICIES_PER_CELL;g!==this.cells.length&&(this.cells=new Uint32Array(g),this.lineLengths=new Uint32Array(l))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.JoinedCellData=n.WebglRenderer=void 0;const p=a(820),_=a(274),l=a(627),g=a(457),v=a(56),w=a(374),m=a(345),h=a(859),f=a(147),d=a(782),u=a(855),y=a(965),C=a(742),S=a(310),b=a(733);class x extends h.Disposable{constructor(R,T,A,j,$,F,B,L,P){super(),this._terminal=R,this._characterJoinerService=T,this._charSizeService=A,this._coreBrowserService=j,this._coreService=$,this._decorationService=F,this._optionsService=B,this._themeService=L,this._cursorBlinkStateManager=new h.MutableDisposable,this._charAtlasDisposable=this.register(new h.MutableDisposable),this._observerDisposable=this.register(new h.MutableDisposable),this._model=new S.RenderModel,this._workCell=new d.CellData,this._workCell2=new d.CellData,this._rectangleRenderer=this.register(new h.MutableDisposable),this._glyphRenderer=this.register(new h.MutableDisposable),this._onChangeTextureAtlas=this.register(new m.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new m.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new m.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new m.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new _.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new b.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,B,this._themeService)],this.dimensions=(0,w.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(B.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const O={antialias:!1,depth:!1,preserveDrawingBuffer:P};if(this._gl=this._canvas.getContext("webgl2",O),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,p.addDisposableDomListener)(this._canvas,"webglcontextlost",I=>{console.log("webglcontextlost event received"),I.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(I)},3e3)})),this.register((0,p.addDisposableDomListener)(this._canvas,"webglcontextrestored",I=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,l.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=(0,v.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(I,W)=>this._setCanvasDevicePixelDimensions(I,W)),this.register(this._coreBrowserService.onWindowChange(I=>{this._observerDisposable.value=(0,v.observeDevicePixelDimensions)(this._canvas,I,(W,K)=>this._setCanvasDevicePixelDimensions(W,K))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,h.toDisposable)(()=>{var I;for(const W of this._renderLayers)W.dispose();(I=this._canvas.parentElement)==null||I.removeChild(this._canvas),(0,l.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var R;return(R=this._charAtlas)==null?void 0:R.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(R,T){var A,j,$,F;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const B of this._renderLayers)B.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(A=this._rectangleRenderer.value)==null||A.setDimensions(this.dimensions),(j=this._rectangleRenderer.value)==null||j.handleResize(),($=this._glyphRenderer.value)==null||$.setDimensions(this.dimensions),(F=this._glyphRenderer.value)==null||F.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var R;for(const T of this._renderLayers)T.handleBlur(this._terminal);(R=this._cursorBlinkStateManager.value)==null||R.pause(),this._requestRedrawViewport()}handleFocus(){var R;for(const T of this._renderLayers)T.handleFocus(this._terminal);(R=this._cursorBlinkStateManager.value)==null||R.resume(),this._requestRedrawViewport()}handleSelectionChanged(R,T,A){for(const j of this._renderLayers)j.handleSelectionChanged(this._terminal,R,T,A);this._model.selection.update(this._core,R,T,A),this._requestRedrawViewport()}handleCursorMove(){var R;for(const T of this._renderLayers)T.handleCursorMove(this._terminal);(R=this._cursorBlinkStateManager.value)==null||R.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new C.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new y.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var T;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const R=(0,l.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==R&&(this._onChangeTextureAtlas.fire(R.pages[0].canvas),this._charAtlasDisposable.value=(0,h.getDisposeArrayDisposable)([(0,m.forwardEvent)(R.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,m.forwardEvent)(R.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=R,this._charAtlas.warmUp(),(T=this._glyphRenderer.value)==null||T.setAtlas(this._charAtlas)}_clearModel(R){var T;this._model.clear(),R&&((T=this._glyphRenderer.value)==null||T.clear())}clearTextureAtlas(){var R;(R=this._charAtlas)==null||R.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var R;this._clearModel(!0);for(const T of this._renderLayers)T.reset(this._terminal);(R=this._cursorBlinkStateManager.value)==null||R.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(R){return-1}deregisterCharacterJoiner(R){return!1}renderRows(R,T){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const A of this._renderLayers)A.handleGridChanged(this._terminal,R,T);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(R,T),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new g.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(R,T){const A=this._core;let j,$,F,B,L,P,O,I,W,K,q,Z,z,N,U=this._workCell;R=M(R,A.rows-1,0),T=M(T,A.rows-1,0);const G=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Q=G-A.buffer.ydisp,Y=Math.min(this._terminal.buffer.active.cursorX,A.cols-1);let ee=-1;const te=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let le=!1;for($=R;$<=T;$++)for(F=$+A.buffer.ydisp,B=A.buffer.lines.get(F),this._model.lineLengths[$]=0,L=this._characterJoinerService.getJoinedCharacters(F),z=0;z<A.cols;z++)if(j=this._cellColorResolver.result.bg,B.loadCell(z,U),z===0&&(j=this._cellColorResolver.result.bg),P=!1,O=z,L.length>0&&z===L[0][0]&&(P=!0,I=L.shift(),U=new k(U,B.translateToString(!0,I[0],I[1]),I[1]-I[0]),O=I[1]-1),W=U.getChars(),K=U.getCode(),Z=($*A.cols+z)*S.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(U,z,F,this.dimensions.device.cell.width),te&&F===G&&(z===Y&&(this._model.cursor={x:Y,y:Q,width:U.getWidth(),style:this._coreBrowserService.isFocused?A.options.cursorStyle||"block":A.options.cursorInactiveStyle,cursorWidth:A.options.cursorWidth,dpr:this._devicePixelRatio},ee=Y+U.getWidth()-1),z>=Y&&z<=ee&&(this._coreBrowserService.isFocused&&(A.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&A.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),K!==u.NULL_CELL_CODE&&(this._model.lineLengths[$]=z+1),(this._model.cells[Z]!==K||this._model.cells[Z+S.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[Z+S.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[Z+S.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(le=!0,W.length>1&&(K|=S.COMBINED_CHAR_BIT_MASK),this._model.cells[Z]=K,this._model.cells[Z+S.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[Z+S.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[Z+S.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,q=U.getWidth(),this._glyphRenderer.value.updateCell(z,$,K,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,W,q,j),P))for(U=this._workCell,z++;z<O;z++)N=($*A.cols+z)*S.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(z,$,u.NULL_CELL_CODE,0,0,0,u.NULL_CELL_CHAR,0,0),this._model.cells[N]=u.NULL_CELL_CODE,this._model.cells[N+S.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[N+S.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[N+S.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;le&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(R,T){this._canvas.width===R&&this._canvas.height===T||(this._canvas.width=R,this._canvas.height=T,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const R=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:R,end:R})}}n.WebglRenderer=x;class k extends f.AttributeData{constructor(R,T,A){super(),this.content=0,this.combinedData="",this.fg=R.fg,this.bg=R.bg,this.combinedData=T,this._width=A}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(R){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function M(D,R,T=0){return Math.max(Math.min(D,R),T)}n.JoinedCellData=k},381:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GLTexture=n.expandFloat32Array=n.createShader=n.createProgram=n.PROJECTION_MATRIX=void 0;const p=a(374);function _(l,g,v){const w=(0,p.throwIfFalsy)(l.createShader(g));if(l.shaderSource(w,v),l.compileShader(w),l.getShaderParameter(w,l.COMPILE_STATUS))return w;console.error(l.getShaderInfoLog(w)),l.deleteShader(w)}n.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),n.createProgram=function(l,g,v){const w=(0,p.throwIfFalsy)(l.createProgram());if(l.attachShader(w,(0,p.throwIfFalsy)(_(l,l.VERTEX_SHADER,g))),l.attachShader(w,(0,p.throwIfFalsy)(_(l,l.FRAGMENT_SHADER,v))),l.linkProgram(w),l.getProgramParameter(w,l.LINK_STATUS))return w;console.error(l.getProgramInfoLog(w)),l.deleteProgram(w)},n.createShader=_,n.expandFloat32Array=function(l,g){const v=Math.min(2*l.length,g),w=new Float32Array(v);for(let m=0;m<l.length;m++)w[m]=l[m];return w},n.GLTexture=class{constructor(l){this.texture=l,this.version=-1}}},592:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const p=a(627),_=a(237),l=a(374),g=a(859);class v extends g.Disposable{constructor(m,h,f,d,u,y,C,S){super(),this._container=h,this._alpha=u,this._coreBrowserService=y,this._optionsService=C,this._themeService=S,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${f}-layer`),this._canvas.style.zIndex=d.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(b=>{this._refreshCharAtlas(m,b),this.reset(m)})),this.register((0,g.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,l.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(m){}handleFocus(m){}handleCursorMove(m){}handleGridChanged(m,h,f){}handleSelectionChanged(m,h,f,d=!1){}_setTransparency(m,h){if(h===this._alpha)return;const f=this._canvas;this._alpha=h,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,f),this._refreshCharAtlas(m,this._themeService.colors),this.handleGridChanged(m,0,m.rows-1)}_refreshCharAtlas(m,h){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,p.acquireTextureAtlas)(m,this._optionsService.rawOptions,h,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(m,h){this._deviceCellWidth=h.device.cell.width,this._deviceCellHeight=h.device.cell.height,this._deviceCharWidth=h.device.char.width,this._deviceCharHeight=h.device.char.height,this._deviceCharLeft=h.device.char.left,this._deviceCharTop=h.device.char.top,this._canvas.width=h.device.canvas.width,this._canvas.height=h.device.canvas.height,this._canvas.style.width=`${h.css.canvas.width}px`,this._canvas.style.height=`${h.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(m,this._themeService.colors)}_fillBottomLineAtCells(m,h,f=1){this._ctx.fillRect(m*this._deviceCellWidth,(h+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,f*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(m,h,f,d){this._alpha?this._ctx.clearRect(m*this._deviceCellWidth,h*this._deviceCellHeight,f*this._deviceCellWidth,d*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(m*this._deviceCellWidth,h*this._deviceCellHeight,f*this._deviceCellWidth,d*this._deviceCellHeight))}_fillCharTrueColor(m,h,f,d){this._ctx.font=this._getFont(m,!1,!1),this._ctx.textBaseline=_.TEXT_BASELINE,this._clipCell(f,d,h.getWidth()),this._ctx.fillText(h.getChars(),f*this._deviceCellWidth+this._deviceCharLeft,d*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(m,h,f){this._ctx.beginPath(),this._ctx.rect(m*this._deviceCellWidth,h*this._deviceCellHeight,f*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(m,h,f){return`${f?"italic":""} ${h?m.options.fontWeightBold:m.options.fontWeight} ${m.options.fontSize*this._coreBrowserService.dpr}px ${m.options.fontFamily}`}}n.BaseRenderLayer=v},733:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const p=a(197),_=a(237),l=a(592);class g extends l.BaseRenderLayer{constructor(w,m,h,f,d,u,y){super(h,w,"link",m,!0,d,u,y),this.register(f.onShowLinkUnderline(C=>this._handleShowLinkUnderline(C))),this.register(f.onHideLinkUnderline(C=>this._handleHideLinkUnderline(C)))}resize(w,m){super.resize(w,m),this._state=void 0}reset(w){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const w=this._state.y2-this._state.y1-1;w>0&&this._clearCells(0,this._state.y1+1,this._state.cols,w),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(w){if(w.fg===_.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:w.fg!==void 0&&(0,p.is256Color)(w.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[w.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,w.y1===w.y2)this._fillBottomLineAtCells(w.x1,w.y1,w.x2-w.x1);else{this._fillBottomLineAtCells(w.x1,w.y1,w.cols-w.x1);for(let m=w.y1+1;m<w.y2;m++)this._fillBottomLineAtCells(0,m,w.cols);this._fillBottomLineAtCells(0,w.y2,w.x2)}this._state=w}_handleHideLinkUnderline(w){this._clearCurrentLink()}}n.LinkRenderLayer=g},820:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(a,p,_,l){a.addEventListener(p,_,l);let g=!1;return{dispose:()=>{g||(g=!0,a.removeEventListener(p,_,l))}}}},274:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const p=a(855),_=a(160),l=a(374);let g,v=0,w=0,m=!1,h=!1,f=!1,d=0;n.CellColorResolver=class{constructor(u,y,C,S,b,x){this._terminal=u,this._optionService=y,this._selectionRenderModel=C,this._decorationService=S,this._coreBrowserService=b,this._themeService=x,this.result={fg:0,bg:0,ext:0}}resolve(u,y,C,S){if(this.result.bg=u.bg,this.result.fg=u.fg,this.result.ext=268435456&u.bg?u.extended.ext:0,w=0,v=0,h=!1,m=!1,f=!1,g=this._themeService.colors,d=0,u.getCode()!==p.NULL_CELL_CODE&&u.extended.underlineStyle===4){const b=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));d=y*S%(2*Math.round(b))}if(this._decorationService.forEachDecorationAtCell(y,C,"bottom",b=>{b.backgroundColorRGB&&(w=b.backgroundColorRGB.rgba>>8&16777215,h=!0),b.foregroundColorRGB&&(v=b.foregroundColorRGB.rgba>>8&16777215,m=!0)}),f=this._selectionRenderModel.isCellSelected(this._terminal,y,C),f){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}w=_.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else w=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(h=!0,g.selectionForeground&&(v=g.selectionForeground.rgba>>8&16777215,m=!0),(0,l.treatGlyphAsBackgroundColor)(u.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))v=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:v=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:v=(16777215&this.result.fg)<<8|255;break;default:v=this._themeService.colors.foreground.rgba}v=_.rgba.blend(v,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}m=!0}}this._decorationService.forEachDecorationAtCell(y,C,"top",b=>{b.backgroundColorRGB&&(w=b.backgroundColorRGB.rgba>>8&16777215,h=!0),b.foregroundColorRGB&&(v=b.foregroundColorRGB.rgba>>8&16777215,m=!0)}),h&&(w=f?-16777216&u.bg&-134217729|w|50331648:-16777216&u.bg|w|50331648),m&&(v=-16777216&u.fg&-67108865|v|50331648),67108864&this.result.fg&&(h&&!m&&(v=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648,m=!0),!h&&m&&(w=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&g.foreground.rgba>>8|50331648,h=!0)),g=void 0,this.result.bg=h?w:this.result.bg,this.result.fg=m?v:this.result.fg,this.result.ext&=536870911,this.result.ext|=d<<29&3758096384}}},627:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const p=a(509),_=a(197),l=[];n.acquireTextureAtlas=function(g,v,w,m,h,f,d,u){const y=(0,_.generateConfig)(m,h,f,d,v,w,u);for(let b=0;b<l.length;b++){const x=l[b],k=x.ownedBy.indexOf(g);if(k>=0){if((0,_.configEquals)(x.config,y))return x.atlas;x.ownedBy.length===1?(x.atlas.dispose(),l.splice(b,1)):x.ownedBy.splice(k,1);break}}for(let b=0;b<l.length;b++){const x=l[b];if((0,_.configEquals)(x.config,y))return x.ownedBy.push(g),x.atlas}const C=g._core,S={atlas:new p.TextureAtlas(document,y,C.unicodeService),config:y,ownedBy:[g]};return l.push(S),S.atlas},n.removeTerminalFromCache=function(g){for(let v=0;v<l.length;v++){const w=l[v].ownedBy.indexOf(g);if(w!==-1){l[v].ownedBy.length===1?(l[v].atlas.dispose(),l.splice(v,1)):l[v].ownedBy.splice(w,1);break}}}},197:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const p=a(160);n.generateConfig=function(_,l,g,v,w,m,h){const f={foreground:m.foreground,background:m.background,cursor:p.NULL_COLOR,cursorAccent:p.NULL_COLOR,selectionForeground:p.NULL_COLOR,selectionBackgroundTransparent:p.NULL_COLOR,selectionBackgroundOpaque:p.NULL_COLOR,selectionInactiveBackgroundTransparent:p.NULL_COLOR,selectionInactiveBackgroundOpaque:p.NULL_COLOR,ansi:m.ansi.slice(),contrastCache:m.contrastCache,halfContrastCache:m.halfContrastCache};return{customGlyphs:w.customGlyphs,devicePixelRatio:h,letterSpacing:w.letterSpacing,lineHeight:w.lineHeight,deviceCellWidth:_,deviceCellHeight:l,deviceCharWidth:g,deviceCharHeight:v,fontFamily:w.fontFamily,fontSize:w.fontSize,fontWeight:w.fontWeight,fontWeightBold:w.fontWeightBold,allowTransparency:w.allowTransparency,drawBoldTextInBrightColors:w.drawBoldTextInBrightColors,minimumContrastRatio:w.minimumContrastRatio,colors:f}},n.configEquals=function(_,l){for(let g=0;g<_.colors.ansi.length;g++)if(_.colors.ansi[g].rgba!==l.colors.ansi[g].rgba)return!1;return _.devicePixelRatio===l.devicePixelRatio&&_.customGlyphs===l.customGlyphs&&_.lineHeight===l.lineHeight&&_.letterSpacing===l.letterSpacing&&_.fontFamily===l.fontFamily&&_.fontSize===l.fontSize&&_.fontWeight===l.fontWeight&&_.fontWeightBold===l.fontWeightBold&&_.allowTransparency===l.allowTransparency&&_.deviceCharWidth===l.deviceCharWidth&&_.deviceCharHeight===l.deviceCharHeight&&_.drawBoldTextInBrightColors===l.drawBoldTextInBrightColors&&_.minimumContrastRatio===l.minimumContrastRatio&&_.colors.foreground.rgba===l.colors.foreground.rgba&&_.colors.background.rgba===l.colors.background.rgba},n.is256Color=function(_){return(50331648&_)==16777216||(50331648&_)==33554432}},237:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const p=a(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=p.isFirefox||p.isLegacyEdge?"bottom":"ideographic"},457:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(a,p){this._renderCallback=a,this._coreBrowserService=p,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const p=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,p>0)return void this._restartInterval(p)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const p=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(p)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const p=a(374);n.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const _={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};n.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(m,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"║":{1:(m,h)=>`M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1`},"╒":{1:(m,h)=>`M.5,1 L.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╓":{1:(m,h)=>`M${.5-m},1 L${.5-m},.5 L1,.5 M${.5+m},.5 L${.5+m},1`},"╔":{1:(m,h)=>`M1,${.5-h} L${.5-m},${.5-h} L${.5-m},1 M1,${.5+h} L${.5+m},${.5+h} L${.5+m},1`},"╕":{1:(m,h)=>`M0,${.5-h} L.5,${.5-h} L.5,1 M0,${.5+h} L.5,${.5+h}`},"╖":{1:(m,h)=>`M${.5+m},1 L${.5+m},.5 L0,.5 M${.5-m},.5 L${.5-m},1`},"╗":{1:(m,h)=>`M0,${.5+h} L${.5-m},${.5+h} L${.5-m},1 M0,${.5-h} L${.5+m},${.5-h} L${.5+m},1`},"╘":{1:(m,h)=>`M.5,0 L.5,${.5+h} L1,${.5+h} M.5,${.5-h} L1,${.5-h}`},"╙":{1:(m,h)=>`M1,.5 L${.5-m},.5 L${.5-m},0 M${.5+m},.5 L${.5+m},0`},"╚":{1:(m,h)=>`M1,${.5-h} L${.5+m},${.5-h} L${.5+m},0 M1,${.5+h} L${.5-m},${.5+h} L${.5-m},0`},"╛":{1:(m,h)=>`M0,${.5+h} L.5,${.5+h} L.5,0 M0,${.5-h} L.5,${.5-h}`},"╜":{1:(m,h)=>`M0,.5 L${.5+m},.5 L${.5+m},0 M${.5-m},.5 L${.5-m},0`},"╝":{1:(m,h)=>`M0,${.5-h} L${.5-m},${.5-h} L${.5-m},0 M0,${.5+h} L${.5+m},${.5+h} L${.5+m},0`},"╞":{1:(m,h)=>`M.5,0 L.5,1 M.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╟":{1:(m,h)=>`M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1 M${.5+m},.5 L1,.5`},"╠":{1:(m,h)=>`M${.5-m},0 L${.5-m},1 M1,${.5+h} L${.5+m},${.5+h} L${.5+m},1 M1,${.5-h} L${.5+m},${.5-h} L${.5+m},0`},"╡":{1:(m,h)=>`M.5,0 L.5,1 M0,${.5-h} L.5,${.5-h} M0,${.5+h} L.5,${.5+h}`},"╢":{1:(m,h)=>`M0,.5 L${.5-m},.5 M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1`},"╣":{1:(m,h)=>`M${.5+m},0 L${.5+m},1 M0,${.5+h} L${.5-m},${.5+h} L${.5-m},1 M0,${.5-h} L${.5-m},${.5-h} L${.5-m},0`},"╤":{1:(m,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h} M.5,${.5+h} L.5,1`},"╥":{1:(m,h)=>`M0,.5 L1,.5 M${.5-m},.5 L${.5-m},1 M${.5+m},.5 L${.5+m},1`},"╦":{1:(m,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L${.5-m},${.5+h} L${.5-m},1 M1,${.5+h} L${.5+m},${.5+h} L${.5+m},1`},"╧":{1:(m,h)=>`M.5,0 L.5,${.5-h} M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╨":{1:(m,h)=>`M0,.5 L1,.5 M${.5-m},.5 L${.5-m},0 M${.5+m},.5 L${.5+m},0`},"╩":{1:(m,h)=>`M0,${.5+h} L1,${.5+h} M0,${.5-h} L${.5-m},${.5-h} L${.5-m},0 M1,${.5-h} L${.5+m},${.5-h} L${.5+m},0`},"╪":{1:(m,h)=>`M.5,0 L.5,1 M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╫":{1:(m,h)=>`M0,.5 L1,.5 M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1`},"╬":{1:(m,h)=>`M0,${.5+h} L${.5-m},${.5+h} L${.5-m},1 M1,${.5+h} L${.5+m},${.5+h} L${.5+m},1 M0,${.5-h} L${.5-m},${.5-h} L${.5-m},0 M1,${.5-h} L${.5+m},${.5-h} L${.5+m},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(m,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,1,.5`},"╮":{1:(m,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,0,.5`},"╯":{1:(m,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,0,.5`},"╰":{1:(m,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,1,.5`}},n.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.tryDrawCustomChar=function(m,h,f,d,u,y,C,S){const b=n.blockElementDefinitions[h];if(b)return function(D,R,T,A,j,$){for(let F=0;F<R.length;F++){const B=R[F],L=j/8,P=$/8;D.fillRect(T+B.x*L,A+B.y*P,B.w*L,B.h*P)}}(m,b,f,d,u,y),!0;const x=_[h];if(x)return function(D,R,T,A,j,$){let F=l.get(R);F||(F=new Map,l.set(R,F));const B=D.fillStyle;if(typeof B!="string")throw new Error(`Unexpected fillStyle type "${B}"`);let L=F.get(B);if(!L){const P=R[0].length,O=R.length,I=D.canvas.ownerDocument.createElement("canvas");I.width=P,I.height=O;const W=(0,p.throwIfFalsy)(I.getContext("2d")),K=new ImageData(P,O);let q,Z,z,N;if(B.startsWith("#"))q=parseInt(B.slice(1,3),16),Z=parseInt(B.slice(3,5),16),z=parseInt(B.slice(5,7),16),N=B.length>7&&parseInt(B.slice(7,9),16)||1;else{if(!B.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${B}" when drawing pattern glyph`);[q,Z,z,N]=B.substring(5,B.length-1).split(",").map(U=>parseFloat(U))}for(let U=0;U<O;U++)for(let G=0;G<P;G++)K.data[4*(U*P+G)]=q,K.data[4*(U*P+G)+1]=Z,K.data[4*(U*P+G)+2]=z,K.data[4*(U*P+G)+3]=R[U][G]*(255*N);W.putImageData(K,0,0),L=(0,p.throwIfFalsy)(D.createPattern(I,null)),F.set(B,L)}D.fillStyle=L,D.fillRect(T,A,j,$)}(m,x,f,d,u,y),!0;const k=n.boxDrawingDefinitions[h];if(k)return function(D,R,T,A,j,$,F){D.strokeStyle=D.fillStyle;for(const[B,L]of Object.entries(R)){let P;D.beginPath(),D.lineWidth=F*Number.parseInt(B),P=typeof L=="function"?L(.15,.15/$*j):L;for(const O of P.split(" ")){const I=O[0],W=v[I];if(!W){console.error(`Could not find drawing instructions for "${I}"`);continue}const K=O.substring(1).split(",");K[0]&&K[1]&&W(D,w(K,j,$,T,A,!0,F))}D.stroke(),D.closePath()}}(m,k,f,d,u,y,S),!0;const M=n.powerlineDefinitions[h];return!!M&&(function(D,R,T,A,j,$,F,B){const L=new Path2D;L.rect(T,A,j,$),D.clip(L),D.beginPath();const P=F/12;D.lineWidth=B*P;for(const O of R.d.split(" ")){const I=O[0],W=v[I];if(!W){console.error(`Could not find drawing instructions for "${I}"`);continue}const K=O.substring(1).split(",");K[0]&&K[1]&&W(D,w(K,j,$,T,A,!1,B,(R.leftPadding??0)*(P/2),(R.rightPadding??0)*(P/2)))}R.type===1?(D.strokeStyle=D.fillStyle,D.stroke()):D.fill(),D.closePath()}(m,M,f,d,u,y,C,S),!0)};const l=new Map;function g(m,h,f=0){return Math.max(Math.min(m,h),f)}const v={C:(m,h)=>m.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]),L:(m,h)=>m.lineTo(h[0],h[1]),M:(m,h)=>m.moveTo(h[0],h[1])};function w(m,h,f,d,u,y,C,S=0,b=0){const x=m.map(k=>parseFloat(k)||parseInt(k));if(x.length<2)throw new Error("Too few arguments for instruction");for(let k=0;k<x.length;k+=2)x[k]*=h-S*C-b*C,y&&x[k]!==0&&(x[k]=g(Math.round(x[k]+.5)-.5,h,0)),x[k]+=d+S*C;for(let k=1;k<x.length;k+=2)x[k]*=f,y&&x[k]!==0&&(x[k]=g(Math.round(x[k]+.5)-.5,f,0)),x[k]+=u;return x}},56:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const p=a(859);n.observeDevicePixelDimensions=function(_,l,g){let v=new l.ResizeObserver(w=>{const m=w.find(d=>d.target===_);if(!m)return;if(!("devicePixelContentBoxSize"in m))return v==null||v.disconnect(),void(v=void 0);const h=m.devicePixelContentBoxSize[0].inlineSize,f=m.devicePixelContentBoxSize[0].blockSize;h>0&&f>0&&g(h,f)});try{v.observe(_,{box:["device-pixel-content-box"]})}catch{v.disconnect(),v=void 0}return(0,p.toDisposable)(()=>v==null?void 0:v.disconnect())}},374:(c,n)=>{function a(_){return 57508<=_&&_<=57558}function p(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=a,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=p,n.allowRescaling=function(_,l,g,v){return l===1&&g>Math.ceil(1.5*v)&&_!==void 0&&_>255&&!p(_)&&!a(_)&&!function(w){return 57344<=w&&w<=63743}(_)},n.treatGlyphAsBackgroundColor=function(_){return a(_)||function(l){return 9472<=l&&l<=9631}(_)},n.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}}}},n.computeNextVariantOffset=function(_,l,g=0){return(_-(2*Math.round(l)-g))%(2*Math.round(l))}},296:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,l,g,v=!1){if(this.selectionStart=l,this.selectionEnd=g,!l||!g||l[0]===g[0]&&l[1]===g[1])return void this.clear();const w=_.buffers.active.ydisp,m=l[1]-w,h=g[1]-w,f=Math.max(m,0),d=Math.min(h,_.rows-1);f>=_.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=m,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=l[0],this.endCol=g[0])}isCellSelected(_,l,g){return!!this.hasSelection&&(g-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&g>=this.viewportCappedStartRow&&l<this.endCol&&g<=this.viewportCappedEndRow:l<this.startCol&&g>=this.viewportCappedStartRow&&l>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&l>=this.startCol)}}n.createSelectionRenderModel=function(){return new a}},509:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const p=a(237),_=a(860),l=a(374),g=a(160),v=a(345),w=a(485),m=a(385),h=a(147),f=a(855),d={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let u;class y{get pages(){return this._pages}constructor(k,M,D){this._document=k,this._config=M,this._unicodeService=D,this._didWarmUp=!1,this._cacheMap=new w.FourKeyMap,this._cacheMapCombined=new w.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new h.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new v.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new v.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=b(k,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const k of this.pages)k.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const k=new m.IdleTaskQueue;for(let M=33;M<126;M++)k.enqueue(()=>{if(!this._cacheMap.get(M,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT)){const D=this._drawToCache(M,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT);this._cacheMap.set(M,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT,D)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const k of this._pages)k.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(y.maxAtlasPages&&this._pages.length>=Math.max(4,y.maxAtlasPages)){const M=this._pages.filter(F=>2*F.canvas.width<=(y.maxTextureSize||4096)).sort((F,B)=>B.canvas.width!==F.canvas.width?B.canvas.width-F.canvas.width:B.percentageUsed-F.percentageUsed);let D=-1,R=0;for(let F=0;F<M.length;F++)if(M[F].canvas.width!==R)D=F,R=M[F].canvas.width;else if(F-D==3)break;const T=M.slice(D,D+4),A=T.map(F=>F.glyphs[0].texturePage).sort((F,B)=>F>B?1:-1),j=this.pages.length-T.length,$=this._mergePages(T,j);$.version++;for(let F=A.length-1;F>=0;F--)this._deletePage(A[F]);this.pages.push($),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire($.canvas)}const k=new C(this._document,this._textureSize);return this._pages.push(k),this._activePages.push(k),this._onAddTextureAtlasCanvas.fire(k.canvas),k}_mergePages(k,M){const D=2*k[0].canvas.width,R=new C(this._document,D,k);for(const[T,A]of k.entries()){const j=T*A.canvas.width%D,$=Math.floor(T/2)*A.canvas.height;R.ctx.drawImage(A.canvas,j,$);for(const B of A.glyphs)B.texturePage=M,B.sizeClipSpace.x=B.size.x/D,B.sizeClipSpace.y=B.size.y/D,B.texturePosition.x+=j,B.texturePosition.y+=$,B.texturePositionClipSpace.x=B.texturePosition.x/D,B.texturePositionClipSpace.y=B.texturePosition.y/D;this._onRemoveTextureAtlasCanvas.fire(A.canvas);const F=this._activePages.indexOf(A);F!==-1&&this._activePages.splice(F,1)}return R}_deletePage(k){this._pages.splice(k,1);for(let M=k;M<this._pages.length;M++){const D=this._pages[M];for(const R of D.glyphs)R.texturePage--;D.version++}}getRasterizedGlyphCombinedChar(k,M,D,R,T){return this._getFromCacheMap(this._cacheMapCombined,k,M,D,R,T)}getRasterizedGlyph(k,M,D,R,T){return this._getFromCacheMap(this._cacheMap,k,M,D,R,T)}_getFromCacheMap(k,M,D,R,T,A=!1){return u=k.get(M,D,R,T),u||(u=this._drawToCache(M,D,R,T,A),k.set(M,D,R,T,u)),u}_getColorFromAnsiIndex(k){if(k>=this._config.colors.ansi.length)throw new Error("No color found for idx "+k);return this._config.colors.ansi[k]}_getBackgroundColor(k,M,D,R){if(this._config.allowTransparency)return g.NULL_COLOR;let T;switch(k){case 16777216:case 33554432:T=this._getColorFromAnsiIndex(M);break;case 50331648:const A=h.AttributeData.toColorRGB(M);T=g.channels.toColor(A[0],A[1],A[2]);break;default:T=D?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return T}_getForegroundColor(k,M,D,R,T,A,j,$,F,B){const L=this._getMinimumContrastColor(k,M,D,R,T,A,j,F,$,B);if(L)return L;let P;switch(T){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&F&&A<8&&(A+=8),P=this._getColorFromAnsiIndex(A);break;case 50331648:const O=h.AttributeData.toColorRGB(A);P=g.channels.toColor(O[0],O[1],O[2]);break;default:P=j?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(P=g.color.opaque(P)),$&&(P=g.color.multiplyOpacity(P,p.DIM_OPACITY)),P}_resolveBackgroundRgba(k,M,D){switch(k){case 16777216:case 33554432:return this._getColorFromAnsiIndex(M).rgba;case 50331648:return M<<8;default:return D?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(k,M,D,R){switch(k){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&R&&M<8&&(M+=8),this._getColorFromAnsiIndex(M).rgba;case 50331648:return M<<8;default:return D?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(k,M,D,R,T,A,j,$,F,B){if(this._config.minimumContrastRatio===1||B)return;const L=this._getContrastCache(F),P=L.getColor(k,R);if(P!==void 0)return P||void 0;const O=this._resolveBackgroundRgba(M,D,j),I=this._resolveForegroundRgba(T,A,j,$),W=g.rgba.ensureContrastRatio(O,I,this._config.minimumContrastRatio/(F?2:1));if(!W)return void L.setColor(k,R,null);const K=g.channels.toColor(W>>24&255,W>>16&255,W>>8&255);return L.setColor(k,R,K),K}_getContrastCache(k){return k?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(k,M,D,R,T=!1){const A=typeof k=="number"?String.fromCharCode(k):k,j=Math.min(this._config.deviceCellWidth*Math.max(A.length,2)+4,this._textureSize);this._tmpCanvas.width<j&&(this._tmpCanvas.width=j);const $=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<$&&(this._tmpCanvas.height=$),this._tmpCtx.save(),this._workAttributeData.fg=D,this._workAttributeData.bg=M,this._workAttributeData.extended.ext=R,this._workAttributeData.isInvisible())return d;const F=!!this._workAttributeData.isBold(),B=!!this._workAttributeData.isInverse(),L=!!this._workAttributeData.isDim(),P=!!this._workAttributeData.isItalic(),O=!!this._workAttributeData.isUnderline(),I=!!this._workAttributeData.isStrikethrough(),W=!!this._workAttributeData.isOverline();let K=this._workAttributeData.getFgColor(),q=this._workAttributeData.getFgColorMode(),Z=this._workAttributeData.getBgColor(),z=this._workAttributeData.getBgColorMode();if(B){const oe=K;K=Z,Z=oe;const we=q;q=z,z=we}const N=this._getBackgroundColor(z,Z,B,L);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const U=F?this._config.fontWeightBold:this._config.fontWeight,G=P?"italic":"";this._tmpCtx.font=`${G} ${U} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=p.TEXT_BASELINE;const Q=A.length===1&&(0,l.isPowerlineGlyph)(A.charCodeAt(0)),Y=A.length===1&&(0,l.isRestrictedPowerlineGlyph)(A.charCodeAt(0)),ee=this._getForegroundColor(M,z,Z,D,q,K,B,L,F,(0,l.treatGlyphAsBackgroundColor)(A.charCodeAt(0)));this._tmpCtx.fillStyle=ee.css;const te=Y?0:4;let le=!1;this._config.customGlyphs!==!1&&(le=(0,_.tryDrawCustomChar)(this._tmpCtx,A,te,te,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let pe,ne=!Q;if(pe=typeof k=="number"?this._unicodeService.wcwidth(k):this._unicodeService.getStringCellWidth(k),O){this._tmpCtx.save();const oe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=oe%2==1?.5:0;if(this._tmpCtx.lineWidth=oe,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ne=!1,this._tmpCtx.strokeStyle=`rgb(${h.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ne=!1;let Ae=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ae<8&&(Ae+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ae).css}this._tmpCtx.beginPath();const xe=te,ae=Math.ceil(te+this._config.deviceCharHeight)-we-(T?2*oe:0),De=ae+oe,ce=ae+2*oe;let Be=this._workAttributeData.getUnderlineVariantOffset();for(let Ae=0;Ae<pe;Ae++){this._tmpCtx.save();const be=xe+Ae*this._config.deviceCellWidth,ve=xe+(Ae+1)*this._config.deviceCellWidth,Tt=be+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(be,ae),this._tmpCtx.lineTo(ve,ae),this._tmpCtx.moveTo(be,ce),this._tmpCtx.lineTo(ve,ce);break;case 3:const Pt=oe<=1?ce:Math.ceil(te+this._config.deviceCharHeight-oe/2)-we,re=oe<=1?ae:Math.ceil(te+this._config.deviceCharHeight+oe/2)-we,de=new Path2D;de.rect(be,ae,this._config.deviceCellWidth,ce-ae),this._tmpCtx.clip(de),this._tmpCtx.moveTo(be-this._config.deviceCellWidth/2,De),this._tmpCtx.bezierCurveTo(be-this._config.deviceCellWidth/2,re,be,re,be,De),this._tmpCtx.bezierCurveTo(be,Pt,Tt,Pt,Tt,De),this._tmpCtx.bezierCurveTo(Tt,re,ve,re,ve,De),this._tmpCtx.bezierCurveTo(ve,Pt,ve+this._config.deviceCellWidth/2,Pt,ve+this._config.deviceCellWidth/2,De);break;case 4:const fe=Be===0?0:Be>=oe?2*oe-Be:oe-Be;Be>=oe||fe===0?(this._tmpCtx.setLineDash([Math.round(oe),Math.round(oe)]),this._tmpCtx.moveTo(be+fe,ae),this._tmpCtx.lineTo(ve,ae)):(this._tmpCtx.setLineDash([Math.round(oe),Math.round(oe)]),this._tmpCtx.moveTo(be,ae),this._tmpCtx.lineTo(be+fe,ae),this._tmpCtx.moveTo(be+fe+oe,ae),this._tmpCtx.lineTo(ve,ae)),Be=(0,l.computeNextVariantOffset)(ve-be,oe,Be);break;case 5:const ke=.6,Oe=.3,J=ve-be,Ge=Math.floor(ke*J),Pe=Math.floor(Oe*J),Zr=J-Ge-Pe;this._tmpCtx.setLineDash([Ge,Pe,Zr]),this._tmpCtx.moveTo(be,ae),this._tmpCtx.lineTo(ve,ae);break;default:this._tmpCtx.moveTo(be,ae),this._tmpCtx.lineTo(ve,ae)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!le&&this._config.fontSize>=12&&!this._config.allowTransparency&&A!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ae=this._tmpCtx.measureText(A);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ae&&Ae.actualBoundingBoxDescent>0){this._tmpCtx.save();const be=new Path2D;be.rect(xe,ae-Math.ceil(oe/2),this._config.deviceCellWidth*pe,ce-ae+Math.ceil(oe/2)),this._tmpCtx.clip(be),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=N.css,this._tmpCtx.strokeText(A,te,te+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(W){const oe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=oe%2==1?.5:0;this._tmpCtx.lineWidth=oe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(te,te+we),this._tmpCtx.lineTo(te+this._config.deviceCharWidth*pe,te+we),this._tmpCtx.stroke()}if(le||this._tmpCtx.fillText(A,te,te+this._config.deviceCharHeight),A==="_"&&!this._config.allowTransparency){let oe=S(this._tmpCtx.getImageData(te,te,this._config.deviceCellWidth,this._config.deviceCellHeight),N,ee,ne);if(oe)for(let we=1;we<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=N.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(A,te,te+this._config.deviceCharHeight-we),oe=S(this._tmpCtx.getImageData(te,te,this._config.deviceCellWidth,this._config.deviceCellHeight),N,ee,ne),oe);we++);}if(I){const oe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),we=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=oe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(te,te+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.lineTo(te+this._config.deviceCharWidth*pe,te+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.stroke()}this._tmpCtx.restore();const Te=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let We;if(We=this._config.allowTransparency?function(oe){for(let we=0;we<oe.data.length;we+=4)if(oe.data[we+3]>0)return!1;return!0}(Te):S(Te,N,ee,ne),We)return d;const me=this._findGlyphBoundingBox(Te,this._workBoundingBox,j,Y,le,te);let ge,ye;for(;;){if(this._activePages.length===0){const oe=this._createNewPage();ge=oe,ye=oe.currentRow,ye.height=me.size.y;break}ge=this._activePages[this._activePages.length-1],ye=ge.currentRow;for(const oe of this._activePages)me.size.y<=oe.currentRow.height&&(ge=oe,ye=oe.currentRow);for(let oe=this._activePages.length-1;oe>=0;oe--)for(const we of this._activePages[oe].fixedRows)we.height<=ye.height&&me.size.y<=we.height&&(ge=this._activePages[oe],ye=we);if(ye.y+me.size.y>=ge.canvas.height||ye.height>me.size.y+2){let oe=!1;if(ge.currentRow.y+ge.currentRow.height+me.size.y>=ge.canvas.height){let we;for(const xe of this._activePages)if(xe.currentRow.y+xe.currentRow.height+me.size.y<xe.canvas.height){we=xe;break}if(we)ge=we;else if(y.maxAtlasPages&&this._pages.length>=y.maxAtlasPages&&ye.y+me.size.y<=ge.canvas.height&&ye.height>=me.size.y&&ye.x+me.size.x<=ge.canvas.width)oe=!0;else{const xe=this._createNewPage();ge=xe,ye=xe.currentRow,ye.height=me.size.y,oe=!0}}oe||(ge.currentRow.height>0&&ge.fixedRows.push(ge.currentRow),ye={x:0,y:ge.currentRow.y+ge.currentRow.height,height:me.size.y},ge.fixedRows.push(ye),ge.currentRow={x:0,y:ye.y+ye.height,height:0})}if(ye.x+me.size.x<=ge.canvas.width)break;ye===ge.currentRow?(ye.x=0,ye.y+=ye.height,ye.height=0):ge.fixedRows.splice(ge.fixedRows.indexOf(ye),1)}return me.texturePage=this._pages.indexOf(ge),me.texturePosition.x=ye.x,me.texturePosition.y=ye.y,me.texturePositionClipSpace.x=ye.x/ge.canvas.width,me.texturePositionClipSpace.y=ye.y/ge.canvas.height,me.sizeClipSpace.x/=ge.canvas.width,me.sizeClipSpace.y/=ge.canvas.height,ye.height=Math.max(ye.height,me.size.y),ye.x+=me.size.x,ge.ctx.putImageData(Te,me.texturePosition.x-this._workBoundingBox.left,me.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,me.size.x,me.size.y),ge.addGlyph(me),ge.version++,me}_findGlyphBoundingBox(k,M,D,R,T,A){M.top=0;const j=R?this._config.deviceCellHeight:this._tmpCanvas.height,$=R?this._config.deviceCellWidth:D;let F=!1;for(let B=0;B<j;B++){for(let L=0;L<$;L++){const P=B*this._tmpCanvas.width*4+4*L+3;if(k.data[P]!==0){M.top=B,F=!0;break}}if(F)break}M.left=0,F=!1;for(let B=0;B<A+$;B++){for(let L=0;L<j;L++){const P=L*this._tmpCanvas.width*4+4*B+3;if(k.data[P]!==0){M.left=B,F=!0;break}}if(F)break}M.right=$,F=!1;for(let B=A+$-1;B>=A;B--){for(let L=0;L<j;L++){const P=L*this._tmpCanvas.width*4+4*B+3;if(k.data[P]!==0){M.right=B,F=!0;break}}if(F)break}M.bottom=j,F=!1;for(let B=j-1;B>=0;B--){for(let L=0;L<$;L++){const P=B*this._tmpCanvas.width*4+4*L+3;if(k.data[P]!==0){M.bottom=B,F=!0;break}}if(F)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:M.right-M.left+1,y:M.bottom-M.top+1},sizeClipSpace:{x:M.right-M.left+1,y:M.bottom-M.top+1},offset:{x:-M.left+A+(R||T?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-M.top+A+(R||T?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=y;class C{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(k){this._glyphs.push(k),this._usedPixels+=k.size.x*k.size.y}constructor(k,M,D){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],D)for(const R of D)this._glyphs.push(...R.glyphs),this._usedPixels+=R._usedPixels;this.canvas=b(k,M,M),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function S(x,k,M,D){const R=k.rgba>>>24,T=k.rgba>>>16&255,A=k.rgba>>>8&255,j=M.rgba>>>24,$=M.rgba>>>16&255,F=M.rgba>>>8&255,B=Math.floor((Math.abs(R-j)+Math.abs(T-$)+Math.abs(A-F))/12);let L=!0;for(let P=0;P<x.data.length;P+=4)x.data[P]===R&&x.data[P+1]===T&&x.data[P+2]===A||D&&Math.abs(x.data[P]-R)+Math.abs(x.data[P+1]-T)+Math.abs(x.data[P+2]-A)<B?x.data[P+3]=0:L=!1;return L}function b(x,k,M){const D=x.createElement("canvas");return D.width=k,D.height=M,D}},160:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let a=0,p=0,_=0,l=0;var g,v,w,m,h;function f(u){const y=u.toString(16);return y.length<2?"0"+y:y}function d(u,y){return u<y?(y+.05)/(u+.05):(u+.05)/(y+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},function(u){u.toCss=function(y,C,S,b){return b!==void 0?`#${f(y)}${f(C)}${f(S)}${f(b)}`:`#${f(y)}${f(C)}${f(S)}`},u.toRgba=function(y,C,S,b=255){return(y<<24|C<<16|S<<8|b)>>>0},u.toColor=function(y,C,S,b){return{css:u.toCss(y,C,S,b),rgba:u.toRgba(y,C,S,b)}}}(g||(n.channels=g={})),function(u){function y(C,S){return l=Math.round(255*S),[a,p,_]=h.toChannels(C.rgba),{css:g.toCss(a,p,_,l),rgba:g.toRgba(a,p,_,l)}}u.blend=function(C,S){if(l=(255&S.rgba)/255,l===1)return{css:S.css,rgba:S.rgba};const b=S.rgba>>24&255,x=S.rgba>>16&255,k=S.rgba>>8&255,M=C.rgba>>24&255,D=C.rgba>>16&255,R=C.rgba>>8&255;return a=M+Math.round((b-M)*l),p=D+Math.round((x-D)*l),_=R+Math.round((k-R)*l),{css:g.toCss(a,p,_),rgba:g.toRgba(a,p,_)}},u.isOpaque=function(C){return(255&C.rgba)==255},u.ensureContrastRatio=function(C,S,b){const x=h.ensureContrastRatio(C.rgba,S.rgba,b);if(x)return g.toColor(x>>24&255,x>>16&255,x>>8&255)},u.opaque=function(C){const S=(255|C.rgba)>>>0;return[a,p,_]=h.toChannels(S),{css:g.toCss(a,p,_),rgba:S}},u.opacity=y,u.multiplyOpacity=function(C,S){return l=255&C.rgba,y(C,l*S/255)},u.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(v||(n.color=v={})),function(u){let y,C;try{const S=document.createElement("canvas");S.width=1,S.height=1;const b=S.getContext("2d",{willReadFrequently:!0});b&&(y=b,y.globalCompositeOperation="copy",C=y.createLinearGradient(0,0,1,1))}catch{}u.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return a=parseInt(S.slice(1,2).repeat(2),16),p=parseInt(S.slice(2,3).repeat(2),16),_=parseInt(S.slice(3,4).repeat(2),16),g.toColor(a,p,_);case 5:return a=parseInt(S.slice(1,2).repeat(2),16),p=parseInt(S.slice(2,3).repeat(2),16),_=parseInt(S.slice(3,4).repeat(2),16),l=parseInt(S.slice(4,5).repeat(2),16),g.toColor(a,p,_,l);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const b=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(b)return a=parseInt(b[1]),p=parseInt(b[2]),_=parseInt(b[3]),l=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),g.toColor(a,p,_,l);if(!y||!C)throw new Error("css.toColor: Unsupported css format");if(y.fillStyle=C,y.fillStyle=S,typeof y.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(y.fillRect(0,0,1,1),[a,p,_,l]=y.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(a,p,_,l),css:S}}}(w||(n.css=w={})),function(u){function y(C,S,b){const x=C/255,k=S/255,M=b/255;return .2126*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))}u.relativeLuminance=function(C){return y(C>>16&255,C>>8&255,255&C)},u.relativeLuminance2=y}(m||(n.rgb=m={})),function(u){function y(S,b,x){const k=S>>24&255,M=S>>16&255,D=S>>8&255;let R=b>>24&255,T=b>>16&255,A=b>>8&255,j=d(m.relativeLuminance2(R,T,A),m.relativeLuminance2(k,M,D));for(;j<x&&(R>0||T>0||A>0);)R-=Math.max(0,Math.ceil(.1*R)),T-=Math.max(0,Math.ceil(.1*T)),A-=Math.max(0,Math.ceil(.1*A)),j=d(m.relativeLuminance2(R,T,A),m.relativeLuminance2(k,M,D));return(R<<24|T<<16|A<<8|255)>>>0}function C(S,b,x){const k=S>>24&255,M=S>>16&255,D=S>>8&255;let R=b>>24&255,T=b>>16&255,A=b>>8&255,j=d(m.relativeLuminance2(R,T,A),m.relativeLuminance2(k,M,D));for(;j<x&&(R<255||T<255||A<255);)R=Math.min(255,R+Math.ceil(.1*(255-R))),T=Math.min(255,T+Math.ceil(.1*(255-T))),A=Math.min(255,A+Math.ceil(.1*(255-A))),j=d(m.relativeLuminance2(R,T,A),m.relativeLuminance2(k,M,D));return(R<<24|T<<16|A<<8|255)>>>0}u.blend=function(S,b){if(l=(255&b)/255,l===1)return b;const x=b>>24&255,k=b>>16&255,M=b>>8&255,D=S>>24&255,R=S>>16&255,T=S>>8&255;return a=D+Math.round((x-D)*l),p=R+Math.round((k-R)*l),_=T+Math.round((M-T)*l),g.toRgba(a,p,_)},u.ensureContrastRatio=function(S,b,x){const k=m.relativeLuminance(S>>8),M=m.relativeLuminance(b>>8);if(d(k,M)<x){if(M<k){const T=y(S,b,x),A=d(k,m.relativeLuminance(T>>8));if(A<x){const j=C(S,b,x);return A>d(k,m.relativeLuminance(j>>8))?T:j}return T}const D=C(S,b,x),R=d(k,m.relativeLuminance(D>>8));if(R<x){const T=y(S,b,x);return R>d(k,m.relativeLuminance(T>>8))?D:T}return D}},u.reduceLuminance=y,u.increaseLuminance=C,u.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}}(h||(n.rgba=h={})),n.toPaddedHex=f,n.contrastRatio=d},345:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let p=0;p<this._listeners.length;p++)if(this._listeners[p]===a)return void this._listeners.splice(p,1)}}})),this._event}fire(a,p){const _=[];for(let l=0;l<this._listeners.length;l++)_.push(this._listeners[l]);for(let l=0;l<_.length;l++)_[l].call(void 0,a,p)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(a,p){return a(_=>p.fire(_))},n.runAndSubscribe=function(a,p){return p(void 0),a(_=>p(_))}},859:(c,n)=>{function a(p){for(const _ of p)_.dispose();p.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const p of this._disposables)p.dispose();this._disposables.length=0}register(p){return this._disposables.push(p),p}unregister(p){const _=this._disposables.indexOf(p);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(p){var _;this._isDisposed||p===this._value||((_=this._value)==null||_.dispose(),this._value=p)}clear(){this.value=void 0}dispose(){var p;this._isDisposed=!0,(p=this._value)==null||p.dispose(),this._value=void 0}},n.toDisposable=function(p){return{dispose:p}},n.disposeArray=a,n.getDisposeArrayDisposable=function(p){return{dispose:()=>a(p)}}},485:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(_,l,g){this._data[_]||(this._data[_]={}),this._data[_][l]=g}get(_,l){return this._data[_]?this._data[_][l]:void 0}clear(){this._data={}}}n.TwoKeyMap=a,n.FourKeyMap=class{constructor(){this._data=new a}set(p,_,l,g,v){this._data.get(p,_)||this._data.set(p,_,new a),this._data.get(p,_).set(l,g,v)}get(p,_,l,g){var v;return(v=this._data.get(p,_))==null?void 0:v.get(l,g)}clear(){this._data.clear()}}},399:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const a=n.isNode?"node":navigator.userAgent,p=n.isNode?"node":navigator.platform;n.isFirefox=a.includes("Firefox"),n.isLegacyEdge=a.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(a),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=a.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p),n.isIpad=p==="iPad",n.isIphone=p==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(p),n.isLinux=p.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(a)},385:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const p=a(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),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(v){this._idleCallback=void 0;let w=0,m=0,h=v.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),m=Math.max(w,m),f=v.timeRemaining(),1.5*m>f)return h-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-w))}ms`),void this._start();h=f}this.clear()}}class l extends _{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const w=Date.now()+v;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}n.PriorityTaskQueue=l,n.IdleTaskQueue=!p.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:l,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new p}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new a;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=a;class p{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,g=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=g}clone(){return new p(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=p},782:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const p=a(133),_=a(855),l=a(147);class g extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const m=new g;return m.setFromCharData(w),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,p.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(w[_.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(w[_.CHAR_DATA_CHAR_INDEX].length===2){const h=w[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const f=w[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(h-55296)+f-56320+65536|w[_.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=w[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[_.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=w[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=g},855:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},133:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},n.utf32ToString=function(a,p=0,_=a.length){let l="";for(let g=p;g<_;++g){let v=a[g];v>65535?(v-=65536,l+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):l+=String.fromCharCode(v)}return l},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,p){const _=a.length;if(!_)return 0;let l=0,g=0;if(this._interim){const v=a.charCodeAt(g++);56320<=v&&v<=57343?p[l++]=1024*(this._interim-55296)+v-56320+65536:(p[l++]=this._interim,p[l++]=v),this._interim=0}for(let v=g;v<_;++v){const w=a.charCodeAt(v);if(55296<=w&&w<=56319){if(++v>=_)return this._interim=w,l;const m=a.charCodeAt(v);56320<=m&&m<=57343?p[l++]=1024*(w-55296)+m-56320+65536:(p[l++]=w,p[l++]=m)}else w!==65279&&(p[l++]=w)}return l}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,p){const _=a.length;if(!_)return 0;let l,g,v,w,m=0,h=0,f=0;if(this.interim[0]){let y=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let S,b=0;for(;(S=63&this.interim[++b])&&b<4;)C<<=6,C|=S;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=x-b;for(;f<k;){if(f>=_)return 0;if(S=a[f++],(192&S)!=128){f--,y=!0;break}this.interim[b++]=S,C<<=6,C|=63&S}y||(x===2?C<128?f--:p[m++]=C:x===3?C<2048||C>=55296&&C<=57343||C===65279||(p[m++]=C):C<65536||C>1114111||(p[m++]=C)),this.interim.fill(0)}const d=_-4;let u=f;for(;u<_;){for(;!(!(u<d)||128&(l=a[u])||128&(g=a[u+1])||128&(v=a[u+2])||128&(w=a[u+3]));)p[m++]=l,p[m++]=g,p[m++]=v,p[m++]=w,u+=4;if(l=a[u++],l<128)p[m++]=l;else if((224&l)==192){if(u>=_)return this.interim[0]=l,m;if(g=a[u++],(192&g)!=128){u--;continue}if(h=(31&l)<<6|63&g,h<128){u--;continue}p[m++]=h}else if((240&l)==224){if(u>=_)return this.interim[0]=l,m;if(g=a[u++],(192&g)!=128){u--;continue}if(u>=_)return this.interim[0]=l,this.interim[1]=g,m;if(v=a[u++],(192&v)!=128){u--;continue}if(h=(15&l)<<12|(63&g)<<6|63&v,h<2048||h>=55296&&h<=57343||h===65279)continue;p[m++]=h}else if((248&l)==240){if(u>=_)return this.interim[0]=l,m;if(g=a[u++],(192&g)!=128){u--;continue}if(u>=_)return this.interim[0]=l,this.interim[1]=g,m;if(v=a[u++],(192&v)!=128){u--;continue}if(u>=_)return this.interim[0]=l,this.interim[1]=g,this.interim[2]=v,m;if(w=a[u++],(192&w)!=128){u--;continue}if(h=(7&l)<<18|(63&g)<<12|(63&v)<<6|63&w,h<65536||h>1114111)continue;p[m++]=h}}return m}}},776:function(c,n,a){var p=this&&this.__decorate||function(h,f,d,u){var y,C=arguments.length,S=C<3?f:u===null?u=Object.getOwnPropertyDescriptor(f,d):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(h,f,d,u);else for(var b=h.length-1;b>=0;b--)(y=h[b])&&(S=(C<3?y(S):C>3?y(f,d,S):y(f,d))||S);return C>3&&S&&Object.defineProperty(f,d,S),S},_=this&&this.__param||function(h,f){return function(d,u){f(d,u,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const l=a(859),g=a(97),v={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let w,m=n.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let f=0;f<h.length;f++)typeof h[f]=="function"&&(h[f]=h[f]())}_log(h,f,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(h,...f){var d;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,f)}debug(h,...f){var d;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,f)}info(h,...f){var d;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,f)}warn(h,...f){var d;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,f)}error(h,...f){var d;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,f)}};n.LogService=m=p([_(0,g.IOptionsService)],m),n.setTraceLogger=function(h){w=h},n.traceCall=function(h,f,d){if(typeof d.value!="function")throw new Error("not supported");const u=d.value;d.value=function(...y){if(w.logLevel!==g.LogLevelEnum.TRACE)return u.apply(this,y);w.trace(`GlyphRenderer#${u.name}(${y.map(S=>JSON.stringify(S)).join(", ")})`);const C=u.apply(this,y);return w.trace(`GlyphRenderer#${u.name} return`,C),C}}},726:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const a="di$target",p="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[p]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const l=function(g,v,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,h,f){h[a]===h?h[p].push({id:m,index:f}):(h[p]=[{id:m,index:f}],h[a]=h)})(l,g,w)};return l.toString=()=>_,n.serviceRegistry.set(_,l),l}},97:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const p=a(726);var _;n.IBufferService=(0,p.createDecorator)("BufferService"),n.ICoreMouseService=(0,p.createDecorator)("CoreMouseService"),n.ICoreService=(0,p.createDecorator)("CoreService"),n.ICharsetService=(0,p.createDecorator)("CharsetService"),n.IInstantiationService=(0,p.createDecorator)("InstantiationService"),function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"}(_||(n.LogLevelEnum=_={})),n.ILogService=(0,p.createDecorator)("LogService"),n.IOptionsService=(0,p.createDecorator)("OptionsService"),n.IOscLinkService=(0,p.createDecorator)("OscLinkService"),n.IUnicodeService=(0,p.createDecorator)("UnicodeService"),n.IDecorationService=(0,p.createDecorator)("DecorationService")}},s={};function i(c){var n=s[c];if(n!==void 0)return n.exports;var a=s[c]={exports:{}};return r[c].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var c=o;Object.defineProperty(c,"__esModule",{value:!0}),c.WebglAddon=void 0;const n=i(345),a=i(859),p=i(399),_=i(666),l=i(776);class g extends a.Disposable{constructor(w){if(p.isSafari&&(0,p.getSafariVersion)()<16){const m={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",m))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=w,this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(w){const m=w._core;if(!w.element)return void this.register(m.onWillOpen(()=>this.activate(w)));this._terminal=w;const h=m.coreService,f=m.optionsService,d=m,u=d._renderService,y=d._characterJoinerService,C=d._charSizeService,S=d._coreBrowserService,b=d._decorationService,x=d._logService,k=d._themeService;(0,l.setTraceLogger)(x),this._renderer=this.register(new _.WebglRenderer(w,y,C,S,h,b,f,k,this._preserveDrawingBuffer)),this.register((0,n.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,n.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,n.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,n.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),u.setRenderer(this._renderer),this.register((0,a.toDisposable)(()=>{const M=this._terminal._core._renderService;M.setRenderer(this._terminal._core._createRenderer()),M.handleResize(w.cols,w.rows)}))}get textureAtlas(){var w;return(w=this._renderer)==null?void 0:w.textureAtlas}clearTextureAtlas(){var w;(w=this._renderer)==null||w.clearTextureAtlas()}}c.WebglAddon=g})(),o})())})(Hv);var N2=Hv.exports;const ep=1,I2=[500,1e3,2e3,4e3,8e3],B2=3e3;function O2({url:e,binaryType:t="arraybuffer",WebSocketImpl:r=typeof WebSocket<"u"?WebSocket:void 0,setTimeoutImpl:s=setTimeout,clearTimeoutImpl:i=clearTimeout,backoff:o=I2,stableMs:c=B2,onOpen:n=()=>{},onMessage:a=()=>{},onState:p=()=>{}}){let _=null,l=0,g=!1,v=0,w=0;const m=()=>{w&&(i(w),w=0)},h=()=>{p(l===0?"connecting":"reconnecting");let y;try{y=new r(e)}catch{d();return}_=y;try{y.binaryType=t}catch{}y.onopen=()=>{y===_&&(p("open"),w=s(()=>{l=0,w=0},c),n(u))},y.onmessage=C=>{y===_&&a(C)},y.onclose=()=>{y===_&&f()},y.onerror=()=>{}},f=()=>{m(),!g&&d()},d=()=>{p("reconnecting");const y=o[Math.min(l,o.length-1)];l++,v=s(()=>{v=0,h()},y)},u={send(y){return _&&_.readyState===ep?(_.send(y),!0):!1},isOpen(){return!!_&&_.readyState===ep},close(){if(g=!0,v&&(i(v),v=0),m(),_)try{_.close()}catch{}_=null},get raw(){return _}};return h(),u}function $2(e){var i;const t=e.buffer.active;let r=!1,s=!1;for(let o=t.baseY;o<t.baseY+e.rows;o++){const c=((i=t.getLine(o))==null?void 0:i.translateToString(!0))||"";/^\s{0,6}❯\s+\S/.test(c)&&(r=!0),/esc/i.test(c)&&/(enter|↵|↑|↓|select|confirm)/i.test(c)&&(s=!0)}return r&&s}function j2(e){var t;return(t=navigator.clipboard)!=null&&t.writeText?navigator.clipboard.writeText(e).then(()=>!0).catch(()=>tp(e)):Promise.resolve(tp(e))}function tp(e){var i;const t=document.activeElement,r=document.createElement("textarea");r.value=e,r.setAttribute("readonly",""),r.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none",document.body.appendChild(r);let s=!1;try{r.select(),r.setSelectionRange(0,e.length),s=document.execCommand("copy")}catch{s=!1}r.remove();try{(i=t==null?void 0:t.focus)==null||i.call(t)}catch{}return s||console.warn("[SessionTerm] clipboard copy failed — selection left intact for manual copy"),s}function F2({sessionId:e,active:t=!0,onMenu:r}){const s=H.useRef(null),i=H.useRef(null),o=H.useRef(null),c=H.useRef({cols:0,rows:0}),n=H.useRef(null),[a,p]=H.useState(!1),[_,l]=H.useState("connecting"),g=H.useRef(r);return g.current=r,H.useEffect(()=>{const v=new T2.Terminal({fontSize:11,fontFamily:"Menlo, monospace",cursorBlink:!1,disableStdin:!0,scrollback:5e3,macOptionClickForcesSelection:!0,theme:{background:"#002b36",foreground:"#93a1a1",cursor:"#93a1a1",selectionBackground:"#268bd2",selectionForeground:"#fdf6e3",selectionInactiveBackground:"#268bd2",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#586e75",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"}});i.current=v;const w=new P2.FitAddon;v.loadAddon(w),v.open(s.current);try{v._core._selectionService.shouldForceSelection=()=>!0}catch{}try{v._core.focus=()=>{}}catch{}const h=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/api/sessions/${e}/socket`;let f=null;const d=()=>{const $=s.current;if(!$||$.clientWidth<40||$.clientHeight<40)return;try{w.fit()}catch{return}const{cols:F,rows:B}=v;if(!F||!B||F<20&&$.clientWidth>200)return;const L=c.current;F===L.cols&&B===L.rows||(c.current={cols:F,rows:B},f!=null&&f.isOpen()&&f.send(JSON.stringify({t:"resize",cols:F,rows:B})))};n.current=d;const u=new TextEncoder;let y=[],C=0;const S=()=>{if(C=0,!y.length)return;let $=0;for(const L of y)$+=L.length;const F=new Uint8Array($);let B=0;for(const L of y)F.set(L,B),B+=L.length;y=[],v.write(F)};f=O2({url:h,onState:l,onOpen:()=>{y=[],C&&(cancelAnimationFrame(C),C=0),v.reset(),c.current={cols:0,rows:0},d()},onMessage:$=>{$.data instanceof ArrayBuffer&&(y.push(new Uint8Array($.data)),C||(C=requestAnimationFrame(S)))}});const b=$=>f.send(u.encode($));v.attachCustomWheelEventHandler($=>{const F=s.current;if(!F||!v.cols||!v.rows)return!1;const B=F.getBoundingClientRect(),L=(K,q)=>Math.min(q,Math.max(1,K)),P=L(Math.floor(($.clientX-B.left)/(B.width/v.cols))+1,v.cols),O=L(Math.floor(($.clientY-B.top)/(B.height/v.rows))+1,v.rows),I=$.deltaY<0?64:65,W=Math.min(5,Math.max(1,Math.round(Math.abs($.deltaY)/40)));for(let K=0;K<W;K++)b(`\x1B[<${I};${P};${O}M`);return $.preventDefault(),!1});let x;const k=s.current,M=$=>{if(!($.metaKey||$.ctrlKey)||$.key!=="c"&&$.key!=="C"||!k||k.offsetParent===null)return;const F=v.getSelection();if(!F)return;const B=document.activeElement;B&&(B.tagName==="TEXTAREA"||B.tagName==="INPUT")&&B.selectionStart!==B.selectionEnd||($.preventDefault(),$.stopPropagation(),j2(F).then(L=>{L&&(p(!0),clearTimeout(x),x=setTimeout(()=>p(!1),1200))}))};document.addEventListener("keydown",M);const D=setInterval(()=>{var $;try{($=g.current)==null||$.call(g,e,$2(v))}catch{}},700),R=requestAnimationFrame(d),T=s.current.closest(".si-term");T&&T.addEventListener("animationend",d);const A=[60,180,320].map($=>setTimeout(d,$)),j=new ResizeObserver(d);return j.observe(s.current),window.addEventListener("resize",d),()=>{var $;cancelAnimationFrame(R),C&&cancelAnimationFrame(C),clearInterval(D),clearTimeout(x),document.removeEventListener("keydown",M),($=g.current)==null||$.call(g,e,!1),A.forEach(clearTimeout),T&&T.removeEventListener("animationend",d),j.disconnect(),window.removeEventListener("resize",d),f.close(),v.dispose(),i.current=null,o.current=null,n.current=null}},[e]),H.useEffect(()=>{const v=i.current;if(v){if(t){if(o.current)return;try{const w=new N2.WebglAddon;w.onContextLoss(()=>{try{w.dispose()}catch{}o.current=null,c.current={cols:0,rows:0},requestAnimationFrame(()=>{var m;(m=n.current)==null||m.call(n);try{v.refresh(0,v.rows-1)}catch{}})}),v.loadAddon(w),o.current=w,requestAnimationFrame(()=>{var m;(m=n.current)==null||m.call(n);try{v.refresh(0,v.rows-1)}catch{}})}catch{o.current=null}}else if(o.current){try{o.current.dispose()}catch{}o.current=null}}},[e,t]),E.jsxs("div",{className:"st-wrap",children:[E.jsx("div",{className:"st-host",ref:s}),a&&E.jsx("div",{className:"st-copyhint copied",children:"copied ✓"}),!a&&_==="reconnecting"&&E.jsx("div",{className:"st-copyhint reconnecting",children:"reconnecting…"})]})}function kn({title:e,closeLabel:t,onClose:r,className:s,children:i}){return E.jsx("div",{className:"legend-backdrop",onClick:r,children:E.jsxs("div",{className:s?`legend ${s}`:"legend",role:"dialog","aria-modal":"true","aria-label":e,onClick:o=>o.stopPropagation(),children:[E.jsxs("div",{className:"legend-head",children:[E.jsx("span",{className:"legend-title",children:e}),E.jsx("button",{className:"legend-close",onClick:r,title:t,children:"×"})]}),E.jsx("div",{className:"legend-body",children:i})]})})}const Qi=(e,t)=>{const r=En(e);return r&&r!==e.id?r:e.id?e.id.slice(0,8):t("common.session")};function H2({data:e}){const t=Me(),r=qr(e.id),s=`sg-node${e.focus?" sg-node--focus":""}${e.source?" sg-node--source":""}`;return E.jsxs("div",{className:s,style:{"--sg":r},title:e.promptPreview||Qi(e,t),children:[E.jsx(Gr,{type:"target",position:he.Top,className:"sg-anchor"}),E.jsx(wi,{seed:e.id,status:e.status,size:34,title:`${Qi(e,t)} · ${t(`status.${e.status}`)}`}),E.jsx("span",{className:"sg-label",children:Qi(e,t)}),E.jsx("span",{className:"sg-status",style:{color:ir[e.status]},children:t(`status.${e.status}`)}),E.jsx(Gr,{type:"source",position:he.Bottom,className:"sg-anchor"})]})}const z2={session:H2};function rp(e,t){const{width:r,height:s}=e.measured,i=e.internals.positionAbsolute,o=t.internals.positionAbsolute,c=r/2,n=s/2,a=i.x+c,p=i.y+n,_=o.x+t.measured.width/2,l=o.y+t.measured.height/2,g=(_-a)/(2*c)-(l-p)/(2*n),v=(_-a)/(2*c)+(l-p)/(2*n),w=1/(Math.abs(g)+Math.abs(v)||1);return{x:c*(w*g+w*v)+a,y:n*(-w*g+w*v)+p}}function sp(e,t){const r=e.internals.positionAbsolute,{width:s,height:i}=e.measured;return Math.round(t.x)<=Math.round(r.x)+1?he.Left:Math.round(t.x)>=Math.round(r.x+s)-1?he.Right:Math.round(t.y)<=Math.round(r.y)+1?he.Top:he.Bottom}function W2({id:e,source:t,target:r,markerEnd:s,style:i,label:o,labelStyle:c,labelShowBg:n,labelBgStyle:a,labelBgPadding:p,labelBgBorderRadius:_}){const l=Uf(t),g=Uf(r);if(!(l!=null&&l.measured)||!(g!=null&&g.measured))return null;const v=rp(l,g),w=rp(g,l),[m,h,f]=gh({sourceX:v.x,sourceY:v.y,sourcePosition:sp(l,v),targetX:w.x,targetY:w.y,targetPosition:sp(g,w)});return E.jsx(jn,{id:e,path:m,markerEnd:s,style:i,label:o,labelX:h,labelY:f,labelStyle:c,labelShowBg:n,labelBgStyle:a,labelBgPadding:p,labelBgBorderRadius:_})}const U2={floating:W2};function V2(e,t){const r=e.map(m=>m.id).sort(),s=r.length;if(!s)return{};const i=Object.fromEntries(r.map((m,h)=>[m,h])),o=250,c=210,n=o*2.2,a=400,p=.11,_=o*Math.max(1,s/8),l=new Float64Array(s),g=new Float64Array(s);for(let m=0;m<s;m++){const h=m/s*2*Math.PI-Math.PI/2;l[m]=Math.cos(h)*_,g[m]=Math.sin(h)*_}const v=t.map(([m,h])=>[i[m],i[h]]).filter(([m,h])=>m!=null&&h!=null&&m!==h);for(let m=0;m<a;m++){const h=(1-m/a)*o,f=new Float64Array(s),d=new Float64Array(s);for(let u=0;u<s;u++)for(let y=u+1;y<s;y++){let C=l[u]-l[y],S=g[u]-g[y];const b=Math.hypot(C,S)||.01;if(b>n)continue;const x=o*o/b;C/=b,S/=b,f[u]+=C*x,d[u]+=S*x,f[y]-=C*x,d[y]-=S*x}for(const[u,y]of v){let C=l[u]-l[y],S=g[u]-g[y];const b=Math.hypot(C,S)||.01,x=b*b/o;C/=b,S/=b,f[u]-=C*x,d[u]-=S*x,f[y]+=C*x,d[y]+=S*x}for(let u=0;u<s;u++){f[u]-=l[u]*p,d[u]-=g[u]*p;const y=Math.hypot(f[u],d[u])||.01,C=Math.min(y,h);l[u]+=f[u]/y*C,g[u]+=d[u]/y*C}for(let u=0;u<s;u++)for(let y=u+1;y<s;y++){let C=l[u]-l[y],S=g[u]-g[y],b=Math.hypot(C,S);if(b>=c)continue;if(b<1e-6){const k=(u*2+y)*1.2399;C=Math.cos(k),S=Math.sin(k),b=1}const x=(c-b)/2;C/=b,S/=b,l[u]+=C*x,g[u]+=S*x,l[y]-=C*x,g[y]-=S*x}}const w={};return r.forEach((m,h)=>{w[m]={x:Math.round(l[h]),y:Math.round(g[h])}}),w}function K2({sessions:e=[],onOpen:t,active:r,legend:s,setLegend:i,edges:o=[],edgesLoaded:c=!1}){const n=Me(),[a,p]=H.useState([]),[_,l]=H.useState(null),[g,v]=H.useState(null),[w,m]=H.useState(null),{fitView:h,setCenter:f,getViewport:d}=$n(),u=H.useRef(!1),[y,C]=H.useState(!1),S=H.useRef(0),b=H.useMemo(()=>Object.fromEntries(e.map(I=>[I.id,I])),[e]),x=H.useMemo(()=>o.filter(I=>b[I.from]&&b[I.to]&&I.from!==I.to).map(I=>[I.from,I.to]),[o,b]),k=H.useMemo(()=>{const I=e.map(K=>K.id).slice().sort().join(","),W=x.map(([K,q])=>`${K}~${q}`).sort().join(";");return`${I}|${W}`},[e,x]),M=H.useMemo(()=>V2(e,x),[k]),D=H.useMemo(()=>e.map(I=>({id:I.id,type:"session",position:M[I.id]||{x:0,y:0},data:{...I,focus:I.id===g,source:I.id===w},draggable:!0})),[e,M,g,w]);H.useEffect(()=>{if(!a.length)return;const I=new Set(o.filter(W=>W.kind!=="comms").map(W=>`${W.from}->${W.to}`));p(W=>W.filter(K=>!I.has(`${K.from}->${K.to}`)))},[o]);const R=H.useMemo(()=>{const I=o.filter(q=>b[q.from]&&b[q.to]).map(q=>{if(q.kind==="comms")return{id:`comms:${q.from}-${q.to}`,source:q.from,target:q.to,type:"floating",label:`⇄ ${q.count??1}`,labelStyle:{fontSize:10,fill:"var(--sg-comms, #93a1a1)",fontWeight:600},labelShowBg:!0,labelBgStyle:{fill:"var(--sg-comms-bg, rgba(238,232,213,0.9))"},labelBgPadding:[4,2],labelBgBorderRadius:4,style:{stroke:"var(--sg-comms, #93a1a1)",strokeWidth:1.5,strokeDasharray:"2 4",opacity:.8},className:"sg-edge sg-comms"};const Z=qr(q.from);return{id:`${q.from}->${q.to}`,source:q.from,target:q.to,type:"floating",animated:!0,style:{stroke:Z,strokeWidth:2},className:"sg-edge",markerEnd:{type:Ss.ArrowClosed,color:Z,width:16,height:16}}}),W=new Set(I.map(q=>q.id)),K=a.filter(q=>!W.has(`${q.from}->${q.to}`)).map(q=>{const Z=qr(q.from);return{id:`pending:${q.from}->${q.to}`,source:q.from,target:q.to,type:"floating",animated:!0,style:{stroke:Z,strokeWidth:2,strokeDasharray:"5 5",opacity:.7},className:"sg-edge sg-pending",markerEnd:{type:Ss.ArrowClosed,color:Z,width:16,height:16}}});return[...I,...K]},[o,b,a]),T=H.useCallback(I=>{l(I),clearTimeout(S.current),S.current=setTimeout(()=>l(null),3200)},[]);H.useEffect(()=>()=>clearTimeout(S.current),[]);const A=H.useCallback((I,W)=>{if(!I||!W||I===W)return;const K=b[I],q=b[W],Z=K?Qi(K,n):I.slice(0,8),z=q?Qi(q,n):W.slice(0,8);p(N=>N.some(U=>U.from===I&&U.to===W)?N:[...N,{from:I,to:W}]),T(n("sessionGraph.asked",{a:Z,b:z})),fetch(`/api/sessions/${I}/keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n("sessionGraph.monitorPrompt",{label:z,id:W}),enter:!0})}).catch(()=>{})},[b,n,T]),j=H.useCallback((I,W)=>{v(W.id),m(W.id)},[]),$=H.useCallback((I,W)=>{if(I.preventDefault(),!w){T(n("sessionGraph.needSource"));return}w!==W.id&&(A(w,W.id),m(null))},[w,A,n,T]),F=H.useCallback((I,W)=>{m(null),t==null||t(W.id)},[t]),B=H.useCallback(()=>m(null),[]),L=H.useCallback(I=>{var W;(W=I.preventDefault)==null||W.call(I),m(null)},[]);H.useEffect(()=>{if(!e.length){g!==null&&v(null);return}(!g||!e.some(I=>I.id===g))&&v(e[0].id)},[e,g]);const P=H.useMemo(()=>({l:(I,W)=>I>0&&I>=Math.abs(W),h:(I,W)=>I<0&&-I>=Math.abs(W),j:(I,W)=>W>0&&W>=Math.abs(I),k:(I,W)=>W<0&&-W>=Math.abs(I)}),[]),O=H.useRef(g);return O.current=g,H.useEffect(()=>{if(!r)return;const I=W=>{if(W.metaKey||W.ctrlKey||W.altKey)return;if(s){W.key==="?"&&(W.preventDefault(),W.stopPropagation(),i(!1));return}if(W.key==="?"){W.preventDefault(),W.stopPropagation(),i(!0);return}const K=b[O.current];if(W.key==="Enter"){K&&(W.preventDefault(),W.stopPropagation(),t==null||t(K.id));return}const q=P[W.key];if(!q||!K)return;W.preventDefault(),W.stopPropagation();const Z=M[K.id]||{x:0,y:0};let z=null,N=1/0;for(const U of e){if(U.id===K.id)continue;const G=M[U.id]||{x:0,y:0},Q=G.x-Z.x,Y=G.y-Z.y;if(!q(Q,Y))continue;const ee=Q*Q+Y*Y;ee<N&&(N=ee,z=U.id)}if(z){v(z);const U=M[z];U&&f(U.x,U.y,{zoom:d().zoom,duration:160})}};return window.addEventListener("keydown",I,!0),()=>window.removeEventListener("keydown",I,!0)},[r,b,M,e,P,t,f,d,s,i]),H.useEffect(()=>{if(!D.length){C(!0);return}if(!c)return;const I=!u.current,W=requestAnimationFrame(()=>{h({padding:.25,duration:I?0:300}),u.current=!0,C(!0)});return()=>cancelAnimationFrame(W)},[D.length,c,h]),E.jsxs(E.Fragment,{children:[E.jsx(_v,{nodes:D,edges:R,nodeTypes:z2,edgeTypes:U2,onNodeClick:j,onNodeDoubleClick:F,onNodeContextMenu:$,onPaneClick:B,onPaneContextMenu:L,nodesDraggable:!0,nodesConnectable:!1,elementsSelectable:!1,defaultViewport:{x:0,y:0,zoom:.8},minZoom:.3,maxZoom:1.6,proOptions:{hideAttribution:!0},style:{opacity:y?1:0},children:E.jsx(vv,{variant:"dots",color:"#cdc6ad",gap:20,size:1})}),w&&E.jsx("div",{className:"sg-pick-hint",children:n("sessionGraph.picked")}),_&&E.jsx("div",{className:"sg-toast",children:_})]})}function G2({onClose:e}){const t=Me(),r=[[["h","j","k","l"],"move"],[["⏎"],"open"],[["←"],"leave"]],s=[[t("sessionGraph.legend.gDblClick"),"openMouse"],[t("sessionGraph.legend.gClickRight"),"monitor"]];return E.jsxs(kn,{title:t("sessionGraph.legend.title"),closeLabel:t("sessionGraph.legend.close"),onClose:e,children:[E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:t("sessionGraph.legend.secKeys")}),r.map(([i,o])=>E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"keymap-keys",children:i.map((c,n)=>E.jsx("kbd",{children:c},n))}),E.jsx("span",{className:"legend-desc",children:t(`sessionGraph.legend.${o}`)})]},o))]}),E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:t("sessionGraph.legend.secMouse")}),s.map(([i,o])=>E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"keymap-keys",children:E.jsx("kbd",{children:i})}),E.jsx("span",{className:"legend-desc",children:t(`sessionGraph.legend.${o}`)})]},o))]}),E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:t("sessionGraph.legend.secEdges")}),E.jsx("div",{className:"legend-row",children:E.jsx("span",{className:"legend-desc",children:t("sessionGraph.legend.edgesDesc")})})]})]})}function q2({sessions:e=[],onOpen:t,active:r=!0,legend:s,setLegend:i,edges:o=[],edgesLoaded:c=!1}){const n=Me();return E.jsxs("div",{className:"session-graph",children:[E.jsx("div",{className:"sg-hud",children:E.jsx("button",{className:"hud-help",onClick:()=>i(a=>!a),title:n("sessionGraph.helpTitle"),children:"?"})}),E.jsx(xh,{children:E.jsx(K2,{sessions:e,onOpen:t,active:r,legend:s,setLegend:i,edges:o,edgesLoaded:c})}),s&&E.jsx(G2,{onClose:()=>i(!1)})]})}const zv=280,Wo=54;function X2(e,t){const r={};e.forEach(o=>{var c;o.parent&&(r[c=o.parent]??(r[c]=[])).push(o.id)});const s={},i=(o,c,n)=>{s[o]={x:c*zv,y:n};const a=t.has(o)?r[o]||[]:[];if(!a.length)return;const p=n-(a.length-1)/2*Wo;a.forEach((_,l)=>i(_,c+1,p+l*Wo))};return e.filter(o=>!o.parent).forEach((o,c)=>i(o.id,0,c*Wo)),s}const ip=[150,350,600,900];async function Ln(e,t){for(let r=0;;r++)try{return await fetch(e,t)}catch(s){if(r>=ip.length)throw s;await new Promise(i=>setTimeout(i,ip[r]))}}async function Y2(){return(await Ln("/api/board")).json()}async function Wv(e,t){return Ln(`/api/sessions/${e}/sort`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t})})}const np=e=>(e==null?void 0:e.project)||"",Q2=e=>(e==null?void 0:e.projectIcon)||"";function Z2(e){return e?/^https?:\/\//.test(e)?e:/^[a-z0-9-]+[:/][a-z0-9-]+$/i.test(e)?`https://api.iconify.design/${e.replace(":","/")}.svg`:"data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">${e}</text></svg>`):""}async function J2(){return(await Ln("/api/config")).json()}const is=e=>e.sortKey!=null?e.sortKey:e.created,ou=1e3;function ek(e){const t=Math.min(...e.map(is));return e.map((r,s)=>({id:r.id,key:t+(s+1)*ou}))}function tk(e,t,r){if(t===r)return null;const s=e.findIndex(g=>g.id===t);if(s<0)return null;const i=e[s],o=e.filter(g=>g.id!==t),c=r==null?o.length:o.findIndex(g=>g.id===r);if(c<0)return null;const n=[...o.slice(0,c),i,...o.slice(c)];if(n.every((g,v)=>g.id===e[v].id))return null;const a=n[c-1],p=n[c+1];let _;if(a&&p)_=(is(a)+is(p))/2;else if(a)_=is(a)+ou;else if(p)_=is(p)-ou;else return null;const l=a&&p&&!(_>is(a)&&_<is(p));return{order:n,updates:l?ek(n):[{id:t,key:_}]}}const Xl=typeof window<"u"?window.__escStack||(window.__escStack=[]):[];typeof window<"u"&&!window.__escStackBound&&(window.__escStackBound=!0,window.addEventListener("keydown",e=>{const t=window.__escStack;e.key!=="Escape"||!t||t.length===0||(e.preventDefault(),e.stopImmediatePropagation(),t[t.length-1].close())},!0));function Uo(e,t){const r=H.useRef(t);r.current=t,H.useEffect(()=>{if(!e)return;const s={close:()=>{var i;return(i=r.current)==null?void 0:i.call(r)}};return Xl.push(s),()=>{const i=Xl.indexOf(s);i>=0&&Xl.splice(i,1)}},[e])}function rk({menu:e,onClose:t,onChanged:r}){const s=Me(),[i,o]=H.useState(null),[c,n]=H.useState(null),[a,p]=H.useState(""),[_,l]=H.useState(!1),g=H.useRef(null);H.useEffect(()=>{if(e)return window.addEventListener("click",t),()=>window.removeEventListener("click",t)},[e,t]),Uo(!!e,t),Uo(!!i,()=>o(null)),Uo(!!c,()=>n(null)),H.useEffect(()=>{i&&requestAnimationFrame(()=>{var d;return(d=g.current)==null?void 0:d.select()})},[i]);const v=d=>{d.stopPropagation(),p(e.session.name||""),o(e.session),t()},w=async d=>{d.stopPropagation();const u=e.session.id;t();try{await Wv(u,null)}catch{}r==null||r()},m=d=>{d.stopPropagation(),n(e.session),t()},h=async()=>{if(!_){l(!0);try{await Ln(`/api/sessions/${c.id}/close`,{method:"POST"})}catch{}finally{l(!1),n(null),r==null||r()}}},f=async d=>{if(d.preventDefault(),!_){l(!0);try{await Ln(`/api/sessions/${i.id}/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})}),r==null||r()}catch{}finally{l(!1),o(null)}}};return E.jsxs(E.Fragment,{children:[e&&E.jsxs("div",{className:"sess-menu",style:{left:e.x,top:e.y},onClick:d=>d.stopPropagation(),children:[E.jsx("button",{className:"sess-menu-item",onClick:v,children:s("sessionWindow.rename")}),e.session.sortKey!=null&&E.jsx("button",{className:"sess-menu-item",onClick:w,children:s("sessionWindow.resetOrder")}),E.jsx("button",{className:"sess-menu-item danger",onClick:m,children:s("sessionWindow.close")})]}),i&&E.jsx(kn,{title:s("sessionWindow.renameTitle",{name:Ls(i)}),closeLabel:s("common.close"),className:"sess-rename-modal",onClose:()=>o(null),children:E.jsxs("form",{className:"sess-rename",onSubmit:f,children:[E.jsx("input",{ref:g,className:"sess-rename-input",value:a,autoFocus:!0,placeholder:s("sessionWindow.renamePlaceholder"),onChange:d=>p(d.target.value)}),E.jsxs("div",{className:"sess-rename-actions",children:[E.jsx("button",{type:"button",className:"sess-rename-btn",onClick:()=>o(null),children:s("common.cancel")}),E.jsx("button",{type:"submit",className:"sess-rename-btn sess-rename-save",disabled:_,children:s("common.save")})]})]})}),c&&E.jsx(kn,{title:s("sessionWindow.closeTitle",{name:En(c)}),closeLabel:s("common.close"),className:"sess-rename-modal",onClose:()=>n(null),children:E.jsxs("div",{className:"sess-confirm",children:[E.jsx("p",{className:"sess-confirm-msg",children:s("sessionWindow.closeConfirm")}),E.jsxs("div",{className:"sess-rename-actions",children:[E.jsx("button",{type:"button",className:"sess-rename-btn",onClick:()=>n(null),children:s("common.cancel")}),E.jsx("button",{type:"button",className:"sess-rename-btn danger",onClick:h,disabled:_,children:s("sessionWindow.close")})]})]})})]})}function sk({sessionId:e,onClose:t}){const r=Me(),s=`/api/sessions/${encodeURIComponent(e)}/proof`;Uo(!0,t);const i=o=>{o&&o.addEventListener("load",()=>{var c;try{(c=o.contentWindow)==null||c.addEventListener("keydown",n=>{n.key==="Escape"&&t()})}catch{}})};return E.jsx("div",{className:"proof-overlay",onClick:t,children:E.jsxs("div",{className:"proof-frame",onClick:o=>o.stopPropagation(),children:[E.jsxs("div",{className:"proof-bar",children:[E.jsx("span",{className:"proof-title",children:r("proof.title")}),E.jsxs("a",{className:"proof-newtab",href:s,target:"_blank",rel:"noopener noreferrer",children:[r("proof.newTab")," ↗"]}),E.jsx("button",{className:"proof-x",onClick:t,title:r("proof.close"),children:"✕"})]}),E.jsx("iframe",{className:"proof-iframe",src:s,title:r("proof.title"),ref:i})]})})}const ik=[{name:"nav",color:"yellow",button:!0,when:e=>!!e&&e!=="offline",labelKey:"session.navBtn",titleKey:"session.navTitle",descKey:"session.cmd.navDesc"},{name:"proof",color:"cyan",button:!0,when:e=>e==="review"||e==="done",labelKey:"proof.btn",titleKey:"proof.btnTitle",descKey:"session.cmd.proofDesc"},{name:"merge",color:"green",button:!0,when:e=>e==="review"||e==="done",labelKey:"session.merge",titleKey:"session.cmd.mergeTitle",descKey:"session.cmd.mergeDesc"},{name:"exit",color:"muted",button:!1,when:e=>!!e&&e!=="offline",titleKey:"session.cmd.exitTitle",descKey:"session.cmd.exitDesc"},{name:"close",color:"red",button:!1,when:e=>!!e&&e!=="offline",titleKey:"session.cmd.closeTitle",descKey:"session.cmd.closeDesc"}];function nk(e,t){return ik.filter(r=>r.when(e)).map(r=>({...r,run:t[r.name]}))}const op=()=>E.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:E.jsx("path",{d:"M12.5 7.2 L7 12.6 a2.6 2.6 0 0 1-3.7-3.7 L9 3.2 a1.7 1.7 0 0 1 2.4 2.4 L5.8 11.2 a0.8 0.8 0 0 1-1.2-1.2 L9.7 5"})}),ap=()=>E.jsxs("svg",{className:"si-attach-busy",width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[E.jsx("circle",{cx:"8",cy:"8",r:"5.5",opacity:"0.3"}),E.jsx("path",{d:"M8 2.5 a5.5 5.5 0 0 1 5.5 5.5"})]}),ok=()=>E.jsx("svg",{className:"si-agent-glyph",viewBox:"0 0 24 24","aria-hidden":"true",children:E.jsx("path",{d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})}),ak=()=>E.jsx("svg",{className:"si-agent-glyph",viewBox:"0 0 24 24","aria-hidden":"true",children:E.jsx("path",{d:"M22.282 9.821a6 6 0 0 0-.516-4.91a6.05 6.05 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a6 6 0 0 0-3.998 2.9a6.05 6.05 0 0 0 .743 7.097a5.98 5.98 0 0 0 .51 4.911a6.05 6.05 0 0 0 6.515 2.9A6 6 0 0 0 13.26 24a6.06 6.06 0 0 0 5.772-4.206a6 6 0 0 0 3.997-2.9a6.06 6.06 0 0 0-.747-7.073M13.26 22.43a4.48 4.48 0 0 1-2.876-1.04l.141-.081l4.779-2.758a.8.8 0 0 0 .392-.681v-6.737l2.02 1.168a.07.07 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494M3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085l4.783 2.759a.77.77 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646M2.34 7.896a4.5 4.5 0 0 1 2.366-1.973V11.6a.77.77 0 0 0 .388.677l5.815 3.354l-2.02 1.168a.08.08 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.08.08 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667m2.01-3.023l-.141-.085l-4.774-2.782a.78.78 0 0 0-.785 0L9.409 9.23V6.897a.07.07 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.8.8 0 0 0-.393.681zm1.097-2.365l2.602-1.5l2.607 1.5v2.999l-2.597 1.5l-2.607-1.5Z"})}),lk={ArrowUp:"Up",ArrowDown:"Down",ArrowLeft:"Left",ArrowRight:"Right",Enter:"Enter",Tab:"Tab",Backspace:"Backspace",Delete:"Delete",Home:"Home",End:"End"," ":"Space"};function ck(e){const t=lk[e.key],r=e.ctrlKey||e.altKey||e.metaKey;let s=null;if(t?s=t:r?/^Key[A-Z]$/.test(e.code)?s=e.shiftKey?e.code.slice(3):e.code.slice(3).toLowerCase():/^Digit[0-9]$/.test(e.code)?s=e.code.slice(5):e.key.length===1&&(s=e.key):e.key.length===1&&(s=e.key),s==null)return null;let i="";return e.ctrlKey&&(i+="C-"),(e.altKey||e.metaKey)&&(i+="M-"),e.shiftKey&&t&&(i+="S-"),i+s}const au=e=>(e||"").replace(/^\.spec\//,"").replace(/\/spec\.md$/,"");function uk(e,t,r){const s=t.toLowerCase(),i=[];for(const o of e){const c=o.id.toLowerCase(),n=au(o.path).toLowerCase();let a;if(!s)a=3;else if(c.startsWith(s))a=0;else if(c.includes(s))a=1;else if(n.includes(s))a=2;else continue;o.id===r&&(a=-1),i.push({s:o,score:a})}return i.sort((o,c)=>o.score-c.score||o.s.id.length-c.s.id.length||o.s.id.localeCompare(c.s.id)),i.slice(0,8).map(o=>o.s)}let es;function hk(e,t){const r=getComputedStyle(e);es||(es=document.createElement("div"),document.body.appendChild(es));const s=es.style;s.position="absolute",s.visibility="hidden",s.top="0",s.left="-9999px",s.whiteSpace="pre-wrap",s.wordWrap="break-word",s.overflow="hidden",s.boxSizing="border-box",s.border="0",s.width=`${e.clientWidth}px`;for(const l of["paddingTop","paddingRight","paddingBottom","paddingLeft","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textIndent","textTransform","tabSize"])s[l]=r[l];const i=e.selectionStart;es.textContent=e.value.slice(0,i);const o=document.createElement("span");o.textContent=e.value.slice(i)||".",es.appendChild(o);const c=parseFloat(r.lineHeight)||parseFloat(r.fontSize)*1.2,n=parseFloat(r.paddingTop)||0,a=parseFloat(r.paddingBottom)||0,p=o.offsetTop-n,_=es.scrollHeight-n-a;return t==="up"?p<c:p>=_-c-1}function lp(e,t){e&&(e.style.height="auto",e.style.overflowY=e.scrollHeight>t?"auto":"hidden",e.style.height=`${Math.min(e.scrollHeight,t)}px`)}function dk(e,t){const r=t.toLowerCase(),s=[];for(const i of e){const o=i.name.toLowerCase();let c;if(!r)c=1;else if(o.startsWith(r))c=0;else if(o.includes(r))c=1;else continue;s.push({c:i,score:c})}return s.sort((i,o)=>i.score-o.score),s.slice(0,10).map(i=>i.c)}function fk(e,t){const r=t.toLowerCase(),s=[];for(const i of e){const o=i.name.toLowerCase();let c;if(!r)c=1;else if(o.startsWith(r))c=0;else if(o.includes(r))c=1;else continue;s.push({p:i,score:c})}return s.sort((i,o)=>i.score-o.score),s.slice(0,10).map(i=>i.p)}const pk={user:"(user)",project:"(project)",skill:"[skill]","built-in":"built-in",board:"[board]"},gk=[{id:"claude",label:"Claude Code",Glyph:ok},{id:"codex",label:"Codex",Glyph:ak}];function cp(e,t){if(!t)return e;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:E.jsxs(E.Fragment,{children:[e.slice(0,r),E.jsx("b",{className:"mention-hit",children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function _k({sessions:e,specs:t=[],focusNode:r,open:s,sel:i,setSel:o,seed:c,onSeedConsumed:n,onClose:a,onPickSession:p,reload:_}){const l=Me(),[g,v]=H.useState(""),[w,m]=H.useState(null),[h,f]=H.useState(null),[d,u]=H.useState([]),[y,C]=H.useState([]),[S,b]=H.useState({}),[x,k]=H.useState(()=>{try{return localStorage.getItem("si.harness")||"claude"}catch{return"claude"}}),M=V=>{k(V);try{localStorage.setItem("si.harness",V)}catch{}},[D,R]=H.useState(!1),[T,A]=H.useState(!1),[j,$]=H.useState({}),[F,B]=H.useState(!1),[L,P]=H.useState(!1),[O,I]=H.useState([]),[W,K]=H.useState(!1);H.useEffect(()=>{if(!s)return;let V=!0;const X=async()=>{try{const Se=await(await fetch("/api/sessions/graph")).json();V&&I(Array.isArray(Se.edges)?Se.edges:[])}catch{}finally{V&&K(!0)}};X();const ie=setInterval(X,4e3);return()=>{V=!1,clearInterval(ie)}},[s]);const[q,Z]=H.useState(!1),[z,N]=H.useState(!1),[U,G]=H.useState(null),[Q,Y]=H.useState(null),ee=H.useRef(0),te=H.useRef(null),le=H.useRef(null),pe=H.useRef(null),ne=H.useRef(null),Te=H.useRef(null),We=H.useRef("new"),[me,ge]=H.useState(null),ye=async V=>{if(V){try{await Promise.all(V.updates.map(X=>Wv(X.id,X.key)))}catch{}_==null||_()}},oe=(V,X)=>{if(V.button!==0)return;const ie=V.clientY,_e=e;let Se=!1,Ce=null;const Ue=je=>{var Er;if(!Se){if(Math.abs(je.clientY-ie)<4)return;Se=!0}je.preventDefault();const Je=[...((Er=pe.current)==null?void 0:Er.querySelectorAll(".si-item"))||[]];Ce=null;for(const Rs of Je){const cr=Rs.getBoundingClientRect();if(je.clientY>=cr.top&&je.clientY<=cr.bottom){Ce={id:Rs.dataset.sid,place:je.clientY<cr.top+cr.height/2?"before":"after"};break}}!Ce&&Je.length&&je.clientY>Je[Je.length-1].getBoundingClientRect().bottom&&(Ce={end:!0}),ge(Ce&&!Ce.end?Ce:null)},$e=()=>{var Je;if(window.removeEventListener("mousemove",Ue),window.removeEventListener("mouseup",$e),ge(null),!Se)return;let je;if(Ce!=null&&Ce.end)je=null;else if(Ce)je=Ce.place==="before"?Ce.id:((Je=_e[_e.findIndex(Er=>Er.id===Ce.id)+1])==null?void 0:Je.id)??null;else return;ye(tk(_e,X.id,je))};window.addEventListener("mousemove",Ue),window.addEventListener("mouseup",$e)},we=V=>E.jsx("span",{className:"si-drag-handle",title:l("session.dragHandle"),onMouseDown:X=>oe(X,V),onClick:X=>X.stopPropagation(),children:"⠿"}),xe=H.useMemo(()=>["new",...e.map(V=>V.id)],[e]),ae=i==="graph"||xe.includes(i)?i:"new";H.useEffect(()=>{i!=="graph"&&!xe.includes(i)&&o("new")},[xe,i,o]);const De=(r==null?void 0:r.id)||null,ce=e.find(V=>V.id===ae),Be=(ce==null?void 0:ce.liveness)==="offline",Ae=Be&&(ce==null?void 0:ce.status)!=="queued",be=S[ae]||"",ve=V=>b(X=>({...X,[ae]:V}));H.useEffect(()=>{const V=(ce==null?void 0:ce.harness)||"claude";fetch(`/api/slash-commands?harness=${V}`).then(X=>X.json()).then(X=>{Array.isArray(X)&&u(X)}).catch(()=>{})},[ce==null?void 0:ce.harness]),H.useEffect(()=>{J2().then(V=>{Array.isArray(V)&&C(V)}).catch(()=>{})},[]);const Tt=y;H.useEffect(()=>{A(!1),R(!1),m(null),B(!1)},[ae]),H.useEffect(()=>{(ce==null?void 0:ce.liveness)==="offline"&&A(!1)},[ce==null?void 0:ce.liveness]);const Pt=H.useRef(!1);H.useEffect(()=>{var V;Pt.current&&!T&&ae!=="new"&&(ce==null?void 0:ce.liveness)!=="offline"&&((V=le.current)==null||V.focus()),Pt.current=T},[T]);const re=V=>{fetch(`/api/sessions/${ae}/rawkey`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:V})}).catch(()=>{})},de=(V,X)=>$(ie=>ie[V]===X?ie:{...ie,[V]:X}),[fe,ke]=H.useState(()=>new Set);H.useEffect(()=>{ke(V=>{const X=new Set;for(const ie of e)ie.liveness!=="offline"&&X.add(ie.id);if(X.size!==V.size)return X;for(const ie of X)if(!V.has(ie))return X;return V})},[e]),H.useEffect(()=>{c!=null&&(o("new"),v(c),m(null),n==null||n(),requestAnimationFrame(()=>{const V=te.current;V&&(V.focus(),V.setSelectionRange(c.length,c.length))}))},[c]),H.useEffect(()=>{if(!s)return;const V=setTimeout(()=>{var X,ie;ae==="new"?(X=te.current)==null||X.focus():ce&&ce.liveness!=="offline"&&((ie=le.current)==null||ie.focus())},0);return()=>clearTimeout(V)},[s,ae,ce==null?void 0:ce.liveness]),H.useEffect(()=>{const V=te.current;!V||ae!=="new"||!s||lp(V,parseFloat(getComputedStyle(V).maxHeight)||1/0)},[g,ae,s]),H.useEffect(()=>{var ie;const V=le.current;if(!V||ae==="new"||!s)return;const X=Math.round((((ie=ne.current)==null?void 0:ie.clientHeight)||360)*.5);V.style.maxHeight=`${X}px`,lp(V,X)},[be,ae,s]);const Oe=V=>{const X=V.match(/^\/(\S+)\s*([\s\S]*)$/);if(!X)return V;const ie=Tt.find($e=>$e.name===X[1]);if(!ie)return V;const _e=[],Se=X[2].replace(/(^|\s)@(\.?[A-Za-z0-9_-]+)/g,($e,je,Je)=>(_e.push(Je),je)).trim(),Ce=_e.length?_e.map($e=>{const je=t.find(Je=>Je.id===$e);return je?`- @${je.id} — ${au(je.path)}`:`- @${$e}`}).join(`
|
|
134
|
-
`):"(No target was @-mentioned. If the prompt names the scope, use it; otherwise ask the human to define the scope before proceeding — unless this task needs no scope, in which case proceed.)",Ue=ie.body.includes("{{targets}}")?ie.body.replace("{{targets}}",Ce):`${ie.body}
|
|
135
|
-
|
|
136
|
-
${Ce}`;return Se?`${Ue}
|
|
137
|
-
|
|
138
|
-
${Se}`:Ue},J=()=>{const V=g.trim();if(!V)return;const X=Oe(V);v(""),fetch("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:X,harness:x})}).then(ie=>ie.json().catch(()=>null)).then(()=>_==null?void 0:_()).catch(()=>{})},Ge=(V,X)=>{if(ae==="new"){let _e=X-1;for(;_e>=0&&V[_e]!=="@"&&!/\s/.test(V[_e]);)_e--;if(_e>=0&&V[_e]==="@"&&(_e===0||/\s/.test(V[_e-1]))){const Ce=V.slice(_e+1,X),Ue=uk(t,Ce,De);return Ue.length?{kind:"mention",items:Ue,index:0,start:_e,end:X,query:Ce}:null}const Se=V.match(/^\/(\S*)$/);if(Se){const Ce=fk(Tt,Se[1]);return Ce.length?{kind:"config",items:Ce,index:0,start:0,end:V.length,query:Se[1]}:null}return null}const ie=V.match(/^\/(\S*)$/);if(ie){const _e=Ms.map(Ce=>({name:Ce.name,description:l(Ce.descKey),board:!0,color:Ce.color})),Se=dk([..._e,...d],ie[1]);return Se.length?{kind:"slash",items:Se,index:0,start:0,end:V.length,query:ie[1]}:null}return null},Pe=V=>m(V?Ge(V.value,V.selectionStart):null),Zr=V=>m(X=>X&&{...X,index:(X.index+V+X.items.length)%X.items.length}),Si=V=>{if(!V||!w)return;if(w.kind==="slash"){if(V.board){const $e=Ms.find(je=>je.name===V.name);ve(""),m(null),$e==null||$e.run();return}const Se=`/${V.name} `,Ce=be.slice(0,w.start);ve(Ce+Se+be.slice(w.end)),m(null);const Ue=Ce.length+Se.length;requestAnimationFrame(()=>{const $e=le.current;$e&&($e.focus(),$e.setSelectionRange(Ue,Ue))});return}const X=w.kind==="config"?`/${V.name} `:`@${V.id} `,ie=g.slice(0,w.start);v(ie+X+g.slice(w.end)),m(null);const _e=ie.length+X.length;requestAnimationFrame(()=>{const Se=te.current;Se&&(Se.focus(),Se.setSelectionRange(_e,_e))})},Hn=(V,X)=>E.jsxs("ul",{className:V?"mention-menu up":"mention-menu",role:"listbox",children:[E.jsxs("li",{className:"mention-head",children:["// ",X," — ",l("session.menuHint")]}),w.items.map((ie,_e)=>{const Se=ie.board?"board":ie.source??ie.kind,Ce=ie.board?` sc-${ie.color}`:"";return E.jsxs("li",{role:"option","aria-selected":_e===w.index,className:`${_e===w.index?"mention-item on":"mention-item"}${Ce}`,onMouseDown:Ue=>{Ue.preventDefault(),Si(ie)},onMouseEnter:()=>m(Ue=>Ue&&{...Ue,index:_e}),children:[E.jsxs("span",{className:ie.board?"slash-name board":"slash-name",children:["/",cp(ie.name,w.query)]}),E.jsx("span",{className:"slash-desc",children:ie.description??ie.desc}),E.jsx("span",{className:`slash-src src-${Se}`,children:pk[Se]||Se})]},`${Se}:${ie.name}`)})]}),el=async()=>{const V=be;if(!V.trim()||ae==="new")return;const X=Ms.find(ie=>V.trim()===`/${ie.name}`);if(X){ve(""),m(null),X.run();return}ve(""),R(!1);try{const ie=await fetch(`/api/sessions/${ae}/keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:V,enter:!0})});if(!ie.ok)throw new Error(`keys ${ie.status}`)}catch{ve(V),R(!0)}},tl=async V=>{const X=new FormData;X.append("file",V,V.name||"pasted");const ie=await fetch("/api/uploads",{method:"POST",body:X});if(!ie.ok)throw new Error(`upload ${ie.status}`);const _e=await ie.json().catch(()=>null);if(!(_e!=null&&_e.path))throw new Error("upload: no path");return _e.path},zn=(V,X,ie,_e)=>{const Se=V.current,Ce=Se?Se.selectionStart:X.length,Ue=Se?Se.selectionEnd:X.length,$e=X.slice(0,Ce),je=($e&&!/\s$/.test($e)?" ":"")+_e+" ";ie($e+je+X.slice(Ue)),requestAnimationFrame(()=>{if(!Se)return;Se.focus();const Je=$e.length+je.length;Se.setSelectionRange(Je,Je)})},xi=async(V,X)=>{const ie=[...V||[]];if(!(!ie.length||q)){N(!1),Y(X),Z(!0);try{const _e=[];for(const Se of ie)_e.push(await tl(Se));X==="new"?zn(te,g,v,_e.join(" ")):zn(le,be,ve,_e.join(" "))}catch{N(!0)}finally{Z(!1)}}},Wn=(V,X)=>{var _e;const ie=(_e=V.clipboardData)==null?void 0:_e.files;ie&&ie.length&&(V.preventDefault(),xi(ie,X))},Un=(V,X)=>{var ie;V.preventDefault(),G(null),xi((ie=V.dataTransfer)==null?void 0:ie.files,X)},Vn=(V,X)=>{var ie;[...((ie=V.dataTransfer)==null?void 0:ie.types)||[]].includes("Files")&&(V.preventDefault(),G(X))},Kn=V=>{var X;We.current=V,(X=Te.current)==null||X.click()},Jr=async V=>{await fetch(`/api/sessions/${ae}/${V}`,{method:"POST"}).catch(()=>{}),await(_==null?void 0:_())},rl={nav:()=>A(V=>!V),proof:()=>B(!0),merge:()=>Jr("merge"),exit:()=>Jr("exit"),close:()=>Jr("close")},Ms=nk(ce==null?void 0:ce.status,rl),Gn=H.useRef({});Gn.current={order:xe,active:ae,submit:J,menu:w,navMenu:Zr,accept:Si,setMenu:m,onClose:a,open:s,navMode:T,setNavMode:A,sendRawKey:re,graphLegend:L,setGraphLegend:P},H.useEffect(()=>{const V=X=>{var Yn;const{order:ie,active:_e,submit:Se,menu:Ce,navMenu:Ue,accept:$e,setMenu:je,onClose:Je,open:Er,navMode:Rs,setNavMode:cr,sendRawKey:qn,graphLegend:Xn,setGraphLegend:ol}=Gn.current;if(!Er)return;const al=X.code==="KeyI"||X.key==="i"||X.key==="I";if((X.altKey||X.metaKey)&&al&&_e!=="new"&&_e!=="graph"){X.preventDefault(),X.stopPropagation(),cr(Nt=>!Nt);return}if((X.ctrlKey||X.metaKey)&&(X.key==="n"||X.key==="N")||(X.ctrlKey||X.metaKey)&&(X.key==="ArrowUp"||X.key==="Home")){X.preventDefault(),X.stopPropagation(),o("new");return}if(_e==="graph"){if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),Xn?ol(!1):Je();return}if(Xn){X.key.startsWith("Arrow")&&(X.preventDefault(),X.stopPropagation());return}if(X.key==="ArrowLeft"){X.preventDefault(),X.stopPropagation(),o("new");return}if(X.key==="ArrowRight"||X.key==="ArrowUp"||X.key==="ArrowDown"){X.preventDefault(),X.stopPropagation();return}return}if(Rs&&_e!=="new"){if(X.preventDefault(),X.stopPropagation(),X.key==="Escape"){qn("Escape");const Ds=Date.now();Ds-ee.current<600&&cr(!1),ee.current=Ds;return}const Nt=ck(X);Nt&&qn(Nt);return}if(Ce){if(X.key==="ArrowDown"){X.preventDefault(),X.stopPropagation(),Ue(1);return}if(X.key==="ArrowUp"){X.preventDefault(),X.stopPropagation(),Ue(-1);return}if(X.key==="Enter"||X.key==="Tab"){X.preventDefault(),X.stopPropagation(),$e(Ce.items[Ce.index]);return}if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),je(null);return}}if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),Je();return}if(_e==="new"&&X.key==="ArrowRight"&&(((Yn=te.current)==null?void 0:Yn.value)??"")===""){X.preventDefault(),X.stopPropagation(),o("graph");return}if(X.key==="ArrowUp"||X.key==="ArrowDown"){const Nt=X.target;if((Nt==null?void 0:Nt.tagName)==="TEXTAREA"&&!hk(Nt,X.key==="ArrowUp"?"up":"down"))return;X.preventDefault(),X.stopPropagation();const Ds=ie.indexOf(_e),ll=Math.max(0,Math.min(ie.length-1,Ds+(X.key==="ArrowDown"?1:-1)));o(ie[ll]);return}X.key==="Enter"&&!X.shiftKey&&_e==="new"&&(X.preventDefault(),X.stopPropagation(),Se())};return window.addEventListener("keydown",V,!0),()=>window.removeEventListener("keydown",V,!0)},[o]);const sl=V=>V&&(V.tagName==="TEXTAREA"||V.tagName==="INPUT"||V.isContentEditable),il=()=>{const V=te.current||le.current;V&&requestAnimationFrame(()=>V.focus())},nl=V=>{if(V.stopPropagation(),V.button!==0)return;const X=V.target;sl(X)||X.closest&&(X.closest(".si-term-body")||X.closest(".session-graph"))||V.preventDefault()};return H.useEffect(()=>{if(!s)return;const V=X=>{var ie;(ie=pe.current)!=null&&ie.contains(X.target)&&(X.preventDefault(),il())};return window.addEventListener("contextmenu",V,!0),()=>window.removeEventListener("contextmenu",V,!0)},[s]),E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"si-backdrop",onMouseDown:a,style:s?void 0:{display:"none"},children:E.jsxs("div",{className:"si-panel",ref:pe,onMouseDown:nl,children:[E.jsx("input",{ref:Te,type:"file",multiple:!0,style:{display:"none"},onChange:V=>{xi(V.target.files,We.current),V.target.value=""}}),E.jsxs("aside",{className:"si-list",children:[E.jsxs("div",{className:"si-toprow",children:[E.jsx("button",{className:ae==="new"?"si-pill new on":"si-pill new",title:l("session.newSessionTitle"),onClick:()=>o("new"),children:E.jsx("span",{className:"si-pill-glyph",children:"+"})}),E.jsx("button",{className:ae==="graph"?"si-pill graph on":"si-pill graph",title:l("session.relationshipTitle"),onClick:()=>o("graph"),children:E.jsxs("svg",{className:"si-pill-glyph",width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[E.jsx("circle",{cx:"3.5",cy:"4",r:"1.8"}),E.jsx("circle",{cx:"12.5",cy:"4",r:"1.8"}),E.jsx("circle",{cx:"8",cy:"12.5",r:"1.8"}),E.jsx("path",{d:"M4.9 5.1 L7 11 M11.1 5.1 L9 11 M5 4 H11"})]})})]}),e.map(V=>{var X;return E.jsx("button",{"data-sid":V.id,className:`si-item${ae===V.id?" on":""}${(me==null?void 0:me.id)===V.id?` drop-${me.place}`:""}`,style:{"--ov":qr(V.id)},onClick:()=>o(V.id),onDoubleClick:()=>{var ie;(ie=V.ops)!=null&&ie.length&&p&&(p(V,!1),a())},onContextMenu:ie=>{ie.preventDefault(),ie.stopPropagation(),f({x:ie.clientX,y:ie.clientY,session:V})},title:(X=V.ops)!=null&&X.length?l("session.opsTitle"):void 0,children:E.jsx(kh,{s:V,locked:!1,handle:we(V)})},V.id)})]}),E.jsxs("section",{className:ae==="new"?"si-content is-new":ae==="graph"?"si-content is-graph":"si-content is-session",children:[s&&ae==="graph"&&E.jsx(q2,{sessions:e,onOpen:V=>o(V),active:!0,legend:L,setLegend:P,edges:O,edgesLoaded:W}),ae==="new"&&E.jsxs("div",{className:"si-new-center",children:[E.jsx("div",{className:"si-avatar",children:"◠‿◠"}),E.jsx("div",{className:"si-ask",children:l("session.ask")}),E.jsxs("div",{className:U==="new"?"si-inputwrap dragover":"si-inputwrap",onDragOver:V=>Vn(V,"new"),onDragLeave:()=>G(null),onDrop:V=>Un(V,"new"),children:[E.jsx("textarea",{ref:te,className:"si-input",rows:1,value:g,onChange:V=>{v(V.target.value),Pe(V.target)},onSelect:V=>Pe(V.target),onPaste:V=>Wn(V,"new"),onBlur:()=>m(null),placeholder:l("session.inputPlaceholder"),spellCheck:!1}),E.jsx("button",{type:"button",className:"si-attach",title:l("session.attachTitle"),onClick:()=>Kn("new"),disabled:q,children:q&&Q==="new"?E.jsx(ap,{}):E.jsx(op,{})}),z&&Q==="new"&&E.jsx("span",{className:"si-attach-err",role:"alert",children:l("session.attachError")}),w&&w.kind==="mention"&&E.jsxs("ul",{className:"mention-menu",role:"listbox",children:[E.jsxs("li",{className:"mention-head",children:["// ",w.query?`@${w.query}`:l("session.menuSpecNodes")," — ",l("session.menuHint")]}),w.items.map((V,X)=>E.jsxs("li",{role:"option","aria-selected":X===w.index,className:X===w.index?"mention-item on":"mention-item",onMouseDown:ie=>{ie.preventDefault(),Si(V)},onMouseEnter:()=>m(ie=>ie&&{...ie,index:X}),children:[E.jsx("span",{className:"mention-dot",style:{background:ir[V.status]||ir.offline}}),E.jsxs("span",{className:"mention-id",children:["@",cp(V.id,w.query)]}),E.jsx("span",{className:"mention-path",children:au(V.path)})]},V.id))]}),w&&w.kind==="config"&&Hn(!1,w.query?`/${w.query}`:l("session.menuPresets"))]}),E.jsx("div",{className:"si-agent-picker",role:"radiogroup","aria-label":l("session.harnessLabel"),children:gk.map(V=>{const X=V.Glyph;return E.jsx("button",{type:"button",role:"radio","aria-checked":x===V.id,"aria-label":V.label,title:V.label,className:x===V.id?"si-agent-opt on":"si-agent-opt",onClick:()=>M(V.id),children:E.jsx(X,{})},V.id)})}),E.jsxs("div",{className:"si-hint",children:[l("session.hint.before"),E.jsx("code",{children:"@"}),l("session.hint.mid"),E.jsx("code",{children:"/"}),l("session.hint.after")]})]}),E.jsxs("div",{className:"si-session-wrap",style:{display:ae==="new"||ae==="graph"?"none":"flex",flexDirection:"column",flex:1,minWidth:0,minHeight:0,position:"relative"},children:[E.jsxs("div",{className:"si-term",ref:ne,children:[E.jsxs("div",{className:"si-term-head",children:[E.jsx("span",{className:"si-dot",style:{background:ir[ce==null?void 0:ce.status]||ir.offline}}),E.jsx("span",{className:"si-th-name",title:ce?En(ce):ae,children:ce&&En(ce)||ae}),E.jsx("span",{className:"si-th-st",style:{color:ir[ce==null?void 0:ce.status]},children:ce!=null&&ce.status?l(`status.${ce.status}`):""}),(ce==null?void 0:ce.merges)>0&&E.jsx("span",{className:"si-merges",title:l("session.mergesTitle"),children:l("session.merges",{n:ce.merges})}),E.jsx("div",{className:"si-actions",children:Ae?E.jsx("button",{className:"si-act go",onClick:()=>Jr("resume"),children:l("session.relaunch")}):Ms.filter(V=>V.button).map(V=>{const X=V.name==="nav"?T?" on":j[ae]?" suggest":"":"";return E.jsx("button",{className:`si-act board sc-${V.color} ${V.name}${X}`,title:l(V.titleKey),onClick:V.run,children:l(V.labelKey)},V.name)})})]}),E.jsxs("div",{className:"si-term-body",style:{position:"relative"},children:[[...fe].map(V=>E.jsx("div",{className:"si-term-layer",style:{position:"absolute",inset:0,display:V===ae?"block":"none"},children:E.jsx(F2,{sessionId:V,active:V===ae,onMenu:de})},V)),Ae&&E.jsxs("div",{className:"si-offline",children:[E.jsx("div",{className:"si-offline-msg",children:l("session.offlineMsg")}),E.jsxs("div",{className:"si-offline-sub",children:[l("session.offlineSubBefore"),E.jsxs("code",{children:[ae.slice(0,8),"…"]}),l("session.offlineSubAfter")]}),E.jsx("button",{className:"si-act go big",onClick:()=>Jr("resume"),children:l("session.relaunchResume")})]})]})]}),T?E.jsxs("div",{className:"si-bottom nav",onClick:()=>A(!1),title:l("session.navExit"),children:[E.jsx("span",{className:"si-nav-ind",children:l("session.navInd")}),E.jsx("span",{className:"si-nav-help",children:l("session.navHelp")})]}):E.jsxs("div",{className:`${D?"si-bottom err":"si-bottom"}${U==="msg"?" dragover":""}`,onDragOver:V=>{Be||Vn(V,"msg")},onDragLeave:()=>G(null),onDrop:V=>{Be||Un(V,"msg")},children:[E.jsx("span",{className:"si-prompt",children:"❯"}),E.jsx("textarea",{ref:le,className:"si-input",rows:1,value:be,onChange:V=>{ve(V.target.value),D&&R(!1),Pe(V.target)},onSelect:V=>Pe(V.target),onPaste:V=>{Be||Wn(V,"msg")},onBlur:()=>m(null),onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),V.stopPropagation(),el())},placeholder:l(Be?"session.msgOffline":"session.msgPlaceholder"),spellCheck:!1,disabled:Be}),E.jsx("button",{type:"button",className:"si-attach",title:l("session.attachTitle"),onClick:()=>Kn("msg"),disabled:q||Be,children:q&&Q==="msg"?E.jsx(ap,{}):E.jsx(op,{})}),z&&Q==="msg"&&E.jsx("span",{className:"si-attach-err",role:"alert",children:l("session.attachError")}),D&&E.jsx("span",{className:"si-send-err",role:"alert",children:l("session.msgError")}),w&&w.kind==="slash"&&Hn(!0,w.query?`/${w.query}`:l("session.menuCommands"))]})]})]})]})}),E.jsx(rk,{menu:h,onClose:()=>f(null),onChanged:_}),F&&ae!=="new"&&ae!=="graph"&&E.jsx(sk,{sessionId:ae,onClose:()=>B(!1)})]})}const Lh=[{id:"nav.up",keys:["ArrowUp","k"],rebind:!1,desc:"legend.board.move"},{id:"nav.down",keys:["ArrowDown","j"],rebind:!1,desc:"legend.board.move"},{id:"nav.parent",keys:["ArrowLeft","h"],rebind:!1,desc:"legend.board.parent"},{id:"nav.child",keys:["ArrowRight","l"],rebind:!1,desc:"legend.board.child"},{id:"board.zoomIn",keys:["+","="],rebind:!0,desc:"legend.board.zoom"},{id:"board.zoomOut",keys:["-","_"],rebind:!0,desc:"legend.board.zoom"},{id:"board.zoomReset",keys:["0"],rebind:!0,desc:"legend.board.zoom"},{id:"board.info",keys:["i","I"],rebind:!0,desc:"legend.board.info"},{id:"board.search",keys:["/"],rebind:!0,desc:"legend.board.search"},{id:"board.cycle",keys:["o"],rebind:!0,desc:"legend.board.overlayCycle"},{id:"board.cycleRev",keys:["O"],rebind:!0,desc:"legend.board.overlayCycle"},{id:"board.enter",keys:["Enter"],rebind:!0,desc:"legend.board.enter"},{id:"board.fresh",keys:["@"],rebind:!0,desc:"legend.board.fresh"},{id:"board.newChild",keys:["n"],rebind:!1,desc:"legend.board.newChild"},{id:"board.del",keys:["d"],rebind:!1,desc:"legend.board.del"},{id:"board.settings",keys:[","],rebind:!0,desc:"legend.board.settings"},{id:"board.help",keys:["?"],rebind:!0,desc:"legend.board.help"}],mk={ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",Enter:"⏎",Escape:"esc"," ":"␣","-":"−"},Uv=e=>mk[e]||e,Mh="spex.keybindings.v1",vk=Object.fromEntries(Lh.map(e=>[e.id,e]));function yk(){try{return JSON.parse(localStorage.getItem(Mh))||{}}catch{return{}}}let cs=yk();function Rh(e){var r;const t=cs[e];return t&&t.keys||((r=vk[e])==null?void 0:r.keys)||[]}function wk(e){return!!cs[e]}function ht(e,t){return Rh(e).includes(t)}function Sk(e,t){cs={...cs,[e]:{...cs[e],...t}},localStorage.setItem(Mh,JSON.stringify(cs)),Vv()}function xk(){cs={},localStorage.removeItem(Mh),Vv()}const Ck=new Set;function Vv(){Ck.forEach(e=>e())}const bk=new Set(["=","_","I"]),Ek=(()=>{const e=[];for(const t of Lh){const r=Rh(t.id).filter(i=>!bk.has(i)).map(Uv),s=e[e.length-1];s&&s.desc===t.desc?s.keys.push(...r):e.push({desc:t.desc,keys:r})}return e})(),kk=[[["←","→","h","l","⇥","1","2"],"legend.popup.switch"],[["j","k","↑","↓"],"legend.popup.scroll"],[["⏎"],"legend.popup.enter"],[["esc"],"legend.popup.esc"]],Lk=["merged","active","drift","pending"],Mk=["added","edited","deleted","moved"];function Rk({t:e}){return E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:e("legend.secBoard")}),Ek.map(t=>E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"keymap-keys",children:t.keys.map((r,s)=>E.jsx("kbd",{children:r},s))}),E.jsx("span",{className:"legend-desc",children:e(t.desc)})]},t.desc))]})}function Dk({title:e,rows:t,t:r}){return E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:e}),t.map(([s,i])=>E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"keymap-keys",children:s.map((o,c)=>E.jsx("kbd",{children:o},c))}),E.jsx("span",{className:"legend-desc",children:r(i)})]},i))]})}function Ak({onClose:e}){const t=Me();return E.jsxs(kn,{title:t("legend.title"),closeLabel:t("legend.close"),onClose:e,children:[E.jsx(Rk,{t}),E.jsx(Dk,{title:t("legend.secPopup"),rows:kk,t}),E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:t("legend.secStatus")}),Lk.map(r=>E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"node-dot",style:{background:xr[r].color},children:r==="active"&&E.jsx("span",{className:"pulse",style:{background:xr[r].color}})}),E.jsx("span",{className:"legend-name",children:t(`status.${r}`)}),E.jsx("span",{className:"legend-desc",children:t(`legend.statusRows.${r}`)})]},r))]}),E.jsxs("section",{className:"legend-sec",children:[E.jsxs("div",{className:"legend-h",children:[t("legend.secOp")," ",E.jsx("span",{className:"legend-sub",children:t("legend.secOpSub")})]}),Mk.map(r=>E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:`ov-mark ov-${r}`,children:Ja[r]}),E.jsx("span",{className:"legend-desc",children:t(`legend.opRows.${r}`)})]},r))]}),E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:t("legend.secBadges")}),E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"drift-badge",children:"⚠N"}),E.jsx("span",{className:"legend-desc",children:t("legend.badgeDrift")})]}),E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"legend-glyph legend-ver",children:"vN"}),E.jsx("span",{className:"legend-desc",children:t("legend.badgeVer")})]})]}),E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:t("legend.secRing")}),E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"legend-ring ring-dashed"}),E.jsx("span",{className:"legend-desc",children:t("legend.ringDashed")})]}),E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"legend-ring ring-solid"}),E.jsx("span",{className:"legend-desc",children:t("legend.ringSolid")})]}),E.jsxs("div",{className:"legend-row",children:[E.jsx("span",{className:"legend-ring ring-ghost"}),E.jsx("span",{className:"legend-desc",children:t("legend.ringGhost")})]})]})]})}function Tk({t:e}){const[t,r]=H.useState(0),[s,i]=H.useState(null),o=()=>r(c=>c+1);return H.useEffect(()=>{if(!s)return;const c=n=>{if(n.preventDefault(),n.stopPropagation(),n.key==="Escape"){i(null);return}["Shift","Control","Alt","Meta"].includes(n.key)||(Sk(s,{keys:[n.key]}),i(null),o())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:e("settings.secShortcuts")}),E.jsx("div",{className:"set-keys",children:Lh.map(c=>E.jsxs("div",{className:"set-key-row",children:[E.jsx("span",{className:"legend-desc",children:e(c.desc)}),E.jsx("button",{className:`bind-cell${s===c.id?" capturing":""}${c.rebind?"":" fixed"}${wk(c.id)?" custom":""}`,disabled:!c.rebind,onClick:()=>c.rebind&&i(c.id),children:s===c.id?E.jsx("span",{className:"bind-hint",children:e("settings.bindPrompt")}):Rh(c.id).map((n,a)=>E.jsx("kbd",{children:Uv(n)},a))})]},c.id))}),E.jsxs("div",{className:"set-foot",children:[E.jsx("span",{className:"legend-desc set-hint",children:e("settings.shortcutsHint")}),E.jsx("button",{className:"set-reset",onClick:()=>{xk(),i(null),o()},children:e("settings.reset")})]})]})}function Pk({onClose:e}){const{t,lang:r,setLang:s}=kv();return E.jsxs(kn,{title:t("settings.title"),closeLabel:t("settings.close"),className:"settings",onClose:e,children:[E.jsxs("section",{className:"legend-sec",children:[E.jsx("div",{className:"legend-h",children:t("settings.secLanguage")}),E.jsx("div",{className:"set-langs",children:e2.map(i=>E.jsx("button",{className:i.code===r?"set-lang on":"set-lang",onClick:()=>s(i.code),"aria-pressed":i.code===r,children:i.label},i.code))}),E.jsx("div",{className:"legend-desc set-hint",children:t("settings.languageHint")})]}),E.jsx(Tk,{t})]})}const Nk=8,Ik=5,Bk=3,Ok=1,$k=new Set(["the","a","an","and","or","of","to","in","on","is","it","its","as","at","by","for","how","does","do","what","which","that","this","these","those","with","from","into","are","be","can","just","them","they","their","so","if","not","no","but","vs","us","we","you"]);function jk(e){const t=new Set;for(const r of e.toLowerCase().split(/[^a-z0-9]+/))r.length>1&&!$k.has(r)&&t.add(r);return[...t]}function Yl(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function Kv(e,t){return t.startsWith(e)}function ba(e,t){return t.startsWith(e)||t.length>=3&&e.startsWith(t)}const up=1.2,hp=.4;function Fk(e,t,r){return e<=0?0:e*(up+1)/(e+up*(1-hp+hp*t/(r||1)))}function Hk(e,t,r){if(t.nameWords.some(i=>Kv(e,i)))return Nk;if(t.name.includes(e))return Ik;if(t.descWords.some(i=>ba(e,i)))return Bk;const s=t.bodyWords.reduce((i,o)=>i+(ba(e,o)?1:0),0);return Ok*Fk(s,t.bodyWords.length,r)}function zk(e,t,r,s=140){const i=e.replace(/\s+/g," ").trim(),o=i.toLowerCase();let c=-1;for(const p of r){const _=o.match(new RegExp("\\b"+p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")));_&&_.index!==void 0&&(c<0||_.index<c)&&(c=_.index)}if(c<0){const p=(t||i).replace(/\s+/g," ").trim();return p.length>s?p.slice(0,s).trimEnd()+"…":p}const n=Math.max(0,c-Math.floor(s/3));let a=i.slice(n,n+s).trim();return n>0&&(a="…"+a),n+s<i.length&&(a=a+"…"),a}function Wk(e,t,r={}){const s=r.limit??10,i=jk(e);if(!i.length)return[];const o=t.map(_=>{const l=_.name.toLowerCase();return{ref:_.ref,name:l,nameWords:Yl(l),desc:_.desc.toLowerCase(),descWords:Yl(_.desc),bodyWords:Yl(_.body),snippetText:`${_.desc}
|
|
139
|
-
${_.body}`}}),c=o.length,n=o.reduce((_,l)=>_+l.bodyWords.length,0)/(c||1),a={};for(const _ of i){let l=0;for(const g of o)(g.nameWords.some(v=>Kv(_,v))||g.descWords.some(v=>ba(_,v))||g.bodyWords.some(v=>ba(_,v)))&&l++;a[_]=l>0?Math.log(c/l):0}const p=[];for(const _ of o){let l=0;for(const g of i)l+=Hk(g,_,n)*a[g];l<=0||p.push({ref:_.ref,score:Math.round(l*100)/100,snippet:zk(_.snippetText,_.desc,i)})}return p.sort((_,l)=>l.score-_.score),p.slice(0,s)}const Uk={pass:"var(--green)",fail:"var(--red)",stalePass:"var(--muted)",staleFail:"var(--muted)",empty:"var(--muted)",missing:"var(--muted)"},Vk=e=>(e||"").replace(/^\.spec\//,"").replace(/\/spec\.md$/,""),dp={spec:0,session:1,issue:2,scenario:3};function Kk(e,t){const r=[];for(const s of e){const i=Vk(s.path);r.push({kind:"spec",key:`spec:${s.id}`,target:s.id,color:(xr[s.status]||xr.pending).color,title:s.title||s.id,sub:i,name:`${s.title||s.id} ${s.id}`,desc:s.desc||"",body:s.body||""});for(const o of s.issues||[]){const c=(o.state||"").toLowerCase()==="open";r.push({kind:"issue",key:`issue:${s.id}:${o.number}`,target:s.id,color:c?"var(--green)":"var(--muted)",title:o.title,sub:`#${o.number} · ${i}`,name:o.title||"",desc:`#${o.number}`,body:""})}for(const o of Fn(s.scenarios,s.evals))r.push({kind:"scenario",key:`scenario:${s.id}:${o.name}`,target:s.id,color:Uk[o.state]||"var(--cyan)",title:o.name,sub:i,name:o.name||"",desc:"",body:o.expected||""})}for(const s of t){const i=Ls(s),o=s.promptPreview||s.note||s.status||"";r.push({kind:"session",key:`session:${s.id}`,target:s.id,color:ir[s.status]||ir.offline,title:i,sub:o,name:i||"",desc:s.status||"",body:s.promptPreview||s.note||""})}return r}const fp=["spec","session","issue","scenario"];function Gk(e,t){const r=(o,c)=>dp[o.kind]-dp[c.kind]||o.name.length-c.name.length||o.key.localeCompare(c.key);if(!t.trim())return e.slice().sort(r).slice(0,15);const s={};for(const o of fp){const c=e.filter(n=>n.kind===o).sort((n,a)=>n.name.length-a.name.length||n.key.localeCompare(a.key));s[o]=Wk(t,c.map(n=>({ref:n,name:n.name,desc:n.desc,body:n.body})),{limit:15}).map(n=>n.ref)}const i=[];for(let o=0;i.length<15;o++){let c=!1;for(const n of fp)s[n][o]&&i.length<15&&(i.push(s[n][o]),c=!0);if(!c)break}return i}function qk({specs:e,sessions:t,onPick:r,onClose:s}){const i=Me(),[o,c]=H.useState(""),[n,a]=H.useState(0),p=H.useRef(null),_=H.useRef(null),l=H.useMemo(()=>Kk(e,t),[e,t]),g=H.useMemo(()=>Gk(l,o),[l,o]);H.useEffect(()=>{var m;(m=p.current)==null||m.focus()},[]),H.useEffect(()=>{a(0)},[o]),H.useEffect(()=>{var m,h;(h=(m=_.current)==null?void 0:m.querySelector(".search-item.on"))==null||h.scrollIntoView({block:"nearest"})},[n,g]);const v=m=>{m&&(r(m),s())},w=m=>{m.key==="ArrowDown"?(m.preventDefault(),a(h=>Math.min(g.length-1,h+1))):m.key==="ArrowUp"?(m.preventDefault(),a(h=>Math.max(0,h-1))):m.key==="Enter"?(m.preventDefault(),v(g[n])):m.key==="Escape"&&(m.preventDefault(),s())};return E.jsx("div",{className:"search-backdrop",onClick:s,children:E.jsxs("div",{className:"search-panel",role:"dialog","aria-modal":"true","aria-label":i("search.title"),onClick:m=>m.stopPropagation(),children:[E.jsxs("div",{className:"search-bar",children:[E.jsx("span",{className:"search-icon",children:"⌕"}),E.jsx("input",{ref:p,className:"search-input",value:o,placeholder:i("search.placeholder"),onChange:m=>c(m.target.value),onKeyDown:w})]}),E.jsxs("ul",{className:"search-results",ref:_,children:[g.length===0&&E.jsx("li",{className:"search-empty",children:i("search.empty")}),g.map((m,h)=>E.jsxs("li",{className:`search-item${h===n?" on":""}`,onMouseEnter:()=>a(h),onClick:()=>v(m),children:[E.jsx("span",{className:"node-dot",style:{background:m.color}}),E.jsx("span",{className:`search-kind k-${m.kind}`,children:i(`search.kind.${m.kind}`)}),E.jsx("span",{className:"search-title",children:m.title||m.target}),E.jsx("span",{className:"search-path",children:m.sub})]},m.key))]}),E.jsx("div",{className:"search-foot",children:i("search.hint")})]})})}function Gv(e,t,r=1,s=i=>i){if(!e.length)return null;const i=e.findIndex(o=>s(o)===t);return i===-1?r>0?e[0]:e[e.length-1]:e[(i+r+e.length)%e.length]}const Xk=["merged","active","drift","pending"],Yk=[{state:"pass",always:!0,titleKey:"scorePass"},{state:"fail",always:!0,titleKey:"scoreFail"},{state:"stalePass",always:!1,titleKey:"scoreStalePass"},{state:"staleFail",always:!1,titleKey:"scoreStaleFail"},{state:"empty",always:!1,titleKey:"scoreEmpty"}];function Qk(e){const t={merged:[],active:[],drift:[],pending:[]},r=[],s=[],i=new Set,o={pass:0,fail:0,stalePass:0,staleFail:0,empty:0},c={pass:[],fail:[],stalePass:[],staleFail:[],empty:[]};for(const n of e){t[n.status]&&t[n.status].push(n.id),n.drift>0&&r.push(n.id);const a=n.openIssues||[];if(a.length){s.push(n.id);for(const _ of a)i.add(_.number)}const p=new Set;for(const _ of Fn(n.scenarios,n.evals)){const l=_.state==="missing"?"empty":_.state;o[l]!==void 0&&(o[l]++,p.has(l)||(p.add(l),c[l].push(n.id)))}}return{total:e.length,status:t,driftIds:r,issueIds:s,issueCount:i.size,scoreCount:o,scoreNodes:c}}function Eo({count:e,ids:t,focusId:r,onJump:s,title:i,cls:o="",children:c}){const n=t.length>0;return E.jsxs("button",{type:"button",className:`bstat ${o}`.trim(),disabled:!n,title:i,onClick:n?()=>s(Gv(t,r)):void 0,children:[c,e]})}function Zk({specs:e,focusId:t,onJump:r}){const s=Me(),i=H.useMemo(()=>Qk(e),[e]),o=c=>c&&(r==null?void 0:r(c));return E.jsxs("div",{className:"board-stats",role:"group","aria-label":s("stats.aria"),children:[E.jsx("span",{className:"bstat-total",title:s("stats.totalTitle",{n:i.total}),children:i.total}),Xk.map(c=>E.jsx(Eo,{count:i.status[c].length,ids:i.status[c],focusId:t,onJump:o,title:s("stats.statusTitle",{n:i.status[c].length,status:s(`status.${c}`)}),children:E.jsx("span",{className:"bstat-dot",style:{background:xr[c].color}})},c)),E.jsx("span",{className:"bstat-sep"}),E.jsx(Eo,{count:i.driftIds.length,ids:i.driftIds,focusId:t,onJump:o,cls:"bstat-drift",title:s("stats.driftTitle",{n:i.driftIds.length}),children:"⚠"}),E.jsx(Eo,{count:i.issueCount,ids:i.issueIds,focusId:t,onJump:o,cls:"bstat-issue",title:s("stats.issueTitle",{n:i.issueCount}),children:"◆"}),E.jsx("span",{className:"bstat-sep"}),Yk.map(({state:c,always:n,titleKey:a})=>{const p=i.scoreCount[c],_=i.scoreNodes[c];return!p&&!n?null:E.jsx(Eo,{count:p,ids:_,focusId:t,onJump:o,title:s(`stats.${a}`,{n:p}),children:E.jsx(bh,{state:c})},c)})]})}const Jk={spec:"nodeView.paneSpec",history:"nodeView.paneHistory",issues:"nodeView.paneIssues",eval:"nodeView.paneEval",edit:"nodeView.paneEdit"},pp=(e,t)=>t.filter(r=>{var s;return(s=r.ops)==null?void 0:s.some(i=>i.nodeId===e.id)});function qv({status:e}){const t=xr[e]||xr.pending;return E.jsx("span",{className:"m-dot",style:{background:t.color}})}function eL({node:e,kids:t,editors:r,onTap:s}){return E.jsxs("button",{className:"m-row",onClick:s,children:[E.jsx(qv,{status:e.status}),E.jsx("span",{className:"m-row-title",children:e.title}),r.length>0&&E.jsx("span",{className:"m-row-faces",children:r.slice(0,3).map(i=>E.jsx(wi,{seed:i.id,status:i.status,title:Ls(i)},i.id))}),e.version?E.jsxs("span",{className:"m-row-ver",children:["v",e.version]}):null,t>0&&E.jsxs("span",{className:"m-row-kids",children:["▸",t]}),E.jsx("span",{className:"m-row-chev",children:"›"})]})}function tL({node:e,childrenOf:t,sessions:r,onOpenChild:s}){const i=Me(),o=Av(e.id),c=t(e.id),n=Eh(e),a=[...c.length?[{key:"children",label:i("mobile.childrenTab",{n:c.length})}]:[],...n.map(v=>({key:v.key,label:i(Jk[v.key])}))],[p,_]=H.useState(null);H.useEffect(()=>{_(null)},[e.id]);const l=p&&a.some(v=>v.key===p)?p:a[0].key,g=pp(e,r);return E.jsxs("div",{className:"m-node",children:[E.jsxs("div",{className:"m-node-head",children:[E.jsx(qv,{status:e.status}),E.jsx("span",{className:"m-node-title",children:e.title}),e.version?E.jsxs("span",{className:"m-node-ver",children:["v",e.version]}):null,E.jsx("span",{className:"m-node-status",children:i(`status.${e.status}`)}),g.length>0&&E.jsx("span",{className:"m-node-faces",title:i("mobile.liveEditors",{n:g.length}),children:g.map(v=>E.jsx(wi,{seed:v.id,status:v.status,title:Ls(v)},v.id))})]}),e.desc&&E.jsx("div",{className:"m-node-desc",children:e.desc}),E.jsx("div",{className:"m-tabs",children:a.map(v=>E.jsx("button",{className:v.key===l?"m-tab on":"m-tab",onClick:()=>_(v.key),children:v.label},v.key))}),E.jsxs("div",{className:l==="history"?"m-pane-host fixed":"m-pane-host",children:[l==="children"&&E.jsx("div",{className:"m-children",children:c.map(v=>E.jsx(eL,{node:v,kids:t(v.id).length,editors:pp(v,r),onTap:()=>s(v.id)},v.id))}),l==="spec"&&E.jsx(Dv,{node:e}),l==="history"&&E.jsx(Nv,{node:e,rows:o}),l==="issues"&&E.jsx(Iv,{node:e}),l==="edit"&&E.jsx(Bv,{node:e})]})]})}function rL({sessions:e,openId:t,setOpenId:r,byId:s,goToNode:i}){const o=Me(),c=t?e.find(n=>n.id===t):null;if(c){const n=c.ops||[];return E.jsxs("div",{className:"m-sessdetail",children:[E.jsxs("div",{className:"m-sess-card",children:[E.jsx(wi,{seed:c.id,status:c.status}),E.jsxs("div",{className:"m-sess-meta",children:[E.jsx("span",{className:"m-sess-name",children:Ls(c)}),E.jsx("span",{className:"m-sess-status",style:{color:ir[c.status]},children:o(`status.${c.status}`)})]})]}),c.activity&&E.jsx("div",{className:"m-sess-activity",children:c.activity}),E.jsx("div",{className:"m-sess-section",children:o("mobile.changing",{n:n.length})}),n.length===0?E.jsx("div",{className:"m-empty",children:o("mobile.noChanges")}):n.map((a,p)=>{const _=s[a.nodeId];return E.jsxs("button",{className:"m-row",disabled:!_,onClick:()=>_&&i(a.nodeId),children:[E.jsx("span",{className:`ov-mark ov-${a.op}`,children:Ja[a.op]||"•"}),E.jsx("span",{className:"m-row-title",children:_?_.title:a.nodeId}),_&&E.jsx("span",{className:"m-row-chev",children:"›"})]},p)})]})}return e.length?E.jsx("div",{className:"m-sesslist",children:e.map(n=>E.jsx("button",{className:"m-sess-row",onClick:()=>r(n.id),children:E.jsx(kh,{s:n,locked:!1})},n.id))}):E.jsx("div",{className:"m-empty big",children:o("mobile.noSessions")})}function sL({specs:e,sessions:t,project:r}){const s=Me(),i=H.useMemo(()=>Object.fromEntries(e.map(C=>[C.id,C])),[e]),o=H.useMemo(()=>e.find(C=>!C.parent)||e[0],[e]),c=H.useMemo(()=>{const C={};return e.forEach(S=>{var b;S.parent&&(C[b=S.parent]??(C[b]=[])).push(S)}),S=>C[S]||[]},[e]),n=H.useMemo(()=>C=>{const S=[];for(let b=i[C];b;b=b.parent?i[b.parent]:null)S.unshift(b.id);return S},[i]),[a,p]=H.useState("specs"),[_,l]=H.useState(()=>o?[o.id]:[]),[g,v]=H.useState(null),w=_.filter(C=>i[C]),m=w[w.length-1]||(o==null?void 0:o.id),h=m?i[m]:null,f=C=>l(S=>[...S.filter(b=>i[b]),C]),d=C=>{l(n(C)),v(null),p("specs")},u=a==="specs"?w.length>1:!!g,y=()=>{a==="specs"?l(C=>C.slice(0,-1)):v(null)};return E.jsxs("div",{className:"m-app",children:[E.jsxs("header",{className:"m-topbar",children:[u?E.jsx("button",{className:"m-back",onClick:y,"aria-label":s("mobile.back"),children:"‹"}):E.jsx("span",{className:"m-back ghost","aria-hidden":"true"}),E.jsx("span",{className:"m-brand",children:r||"SpexCode"})]}),E.jsx("main",{className:"m-main",children:a==="specs"?E.jsxs("div",{className:"m-specs",children:[E.jsx("nav",{className:"m-crumbs",children:w.map((C,S)=>E.jsxs("span",{className:"m-crumb",children:[S>0&&E.jsx("span",{className:"m-crumb-sep",children:"›"}),E.jsx("button",{className:S===w.length-1?"m-crumb-btn cur":"m-crumb-btn",onClick:()=>l(w.slice(0,S+1)),children:i[C].title})]},C))}),h&&E.jsx(tL,{node:h,childrenOf:c,sessions:t,onOpenChild:f},h.id)]}):E.jsx(rL,{sessions:t,openId:g,setOpenId:v,byId:i,goToNode:d})}),E.jsxs("nav",{className:"m-tabbar",children:[E.jsxs("button",{className:a==="specs"?"m-tabbar-btn on":"m-tabbar-btn",onClick:()=>p("specs"),children:[E.jsx("span",{className:"m-tabbar-ico",children:"❯_"}),s("mobile.specsTab")]}),E.jsxs("button",{className:a==="sessions"?"m-tabbar-btn on":"m-tabbar-btn",onClick:()=>p("sessions"),children:[E.jsx("span",{className:"m-tabbar-ico",children:"◐"}),s("mobile.sessionsTab"),t.length>0&&E.jsx("span",{className:"m-tabbar-badge",children:t.length})]})]})]})}const gp="(max-width: 640px)";function iL(){const[e,t]=H.useState(()=>typeof window<"u"&&window.matchMedia(gp).matches);return H.useEffect(()=>{const r=window.matchMedia(gp),s=()=>t(r.matches);return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[]),e}function _p(){let e=0,t=null,r=null,s=null;return function(o,c){if(!o)return;const n=s!=null&&Math.abs(o.scrollTop-s)>1;(o!==r||n)&&(r=o,t=null,s=null);const a=o.scrollHeight-o.clientHeight,p=t??o.scrollTop;t=Math.max(0,Math.min(a,p+c)),cancelAnimationFrame(e);const _=()=>{if(s!=null&&Math.abs(o.scrollTop-s)>1){cancelAnimationFrame(e),t=null,s=null;return}const l=t-o.scrollTop;if(Math.abs(l)<.5){o.scrollTop=t,s=o.scrollTop;return}o.scrollTop+=l*.2,s=o.scrollTop,e=requestAnimationFrame(_)};e=requestAnimationFrame(_)}}const nL={spec:d2},oL=220,aL=46,mp=e=>Math.max(.4,Math.min(1.6,e)),lu={nn:e=>`@new under @${e}: `,dd:e=>`@delete @${e}: `},Xv=Object.keys(lu),lL=new Set(Xv.map(e=>e[0]));function cL({specs:e,sessions:t,reload:r}){const[s,i]=H.useState(()=>{var re;return(re=e.find(de=>!de.parent))==null?void 0:re.id}),[o,c]=H.useState(!1),[n,a]=H.useState("spec"),[p,_]=H.useState(!1),[l,g]=H.useState(!1),[v,w]=H.useState(!1),[m,h]=H.useState(!1),[f,d]=H.useState("new"),[u,y]=H.useState(null),[C,S]=H.useState(null),{getViewport:b,setViewport:x}=$n(),k=Me(),M=H.useRef(null),D=H.useRef(0),R=H.useRef({buf:"",timer:0}),[T,A]=H.useState(!1),j=H.useRef(!1);j.current=T;const $=H.useRef({x:-1,y:-1}),F=H.useMemo(()=>_p(),[]),B=H.useMemo(()=>_p(),[]),L=H.useMemo(()=>Object.fromEntries(e.map(re=>[re.id,re])),[e]),P=L[s]||e.find(re=>!re.parent)||e[0],O=H.useMemo(()=>{const re=new Set;for(let de=P;de;de=de.parent?L[de.parent]:null)re.add(de.id);return re},[P,L]),I=H.useMemo(()=>X2(e,O),[e,O]),W=H.useMemo(()=>e.filter(re=>I[re.id]).map(re=>({...re,...I[re.id]})),[e,I]),K=H.useMemo(()=>Object.fromEntries(W.map(re=>[re.id,re])),[W]),q=K[P.id],Z=H.useMemo(()=>{const re={};return e.forEach(de=>{de.parent&&(re[de.parent]=(re[de.parent]||0)+1)}),re},[e]),z=H.useMemo(()=>e.filter(re=>{var de;return(de=re.overlays)==null?void 0:de.length}),[e]),N=H.useMemo(()=>u?t.find(re=>re.source===u):null,[t,u]),U=H.useMemo(()=>u?e.filter(re=>(re.overlays||[]).some(de=>de.source===u)):[],[e,u]),G=H.useMemo(()=>u?U:z,[u,U,z]),Q=H.useCallback(re=>re?t.filter(de=>{var fe;return(fe=de.ops)==null?void 0:fe.some(ke=>ke.nodeId===re.id)}):[],[t]),Y=H.useCallback(()=>_(!0),[]),ee=H.useCallback(()=>{a("eval"),c(!0)},[]),te=H.useCallback(re=>{d(re),_(!0)},[]),le=H.useCallback(re=>{d("new"),S(re),_(!0)},[]),pe=H.useCallback(re=>{re.kind==="session"?te(re.target):i(re.target)},[te]),ne=H.useMemo(()=>W.filter(re=>re.parent===q.id),[W,q]),Te=q.parent?K[q.parent]:null,We=H.useMemo(()=>ne.length?ne.reduce((re,de)=>Math.abs(de.y-q.y)<Math.abs(re.y-q.y)?de:re):null,[ne,q]),me=H.useMemo(()=>{if(We)return We;let re=null,de=1/0;for(const fe of W){const ke=fe.x-q.x;if(ke<=0)continue;const Oe=fe.y-q.y,J=(ke/zv)**2+(Oe/Wo)**2;J<de&&(de=J,re=fe)}return re},[We,W,q]),ge=H.useCallback(re=>{let de=null;for(const fe of W){if(fe.id===q.id||fe.x!==q.x)continue;const ke=fe.y-q.y;(re==="down"?ke<=0:ke>=0)||(!de||Math.abs(ke)<Math.abs(de.y-q.y))&&(de=fe)}return de},[W,q]),ye=H.useMemo(()=>ge("down"),[ge]),oe=H.useMemo(()=>ge("up"),[ge]),we=H.useMemo(()=>W.map(re=>{const de=re.id===s||re.id===q.parent||re.parent===s||re.parent===q.parent;let fe;u&&U.length?fe=(re.overlays||[]).some(Pe=>Pe.source===u)?"ov-hot":"ov-dim":fe=de?void 0:"is-far";const Oe=Q(re).map(Pe=>({id:Pe.id,status:Pe.status,node:Pe.node})),J=Z[re.id]||0,Ge={editors:Oe,collapsed:J>0&&!O.has(re.id),childCount:J};return{id:re.id,type:"spec",position:{x:re.x,y:re.y},data:{...re,...Ge},draggable:!1,selected:re.id===s,className:fe}}),[s,q.parent,u,U,W,Q,Z,O]),xe=H.useMemo(()=>{const re=W.filter(fe=>fe.parent).map(fe=>{const ke=fe.id===s||fe.parent===s;return{id:`${fe.parent}-${fe.id}`,source:fe.parent,target:fe.id,type:"smoothstep",style:{stroke:ke?"var(--blue)":"var(--line)",strokeWidth:ke?2:1},zIndex:ke?1:0}}),de=[];for(const fe of W){const ke=(fe.overlays||[]).find(J=>J.op==="moved"&&J.toParent&&K[J.toParent]);if(!ke)continue;const Oe=qr(ke.seed);de.push({id:`move-${fe.id}-${ke.toParent}`,source:fe.id,target:ke.toParent,type:"smoothstep",animated:!0,zIndex:2,className:"move-edge",style:{stroke:Oe,strokeWidth:1.5,strokeDasharray:"4 4",opacity:.6},markerEnd:{type:Ss.ArrowClosed,color:Oe,width:14,height:14}})}return[...re,...de]},[s,W,K]),ae=H.useCallback((re,de)=>{const fe=b(),ke=performance.now();cancelAnimationFrame(D.current);const Oe=J=>{const Ge=de?Math.min(1,(J-ke)/de):1,Pe=1-Math.pow(1-Ge,3);x({x:fe.x+(re.x-fe.x)*Pe,y:fe.y+(re.y-fe.y)*Pe,zoom:fe.zoom+(re.zoom-fe.zoom)*Pe}),Ge<1&&(D.current=requestAnimationFrame(Oe))};D.current=requestAnimationFrame(Oe)},[b,x]),De=H.useCallback((re,de,fe=300)=>{const ke=M.current;if(!ke)return;const Oe=de??b().zoom;ae({x:ke.clientWidth/2-(re.x+oL/2)*Oe,y:ke.clientHeight/2-(re.y+aL/2)*Oe,zoom:Oe},fe)},[ae,b]),ce=H.useRef(!1);H.useEffect(()=>{if(ce.current)return;ce.current=!0;const re=requestAnimationFrame(()=>De(q,void 0,0));return()=>cancelAnimationFrame(re)},[De,q]);const Be=H.useRef(q);Be.current=q;const Ae=H.useRef(De);Ae.current=De;const be=H.useRef(!1);H.useEffect(()=>{if(!be.current){be.current=!0;return}Ae.current(Be.current)},[s]),H.useEffect(()=>{const re=Eh(q).map(J=>J.key),de=J=>a(Ge=>{const Pe=re.indexOf(Ge);return re[((Pe<0?0:Pe)+J+re.length)%re.length]}),fe=(J,Ge)=>{J&&(Ge.preventDefault(),Ge.stopPropagation(),A(!0),i(J.id))},ke=J=>F(document.querySelector(".ov-body .pane-doc, .ov-body .pane-hist, .ov-body .pane-issues, .ov-body .pane-eval, .ov-body .pane-edit"),J),Oe=J=>{if(!p){if(m){J.key==="Escape"&&(J.preventDefault(),h(!1));return}if(o){if(J.key==="Escape"){J.preventDefault(),c(!1);return}if(J.key==="Tab"){J.preventDefault(),J.stopPropagation(),de(J.shiftKey?-1:1);return}if(J.key==="ArrowLeft"||J.key==="h"){J.preventDefault(),J.stopPropagation(),de(-1);return}if(J.key==="ArrowRight"||J.key==="l"){J.preventDefault(),J.stopPropagation(),de(1);return}if(/^[1-9]$/.test(J.key)&&+J.key<=re.length){J.preventDefault(),J.stopPropagation(),a(re[+J.key-1]);return}if(J.key==="j"||J.key==="k"||J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),J.stopPropagation(),ke(J.key==="j"||J.key==="ArrowDown"?120:-120);return}if(J.key==="Enter"){J.preventDefault(),J.stopPropagation(),c(!1),Y();return}return}if(l){if(J.key==="Escape"||J.key==="?"){J.preventDefault(),g(!1);return}if(J.key==="j"||J.key==="k"||J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),J.stopPropagation(),B(document.querySelector(".legend"),J.key==="j"||J.key==="ArrowDown"?120:-120);return}return}if(ht("board.help",J.key)){J.preventDefault(),g(!0);return}if(v){if(J.key==="Escape"||J.key===","){J.preventDefault(),w(!1);return}return}if(J.key==="Escape"&&u){J.preventDefault(),J.stopPropagation(),y(null);return}if(ht("board.settings",J.key)){J.preventDefault(),w(!0);return}if(ht("board.search",J.key)){J.preventDefault(),J.stopPropagation(),h(!0);return}if(!J.metaKey&&!J.ctrlKey&&!J.altKey&&/^[a-zA-Z]$/.test(J.key)){const Ge=R.current;if(Ge.buf||lL.has(J.key)){clearTimeout(Ge.timer);const Pe=Ge.buf+J.key;if(lu[Pe]){J.preventDefault(),J.stopPropagation(),R.current={buf:"",timer:0},le(lu[Pe](q.id));return}if(Xv.some(Zr=>Zr.startsWith(Pe))){J.preventDefault(),J.stopPropagation(),R.current={buf:Pe,timer:setTimeout(()=>{R.current={buf:"",timer:0}},700)};return}R.current={buf:"",timer:0}}}if(ht("nav.up",J.key))return fe(oe,J);if(ht("nav.down",J.key))return fe(ye,J);if(ht("nav.parent",J.key))return fe(Te,J);if(ht("nav.child",J.key))return fe(me,J);if(ht("board.zoomIn",J.key))J.preventDefault(),A(!0),De(q,mp(b().zoom*1.2),160);else if(ht("board.zoomOut",J.key))J.preventDefault(),A(!0),De(q,mp(b().zoom/1.2),160);else if(ht("board.zoomReset",J.key))J.preventDefault(),A(!0),De(q,.85,200);else if(ht("board.info",J.key))J.preventDefault(),c(!0);else if(ht("board.cycle",J.key)||ht("board.cycleRev",J.key)){if(J.preventDefault(),!G.length)return;A(!0);const Ge=Gv(G,q.id,ht("board.cycleRev",J.key)?-1:1,Pe=>Pe.id);Ge&&i(Ge.id)}else ht("board.enter",J.key)?(J.preventDefault(),Y()):ht("board.fresh",J.key)&&(J.preventDefault(),le(`@${q.id} `))}};return window.addEventListener("keydown",Oe,!0),()=>window.removeEventListener("keydown",Oe,!0)},[o,p,l,v,m,u,q,G,oe,ye,me,Te,De,b,Y,le,F,B]),H.useEffect(()=>{const re=de=>{const fe=$.current,ke=de.clientX!==fe.x||de.clientY!==fe.y;fe.x=de.clientX,fe.y=de.clientY,ke&&j.current&&A(!1)};return window.addEventListener("mousemove",re,!0),()=>window.removeEventListener("mousemove",re,!0)},[]);const ve=H.useCallback((re,de)=>i(de.id),[]),Tt=H.useCallback((re,de)=>{i(de.id),c(!0)},[]),Pt=H.useCallback((re,de=!0)=>{const fe=de&&u===re.source;if(y(fe?null:re.source),fe)return;const ke=new Set((re.ops||[]).map(J=>J.nodeId)),Oe=e.find(J=>ke.has(J.id));Oe&&i(Oe.id)},[u,e]);return E.jsxs("div",{className:T?"app kbd-mode":"app",children:[E.jsxs("div",{className:"graph",ref:M,children:[E.jsx(_v,{nodes:we,edges:xe,nodeTypes:nL,onNodeClick:ve,onNodeDoubleClick:Tt,zoomOnDoubleClick:!1,nodesDraggable:!1,nodesFocusable:!1,disableKeyboardA11y:!0,defaultViewport:{x:0,y:0,zoom:.85},minZoom:.4,maxZoom:1.6,proOptions:{hideAttribution:!0},children:E.jsx(vv,{variant:"dots",color:"#cdc6ad",gap:20,size:1})}),E.jsxs("div",{className:"hud",children:[E.jsx("span",{className:"brand",children:"$ spec-dashboard"}),E.jsx("button",{className:"hud-graph",onClick:()=>{d("graph"),_(!0)},title:k("hud.graphTitle"),children:E.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",children:[E.jsx("circle",{cx:"3.5",cy:"4",r:"1.8"}),E.jsx("circle",{cx:"12.5",cy:"4",r:"1.8"}),E.jsx("circle",{cx:"8",cy:"12.5",r:"1.8"}),E.jsx("path",{d:"M4.9 5.1 L7 11 M11.1 5.1 L9 11 M5 4 H11"})]})}),E.jsx("button",{className:"hud-help",onClick:()=>g(re=>!re),title:k("hud.helpTitle"),children:"?"})]}),E.jsx(A2,{sessions:t,activeId:u,onPick:Pt,onOpenSession:te}),E.jsx(Zk,{specs:e,focusId:s,onJump:i}),N&&E.jsxs("div",{className:"lock-hint",style:{"--ov":qr(N.id)},children:[E.jsxs("span",{className:"lock-hint-lead",children:[E.jsx(Ov,{})," ",Ls(N)]}),U.length?E.jsxs("span",{className:"lock-hint-body",children:[k("lockHint.cycleBefore"),E.jsx("kbd",{children:"o"}),E.jsx("kbd",{children:"O"}),k("lockHint.cycleAfter",{n:U.length})]}):E.jsx("span",{className:"lock-hint-body",children:k("lockHint.empty")}),E.jsx("button",{className:"lock-hint-release",onClick:()=>y(null),title:k("lockHint.releaseTitle"),children:k("lockHint.release")})]}),l&&E.jsx(Ak,{onClose:()=>g(!1)}),v&&E.jsx(Pk,{onClose:()=>w(!1)}),m&&E.jsx(qk,{specs:e,sessions:t,onPick:pe,onClose:()=>h(!1)})]}),E.jsx(R2,{node:q,onOpenEval:ee}),o&&E.jsx(k2,{node:q,pane:n,setPane:a,onClose:()=>c(!1)}),E.jsx(_k,{sessions:t,specs:e,focusNode:q,open:p,sel:f,setSel:d,seed:C,onSeedConsumed:()=>S(null),onClose:()=>_(!1),onPickSession:Pt,reload:r})]})}function uL(){const e=Me(),t=iL(),[r,s]=H.useState(null),i=H.useRef(0),o=H.useCallback(()=>{const c=++i.current;return Y2().then(n=>{c===i.current&&s(n)}).catch(()=>{})},[]);return H.useEffect(()=>{o();const c=setInterval(o,4e3);return()=>clearInterval(c)},[o]),H.useEffect(()=>{const c=np(r);c&&(document.title=`${c} · SpexCode`)},[r==null?void 0:r.project]),H.useEffect(()=>{const c=Z2(Q2(r));if(!c)return;let n=document.querySelector("link[rel~='icon']");n||(n=document.createElement("link"),n.rel="icon",document.head.appendChild(n)),n.setAttribute("href",c)},[r==null?void 0:r.projectIcon]),r?t?E.jsx(sL,{specs:r.nodes,sessions:r.sessions,project:np(r)}):E.jsx(cL,{specs:r.nodes,sessions:r.sessions,reload:o}):E.jsx("div",{className:"loading",children:e("hud.loading")})}Ql.createRoot(document.getElementById("root")).render(E.jsx(Rp.StrictMode,{children:E.jsx(n2,{children:E.jsx(xh,{children:E.jsx(uL,{})})})}));
|