0pflow 0.1.0-dev.582d64d → 0.1.0-dev.67aecec
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/factory.test.js +6 -0
- package/dist/__tests__/factory.test.js.map +1 -1
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +16 -1
- package/dist/agent.js.map +1 -1
- package/dist/cli/app.d.ts.map +1 -1
- package/dist/cli/app.js +4 -0
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/cloud-dev.d.ts +7 -0
- package/dist/cli/cloud-dev.d.ts.map +1 -0
- package/dist/cli/cloud-dev.js +570 -0
- package/dist/cli/cloud-dev.js.map +1 -0
- package/dist/cli/deploy.d.ts +27 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +332 -0
- package/dist/cli/deploy.js.map +1 -0
- package/dist/cli/env.d.ts +3 -1
- package/dist/cli/env.d.ts.map +1 -1
- package/dist/cli/env.js +8 -3
- package/dist/cli/env.js.map +1 -1
- package/dist/cli/index.js +84 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/install.d.ts +4 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +25 -24
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/mcp/lib/scaffolding.d.ts.map +1 -1
- package/dist/cli/mcp/lib/scaffolding.js +36 -21
- package/dist/cli/mcp/lib/scaffolding.js.map +1 -1
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +270 -101
- package/dist/cli/run.js.map +1 -1
- package/dist/connections/cloud-auth.d.ts.map +1 -1
- package/dist/connections/cloud-auth.js +5 -1
- package/dist/connections/cloud-auth.js.map +1 -1
- package/dist/connections/cloud-client.d.ts.map +1 -1
- package/dist/connections/cloud-client.js +10 -3
- package/dist/connections/cloud-client.js.map +1 -1
- package/dist/connections/cloud-integration-provider.d.ts +2 -1
- package/dist/connections/cloud-integration-provider.d.ts.map +1 -1
- package/dist/connections/cloud-integration-provider.js +18 -2
- package/dist/connections/cloud-integration-provider.js.map +1 -1
- package/dist/connections/connection-labels.d.ts +14 -0
- package/dist/connections/connection-labels.d.ts.map +1 -0
- package/dist/connections/connection-labels.js +46 -0
- package/dist/connections/connection-labels.js.map +1 -0
- package/dist/connections/index.d.ts +1 -0
- package/dist/connections/index.d.ts.map +1 -1
- package/dist/connections/index.js +1 -0
- package/dist/connections/index.js.map +1 -1
- package/dist/connections/integration-provider.d.ts +1 -0
- package/dist/connections/integration-provider.d.ts.map +1 -1
- package/dist/connections/local-integration-provider.d.ts +2 -1
- package/dist/connections/local-integration-provider.d.ts.map +1 -1
- package/dist/connections/local-integration-provider.js +20 -3
- package/dist/connections/local-integration-provider.js.map +1 -1
- package/dist/connections/nango-client.d.ts +1 -1
- package/dist/connections/nango-client.d.ts.map +1 -1
- package/dist/connections/nango-client.js +3 -2
- package/dist/connections/nango-client.js.map +1 -1
- package/dist/dev-ui/api.d.ts +2 -0
- package/dist/dev-ui/api.d.ts.map +1 -1
- package/dist/dev-ui/api.js +36 -0
- package/dist/dev-ui/api.js.map +1 -1
- package/dist/dev-ui/deploy-api.d.ts +14 -0
- package/dist/dev-ui/deploy-api.d.ts.map +1 -0
- package/dist/dev-ui/deploy-api.js +112 -0
- package/dist/dev-ui/deploy-api.js.map +1 -0
- package/dist/dev-ui/dev-server.d.ts.map +1 -1
- package/dist/dev-ui/dev-server.js +55 -2
- package/dist/dev-ui/dev-server.js.map +1 -1
- package/dist/dev-ui/watcher.d.ts.map +1 -1
- package/dist/dev-ui/watcher.js +6 -2
- package/dist/dev-ui/watcher.js.map +1 -1
- package/dist/dev-ui-client/assets/index-CNKqwcCH.css +32 -0
- package/dist/dev-ui-client/assets/index-Ccj-QknZ.js +179 -0
- package/dist/dev-ui-client/index.html +2 -2
- package/dist/discover.d.ts.map +1 -1
- package/dist/discover.js +5 -2
- package/dist/discover.js.map +1 -1
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +12 -1
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/registry-gen.d.ts +6 -0
- package/dist/registry-gen.d.ts.map +1 -0
- package/dist/registry-gen.js +146 -0
- package/dist/registry-gen.js.map +1 -0
- package/dist/types.d.ts +12 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -1
- package/dist/types.js.map +1 -1
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +16 -1
- package/dist/workflow.js.map +1 -1
- package/package.json +3 -1
- package/templates/app/.dockerignore +6 -0
- package/templates/app/Dockerfile +34 -0
- package/templates/app/generated/registry.ts +8 -0
- package/templates/app/next.config.js +4 -1
- package/templates/app/package.json +2 -0
- package/templates/app/src/lib/pflow.ts +5 -6
- package/dist/dev-ui-client/assets/index-C-LxzUII.css +0 -32
- package/dist/dev-ui-client/assets/index-aAIwXl4O.js +0 -127
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function i(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=i(o);fetch(o.href,a)}})();function nh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hd={exports:{}},Hl={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and 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 ly;function RE(){if(ly)return Hl;ly=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(r,o,a){var c=null;if(a!==void 0&&(c=""+a),o.key!==void 0&&(c=""+o.key),"key"in o){a={};for(var h in o)h!=="key"&&(a[h]=o[h])}else a=o;return o=a.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:a}}return Hl.Fragment=t,Hl.jsx=i,Hl.jsxs=i,Hl}var ay;function BE(){return ay||(ay=1,Hd.exports=RE()),Hd.exports}var w=BE(),jd={exports:{}},De={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and 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 cy;function LE(){if(cy)return De;cy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function y(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,k={};function C(L,Y,A){this.props=L,this.context=Y,this.refs=k,this.updater=A||S}C.prototype.isReactComponent={},C.prototype.setState=function(L,Y){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,Y,"setState")},C.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function z(){}z.prototype=C.prototype;function E(L,Y,A){this.props=L,this.context=Y,this.refs=k,this.updater=A||S}var T=E.prototype=new z;T.constructor=E,b(T,C.prototype),T.isPureReactComponent=!0;var P=Array.isArray;function R(){}var U={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function G(L,Y,A){var ee=A.ref;return{$$typeof:e,type:L,key:Y,ref:ee!==void 0?ee:null,props:A}}function ne(L,Y){return G(L.type,Y,L.props)}function V(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function I(L){var Y={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(A){return Y[A]})}var F=/\/+/g;function B(L,Y){return typeof L=="object"&&L!==null&&L.key!=null?I(""+L.key):Y.toString(36)}function O(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(R,R):(L.status="pending",L.then(function(Y){L.status==="pending"&&(L.status="fulfilled",L.value=Y)},function(Y){L.status==="pending"&&(L.status="rejected",L.reason=Y)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function M(L,Y,A,ee,ce){var le=typeof L;(le==="undefined"||le==="boolean")&&(L=null);var fe=!1;if(L===null)fe=!0;else switch(le){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(L.$$typeof){case e:case t:fe=!0;break;case m:return fe=L._init,M(fe(L._payload),Y,A,ee,ce)}}if(fe)return ce=ce(L),fe=ee===""?"."+B(L,0):ee,P(ce)?(A="",fe!=null&&(A=fe.replace(F,"$&/")+"/"),M(ce,Y,A,"",function(Ce){return Ce})):ce!=null&&(V(ce)&&(ce=ne(ce,A+(ce.key==null||L&&L.key===ce.key?"":(""+ce.key).replace(F,"$&/")+"/")+fe)),Y.push(ce)),1;fe=0;var he=ee===""?".":ee+":";if(P(L))for(var pe=0;pe<L.length;pe++)ee=L[pe],le=he+B(ee,pe),fe+=M(ee,Y,A,le,ce);else if(pe=y(L),typeof pe=="function")for(L=pe.call(L),pe=0;!(ee=L.next()).done;)ee=ee.value,le=he+B(ee,pe++),fe+=M(ee,Y,A,le,ce);else if(le==="object"){if(typeof L.then=="function")return M(O(L),Y,A,ee,ce);throw Y=String(L),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return fe}function j(L,Y,A){if(L==null)return L;var ee=[],ce=0;return M(L,ee,"","",function(le){return Y.call(A,le,ce++)}),ee}function H(L){if(L._status===-1){var Y=L._result;Y=Y(),Y.then(function(A){(L._status===0||L._status===-1)&&(L._status=1,L._result=A)},function(A){(L._status===0||L._status===-1)&&(L._status=2,L._result=A)}),L._status===-1&&(L._status=0,L._result=Y)}if(L._status===1)return L._result.default;throw L._result}var $=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},N={map:j,forEach:function(L,Y,A){j(L,function(){Y.apply(this,arguments)},A)},count:function(L){var Y=0;return j(L,function(){Y++}),Y},toArray:function(L){return j(L,function(Y){return Y})||[]},only:function(L){if(!V(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return De.Activity=g,De.Children=N,De.Component=C,De.Fragment=i,De.Profiler=o,De.PureComponent=E,De.StrictMode=r,De.Suspense=d,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,De.__COMPILER_RUNTIME={__proto__:null,c:function(L){return U.H.useMemoCache(L)}},De.cache=function(L){return function(){return L.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(L,Y,A){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ee=b({},L.props),ce=L.key;if(Y!=null)for(le in Y.key!==void 0&&(ce=""+Y.key),Y)!X.call(Y,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&Y.ref===void 0||(ee[le]=Y[le]);var le=arguments.length-2;if(le===1)ee.children=A;else if(1<le){for(var fe=Array(le),he=0;he<le;he++)fe[he]=arguments[he+2];ee.children=fe}return G(L.type,ce,ee)},De.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:a,_context:L},L},De.createElement=function(L,Y,A){var ee,ce={},le=null;if(Y!=null)for(ee in Y.key!==void 0&&(le=""+Y.key),Y)X.call(Y,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ce[ee]=Y[ee]);var fe=arguments.length-2;if(fe===1)ce.children=A;else if(1<fe){for(var he=Array(fe),pe=0;pe<fe;pe++)he[pe]=arguments[pe+2];ce.children=he}if(L&&L.defaultProps)for(ee in fe=L.defaultProps,fe)ce[ee]===void 0&&(ce[ee]=fe[ee]);return G(L,le,ce)},De.createRef=function(){return{current:null}},De.forwardRef=function(L){return{$$typeof:h,render:L}},De.isValidElement=V,De.lazy=function(L){return{$$typeof:m,_payload:{_status:-1,_result:L},_init:H}},De.memo=function(L,Y){return{$$typeof:f,type:L,compare:Y===void 0?null:Y}},De.startTransition=function(L){var Y=U.T,A={};U.T=A;try{var ee=L(),ce=U.S;ce!==null&&ce(A,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(R,$)}catch(le){$(le)}finally{Y!==null&&A.types!==null&&(Y.types=A.types),U.T=Y}},De.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},De.use=function(L){return U.H.use(L)},De.useActionState=function(L,Y,A){return U.H.useActionState(L,Y,A)},De.useCallback=function(L,Y){return U.H.useCallback(L,Y)},De.useContext=function(L){return U.H.useContext(L)},De.useDebugValue=function(){},De.useDeferredValue=function(L,Y){return U.H.useDeferredValue(L,Y)},De.useEffect=function(L,Y){return U.H.useEffect(L,Y)},De.useEffectEvent=function(L){return U.H.useEffectEvent(L)},De.useId=function(){return U.H.useId()},De.useImperativeHandle=function(L,Y,A){return U.H.useImperativeHandle(L,Y,A)},De.useInsertionEffect=function(L,Y){return U.H.useInsertionEffect(L,Y)},De.useLayoutEffect=function(L,Y){return U.H.useLayoutEffect(L,Y)},De.useMemo=function(L,Y){return U.H.useMemo(L,Y)},De.useOptimistic=function(L,Y){return U.H.useOptimistic(L,Y)},De.useReducer=function(L,Y,A){return U.H.useReducer(L,Y,A)},De.useRef=function(L){return U.H.useRef(L)},De.useState=function(L){return U.H.useState(L)},De.useSyncExternalStore=function(L,Y,A){return U.H.useSyncExternalStore(L,Y,A)},De.useTransition=function(){return U.H.useTransition()},De.version="19.2.4",De}var uy;function Ea(){return uy||(uy=1,jd.exports=LE()),jd.exports}var q=Ea();const zE=nh(q);var Pd={exports:{}},jl={},Id={exports:{}},Ud={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var hy;function OE(){return hy||(hy=1,(function(e){function t(M,j){var H=M.length;M.push(j);e:for(;0<H;){var $=H-1>>>1,N=M[$];if(0<o(N,j))M[$]=j,M[H]=N,H=$;else break e}}function i(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var j=M[0],H=M.pop();if(H!==j){M[0]=H;e:for(var $=0,N=M.length,L=N>>>1;$<L;){var Y=2*($+1)-1,A=M[Y],ee=Y+1,ce=M[ee];if(0>o(A,H))ee<N&&0>o(ce,A)?(M[$]=ce,M[ee]=H,$=ee):(M[$]=A,M[Y]=H,$=Y);else if(ee<N&&0>o(ce,H))M[$]=ce,M[ee]=H,$=ee;else break e}}return j}function o(M,j){var H=M.sortIndex-j.sortIndex;return H!==0?H:M.id-j.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,h=c.now();e.unstable_now=function(){return c.now()-h}}var d=[],f=[],m=1,g=null,v=3,y=!1,S=!1,b=!1,k=!1,C=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function T(M){for(var j=i(f);j!==null;){if(j.callback===null)r(f);else if(j.startTime<=M)r(f),j.sortIndex=j.expirationTime,t(d,j);else break;j=i(f)}}function P(M){if(b=!1,T(M),!S)if(i(d)!==null)S=!0,R||(R=!0,I());else{var j=i(f);j!==null&&O(P,j.startTime-M)}}var R=!1,U=-1,X=5,G=-1;function ne(){return k?!0:!(e.unstable_now()-G<X)}function V(){if(k=!1,R){var M=e.unstable_now();G=M;var j=!0;try{e:{S=!1,b&&(b=!1,z(U),U=-1),y=!0;var H=v;try{t:{for(T(M),g=i(d);g!==null&&!(g.expirationTime>M&&ne());){var $=g.callback;if(typeof $=="function"){g.callback=null,v=g.priorityLevel;var N=$(g.expirationTime<=M);if(M=e.unstable_now(),typeof N=="function"){g.callback=N,T(M),j=!0;break t}g===i(d)&&r(d),T(M)}else r(d);g=i(d)}if(g!==null)j=!0;else{var L=i(f);L!==null&&O(P,L.startTime-M),j=!1}}break e}finally{g=null,v=H,y=!1}j=void 0}}finally{j?I():R=!1}}}var I;if(typeof E=="function")I=function(){E(V)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,B=F.port2;F.port1.onmessage=V,I=function(){B.postMessage(null)}}else I=function(){C(V,0)};function O(M,j){U=C(function(){M(e.unstable_now())},j)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var j=3;break;default:j=v}var H=v;v=j;try{return M()}finally{v=H}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(M,j){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var H=v;v=M;try{return j()}finally{v=H}},e.unstable_scheduleCallback=function(M,j,H){var $=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?$+H:$):H=$,M){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=H+N,M={id:m++,callback:j,priorityLevel:M,startTime:H,expirationTime:N,sortIndex:-1},H>$?(M.sortIndex=H,t(f,M),i(d)===null&&M===i(f)&&(b?(z(U),U=-1):b=!0,O(P,H-$))):(M.sortIndex=N,t(d,M),S||y||(S=!0,R||(R=!0,I()))),M},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(M){var j=v;return function(){var H=v;v=j;try{return M.apply(this,arguments)}finally{v=H}}}})(Ud)),Ud}var fy;function HE(){return fy||(fy=1,Id.exports=OE()),Id.exports}var qd={exports:{}},ii={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and 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 dy;function jE(){if(dy)return ii;dy=1;var e=Ea();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var r={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function a(d,f,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:d,containerInfo:f,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return ii.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ii.createPortal=function(d,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,m)},ii.flushSync=function(d){var f=c.T,m=r.p;try{if(c.T=null,r.p=2,d)return d()}finally{c.T=f,r.p=m,r.d.f()}},ii.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},ii.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},ii.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var m=f.as,g=h(m,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:y}):m==="script"&&r.d.X(d,{crossOrigin:g,integrity:v,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},ii.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=h(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},ii.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,g=h(m,f.crossOrigin);r.d.L(d,m,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},ii.preloadModule=function(d,f){if(typeof d=="string")if(f){var m=h(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},ii.requestFormReset=function(d){r.d.r(d)},ii.unstable_batchedUpdates=function(d,f){return d(f)},ii.useFormState=function(d,f,m){return c.H.useFormState(d,f,m)},ii.useFormStatus=function(){return c.H.useHostTransitionStatus()},ii.version="19.2.4",ii}var py;function fb(){if(py)return qd.exports;py=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qd.exports=jE(),qd.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var gy;function PE(){if(gy)return jl;gy=1;var e=HE(),t=Ea(),i=fb();function r(n){var s="https://react.dev/errors/"+n;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function a(n){var s=n,l=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(l=s.return),n=s.return;while(n)}return s.tag===3?l:null}function c(n){if(n.tag===13){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function h(n){if(n.tag===31){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function d(n){if(a(n)!==n)throw Error(r(188))}function f(n){var s=n.alternate;if(!s){if(s=a(n),s===null)throw Error(r(188));return s!==n?null:n}for(var l=n,u=s;;){var p=l.return;if(p===null)break;var _=p.alternate;if(_===null){if(u=p.return,u!==null){l=u;continue}break}if(p.child===_.child){for(_=p.child;_;){if(_===l)return d(p),n;if(_===u)return d(p),s;_=_.sibling}throw Error(r(188))}if(l.return!==u.return)l=p,u=_;else{for(var x=!1,D=p.child;D;){if(D===l){x=!0,l=p,u=_;break}if(D===u){x=!0,u=p,l=_;break}D=D.sibling}if(!x){for(D=_.child;D;){if(D===l){x=!0,l=_,u=p;break}if(D===u){x=!0,u=_,l=p;break}D=D.sibling}if(!x)throw Error(r(189))}}if(l.alternate!==u)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:s}function m(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n;for(n=n.child;n!==null;){if(s=m(n),s!==null)return s;n=n.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),E=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function I(n){return n===null||typeof n!="object"?null:(n=V&&n[V]||n["@@iterator"],typeof n=="function"?n:null)}var F=Symbol.for("react.client.reference");function B(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===F?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case b:return"Fragment";case C:return"Profiler";case k:return"StrictMode";case P:return"Suspense";case R:return"SuspenseList";case G:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case S:return"Portal";case E:return n.displayName||"Context";case z:return(n._context.displayName||"Context")+".Consumer";case T:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case U:return s=n.displayName||null,s!==null?s:B(n.type)||"Memo";case X:s=n._payload,n=n._init;try{return B(n(s))}catch{}}return null}var O=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},$=[],N=-1;function L(n){return{current:n}}function Y(n){0>N||(n.current=$[N],$[N]=null,N--)}function A(n,s){N++,$[N]=n.current,n.current=s}var ee=L(null),ce=L(null),le=L(null),fe=L(null);function he(n,s){switch(A(le,s),A(ce,n),A(ee,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?Av(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=Av(s),n=Dv(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Y(ee),A(ee,n)}function pe(){Y(ee),Y(ce),Y(le)}function Ce(n){n.memoizedState!==null&&A(fe,n);var s=ee.current,l=Dv(s,n.type);s!==l&&(A(ce,n),A(ee,l))}function xe(n){ce.current===n&&(Y(ee),Y(ce)),fe.current===n&&(Y(fe),Bl._currentValue=H)}var Se,me;function Ae(n){if(Se===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);Se=s&&s[1]||"",me=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Se+n+me}var Ye=!1;function ze(n,s){if(!n||Ye)return"";Ye=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(s){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(ie){var te=ie}Reflect.construct(n,[],ae)}else{try{ae.call()}catch(ie){te=ie}n.call(ae.prototype)}}else{try{throw Error()}catch(ie){te=ie}(ae=n())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=u.DetermineComponentFrameRoot(),x=_[0],D=_[1];if(x&&D){var W=x.split(`
|
|
44
|
+
`),J=D.split(`
|
|
45
|
+
`);for(p=u=0;u<W.length&&!W[u].includes("DetermineComponentFrameRoot");)u++;for(;p<J.length&&!J[p].includes("DetermineComponentFrameRoot");)p++;if(u===W.length||p===J.length)for(u=W.length-1,p=J.length-1;1<=u&&0<=p&&W[u]!==J[p];)p--;for(;1<=u&&0<=p;u--,p--)if(W[u]!==J[p]){if(u!==1||p!==1)do if(u--,p--,0>p||W[u]!==J[p]){var se=`
|
|
46
|
+
`+W[u].replace(" at new "," at ");return n.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",n.displayName)),se}while(1<=u&&0<=p);break}}}finally{Ye=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?Ae(l):""}function St(n,s){switch(n.tag){case 26:case 27:case 5:return Ae(n.type);case 16:return Ae("Lazy");case 13:return n.child!==s&&s!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return ze(n.type,!1);case 11:return ze(n.type.render,!1);case 1:return ze(n.type,!0);case 31:return Ae("Activity");default:return""}}function Ci(n){try{var s="",l=null;do s+=St(n,l),l=n,n=n.return;while(n);return s}catch(u){return`
|
|
47
|
+
Error generating stack: `+u.message+`
|
|
48
|
+
`+u.stack}}var Jt=Object.prototype.hasOwnProperty,ui=e.unstable_scheduleCallback,Qi=e.unstable_cancelCallback,An=e.unstable_shouldYield,Dn=e.unstable_requestPaint,Lt=e.unstable_now,ar=e.unstable_getCurrentPriorityLevel,re=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,Oe=e.unstable_LowPriority,Fe=e.unstable_IdlePriority,si=e.log,Ji=e.unstable_setDisableYieldValue,Yt=null,bt=null;function ei(n){if(typeof si=="function"&&Ji(n),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Yt,n)}catch{}}var Ze=Math.clz32?Math.clz32:Ch,hn=Math.log,Ei=Math.LN2;function Ch(n){return n>>>=0,n===0?32:31-(hn(n)/Ei|0)|0}var Ls=256,zs=262144,Os=4194304;function Rn(n){var s=n&42;if(s!==0)return s;switch(n&-n){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Hs(n,s,l){var u=n.pendingLanes;if(u===0)return 0;var p=0,_=n.suspendedLanes,x=n.pingedLanes;n=n.warmLanes;var D=u&134217727;return D!==0?(u=D&~_,u!==0?p=Rn(u):(x&=D,x!==0?p=Rn(x):l||(l=D&~n,l!==0&&(p=Rn(l))))):(D=u&~_,D!==0?p=Rn(D):x!==0?p=Rn(x):l||(l=u&~n,l!==0&&(p=Rn(l)))),p===0?0:s!==0&&s!==p&&(s&_)===0&&(_=p&-p,l=s&-s,_>=l||_===32&&(l&4194048)!==0)?s:p}function Gr(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}function Eh(n,s){switch(n){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32: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 s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ja(){var n=Os;return Os<<=1,(Os&62914560)===0&&(Os=4194304),n}function Fo(n){for(var s=[],l=0;31>l;l++)s.push(n);return s}function Zr(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function kh(n,s,l,u,p,_){var x=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var D=n.entanglements,W=n.expirationTimes,J=n.hiddenUpdates;for(l=x&~l;0<l;){var se=31-Ze(l),ae=1<<se;D[se]=0,W[se]=-1;var te=J[se];if(te!==null)for(J[se]=null,se=0;se<te.length;se++){var ie=te[se];ie!==null&&(ie.lane&=-536870913)}l&=~ae}u!==0&&Pa(n,u,0),_!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=_&~(x&~s))}function Pa(n,s,l){n.pendingLanes|=s,n.suspendedLanes&=~s;var u=31-Ze(s);n.entangledLanes|=s,n.entanglements[u]=n.entanglements[u]|1073741824|l&261930}function Ia(n,s){var l=n.entangledLanes|=s;for(n=n.entanglements;l;){var u=31-Ze(l),p=1<<u;p&s|n[u]&s&&(n[u]|=s),l&=~p}}function Ua(n,s){var l=s&-s;return l=(l&42)!==0?1:$o(l),(l&(n.suspendedLanes|s))!==0?0:l}function $o(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Yo(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function qa(){var n=j.p;return n!==0?n:(n=window.event,n===void 0?32:ey(n.type))}function Va(n,s){var l=j.p;try{return j.p=n,s()}finally{j.p=l}}var fn=Math.random().toString(36).slice(2),zt="__reactFiber$"+fn,ti="__reactProps$"+fn,Bn="__reactContainer$"+fn,js="__reactEvents$"+fn,Fa="__reactListeners$"+fn,Mh="__reactHandles$"+fn,$a="__reactResources$"+fn,Qr="__reactMarker$"+fn;function Wo(n){delete n[zt],delete n[ti],delete n[js],delete n[Fa],delete n[Mh]}function cr(n){var s=n[zt];if(s)return s;for(var l=n.parentNode;l;){if(s=l[Bn]||l[zt]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(n=jv(n);n!==null;){if(l=n[zt])return l;n=jv(n)}return s}n=l,l=n.parentNode}return null}function ur(n){if(n=n[zt]||n[Bn]){var s=n.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return n}return null}function hr(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n.stateNode;throw Error(r(33))}function fr(n){var s=n[$a];return s||(s=n[$a]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Et(n){n[Qr]=!0}var Ya=new Set,Wa={};function Ln(n,s){dr(n,s),dr(n+"Capture",s)}function dr(n,s){for(Wa[n]=s,n=0;n<s.length;n++)Ya.add(s[n])}var Th=RegExp("^[: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]*$"),Xo={},Xa={};function Nh(n){return Jt.call(Xa,n)?!0:Jt.call(Xo,n)?!1:Th.test(n)?Xa[n]=!0:(Xo[n]=!0,!1)}function Ps(n,s,l){if(Nh(s))if(l===null)n.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(s);return;case"boolean":var u=s.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(s);return}}n.setAttribute(s,""+l)}}function Is(n,s,l){if(l===null)n.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttribute(s,""+l)}}function en(n,s,l,u){if(u===null)n.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(s,l,""+u)}}function hi(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ka(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ah(n,s,l){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,s);if(!n.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,_=u.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return p.call(this)},set:function(x){l=""+x,_.call(this,x)}}),Object.defineProperty(n,s,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(x){l=""+x},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function pr(n){if(!n._valueTracker){var s=Ka(n)?"checked":"value";n._valueTracker=Ah(n,s,""+n[s])}}function Ga(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var l=s.getValue(),u="";return n&&(u=Ka(n)?n.checked?"true":"false":n.value),n=u,n!==l?(s.setValue(n),!0):!1}function Jr(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Dh=/[\n"\\]/g;function fi(n){return n.replace(Dh,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function es(n,s,l,u,p,_,x,D){n.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?n.type=x:n.removeAttribute("type"),s!=null?x==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+hi(s)):n.value!==""+hi(s)&&(n.value=""+hi(s)):x!=="submit"&&x!=="reset"||n.removeAttribute("value"),s!=null?Ko(n,x,hi(s)):l!=null?Ko(n,x,hi(l)):u!=null&&n.removeAttribute("value"),p==null&&_!=null&&(n.defaultChecked=!!_),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?n.name=""+hi(D):n.removeAttribute("name")}function Za(n,s,l,u,p,_,x,D){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(n.type=_),s!=null||l!=null){if(!(_!=="submit"&&_!=="reset"||s!=null)){pr(n);return}l=l!=null?""+hi(l):"",s=s!=null?""+hi(s):l,D||s===n.value||(n.value=s),n.defaultValue=s}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=D?n.checked:!!u,n.defaultChecked=!!u,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.name=x),pr(n)}function Ko(n,s,l){s==="number"&&Jr(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function zn(n,s,l,u){if(n=n.options,s){s={};for(var p=0;p<l.length;p++)s["$"+l[p]]=!0;for(l=0;l<n.length;l++)p=s.hasOwnProperty("$"+n[l].value),n[l].selected!==p&&(n[l].selected=p),p&&u&&(n[l].defaultSelected=!0)}else{for(l=""+hi(l),s=null,p=0;p<n.length;p++){if(n[p].value===l){n[p].selected=!0,u&&(n[p].defaultSelected=!0);return}s!==null||n[p].disabled||(s=n[p])}s!==null&&(s.selected=!0)}}function Em(n,s,l){if(s!=null&&(s=""+hi(s),s!==n.value&&(n.value=s),l==null)){n.defaultValue!==s&&(n.defaultValue=s);return}n.defaultValue=l!=null?""+hi(l):""}function km(n,s,l,u){if(s==null){if(u!=null){if(l!=null)throw Error(r(92));if(O(u)){if(1<u.length)throw Error(r(93));u=u[0]}l=u}l==null&&(l=""),s=l}l=hi(s),n.defaultValue=l,u=n.textContent,u===l&&u!==""&&u!==null&&(n.value=u),pr(n)}function Us(n,s){if(s){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=s;return}}n.textContent=s}var MC=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Mm(n,s,l){var u=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="":u?n.setProperty(s,l):typeof l!="number"||l===0||MC.has(s)?s==="float"?n.cssFloat=l:n[s]=(""+l).trim():n[s]=l+"px"}function Tm(n,s,l){if(s!=null&&typeof s!="object")throw Error(r(62));if(n=n.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||s!=null&&s.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var p in s)u=s[p],s.hasOwnProperty(p)&&l[p]!==u&&Mm(n,p,u)}else for(var _ in s)s.hasOwnProperty(_)&&Mm(n,_,s[_])}function Rh(n){if(n.indexOf("-")===-1)return!1;switch(n){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 TC=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),NC=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qa(n){return NC.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function On(){}var Bh=null;function Lh(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var qs=null,Vs=null;function Nm(n){var s=ur(n);if(s&&(n=s.stateNode)){var l=n[ti]||null;e:switch(n=s.stateNode,s.type){case"input":if(es(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+fi(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var u=l[s];if(u!==n&&u.form===n.form){var p=u[ti]||null;if(!p)throw Error(r(90));es(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<l.length;s++)u=l[s],u.form===n.form&&Ga(u)}break e;case"textarea":Em(n,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&zn(n,!!l.multiple,s,!1)}}}var zh=!1;function Am(n,s,l){if(zh)return n(s,l);zh=!0;try{var u=n(s);return u}finally{if(zh=!1,(qs!==null||Vs!==null)&&(Pc(),qs&&(s=qs,n=Vs,Vs=qs=null,Nm(s),n)))for(s=0;s<n.length;s++)Nm(n[s])}}function Go(n,s){var l=n.stateNode;if(l===null)return null;var u=l[ti]||null;if(u===null)return null;l=u[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,s,typeof l));return l}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oh=!1;if(Hn)try{var Zo={};Object.defineProperty(Zo,"passive",{get:function(){Oh=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{Oh=!1}var gr=null,Hh=null,Ja=null;function Dm(){if(Ja)return Ja;var n,s=Hh,l=s.length,u,p="value"in gr?gr.value:gr.textContent,_=p.length;for(n=0;n<l&&s[n]===p[n];n++);var x=l-n;for(u=1;u<=x&&s[l-u]===p[_-u];u++);return Ja=p.slice(n,1<u?1-u:void 0)}function ec(n){var s=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&s===13&&(n=13)):n=s,n===10&&(n=13),32<=n||n===13?n:0}function tc(){return!0}function Rm(){return!1}function di(n){function s(l,u,p,_,x){this._reactName=l,this._targetInst=p,this.type=u,this.nativeEvent=_,this.target=x,this.currentTarget=null;for(var D in n)n.hasOwnProperty(D)&&(l=n[D],this[D]=l?l(_):_[D]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?tc:Rm,this.isPropagationStopped=Rm,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=tc)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=tc)},persist:function(){},isPersistent:tc}),s}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ic=di(ts),Qo=g({},ts,{view:0,detail:0}),AC=di(Qo),jh,Ph,Jo,nc=g({},Qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uh,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Jo&&(Jo&&n.type==="mousemove"?(jh=n.screenX-Jo.screenX,Ph=n.screenY-Jo.screenY):Ph=jh=0,Jo=n),jh)},movementY:function(n){return"movementY"in n?n.movementY:Ph}}),Bm=di(nc),DC=g({},nc,{dataTransfer:0}),RC=di(DC),BC=g({},Qo,{relatedTarget:0}),Ih=di(BC),LC=g({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),zC=di(LC),OC=g({},ts,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),HC=di(OC),jC=g({},ts,{data:0}),Lm=di(jC),PC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},IC={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"},UC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qC(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=UC[n])?!!s[n]:!1}function Uh(){return qC}var VC=g({},Qo,{key:function(n){if(n.key){var s=PC[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=ec(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?IC[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uh,charCode:function(n){return n.type==="keypress"?ec(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?ec(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),FC=di(VC),$C=g({},nc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zm=di($C),YC=g({},Qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uh}),WC=di(YC),XC=g({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),KC=di(XC),GC=g({},nc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),ZC=di(GC),QC=g({},ts,{newState:0,oldState:0}),JC=di(QC),e2=[9,13,27,32],qh=Hn&&"CompositionEvent"in window,el=null;Hn&&"documentMode"in document&&(el=document.documentMode);var t2=Hn&&"TextEvent"in window&&!el,Om=Hn&&(!qh||el&&8<el&&11>=el),Hm=" ",jm=!1;function Pm(n,s){switch(n){case"keyup":return e2.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Im(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Fs=!1;function i2(n,s){switch(n){case"compositionend":return Im(s);case"keypress":return s.which!==32?null:(jm=!0,Hm);case"textInput":return n=s.data,n===Hm&&jm?null:n;default:return null}}function n2(n,s){if(Fs)return n==="compositionend"||!qh&&Pm(n,s)?(n=Dm(),Ja=Hh=gr=null,Fs=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Om&&s.locale!=="ko"?null:s.data;default:return null}}var r2={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 Um(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!r2[n.type]:s==="textarea"}function qm(n,s,l,u){qs?Vs?Vs.push(u):Vs=[u]:qs=u,s=Yc(s,"onChange"),0<s.length&&(l=new ic("onChange","change",null,l,u),n.push({event:l,listeners:s}))}var tl=null,il=null;function s2(n){Cv(n,0)}function rc(n){var s=hr(n);if(Ga(s))return n}function Vm(n,s){if(n==="change")return s}var Fm=!1;if(Hn){var Vh;if(Hn){var Fh="oninput"in document;if(!Fh){var $m=document.createElement("div");$m.setAttribute("oninput","return;"),Fh=typeof $m.oninput=="function"}Vh=Fh}else Vh=!1;Fm=Vh&&(!document.documentMode||9<document.documentMode)}function Ym(){tl&&(tl.detachEvent("onpropertychange",Wm),il=tl=null)}function Wm(n){if(n.propertyName==="value"&&rc(il)){var s=[];qm(s,il,n,Lh(n)),Am(s2,s)}}function o2(n,s,l){n==="focusin"?(Ym(),tl=s,il=l,tl.attachEvent("onpropertychange",Wm)):n==="focusout"&&Ym()}function l2(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return rc(il)}function a2(n,s){if(n==="click")return rc(s)}function c2(n,s){if(n==="input"||n==="change")return rc(s)}function u2(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}var ki=typeof Object.is=="function"?Object.is:u2;function nl(n,s){if(ki(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var l=Object.keys(n),u=Object.keys(s);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var p=l[u];if(!Jt.call(s,p)||!ki(n[p],s[p]))return!1}return!0}function Xm(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Km(n,s){var l=Xm(n);n=0;for(var u;l;){if(l.nodeType===3){if(u=n+l.textContent.length,n<=s&&u>=s)return{node:l,offset:s-n};n=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xm(l)}}function Gm(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?Gm(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function Zm(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=Jr(n.document);s instanceof n.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)n=s.contentWindow;else break;s=Jr(n.document)}return s}function $h(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}var h2=Hn&&"documentMode"in document&&11>=document.documentMode,$s=null,Yh=null,rl=null,Wh=!1;function Qm(n,s,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Wh||$s==null||$s!==Jr(u)||(u=$s,"selectionStart"in u&&$h(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),rl&&nl(rl,u)||(rl=u,u=Yc(Yh,"onSelect"),0<u.length&&(s=new ic("onSelect","select",null,s,l),n.push({event:s,listeners:u}),s.target=$s)))}function is(n,s){var l={};return l[n.toLowerCase()]=s.toLowerCase(),l["Webkit"+n]="webkit"+s,l["Moz"+n]="moz"+s,l}var Ys={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},Xh={},Jm={};Hn&&(Jm=document.createElement("div").style,"AnimationEvent"in window||(delete Ys.animationend.animation,delete Ys.animationiteration.animation,delete Ys.animationstart.animation),"TransitionEvent"in window||delete Ys.transitionend.transition);function ns(n){if(Xh[n])return Xh[n];if(!Ys[n])return n;var s=Ys[n],l;for(l in s)if(s.hasOwnProperty(l)&&l in Jm)return Xh[n]=s[l];return n}var e_=ns("animationend"),t_=ns("animationiteration"),i_=ns("animationstart"),f2=ns("transitionrun"),d2=ns("transitionstart"),p2=ns("transitioncancel"),n_=ns("transitionend"),r_=new Map,Kh="abort auxClick beforeToggle 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(" ");Kh.push("scrollEnd");function tn(n,s){r_.set(n,s),Ln(s,[n])}var sc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Pi=[],Ws=0,Gh=0;function oc(){for(var n=Ws,s=Gh=Ws=0;s<n;){var l=Pi[s];Pi[s++]=null;var u=Pi[s];Pi[s++]=null;var p=Pi[s];Pi[s++]=null;var _=Pi[s];if(Pi[s++]=null,u!==null&&p!==null){var x=u.pending;x===null?p.next=p:(p.next=x.next,x.next=p),u.pending=p}_!==0&&s_(l,p,_)}}function lc(n,s,l,u){Pi[Ws++]=n,Pi[Ws++]=s,Pi[Ws++]=l,Pi[Ws++]=u,Gh|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Zh(n,s,l,u){return lc(n,s,l,u),ac(n)}function rs(n,s){return lc(n,null,null,s),ac(n)}function s_(n,s,l){n.lanes|=l;var u=n.alternate;u!==null&&(u.lanes|=l);for(var p=!1,_=n.return;_!==null;)_.childLanes|=l,u=_.alternate,u!==null&&(u.childLanes|=l),_.tag===22&&(n=_.stateNode,n===null||n._visibility&1||(p=!0)),n=_,_=_.return;return n.tag===3?(_=n.stateNode,p&&s!==null&&(p=31-Ze(l),n=_.hiddenUpdates,u=n[p],u===null?n[p]=[s]:u.push(s),s.lane=l|536870912),_):null}function ac(n){if(50<kl)throw kl=0,ld=null,Error(r(185));for(var s=n.return;s!==null;)n=s,s=n.return;return n.tag===3?n.stateNode:null}var Xs={};function g2(n,s,l,u){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mi(n,s,l,u){return new g2(n,s,l,u)}function Qh(n){return n=n.prototype,!(!n||!n.isReactComponent)}function jn(n,s){var l=n.alternate;return l===null?(l=Mi(n.tag,s,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=s,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,s=n.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function o_(n,s){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=s,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,s=l.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),n}function cc(n,s,l,u,p,_){var x=0;if(u=n,typeof n=="function")Qh(n)&&(x=1);else if(typeof n=="string")x=SE(n,l,ee.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case G:return n=Mi(31,l,s,p),n.elementType=G,n.lanes=_,n;case b:return ss(l.children,p,_,s);case k:x=8,p|=24;break;case C:return n=Mi(12,l,s,p|2),n.elementType=C,n.lanes=_,n;case P:return n=Mi(13,l,s,p),n.elementType=P,n.lanes=_,n;case R:return n=Mi(19,l,s,p),n.elementType=R,n.lanes=_,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case E:x=10;break e;case z:x=9;break e;case T:x=11;break e;case U:x=14;break e;case X:x=16,u=null;break e}x=29,l=Error(r(130,n===null?"null":typeof n,"")),u=null}return s=Mi(x,l,s,p),s.elementType=n,s.type=u,s.lanes=_,s}function ss(n,s,l,u){return n=Mi(7,n,u,s),n.lanes=l,n}function Jh(n,s,l){return n=Mi(6,n,null,s),n.lanes=l,n}function l_(n){var s=Mi(18,null,null,0);return s.stateNode=n,s}function ef(n,s,l){return s=Mi(4,n.children!==null?n.children:[],n.key,s),s.lanes=l,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}var a_=new WeakMap;function Ii(n,s){if(typeof n=="object"&&n!==null){var l=a_.get(n);return l!==void 0?l:(s={value:n,source:s,stack:Ci(s)},a_.set(n,s),s)}return{value:n,source:s,stack:Ci(s)}}var Ks=[],Gs=0,uc=null,sl=0,Ui=[],qi=0,mr=null,dn=1,pn="";function Pn(n,s){Ks[Gs++]=sl,Ks[Gs++]=uc,uc=n,sl=s}function c_(n,s,l){Ui[qi++]=dn,Ui[qi++]=pn,Ui[qi++]=mr,mr=n;var u=dn;n=pn;var p=32-Ze(u)-1;u&=~(1<<p),l+=1;var _=32-Ze(s)+p;if(30<_){var x=p-p%5;_=(u&(1<<x)-1).toString(32),u>>=x,p-=x,dn=1<<32-Ze(s)+p|l<<p|u,pn=_+n}else dn=1<<_|l<<p|u,pn=n}function tf(n){n.return!==null&&(Pn(n,1),c_(n,1,0))}function nf(n){for(;n===uc;)uc=Ks[--Gs],Ks[Gs]=null,sl=Ks[--Gs],Ks[Gs]=null;for(;n===mr;)mr=Ui[--qi],Ui[qi]=null,pn=Ui[--qi],Ui[qi]=null,dn=Ui[--qi],Ui[qi]=null}function u_(n,s){Ui[qi++]=dn,Ui[qi++]=pn,Ui[qi++]=mr,dn=s.id,pn=s.overflow,mr=n}var Wt=null,lt=null,Ve=!1,_r=null,Vi=!1,rf=Error(r(519));function vr(n){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ol(Ii(s,n)),rf}function h_(n){var s=n.stateNode,l=n.type,u=n.memoizedProps;switch(s[zt]=n,s[ti]=u,l){case"dialog":Ie("cancel",s),Ie("close",s);break;case"iframe":case"object":case"embed":Ie("load",s);break;case"video":case"audio":for(l=0;l<Tl.length;l++)Ie(Tl[l],s);break;case"source":Ie("error",s);break;case"img":case"image":case"link":Ie("error",s),Ie("load",s);break;case"details":Ie("toggle",s);break;case"input":Ie("invalid",s),Za(s,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ie("invalid",s);break;case"textarea":Ie("invalid",s),km(s,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||u.suppressHydrationWarning===!0||Tv(s.textContent,l)?(u.popover!=null&&(Ie("beforetoggle",s),Ie("toggle",s)),u.onScroll!=null&&Ie("scroll",s),u.onScrollEnd!=null&&Ie("scrollend",s),u.onClick!=null&&(s.onclick=On),s=!0):s=!1,s||vr(n,!0)}function f_(n){for(Wt=n.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:Vi=!1;return;case 27:case 3:Vi=!0;return;default:Wt=Wt.return}}function Zs(n){if(n!==Wt)return!1;if(!Ve)return f_(n),Ve=!0,!1;var s=n.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||xd(n.type,n.memoizedProps)),l=!l),l&<&&vr(n),f_(n),s===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));lt=Hv(n)}else if(s===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));lt=Hv(n)}else s===27?(s=lt,Rr(n.type)?(n=Md,Md=null,lt=n):lt=s):lt=Wt?$i(n.stateNode.nextSibling):null;return!0}function os(){lt=Wt=null,Ve=!1}function sf(){var n=_r;return n!==null&&(_i===null?_i=n:_i.push.apply(_i,n),_r=null),n}function ol(n){_r===null?_r=[n]:_r.push(n)}var of=L(null),ls=null,In=null;function yr(n,s,l){A(of,s._currentValue),s._currentValue=l}function Un(n){n._currentValue=of.current,Y(of)}function lf(n,s,l){for(;n!==null;){var u=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,u!==null&&(u.childLanes|=s)):u!==null&&(u.childLanes&s)!==s&&(u.childLanes|=s),n===l)break;n=n.return}}function af(n,s,l,u){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var _=p.dependencies;if(_!==null){var x=p.child;_=_.firstContext;e:for(;_!==null;){var D=_;_=p;for(var W=0;W<s.length;W++)if(D.context===s[W]){_.lanes|=l,D=_.alternate,D!==null&&(D.lanes|=l),lf(_.return,l,n),u||(x=null);break e}_=D.next}}else if(p.tag===18){if(x=p.return,x===null)throw Error(r(341));x.lanes|=l,_=x.alternate,_!==null&&(_.lanes|=l),lf(x,l,n),x=null}else x=p.child;if(x!==null)x.return=p;else for(x=p;x!==null;){if(x===n){x=null;break}if(p=x.sibling,p!==null){p.return=x.return,x=p;break}x=x.return}p=x}}function Qs(n,s,l,u){n=null;for(var p=s,_=!1;p!==null;){if(!_){if((p.flags&524288)!==0)_=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var x=p.alternate;if(x===null)throw Error(r(387));if(x=x.memoizedProps,x!==null){var D=p.type;ki(p.pendingProps.value,x.value)||(n!==null?n.push(D):n=[D])}}else if(p===fe.current){if(x=p.alternate,x===null)throw Error(r(387));x.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Bl):n=[Bl])}p=p.return}n!==null&&af(s,n,l,u),s.flags|=262144}function hc(n){for(n=n.firstContext;n!==null;){if(!ki(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function as(n){ls=n,In=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Xt(n){return d_(ls,n)}function fc(n,s){return ls===null&&as(n),d_(n,s)}function d_(n,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},In===null){if(n===null)throw Error(r(308));In=s,n.dependencies={lanes:0,firstContext:s},n.flags|=524288}else In=In.next=s;return l}var m2=typeof AbortController<"u"?AbortController:function(){var n=[],s=this.signal={aborted:!1,addEventListener:function(l,u){n.push(u)}};this.abort=function(){s.aborted=!0,n.forEach(function(l){return l()})}},_2=e.unstable_scheduleCallback,v2=e.unstable_NormalPriority,kt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cf(){return{controller:new m2,data:new Map,refCount:0}}function ll(n){n.refCount--,n.refCount===0&&_2(v2,function(){n.controller.abort()})}var al=null,uf=0,Js=0,eo=null;function y2(n,s){if(al===null){var l=al=[];uf=0,Js=dd(),eo={status:"pending",value:void 0,then:function(u){l.push(u)}}}return uf++,s.then(p_,p_),s}function p_(){if(--uf===0&&al!==null){eo!==null&&(eo.status="fulfilled");var n=al;al=null,Js=0,eo=null;for(var s=0;s<n.length;s++)(0,n[s])()}}function S2(n,s){var l=[],u={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return n.then(function(){u.status="fulfilled",u.value=s;for(var p=0;p<l.length;p++)(0,l[p])(s)},function(p){for(u.status="rejected",u.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),u}var g_=M.S;M.S=function(n,s){Q0=Lt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&y2(n,s),g_!==null&&g_(n,s)};var cs=L(null);function hf(){var n=cs.current;return n!==null?n:rt.pooledCache}function dc(n,s){s===null?A(cs,cs.current):A(cs,s.pool)}function m_(){var n=hf();return n===null?null:{parent:kt._currentValue,pool:n}}var to=Error(r(460)),ff=Error(r(474)),pc=Error(r(542)),gc={then:function(){}};function __(n){return n=n.status,n==="fulfilled"||n==="rejected"}function v_(n,s,l){switch(l=n[l],l===void 0?n.push(s):l!==s&&(s.then(On,On),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,S_(n),n;default:if(typeof s.status=="string")s.then(On,On);else{if(n=rt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=s,n.status="pending",n.then(function(u){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=u}},function(u){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=u}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,S_(n),n}throw hs=s,to}}function us(n){try{var s=n._init;return s(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(hs=l,to):l}}var hs=null;function y_(){if(hs===null)throw Error(r(459));var n=hs;return hs=null,n}function S_(n){if(n===to||n===pc)throw Error(r(483))}var io=null,cl=0;function mc(n){var s=cl;return cl+=1,io===null&&(io=[]),v_(io,n,s)}function ul(n,s){s=s.props.ref,n.ref=s!==void 0?s:null}function _c(n,s){throw s.$$typeof===v?Error(r(525)):(n=Object.prototype.toString.call(s),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n)))}function b_(n){function s(Z,K){if(n){var Q=Z.deletions;Q===null?(Z.deletions=[K],Z.flags|=16):Q.push(K)}}function l(Z,K){if(!n)return null;for(;K!==null;)s(Z,K),K=K.sibling;return null}function u(Z){for(var K=new Map;Z!==null;)Z.key!==null?K.set(Z.key,Z):K.set(Z.index,Z),Z=Z.sibling;return K}function p(Z,K){return Z=jn(Z,K),Z.index=0,Z.sibling=null,Z}function _(Z,K,Q){return Z.index=Q,n?(Q=Z.alternate,Q!==null?(Q=Q.index,Q<K?(Z.flags|=67108866,K):Q):(Z.flags|=67108866,K)):(Z.flags|=1048576,K)}function x(Z){return n&&Z.alternate===null&&(Z.flags|=67108866),Z}function D(Z,K,Q,oe){return K===null||K.tag!==6?(K=Jh(Q,Z.mode,oe),K.return=Z,K):(K=p(K,Q),K.return=Z,K)}function W(Z,K,Q,oe){var Ee=Q.type;return Ee===b?se(Z,K,Q.props.children,oe,Q.key):K!==null&&(K.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===X&&us(Ee)===K.type)?(K=p(K,Q.props),ul(K,Q),K.return=Z,K):(K=cc(Q.type,Q.key,Q.props,null,Z.mode,oe),ul(K,Q),K.return=Z,K)}function J(Z,K,Q,oe){return K===null||K.tag!==4||K.stateNode.containerInfo!==Q.containerInfo||K.stateNode.implementation!==Q.implementation?(K=ef(Q,Z.mode,oe),K.return=Z,K):(K=p(K,Q.children||[]),K.return=Z,K)}function se(Z,K,Q,oe,Ee){return K===null||K.tag!==7?(K=ss(Q,Z.mode,oe,Ee),K.return=Z,K):(K=p(K,Q),K.return=Z,K)}function ae(Z,K,Q){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Jh(""+K,Z.mode,Q),K.return=Z,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case y:return Q=cc(K.type,K.key,K.props,null,Z.mode,Q),ul(Q,K),Q.return=Z,Q;case S:return K=ef(K,Z.mode,Q),K.return=Z,K;case X:return K=us(K),ae(Z,K,Q)}if(O(K)||I(K))return K=ss(K,Z.mode,Q,null),K.return=Z,K;if(typeof K.then=="function")return ae(Z,mc(K),Q);if(K.$$typeof===E)return ae(Z,fc(Z,K),Q);_c(Z,K)}return null}function te(Z,K,Q,oe){var Ee=K!==null?K.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ee!==null?null:D(Z,K,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return Q.key===Ee?W(Z,K,Q,oe):null;case S:return Q.key===Ee?J(Z,K,Q,oe):null;case X:return Q=us(Q),te(Z,K,Q,oe)}if(O(Q)||I(Q))return Ee!==null?null:se(Z,K,Q,oe,null);if(typeof Q.then=="function")return te(Z,K,mc(Q),oe);if(Q.$$typeof===E)return te(Z,K,fc(Z,Q),oe);_c(Z,Q)}return null}function ie(Z,K,Q,oe,Ee){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Z=Z.get(Q)||null,D(K,Z,""+oe,Ee);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case y:return Z=Z.get(oe.key===null?Q:oe.key)||null,W(K,Z,oe,Ee);case S:return Z=Z.get(oe.key===null?Q:oe.key)||null,J(K,Z,oe,Ee);case X:return oe=us(oe),ie(Z,K,Q,oe,Ee)}if(O(oe)||I(oe))return Z=Z.get(Q)||null,se(K,Z,oe,Ee,null);if(typeof oe.then=="function")return ie(Z,K,Q,mc(oe),Ee);if(oe.$$typeof===E)return ie(Z,K,Q,fc(K,oe),Ee);_c(K,oe)}return null}function ye(Z,K,Q,oe){for(var Ee=null,We=null,be=K,Be=K=0,qe=null;be!==null&&Be<Q.length;Be++){be.index>Be?(qe=be,be=null):qe=be.sibling;var Xe=te(Z,be,Q[Be],oe);if(Xe===null){be===null&&(be=qe);break}n&&be&&Xe.alternate===null&&s(Z,be),K=_(Xe,K,Be),We===null?Ee=Xe:We.sibling=Xe,We=Xe,be=qe}if(Be===Q.length)return l(Z,be),Ve&&Pn(Z,Be),Ee;if(be===null){for(;Be<Q.length;Be++)be=ae(Z,Q[Be],oe),be!==null&&(K=_(be,K,Be),We===null?Ee=be:We.sibling=be,We=be);return Ve&&Pn(Z,Be),Ee}for(be=u(be);Be<Q.length;Be++)qe=ie(be,Z,Be,Q[Be],oe),qe!==null&&(n&&qe.alternate!==null&&be.delete(qe.key===null?Be:qe.key),K=_(qe,K,Be),We===null?Ee=qe:We.sibling=qe,We=qe);return n&&be.forEach(function(Hr){return s(Z,Hr)}),Ve&&Pn(Z,Be),Ee}function Me(Z,K,Q,oe){if(Q==null)throw Error(r(151));for(var Ee=null,We=null,be=K,Be=K=0,qe=null,Xe=Q.next();be!==null&&!Xe.done;Be++,Xe=Q.next()){be.index>Be?(qe=be,be=null):qe=be.sibling;var Hr=te(Z,be,Xe.value,oe);if(Hr===null){be===null&&(be=qe);break}n&&be&&Hr.alternate===null&&s(Z,be),K=_(Hr,K,Be),We===null?Ee=Hr:We.sibling=Hr,We=Hr,be=qe}if(Xe.done)return l(Z,be),Ve&&Pn(Z,Be),Ee;if(be===null){for(;!Xe.done;Be++,Xe=Q.next())Xe=ae(Z,Xe.value,oe),Xe!==null&&(K=_(Xe,K,Be),We===null?Ee=Xe:We.sibling=Xe,We=Xe);return Ve&&Pn(Z,Be),Ee}for(be=u(be);!Xe.done;Be++,Xe=Q.next())Xe=ie(be,Z,Be,Xe.value,oe),Xe!==null&&(n&&Xe.alternate!==null&&be.delete(Xe.key===null?Be:Xe.key),K=_(Xe,K,Be),We===null?Ee=Xe:We.sibling=Xe,We=Xe);return n&&be.forEach(function(DE){return s(Z,DE)}),Ve&&Pn(Z,Be),Ee}function it(Z,K,Q,oe){if(typeof Q=="object"&&Q!==null&&Q.type===b&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:e:{for(var Ee=Q.key;K!==null;){if(K.key===Ee){if(Ee=Q.type,Ee===b){if(K.tag===7){l(Z,K.sibling),oe=p(K,Q.props.children),oe.return=Z,Z=oe;break e}}else if(K.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===X&&us(Ee)===K.type){l(Z,K.sibling),oe=p(K,Q.props),ul(oe,Q),oe.return=Z,Z=oe;break e}l(Z,K);break}else s(Z,K);K=K.sibling}Q.type===b?(oe=ss(Q.props.children,Z.mode,oe,Q.key),oe.return=Z,Z=oe):(oe=cc(Q.type,Q.key,Q.props,null,Z.mode,oe),ul(oe,Q),oe.return=Z,Z=oe)}return x(Z);case S:e:{for(Ee=Q.key;K!==null;){if(K.key===Ee)if(K.tag===4&&K.stateNode.containerInfo===Q.containerInfo&&K.stateNode.implementation===Q.implementation){l(Z,K.sibling),oe=p(K,Q.children||[]),oe.return=Z,Z=oe;break e}else{l(Z,K);break}else s(Z,K);K=K.sibling}oe=ef(Q,Z.mode,oe),oe.return=Z,Z=oe}return x(Z);case X:return Q=us(Q),it(Z,K,Q,oe)}if(O(Q))return ye(Z,K,Q,oe);if(I(Q)){if(Ee=I(Q),typeof Ee!="function")throw Error(r(150));return Q=Ee.call(Q),Me(Z,K,Q,oe)}if(typeof Q.then=="function")return it(Z,K,mc(Q),oe);if(Q.$$typeof===E)return it(Z,K,fc(Z,Q),oe);_c(Z,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,K!==null&&K.tag===6?(l(Z,K.sibling),oe=p(K,Q),oe.return=Z,Z=oe):(l(Z,K),oe=Jh(Q,Z.mode,oe),oe.return=Z,Z=oe),x(Z)):l(Z,K)}return function(Z,K,Q,oe){try{cl=0;var Ee=it(Z,K,Q,oe);return io=null,Ee}catch(be){if(be===to||be===pc)throw be;var We=Mi(29,be,null,Z.mode);return We.lanes=oe,We.return=Z,We}finally{}}}var fs=b_(!0),x_=b_(!1),Sr=!1;function df(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pf(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function br(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function xr(n,s,l){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Ke&2)!==0){var p=u.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),u.pending=s,s=ac(n),s_(n,null,l),s}return lc(n,u,s,l),ac(n)}function hl(n,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var u=s.lanes;u&=n.pendingLanes,l|=u,s.lanes=l,Ia(n,l)}}function gf(n,s){var l=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var p=null,_=null;if(l=l.firstBaseUpdate,l!==null){do{var x={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};_===null?p=_=x:_=_.next=x,l=l.next}while(l!==null);_===null?p=_=s:_=_.next=s}else p=_=s;l={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:_,shared:u.shared,callbacks:u.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=s:n.next=s,l.lastBaseUpdate=s}var mf=!1;function fl(){if(mf){var n=eo;if(n!==null)throw n}}function dl(n,s,l,u){mf=!1;var p=n.updateQueue;Sr=!1;var _=p.firstBaseUpdate,x=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var W=D,J=W.next;W.next=null,x===null?_=J:x.next=J,x=W;var se=n.alternate;se!==null&&(se=se.updateQueue,D=se.lastBaseUpdate,D!==x&&(D===null?se.firstBaseUpdate=J:D.next=J,se.lastBaseUpdate=W))}if(_!==null){var ae=p.baseState;x=0,se=J=W=null,D=_;do{var te=D.lane&-536870913,ie=te!==D.lane;if(ie?(Ue&te)===te:(u&te)===te){te!==0&&te===Js&&(mf=!0),se!==null&&(se=se.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var ye=n,Me=D;te=s;var it=l;switch(Me.tag){case 1:if(ye=Me.payload,typeof ye=="function"){ae=ye.call(it,ae,te);break e}ae=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Me.payload,te=typeof ye=="function"?ye.call(it,ae,te):ye,te==null)break e;ae=g({},ae,te);break e;case 2:Sr=!0}}te=D.callback,te!==null&&(n.flags|=64,ie&&(n.flags|=8192),ie=p.callbacks,ie===null?p.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:D.tag,payload:D.payload,callback:D.callback,next:null},se===null?(J=se=ie,W=ae):se=se.next=ie,x|=te;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;ie=D,D=ie.next,ie.next=null,p.lastBaseUpdate=ie,p.shared.pending=null}}while(!0);se===null&&(W=ae),p.baseState=W,p.firstBaseUpdate=J,p.lastBaseUpdate=se,_===null&&(p.shared.lanes=0),Mr|=x,n.lanes=x,n.memoizedState=ae}}function w_(n,s){if(typeof n!="function")throw Error(r(191,n));n.call(s)}function C_(n,s){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)w_(l[n],s)}var no=L(null),vc=L(0);function E_(n,s){n=Gn,A(vc,n),A(no,s),Gn=n|s.baseLanes}function _f(){A(vc,Gn),A(no,no.current)}function vf(){Gn=vc.current,Y(no),Y(vc)}var Ti=L(null),Fi=null;function wr(n){var s=n.alternate;A(xt,xt.current&1),A(Ti,n),Fi===null&&(s===null||no.current!==null||s.memoizedState!==null)&&(Fi=n)}function yf(n){A(xt,xt.current),A(Ti,n),Fi===null&&(Fi=n)}function k_(n){n.tag===22?(A(xt,xt.current),A(Ti,n),Fi===null&&(Fi=n)):Cr()}function Cr(){A(xt,xt.current),A(Ti,Ti.current)}function Ni(n){Y(Ti),Fi===n&&(Fi=null),Y(xt)}var xt=L(0);function yc(n){for(var s=n;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Ed(l)||kd(l)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var qn=0,Re=null,et=null,Mt=null,Sc=!1,ro=!1,ds=!1,bc=0,pl=0,so=null,b2=0;function mt(){throw Error(r(321))}function Sf(n,s){if(s===null)return!1;for(var l=0;l<s.length&&l<n.length;l++)if(!ki(n[l],s[l]))return!1;return!0}function bf(n,s,l,u,p,_){return qn=_,Re=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,M.H=n===null||n.memoizedState===null?c0:Of,ds=!1,_=l(u,p),ds=!1,ro&&(_=T_(s,l,u,p)),M_(n),_}function M_(n){M.H=_l;var s=et!==null&&et.next!==null;if(qn=0,Mt=et=Re=null,Sc=!1,pl=0,so=null,s)throw Error(r(300));n===null||Tt||(n=n.dependencies,n!==null&&hc(n)&&(Tt=!0))}function T_(n,s,l,u){Re=n;var p=0;do{if(ro&&(so=null),pl=0,ro=!1,25<=p)throw Error(r(301));if(p+=1,Mt=et=null,n.updateQueue!=null){var _=n.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}M.H=u0,_=s(l,u)}while(ro);return _}function x2(){var n=M.H,s=n.useState()[0];return s=typeof s.then=="function"?gl(s):s,n=n.useState()[0],(et!==null?et.memoizedState:null)!==n&&(Re.flags|=1024),s}function xf(){var n=bc!==0;return bc=0,n}function wf(n,s,l){s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~l}function Cf(n){if(Sc){for(n=n.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Sc=!1}qn=0,Mt=et=Re=null,ro=!1,pl=bc=0,so=null}function oi(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?Re.memoizedState=Mt=n:Mt=Mt.next=n,Mt}function wt(){if(et===null){var n=Re.alternate;n=n!==null?n.memoizedState:null}else n=et.next;var s=Mt===null?Re.memoizedState:Mt.next;if(s!==null)Mt=s,et=n;else{if(n===null)throw Re.alternate===null?Error(r(467)):Error(r(310));et=n,n={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},Mt===null?Re.memoizedState=Mt=n:Mt=Mt.next=n}return Mt}function xc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gl(n){var s=pl;return pl+=1,so===null&&(so=[]),n=v_(so,n,s),s=Re,(Mt===null?s.memoizedState:Mt.next)===null&&(s=s.alternate,M.H=s===null||s.memoizedState===null?c0:Of),n}function wc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return gl(n);if(n.$$typeof===E)return Xt(n)}throw Error(r(438,String(n)))}function Ef(n){var s=null,l=Re.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var u=Re.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(s={data:u.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=xc(),Re.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(n),u=0;u<n;u++)l[u]=ne;return s.index++,l}function Vn(n,s){return typeof s=="function"?s(n):s}function Cc(n){var s=wt();return kf(s,et,n)}function kf(n,s,l){var u=n.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=l;var p=n.baseQueue,_=u.pending;if(_!==null){if(p!==null){var x=p.next;p.next=_.next,_.next=x}s.baseQueue=p=_,u.pending=null}if(_=n.baseState,p===null)n.memoizedState=_;else{s=p.next;var D=x=null,W=null,J=s,se=!1;do{var ae=J.lane&-536870913;if(ae!==J.lane?(Ue&ae)===ae:(qn&ae)===ae){var te=J.revertLane;if(te===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ae===Js&&(se=!0);else if((qn&te)===te){J=J.next,te===Js&&(se=!0);continue}else ae={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},W===null?(D=W=ae,x=_):W=W.next=ae,Re.lanes|=te,Mr|=te;ae=J.action,ds&&l(_,ae),_=J.hasEagerState?J.eagerState:l(_,ae)}else te={lane:ae,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},W===null?(D=W=te,x=_):W=W.next=te,Re.lanes|=ae,Mr|=ae;J=J.next}while(J!==null&&J!==s);if(W===null?x=_:W.next=D,!ki(_,n.memoizedState)&&(Tt=!0,se&&(l=eo,l!==null)))throw l;n.memoizedState=_,n.baseState=x,n.baseQueue=W,u.lastRenderedState=_}return p===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function Mf(n){var s=wt(),l=s.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var u=l.dispatch,p=l.pending,_=s.memoizedState;if(p!==null){l.pending=null;var x=p=p.next;do _=n(_,x.action),x=x.next;while(x!==p);ki(_,s.memoizedState)||(Tt=!0),s.memoizedState=_,s.baseQueue===null&&(s.baseState=_),l.lastRenderedState=_}return[_,u]}function N_(n,s,l){var u=Re,p=wt(),_=Ve;if(_){if(l===void 0)throw Error(r(407));l=l()}else l=s();var x=!ki((et||p).memoizedState,l);if(x&&(p.memoizedState=l,Tt=!0),p=p.queue,Af(R_.bind(null,u,p,n),[n]),p.getSnapshot!==s||x||Mt!==null&&Mt.memoizedState.tag&1){if(u.flags|=2048,oo(9,{destroy:void 0},D_.bind(null,u,p,l,s),null),rt===null)throw Error(r(349));_||(qn&127)!==0||A_(u,s,l)}return l}function A_(n,s,l){n.flags|=16384,n={getSnapshot:s,value:l},s=Re.updateQueue,s===null?(s=xc(),Re.updateQueue=s,s.stores=[n]):(l=s.stores,l===null?s.stores=[n]:l.push(n))}function D_(n,s,l,u){s.value=l,s.getSnapshot=u,B_(s)&&L_(n)}function R_(n,s,l){return l(function(){B_(s)&&L_(n)})}function B_(n){var s=n.getSnapshot;n=n.value;try{var l=s();return!ki(n,l)}catch{return!0}}function L_(n){var s=rs(n,2);s!==null&&vi(s,n,2)}function Tf(n){var s=oi();if(typeof n=="function"){var l=n;if(n=l(),ds){ei(!0);try{l()}finally{ei(!1)}}}return s.memoizedState=s.baseState=n,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:n},s}function z_(n,s,l,u){return n.baseState=l,kf(n,et,typeof u=="function"?u:Vn)}function w2(n,s,l,u,p){if(Mc(n))throw Error(r(485));if(n=s.action,n!==null){var _={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){_.listeners.push(x)}};M.T!==null?l(!0):_.isTransition=!1,u(_),l=s.pending,l===null?(_.next=s.pending=_,O_(s,_)):(_.next=l.next,s.pending=l.next=_)}}function O_(n,s){var l=s.action,u=s.payload,p=n.state;if(s.isTransition){var _=M.T,x={};M.T=x;try{var D=l(p,u),W=M.S;W!==null&&W(x,D),H_(n,s,D)}catch(J){Nf(n,s,J)}finally{_!==null&&x.types!==null&&(_.types=x.types),M.T=_}}else try{_=l(p,u),H_(n,s,_)}catch(J){Nf(n,s,J)}}function H_(n,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){j_(n,s,u)},function(u){return Nf(n,s,u)}):j_(n,s,l)}function j_(n,s,l){s.status="fulfilled",s.value=l,P_(s),n.state=l,s=n.pending,s!==null&&(l=s.next,l===s?n.pending=null:(l=l.next,s.next=l,O_(n,l)))}function Nf(n,s,l){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do s.status="rejected",s.reason=l,P_(s),s=s.next;while(s!==u)}n.action=null}function P_(n){n=n.listeners;for(var s=0;s<n.length;s++)(0,n[s])()}function I_(n,s){return s}function U_(n,s){if(Ve){var l=rt.formState;if(l!==null){e:{var u=Re;if(Ve){if(lt){t:{for(var p=lt,_=Vi;p.nodeType!==8;){if(!_){p=null;break t}if(p=$i(p.nextSibling),p===null){p=null;break t}}_=p.data,p=_==="F!"||_==="F"?p:null}if(p){lt=$i(p.nextSibling),u=p.data==="F!";break e}}vr(u)}u=!1}u&&(s=l[0])}}return l=oi(),l.memoizedState=l.baseState=s,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:I_,lastRenderedState:s},l.queue=u,l=o0.bind(null,Re,u),u.dispatch=l,u=Tf(!1),_=zf.bind(null,Re,!1,u.queue),u=oi(),p={state:s,dispatch:null,action:n,pending:null},u.queue=p,l=w2.bind(null,Re,p,_,l),p.dispatch=l,u.memoizedState=n,[s,l,!1]}function q_(n){var s=wt();return V_(s,et,n)}function V_(n,s,l){if(s=kf(n,s,I_)[0],n=Cc(Vn)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var u=gl(s)}catch(x){throw x===to?pc:x}else u=s;s=wt();var p=s.queue,_=p.dispatch;return l!==s.memoizedState&&(Re.flags|=2048,oo(9,{destroy:void 0},C2.bind(null,p,l),null)),[u,_,n]}function C2(n,s){n.action=s}function F_(n){var s=wt(),l=et;if(l!==null)return V_(s,l,n);wt(),s=s.memoizedState,l=wt();var u=l.queue.dispatch;return l.memoizedState=n,[s,u,!1]}function oo(n,s,l,u){return n={tag:n,create:l,deps:u,inst:s,next:null},s=Re.updateQueue,s===null&&(s=xc(),Re.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=n.next=n:(u=l.next,l.next=n,n.next=u,s.lastEffect=n),n}function $_(){return wt().memoizedState}function Ec(n,s,l,u){var p=oi();Re.flags|=n,p.memoizedState=oo(1|s,{destroy:void 0},l,u===void 0?null:u)}function kc(n,s,l,u){var p=wt();u=u===void 0?null:u;var _=p.memoizedState.inst;et!==null&&u!==null&&Sf(u,et.memoizedState.deps)?p.memoizedState=oo(s,_,l,u):(Re.flags|=n,p.memoizedState=oo(1|s,_,l,u))}function Y_(n,s){Ec(8390656,8,n,s)}function Af(n,s){kc(2048,8,n,s)}function E2(n){Re.flags|=4;var s=Re.updateQueue;if(s===null)s=xc(),Re.updateQueue=s,s.events=[n];else{var l=s.events;l===null?s.events=[n]:l.push(n)}}function W_(n){var s=wt().memoizedState;return E2({ref:s,nextImpl:n}),function(){if((Ke&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function X_(n,s){return kc(4,2,n,s)}function K_(n,s){return kc(4,4,n,s)}function G_(n,s){if(typeof s=="function"){n=n();var l=s(n);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return n=n(),s.current=n,function(){s.current=null}}function Z_(n,s,l){l=l!=null?l.concat([n]):null,kc(4,4,G_.bind(null,s,n),l)}function Df(){}function Q_(n,s){var l=wt();s=s===void 0?null:s;var u=l.memoizedState;return s!==null&&Sf(s,u[1])?u[0]:(l.memoizedState=[n,s],n)}function J_(n,s){var l=wt();s=s===void 0?null:s;var u=l.memoizedState;if(s!==null&&Sf(s,u[1]))return u[0];if(u=n(),ds){ei(!0);try{n()}finally{ei(!1)}}return l.memoizedState=[u,s],u}function Rf(n,s,l){return l===void 0||(qn&1073741824)!==0&&(Ue&261930)===0?n.memoizedState=s:(n.memoizedState=l,n=ev(),Re.lanes|=n,Mr|=n,l)}function e0(n,s,l,u){return ki(l,s)?l:no.current!==null?(n=Rf(n,l,u),ki(n,s)||(Tt=!0),n):(qn&42)===0||(qn&1073741824)!==0&&(Ue&261930)===0?(Tt=!0,n.memoizedState=l):(n=ev(),Re.lanes|=n,Mr|=n,s)}function t0(n,s,l,u,p){var _=j.p;j.p=_!==0&&8>_?_:8;var x=M.T,D={};M.T=D,zf(n,!1,s,l);try{var W=p(),J=M.S;if(J!==null&&J(D,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var se=S2(W,u);ml(n,s,se,Ri(n))}else ml(n,s,u,Ri(n))}catch(ae){ml(n,s,{then:function(){},status:"rejected",reason:ae},Ri())}finally{j.p=_,x!==null&&D.types!==null&&(x.types=D.types),M.T=x}}function k2(){}function Bf(n,s,l,u){if(n.tag!==5)throw Error(r(476));var p=i0(n).queue;t0(n,p,s,H,l===null?k2:function(){return n0(n),l(u)})}function i0(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:H},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:l},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}function n0(n){var s=i0(n);s.next===null&&(s=n.alternate.memoizedState),ml(n,s.next.queue,{},Ri())}function Lf(){return Xt(Bl)}function r0(){return wt().memoizedState}function s0(){return wt().memoizedState}function M2(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var l=Ri();n=br(l);var u=xr(s,n,l);u!==null&&(vi(u,s,l),hl(u,s,l)),s={cache:cf()},n.payload=s;return}s=s.return}}function T2(n,s,l){var u=Ri();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Mc(n)?l0(s,l):(l=Zh(n,s,l,u),l!==null&&(vi(l,n,u),a0(l,s,u)))}function o0(n,s,l){var u=Ri();ml(n,s,l,u)}function ml(n,s,l,u){var p={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Mc(n))l0(s,p);else{var _=n.alternate;if(n.lanes===0&&(_===null||_.lanes===0)&&(_=s.lastRenderedReducer,_!==null))try{var x=s.lastRenderedState,D=_(x,l);if(p.hasEagerState=!0,p.eagerState=D,ki(D,x))return lc(n,s,p,0),rt===null&&oc(),!1}catch{}finally{}if(l=Zh(n,s,p,u),l!==null)return vi(l,n,u),a0(l,s,u),!0}return!1}function zf(n,s,l,u){if(u={lane:2,revertLane:dd(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Mc(n)){if(s)throw Error(r(479))}else s=Zh(n,l,u,2),s!==null&&vi(s,n,2)}function Mc(n){var s=n.alternate;return n===Re||s!==null&&s===Re}function l0(n,s){ro=Sc=!0;var l=n.pending;l===null?s.next=s:(s.next=l.next,l.next=s),n.pending=s}function a0(n,s,l){if((l&4194048)!==0){var u=s.lanes;u&=n.pendingLanes,l|=u,s.lanes=l,Ia(n,l)}}var _l={readContext:Xt,use:wc,useCallback:mt,useContext:mt,useEffect:mt,useImperativeHandle:mt,useLayoutEffect:mt,useInsertionEffect:mt,useMemo:mt,useReducer:mt,useRef:mt,useState:mt,useDebugValue:mt,useDeferredValue:mt,useTransition:mt,useSyncExternalStore:mt,useId:mt,useHostTransitionStatus:mt,useFormState:mt,useActionState:mt,useOptimistic:mt,useMemoCache:mt,useCacheRefresh:mt};_l.useEffectEvent=mt;var c0={readContext:Xt,use:wc,useCallback:function(n,s){return oi().memoizedState=[n,s===void 0?null:s],n},useContext:Xt,useEffect:Y_,useImperativeHandle:function(n,s,l){l=l!=null?l.concat([n]):null,Ec(4194308,4,G_.bind(null,s,n),l)},useLayoutEffect:function(n,s){return Ec(4194308,4,n,s)},useInsertionEffect:function(n,s){Ec(4,2,n,s)},useMemo:function(n,s){var l=oi();s=s===void 0?null:s;var u=n();if(ds){ei(!0);try{n()}finally{ei(!1)}}return l.memoizedState=[u,s],u},useReducer:function(n,s,l){var u=oi();if(l!==void 0){var p=l(s);if(ds){ei(!0);try{l(s)}finally{ei(!1)}}}else p=s;return u.memoizedState=u.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},u.queue=n,n=n.dispatch=T2.bind(null,Re,n),[u.memoizedState,n]},useRef:function(n){var s=oi();return n={current:n},s.memoizedState=n},useState:function(n){n=Tf(n);var s=n.queue,l=o0.bind(null,Re,s);return s.dispatch=l,[n.memoizedState,l]},useDebugValue:Df,useDeferredValue:function(n,s){var l=oi();return Rf(l,n,s)},useTransition:function(){var n=Tf(!1);return n=t0.bind(null,Re,n.queue,!0,!1),oi().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,s,l){var u=Re,p=oi();if(Ve){if(l===void 0)throw Error(r(407));l=l()}else{if(l=s(),rt===null)throw Error(r(349));(Ue&127)!==0||A_(u,s,l)}p.memoizedState=l;var _={value:l,getSnapshot:s};return p.queue=_,Y_(R_.bind(null,u,_,n),[n]),u.flags|=2048,oo(9,{destroy:void 0},D_.bind(null,u,_,l,s),null),l},useId:function(){var n=oi(),s=rt.identifierPrefix;if(Ve){var l=pn,u=dn;l=(u&~(1<<32-Ze(u)-1)).toString(32)+l,s="_"+s+"R_"+l,l=bc++,0<l&&(s+="H"+l.toString(32)),s+="_"}else l=b2++,s="_"+s+"r_"+l.toString(32)+"_";return n.memoizedState=s},useHostTransitionStatus:Lf,useFormState:U_,useActionState:U_,useOptimistic:function(n){var s=oi();s.memoizedState=s.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=zf.bind(null,Re,!0,l),l.dispatch=s,[n,s]},useMemoCache:Ef,useCacheRefresh:function(){return oi().memoizedState=M2.bind(null,Re)},useEffectEvent:function(n){var s=oi(),l={impl:n};return s.memoizedState=l,function(){if((Ke&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Of={readContext:Xt,use:wc,useCallback:Q_,useContext:Xt,useEffect:Af,useImperativeHandle:Z_,useInsertionEffect:X_,useLayoutEffect:K_,useMemo:J_,useReducer:Cc,useRef:$_,useState:function(){return Cc(Vn)},useDebugValue:Df,useDeferredValue:function(n,s){var l=wt();return e0(l,et.memoizedState,n,s)},useTransition:function(){var n=Cc(Vn)[0],s=wt().memoizedState;return[typeof n=="boolean"?n:gl(n),s]},useSyncExternalStore:N_,useId:r0,useHostTransitionStatus:Lf,useFormState:q_,useActionState:q_,useOptimistic:function(n,s){var l=wt();return z_(l,et,n,s)},useMemoCache:Ef,useCacheRefresh:s0};Of.useEffectEvent=W_;var u0={readContext:Xt,use:wc,useCallback:Q_,useContext:Xt,useEffect:Af,useImperativeHandle:Z_,useInsertionEffect:X_,useLayoutEffect:K_,useMemo:J_,useReducer:Mf,useRef:$_,useState:function(){return Mf(Vn)},useDebugValue:Df,useDeferredValue:function(n,s){var l=wt();return et===null?Rf(l,n,s):e0(l,et.memoizedState,n,s)},useTransition:function(){var n=Mf(Vn)[0],s=wt().memoizedState;return[typeof n=="boolean"?n:gl(n),s]},useSyncExternalStore:N_,useId:r0,useHostTransitionStatus:Lf,useFormState:F_,useActionState:F_,useOptimistic:function(n,s){var l=wt();return et!==null?z_(l,et,n,s):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:Ef,useCacheRefresh:s0};u0.useEffectEvent=W_;function Hf(n,s,l,u){s=n.memoizedState,l=l(u,s),l=l==null?s:g({},s,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var jf={enqueueSetState:function(n,s,l){n=n._reactInternals;var u=Ri(),p=br(u);p.payload=s,l!=null&&(p.callback=l),s=xr(n,p,u),s!==null&&(vi(s,n,u),hl(s,n,u))},enqueueReplaceState:function(n,s,l){n=n._reactInternals;var u=Ri(),p=br(u);p.tag=1,p.payload=s,l!=null&&(p.callback=l),s=xr(n,p,u),s!==null&&(vi(s,n,u),hl(s,n,u))},enqueueForceUpdate:function(n,s){n=n._reactInternals;var l=Ri(),u=br(l);u.tag=2,s!=null&&(u.callback=s),s=xr(n,u,l),s!==null&&(vi(s,n,l),hl(s,n,l))}};function h0(n,s,l,u,p,_,x){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,_,x):s.prototype&&s.prototype.isPureReactComponent?!nl(l,u)||!nl(p,_):!0}function f0(n,s,l,u){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,u),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,u),s.state!==n&&jf.enqueueReplaceState(s,s.state,null)}function ps(n,s){var l=s;if("ref"in s){l={};for(var u in s)u!=="ref"&&(l[u]=s[u])}if(n=n.defaultProps){l===s&&(l=g({},l));for(var p in n)l[p]===void 0&&(l[p]=n[p])}return l}function d0(n){sc(n)}function p0(n){console.error(n)}function g0(n){sc(n)}function Tc(n,s){try{var l=n.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(u){setTimeout(function(){throw u})}}function m0(n,s,l){try{var u=n.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Pf(n,s,l){return l=br(l),l.tag=3,l.payload={element:null},l.callback=function(){Tc(n,s)},l}function _0(n){return n=br(n),n.tag=3,n}function v0(n,s,l,u){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var _=u.value;n.payload=function(){return p(_)},n.callback=function(){m0(s,l,u)}}var x=l.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(n.callback=function(){m0(s,l,u),typeof p!="function"&&(Tr===null?Tr=new Set([this]):Tr.add(this));var D=u.stack;this.componentDidCatch(u.value,{componentStack:D!==null?D:""})})}function N2(n,s,l,u,p){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(s=l.alternate,s!==null&&Qs(s,l,p,!0),l=Ti.current,l!==null){switch(l.tag){case 31:case 13:return Fi===null?Ic():l.alternate===null&&_t===0&&(_t=3),l.flags&=-257,l.flags|=65536,l.lanes=p,u===gc?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([u]):s.add(u),ud(n,u,p)),!1;case 22:return l.flags|=65536,u===gc?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([u]):l.add(u)),ud(n,u,p)),!1}throw Error(r(435,l.tag))}return ud(n,u,p),Ic(),!1}if(Ve)return s=Ti.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,u!==rf&&(n=Error(r(422),{cause:u}),ol(Ii(n,l)))):(u!==rf&&(s=Error(r(423),{cause:u}),ol(Ii(s,l))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,u=Ii(u,l),p=Pf(n.stateNode,u,p),gf(n,p),_t!==4&&(_t=2)),!1;var _=Error(r(520),{cause:u});if(_=Ii(_,l),El===null?El=[_]:El.push(_),_t!==4&&(_t=2),s===null)return!0;u=Ii(u,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,n=p&-p,l.lanes|=n,n=Pf(l.stateNode,u,n),gf(l,n),!1;case 1:if(s=l.type,_=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Tr===null||!Tr.has(_))))return l.flags|=65536,p&=-p,l.lanes|=p,p=_0(p),v0(p,n,l,u),gf(l,p),!1}l=l.return}while(l!==null);return!1}var If=Error(r(461)),Tt=!1;function Kt(n,s,l,u){s.child=n===null?x_(s,null,l,u):fs(s,n.child,l,u)}function y0(n,s,l,u,p){l=l.render;var _=s.ref;if("ref"in u){var x={};for(var D in u)D!=="ref"&&(x[D]=u[D])}else x=u;return as(s),u=bf(n,s,l,x,_,p),D=xf(),n!==null&&!Tt?(wf(n,s,p),Fn(n,s,p)):(Ve&&D&&tf(s),s.flags|=1,Kt(n,s,u,p),s.child)}function S0(n,s,l,u,p){if(n===null){var _=l.type;return typeof _=="function"&&!Qh(_)&&_.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=_,b0(n,s,_,u,p)):(n=cc(l.type,null,u,s,s.mode,p),n.ref=s.ref,n.return=s,s.child=n)}if(_=n.child,!Xf(n,p)){var x=_.memoizedProps;if(l=l.compare,l=l!==null?l:nl,l(x,u)&&n.ref===s.ref)return Fn(n,s,p)}return s.flags|=1,n=jn(_,u),n.ref=s.ref,n.return=s,s.child=n}function b0(n,s,l,u,p){if(n!==null){var _=n.memoizedProps;if(nl(_,u)&&n.ref===s.ref)if(Tt=!1,s.pendingProps=u=_,Xf(n,p))(n.flags&131072)!==0&&(Tt=!0);else return s.lanes=n.lanes,Fn(n,s,p)}return Uf(n,s,l,u,p)}function x0(n,s,l,u){var p=u.children,_=n!==null?n.memoizedState:null;if(n===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((s.flags&128)!==0){if(_=_!==null?_.baseLanes|l:l,n!==null){for(u=s.child=n.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~_}else u=0,s.child=null;return w0(n,s,_,l,u)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},n!==null&&dc(s,_!==null?_.cachePool:null),_!==null?E_(s,_):_f(),k_(s);else return u=s.lanes=536870912,w0(n,s,_!==null?_.baseLanes|l:l,l,u)}else _!==null?(dc(s,_.cachePool),E_(s,_),Cr(),s.memoizedState=null):(n!==null&&dc(s,null),_f(),Cr());return Kt(n,s,p,l),s.child}function vl(n,s){return n!==null&&n.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function w0(n,s,l,u,p){var _=hf();return _=_===null?null:{parent:kt._currentValue,pool:_},s.memoizedState={baseLanes:l,cachePool:_},n!==null&&dc(s,null),_f(),k_(s),n!==null&&Qs(n,s,u,!0),s.childLanes=p,null}function Nc(n,s){return s=Dc({mode:s.mode,children:s.children},n.mode),s.ref=n.ref,n.child=s,s.return=n,s}function C0(n,s,l){return fs(s,n.child,null,l),n=Nc(s,s.pendingProps),n.flags|=2,Ni(s),s.memoizedState=null,n}function A2(n,s,l){var u=s.pendingProps,p=(s.flags&128)!==0;if(s.flags&=-129,n===null){if(Ve){if(u.mode==="hidden")return n=Nc(s,u),s.lanes=536870912,vl(null,n);if(yf(s),(n=lt)?(n=Ov(n,Vi),n=n!==null&&n.data==="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:mr!==null?{id:dn,overflow:pn}:null,retryLane:536870912,hydrationErrors:null},l=l_(n),l.return=s,s.child=l,Wt=s,lt=null)):n=null,n===null)throw vr(s);return s.lanes=536870912,null}return Nc(s,u)}var _=n.memoizedState;if(_!==null){var x=_.dehydrated;if(yf(s),p)if(s.flags&256)s.flags&=-257,s=C0(n,s,l);else if(s.memoizedState!==null)s.child=n.child,s.flags|=128,s=null;else throw Error(r(558));else if(Tt||Qs(n,s,l,!1),p=(l&n.childLanes)!==0,Tt||p){if(u=rt,u!==null&&(x=Ua(u,l),x!==0&&x!==_.retryLane))throw _.retryLane=x,rs(n,x),vi(u,n,x),If;Ic(),s=C0(n,s,l)}else n=_.treeContext,lt=$i(x.nextSibling),Wt=s,Ve=!0,_r=null,Vi=!1,n!==null&&u_(s,n),s=Nc(s,u),s.flags|=4096;return s}return n=jn(n.child,{mode:u.mode,children:u.children}),n.ref=s.ref,s.child=n,n.return=s,n}function Ac(n,s){var l=s.ref;if(l===null)n!==null&&n.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(n===null||n.ref!==l)&&(s.flags|=4194816)}}function Uf(n,s,l,u,p){return as(s),l=bf(n,s,l,u,void 0,p),u=xf(),n!==null&&!Tt?(wf(n,s,p),Fn(n,s,p)):(Ve&&u&&tf(s),s.flags|=1,Kt(n,s,l,p),s.child)}function E0(n,s,l,u,p,_){return as(s),s.updateQueue=null,l=T_(s,u,l,p),M_(n),u=xf(),n!==null&&!Tt?(wf(n,s,_),Fn(n,s,_)):(Ve&&u&&tf(s),s.flags|=1,Kt(n,s,l,_),s.child)}function k0(n,s,l,u,p){if(as(s),s.stateNode===null){var _=Xs,x=l.contextType;typeof x=="object"&&x!==null&&(_=Xt(x)),_=new l(u,_),s.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=jf,s.stateNode=_,_._reactInternals=s,_=s.stateNode,_.props=u,_.state=s.memoizedState,_.refs={},df(s),x=l.contextType,_.context=typeof x=="object"&&x!==null?Xt(x):Xs,_.state=s.memoizedState,x=l.getDerivedStateFromProps,typeof x=="function"&&(Hf(s,l,x,u),_.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(x=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),x!==_.state&&jf.enqueueReplaceState(_,_.state,null),dl(s,u,_,p),fl(),_.state=s.memoizedState),typeof _.componentDidMount=="function"&&(s.flags|=4194308),u=!0}else if(n===null){_=s.stateNode;var D=s.memoizedProps,W=ps(l,D);_.props=W;var J=_.context,se=l.contextType;x=Xs,typeof se=="object"&&se!==null&&(x=Xt(se));var ae=l.getDerivedStateFromProps;se=typeof ae=="function"||typeof _.getSnapshotBeforeUpdate=="function",D=s.pendingProps!==D,se||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D||J!==x)&&f0(s,_,u,x),Sr=!1;var te=s.memoizedState;_.state=te,dl(s,u,_,p),fl(),J=s.memoizedState,D||te!==J||Sr?(typeof ae=="function"&&(Hf(s,l,ae,u),J=s.memoizedState),(W=Sr||h0(s,l,W,u,te,J,x))?(se||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(s.flags|=4194308)):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=u,s.memoizedState=J),_.props=u,_.state=J,_.context=x,u=W):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),u=!1)}else{_=s.stateNode,pf(n,s),x=s.memoizedProps,se=ps(l,x),_.props=se,ae=s.pendingProps,te=_.context,J=l.contextType,W=Xs,typeof J=="object"&&J!==null&&(W=Xt(J)),D=l.getDerivedStateFromProps,(J=typeof D=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(x!==ae||te!==W)&&f0(s,_,u,W),Sr=!1,te=s.memoizedState,_.state=te,dl(s,u,_,p),fl();var ie=s.memoizedState;x!==ae||te!==ie||Sr||n!==null&&n.dependencies!==null&&hc(n.dependencies)?(typeof D=="function"&&(Hf(s,l,D,u),ie=s.memoizedState),(se=Sr||h0(s,l,se,u,te,ie,W)||n!==null&&n.dependencies!==null&&hc(n.dependencies))?(J||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(u,ie,W),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(u,ie,W)),typeof _.componentDidUpdate=="function"&&(s.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof _.componentDidUpdate!="function"||x===n.memoizedProps&&te===n.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||x===n.memoizedProps&&te===n.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=ie),_.props=u,_.state=ie,_.context=W,u=se):(typeof _.componentDidUpdate!="function"||x===n.memoizedProps&&te===n.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||x===n.memoizedProps&&te===n.memoizedState||(s.flags|=1024),u=!1)}return _=u,Ac(n,s),u=(s.flags&128)!==0,_||u?(_=s.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:_.render(),s.flags|=1,n!==null&&u?(s.child=fs(s,n.child,null,p),s.child=fs(s,null,l,p)):Kt(n,s,l,p),s.memoizedState=_.state,n=s.child):n=Fn(n,s,p),n}function M0(n,s,l,u){return os(),s.flags|=256,Kt(n,s,l,u),s.child}var qf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vf(n){return{baseLanes:n,cachePool:m_()}}function Ff(n,s,l){return n=n!==null?n.childLanes&~l:0,s&&(n|=Di),n}function T0(n,s,l){var u=s.pendingProps,p=!1,_=(s.flags&128)!==0,x;if((x=_)||(x=n!==null&&n.memoizedState===null?!1:(xt.current&2)!==0),x&&(p=!0,s.flags&=-129),x=(s.flags&32)!==0,s.flags&=-33,n===null){if(Ve){if(p?wr(s):Cr(),(n=lt)?(n=Ov(n,Vi),n=n!==null&&n.data!=="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:mr!==null?{id:dn,overflow:pn}:null,retryLane:536870912,hydrationErrors:null},l=l_(n),l.return=s,s.child=l,Wt=s,lt=null)):n=null,n===null)throw vr(s);return kd(n)?s.lanes=32:s.lanes=536870912,null}var D=u.children;return u=u.fallback,p?(Cr(),p=s.mode,D=Dc({mode:"hidden",children:D},p),u=ss(u,p,l,null),D.return=s,u.return=s,D.sibling=u,s.child=D,u=s.child,u.memoizedState=Vf(l),u.childLanes=Ff(n,x,l),s.memoizedState=qf,vl(null,u)):(wr(s),$f(s,D))}var W=n.memoizedState;if(W!==null&&(D=W.dehydrated,D!==null)){if(_)s.flags&256?(wr(s),s.flags&=-257,s=Yf(n,s,l)):s.memoizedState!==null?(Cr(),s.child=n.child,s.flags|=128,s=null):(Cr(),D=u.fallback,p=s.mode,u=Dc({mode:"visible",children:u.children},p),D=ss(D,p,l,null),D.flags|=2,u.return=s,D.return=s,u.sibling=D,s.child=u,fs(s,n.child,null,l),u=s.child,u.memoizedState=Vf(l),u.childLanes=Ff(n,x,l),s.memoizedState=qf,s=vl(null,u));else if(wr(s),kd(D)){if(x=D.nextSibling&&D.nextSibling.dataset,x)var J=x.dgst;x=J,u=Error(r(419)),u.stack="",u.digest=x,ol({value:u,source:null,stack:null}),s=Yf(n,s,l)}else if(Tt||Qs(n,s,l,!1),x=(l&n.childLanes)!==0,Tt||x){if(x=rt,x!==null&&(u=Ua(x,l),u!==0&&u!==W.retryLane))throw W.retryLane=u,rs(n,u),vi(x,n,u),If;Ed(D)||Ic(),s=Yf(n,s,l)}else Ed(D)?(s.flags|=192,s.child=n.child,s=null):(n=W.treeContext,lt=$i(D.nextSibling),Wt=s,Ve=!0,_r=null,Vi=!1,n!==null&&u_(s,n),s=$f(s,u.children),s.flags|=4096);return s}return p?(Cr(),D=u.fallback,p=s.mode,W=n.child,J=W.sibling,u=jn(W,{mode:"hidden",children:u.children}),u.subtreeFlags=W.subtreeFlags&65011712,J!==null?D=jn(J,D):(D=ss(D,p,l,null),D.flags|=2),D.return=s,u.return=s,u.sibling=D,s.child=u,vl(null,u),u=s.child,D=n.child.memoizedState,D===null?D=Vf(l):(p=D.cachePool,p!==null?(W=kt._currentValue,p=p.parent!==W?{parent:W,pool:W}:p):p=m_(),D={baseLanes:D.baseLanes|l,cachePool:p}),u.memoizedState=D,u.childLanes=Ff(n,x,l),s.memoizedState=qf,vl(n.child,u)):(wr(s),l=n.child,n=l.sibling,l=jn(l,{mode:"visible",children:u.children}),l.return=s,l.sibling=null,n!==null&&(x=s.deletions,x===null?(s.deletions=[n],s.flags|=16):x.push(n)),s.child=l,s.memoizedState=null,l)}function $f(n,s){return s=Dc({mode:"visible",children:s},n.mode),s.return=n,n.child=s}function Dc(n,s){return n=Mi(22,n,null,s),n.lanes=0,n}function Yf(n,s,l){return fs(s,n.child,null,l),n=$f(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function N0(n,s,l){n.lanes|=s;var u=n.alternate;u!==null&&(u.lanes|=s),lf(n.return,s,l)}function Wf(n,s,l,u,p,_){var x=n.memoizedState;x===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:p,treeForkCount:_}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=u,x.tail=l,x.tailMode=p,x.treeForkCount=_)}function A0(n,s,l){var u=s.pendingProps,p=u.revealOrder,_=u.tail;u=u.children;var x=xt.current,D=(x&2)!==0;if(D?(x=x&1|2,s.flags|=128):x&=1,A(xt,x),Kt(n,s,u,l),u=Ve?sl:0,!D&&n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&N0(n,l,s);else if(n.tag===19)N0(n,l,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(l=s.child,p=null;l!==null;)n=l.alternate,n!==null&&yc(n)===null&&(p=l),l=l.sibling;l=p,l===null?(p=s.child,s.child=null):(p=l.sibling,l.sibling=null),Wf(s,!1,p,l,_,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=s.child,s.child=null;p!==null;){if(n=p.alternate,n!==null&&yc(n)===null){s.child=p;break}n=p.sibling,p.sibling=l,l=p,p=n}Wf(s,!0,l,null,_,u);break;case"together":Wf(s,!1,null,null,void 0,u);break;default:s.memoizedState=null}return s.child}function Fn(n,s,l){if(n!==null&&(s.dependencies=n.dependencies),Mr|=s.lanes,(l&s.childLanes)===0)if(n!==null){if(Qs(n,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(n!==null&&s.child!==n.child)throw Error(r(153));if(s.child!==null){for(n=s.child,l=jn(n,n.pendingProps),s.child=l,l.return=s;n.sibling!==null;)n=n.sibling,l=l.sibling=jn(n,n.pendingProps),l.return=s;l.sibling=null}return s.child}function Xf(n,s){return(n.lanes&s)!==0?!0:(n=n.dependencies,!!(n!==null&&hc(n)))}function D2(n,s,l){switch(s.tag){case 3:he(s,s.stateNode.containerInfo),yr(s,kt,n.memoizedState.cache),os();break;case 27:case 5:Ce(s);break;case 4:he(s,s.stateNode.containerInfo);break;case 10:yr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,yf(s),null;break;case 13:var u=s.memoizedState;if(u!==null)return u.dehydrated!==null?(wr(s),s.flags|=128,null):(l&s.child.childLanes)!==0?T0(n,s,l):(wr(s),n=Fn(n,s,l),n!==null?n.sibling:null);wr(s);break;case 19:var p=(n.flags&128)!==0;if(u=(l&s.childLanes)!==0,u||(Qs(n,s,l,!1),u=(l&s.childLanes)!==0),p){if(u)return A0(n,s,l);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),A(xt,xt.current),u)break;return null;case 22:return s.lanes=0,x0(n,s,l,s.pendingProps);case 24:yr(s,kt,n.memoizedState.cache)}return Fn(n,s,l)}function D0(n,s,l){if(n!==null)if(n.memoizedProps!==s.pendingProps)Tt=!0;else{if(!Xf(n,l)&&(s.flags&128)===0)return Tt=!1,D2(n,s,l);Tt=(n.flags&131072)!==0}else Tt=!1,Ve&&(s.flags&1048576)!==0&&c_(s,sl,s.index);switch(s.lanes=0,s.tag){case 16:e:{var u=s.pendingProps;if(n=us(s.elementType),s.type=n,typeof n=="function")Qh(n)?(u=ps(n,u),s.tag=1,s=k0(null,s,n,u,l)):(s.tag=0,s=Uf(null,s,n,u,l));else{if(n!=null){var p=n.$$typeof;if(p===T){s.tag=11,s=y0(null,s,n,u,l);break e}else if(p===U){s.tag=14,s=S0(null,s,n,u,l);break e}}throw s=B(n)||n,Error(r(306,s,""))}}return s;case 0:return Uf(n,s,s.type,s.pendingProps,l);case 1:return u=s.type,p=ps(u,s.pendingProps),k0(n,s,u,p,l);case 3:e:{if(he(s,s.stateNode.containerInfo),n===null)throw Error(r(387));u=s.pendingProps;var _=s.memoizedState;p=_.element,pf(n,s),dl(s,u,null,l);var x=s.memoizedState;if(u=x.cache,yr(s,kt,u),u!==_.cache&&af(s,[kt],l,!0),fl(),u=x.element,_.isDehydrated)if(_={element:u,isDehydrated:!1,cache:x.cache},s.updateQueue.baseState=_,s.memoizedState=_,s.flags&256){s=M0(n,s,u,l);break e}else if(u!==p){p=Ii(Error(r(424)),s),ol(p),s=M0(n,s,u,l);break e}else{switch(n=s.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(lt=$i(n.firstChild),Wt=s,Ve=!0,_r=null,Vi=!0,l=x_(s,null,u,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(os(),u===p){s=Fn(n,s,l);break e}Kt(n,s,u,l)}s=s.child}return s;case 26:return Ac(n,s),n===null?(l=qv(s.type,null,s.pendingProps,null))?s.memoizedState=l:Ve||(l=s.type,n=s.pendingProps,u=Wc(le.current).createElement(l),u[zt]=s,u[ti]=n,Gt(u,l,n),Et(u),s.stateNode=u):s.memoizedState=qv(s.type,n.memoizedProps,s.pendingProps,n.memoizedState),null;case 27:return Ce(s),n===null&&Ve&&(u=s.stateNode=Pv(s.type,s.pendingProps,le.current),Wt=s,Vi=!0,p=lt,Rr(s.type)?(Md=p,lt=$i(u.firstChild)):lt=p),Kt(n,s,s.pendingProps.children,l),Ac(n,s),n===null&&(s.flags|=4194304),s.child;case 5:return n===null&&Ve&&((p=u=lt)&&(u=lE(u,s.type,s.pendingProps,Vi),u!==null?(s.stateNode=u,Wt=s,lt=$i(u.firstChild),Vi=!1,p=!0):p=!1),p||vr(s)),Ce(s),p=s.type,_=s.pendingProps,x=n!==null?n.memoizedProps:null,u=_.children,xd(p,_)?u=null:x!==null&&xd(p,x)&&(s.flags|=32),s.memoizedState!==null&&(p=bf(n,s,x2,null,null,l),Bl._currentValue=p),Ac(n,s),Kt(n,s,u,l),s.child;case 6:return n===null&&Ve&&((n=l=lt)&&(l=aE(l,s.pendingProps,Vi),l!==null?(s.stateNode=l,Wt=s,lt=null,n=!0):n=!1),n||vr(s)),null;case 13:return T0(n,s,l);case 4:return he(s,s.stateNode.containerInfo),u=s.pendingProps,n===null?s.child=fs(s,null,u,l):Kt(n,s,u,l),s.child;case 11:return y0(n,s,s.type,s.pendingProps,l);case 7:return Kt(n,s,s.pendingProps,l),s.child;case 8:return Kt(n,s,s.pendingProps.children,l),s.child;case 12:return Kt(n,s,s.pendingProps.children,l),s.child;case 10:return u=s.pendingProps,yr(s,s.type,u.value),Kt(n,s,u.children,l),s.child;case 9:return p=s.type._context,u=s.pendingProps.children,as(s),p=Xt(p),u=u(p),s.flags|=1,Kt(n,s,u,l),s.child;case 14:return S0(n,s,s.type,s.pendingProps,l);case 15:return b0(n,s,s.type,s.pendingProps,l);case 19:return A0(n,s,l);case 31:return A2(n,s,l);case 22:return x0(n,s,l,s.pendingProps);case 24:return as(s),u=Xt(kt),n===null?(p=hf(),p===null&&(p=rt,_=cf(),p.pooledCache=_,_.refCount++,_!==null&&(p.pooledCacheLanes|=l),p=_),s.memoizedState={parent:u,cache:p},df(s),yr(s,kt,p)):((n.lanes&l)!==0&&(pf(n,s),dl(s,null,null,l),fl()),p=n.memoizedState,_=s.memoizedState,p.parent!==u?(p={parent:u,cache:u},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),yr(s,kt,u)):(u=_.cache,yr(s,kt,u),u!==p.cache&&af(s,[kt],l,!0))),Kt(n,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function $n(n){n.flags|=4}function Kf(n,s,l,u,p){if((s=(n.mode&32)!==0)&&(s=!1),s){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(rv())n.flags|=8192;else throw hs=gc,ff}else n.flags&=-16777217}function R0(n,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Wv(s))if(rv())n.flags|=8192;else throw hs=gc,ff}function Rc(n,s){s!==null&&(n.flags|=4),n.flags&16384&&(s=n.tag!==22?ja():536870912,n.lanes|=s,uo|=s)}function yl(n,s){if(!Ve)switch(n.tailMode){case"hidden":s=n.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function at(n){var s=n.alternate!==null&&n.alternate.child===n.child,l=0,u=0;if(s)for(var p=n.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=u,n.childLanes=l,s}function R2(n,s,l){var u=s.pendingProps;switch(nf(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(s),null;case 1:return at(s),null;case 3:return l=s.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Un(kt),pe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Zs(s)?$n(s):n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,sf())),at(s),null;case 26:var p=s.type,_=s.memoizedState;return n===null?($n(s),_!==null?(at(s),R0(s,_)):(at(s),Kf(s,p,null,u,l))):_?_!==n.memoizedState?($n(s),at(s),R0(s,_)):(at(s),s.flags&=-16777217):(n=n.memoizedProps,n!==u&&$n(s),at(s),Kf(s,p,n,u,l)),null;case 27:if(xe(s),l=le.current,p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==u&&$n(s);else{if(!u){if(s.stateNode===null)throw Error(r(166));return at(s),null}n=ee.current,Zs(s)?h_(s):(n=Pv(p,u,l),s.stateNode=n,$n(s))}return at(s),null;case 5:if(xe(s),p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==u&&$n(s);else{if(!u){if(s.stateNode===null)throw Error(r(166));return at(s),null}if(_=ee.current,Zs(s))h_(s);else{var x=Wc(le.current);switch(_){case 1:_=x.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:_=x.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":_=x.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":_=x.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":_=x.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof u.is=="string"?x.createElement("select",{is:u.is}):x.createElement("select"),u.multiple?_.multiple=!0:u.size&&(_.size=u.size);break;default:_=typeof u.is=="string"?x.createElement(p,{is:u.is}):x.createElement(p)}}_[zt]=s,_[ti]=u;e:for(x=s.child;x!==null;){if(x.tag===5||x.tag===6)_.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===s)break e;for(;x.sibling===null;){if(x.return===null||x.return===s)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}s.stateNode=_;e:switch(Gt(_,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&$n(s)}}return at(s),Kf(s,s.type,n===null?null:n.memoizedProps,s.pendingProps,l),null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==u&&$n(s);else{if(typeof u!="string"&&s.stateNode===null)throw Error(r(166));if(n=le.current,Zs(s)){if(n=s.stateNode,l=s.memoizedProps,u=null,p=Wt,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}n[zt]=s,n=!!(n.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||Tv(n.nodeValue,l)),n||vr(s,!0)}else n=Wc(n).createTextNode(u),n[zt]=s,s.stateNode=n}return at(s),null;case 31:if(l=s.memoizedState,n===null||n.memoizedState!==null){if(u=Zs(s),l!==null){if(n===null){if(!u)throw Error(r(318));if(n=s.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(557));n[zt]=s}else os(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;at(s),n=!1}else l=sf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return s.flags&256?(Ni(s),s):(Ni(s),null);if((s.flags&128)!==0)throw Error(r(558))}return at(s),null;case 13:if(u=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=Zs(s),u!==null&&u.dehydrated!==null){if(n===null){if(!p)throw Error(r(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[zt]=s}else os(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;at(s),p=!1}else p=sf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(Ni(s),s):(Ni(s),null)}return Ni(s),(s.flags&128)!==0?(s.lanes=l,s):(l=u!==null,n=n!==null&&n.memoizedState!==null,l&&(u=s.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),_=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(_=u.memoizedState.cachePool.pool),_!==p&&(u.flags|=2048)),l!==n&&l&&(s.child.flags|=8192),Rc(s,s.updateQueue),at(s),null);case 4:return pe(),n===null&&_d(s.stateNode.containerInfo),at(s),null;case 10:return Un(s.type),at(s),null;case 19:if(Y(xt),u=s.memoizedState,u===null)return at(s),null;if(p=(s.flags&128)!==0,_=u.rendering,_===null)if(p)yl(u,!1);else{if(_t!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(_=yc(n),_!==null){for(s.flags|=128,yl(u,!1),n=_.updateQueue,s.updateQueue=n,Rc(s,n),s.subtreeFlags=0,n=l,l=s.child;l!==null;)o_(l,n),l=l.sibling;return A(xt,xt.current&1|2),Ve&&Pn(s,u.treeForkCount),s.child}n=n.sibling}u.tail!==null&&Lt()>Hc&&(s.flags|=128,p=!0,yl(u,!1),s.lanes=4194304)}else{if(!p)if(n=yc(_),n!==null){if(s.flags|=128,p=!0,n=n.updateQueue,s.updateQueue=n,Rc(s,n),yl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!_.alternate&&!Ve)return at(s),null}else 2*Lt()-u.renderingStartTime>Hc&&l!==536870912&&(s.flags|=128,p=!0,yl(u,!1),s.lanes=4194304);u.isBackwards?(_.sibling=s.child,s.child=_):(n=u.last,n!==null?n.sibling=_:s.child=_,u.last=_)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Lt(),n.sibling=null,l=xt.current,A(xt,p?l&1|2:l&1),Ve&&Pn(s,u.treeForkCount),n):(at(s),null);case 22:case 23:return Ni(s),vf(),u=s.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(s.flags|=8192):u&&(s.flags|=8192),u?(l&536870912)!==0&&(s.flags&128)===0&&(at(s),s.subtreeFlags&6&&(s.flags|=8192)):at(s),l=s.updateQueue,l!==null&&Rc(s,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),u=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),u!==l&&(s.flags|=2048),n!==null&&Y(cs),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),Un(kt),at(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function B2(n,s){switch(nf(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return Un(kt),pe(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return xe(s),null;case 31:if(s.memoizedState!==null){if(Ni(s),s.alternate===null)throw Error(r(340));os()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 13:if(Ni(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(r(340));os()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return Y(xt),null;case 4:return pe(),null;case 10:return Un(s.type),null;case 22:case 23:return Ni(s),vf(),n!==null&&Y(cs),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return Un(kt),null;case 25:return null;default:return null}}function B0(n,s){switch(nf(s),s.tag){case 3:Un(kt),pe();break;case 26:case 27:case 5:xe(s);break;case 4:pe();break;case 31:s.memoizedState!==null&&Ni(s);break;case 13:Ni(s);break;case 19:Y(xt);break;case 10:Un(s.type);break;case 22:case 23:Ni(s),vf(),n!==null&&Y(cs);break;case 24:Un(kt)}}function Sl(n,s){try{var l=s.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var p=u.next;l=p;do{if((l.tag&n)===n){u=void 0;var _=l.create,x=l.inst;u=_(),x.destroy=u}l=l.next}while(l!==p)}}catch(D){Je(s,s.return,D)}}function Er(n,s,l){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var _=p.next;u=_;do{if((u.tag&n)===n){var x=u.inst,D=x.destroy;if(D!==void 0){x.destroy=void 0,p=s;var W=l,J=D;try{J()}catch(se){Je(p,W,se)}}}u=u.next}while(u!==_)}}catch(se){Je(s,s.return,se)}}function L0(n){var s=n.updateQueue;if(s!==null){var l=n.stateNode;try{C_(s,l)}catch(u){Je(n,n.return,u)}}}function z0(n,s,l){l.props=ps(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(u){Je(n,s,u)}}function bl(n,s){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof l=="function"?n.refCleanup=l(u):l.current=u}}catch(p){Je(n,s,p)}}function gn(n,s){var l=n.ref,u=n.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(p){Je(n,s,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){Je(n,s,p)}else l.current=null}function O0(n){var s=n.type,l=n.memoizedProps,u=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(p){Je(n,n.return,p)}}function Gf(n,s,l){try{var u=n.stateNode;tE(u,n.type,l,s),u[ti]=s}catch(p){Je(n,n.return,p)}}function H0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Rr(n.type)||n.tag===4}function Zf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||H0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Rr(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Qf(n,s,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(n),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=On));else if(u!==4&&(u===27&&Rr(n.type)&&(l=n.stateNode,s=null),n=n.child,n!==null))for(Qf(n,s,l),n=n.sibling;n!==null;)Qf(n,s,l),n=n.sibling}function Bc(n,s,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,s?l.insertBefore(n,s):l.appendChild(n);else if(u!==4&&(u===27&&Rr(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(Bc(n,s,l),n=n.sibling;n!==null;)Bc(n,s,l),n=n.sibling}function j0(n){var s=n.stateNode,l=n.memoizedProps;try{for(var u=n.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);Gt(s,u,l),s[zt]=n,s[ti]=l}catch(_){Je(n,n.return,_)}}var Yn=!1,Nt=!1,Jf=!1,P0=typeof WeakSet=="function"?WeakSet:Set,It=null;function L2(n,s){if(n=n.containerInfo,Sd=eu,n=Zm(n),$h(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var p=u.anchorOffset,_=u.focusNode;u=u.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var x=0,D=-1,W=-1,J=0,se=0,ae=n,te=null;t:for(;;){for(var ie;ae!==l||p!==0&&ae.nodeType!==3||(D=x+p),ae!==_||u!==0&&ae.nodeType!==3||(W=x+u),ae.nodeType===3&&(x+=ae.nodeValue.length),(ie=ae.firstChild)!==null;)te=ae,ae=ie;for(;;){if(ae===n)break t;if(te===l&&++J===p&&(D=x),te===_&&++se===u&&(W=x),(ie=ae.nextSibling)!==null)break;ae=te,te=ae.parentNode}ae=ie}l=D===-1||W===-1?null:{start:D,end:W}}else l=null}l=l||{start:0,end:0}}else l=null;for(bd={focusedElem:n,selectionRange:l},eu=!1,It=s;It!==null;)if(s=It,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,It=n;else for(;It!==null;){switch(s=It,_=s.alternate,n=s.flags,s.tag){case 0:if((n&4)!==0&&(n=s.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)p=n[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&_!==null){n=void 0,l=s,p=_.memoizedProps,_=_.memoizedState,u=l.stateNode;try{var ye=ps(l.type,p);n=u.getSnapshotBeforeUpdate(ye,_),u.__reactInternalSnapshotBeforeUpdate=n}catch(Me){Je(l,l.return,Me)}}break;case 3:if((n&1024)!==0){if(n=s.stateNode.containerInfo,l=n.nodeType,l===9)Cd(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Cd(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(r(163))}if(n=s.sibling,n!==null){n.return=s.return,It=n;break}It=s.return}}function I0(n,s,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:Xn(n,l),u&4&&Sl(5,l);break;case 1:if(Xn(n,l),u&4)if(n=l.stateNode,s===null)try{n.componentDidMount()}catch(x){Je(l,l.return,x)}else{var p=ps(l.type,s.memoizedProps);s=s.memoizedState;try{n.componentDidUpdate(p,s,n.__reactInternalSnapshotBeforeUpdate)}catch(x){Je(l,l.return,x)}}u&64&&L0(l),u&512&&bl(l,l.return);break;case 3:if(Xn(n,l),u&64&&(n=l.updateQueue,n!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{C_(n,s)}catch(x){Je(l,l.return,x)}}break;case 27:s===null&&u&4&&j0(l);case 26:case 5:Xn(n,l),s===null&&u&4&&O0(l),u&512&&bl(l,l.return);break;case 12:Xn(n,l);break;case 31:Xn(n,l),u&4&&V0(n,l);break;case 13:Xn(n,l),u&4&&F0(n,l),u&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=V2.bind(null,l),cE(n,l))));break;case 22:if(u=l.memoizedState!==null||Yn,!u){s=s!==null&&s.memoizedState!==null||Nt,p=Yn;var _=Nt;Yn=u,(Nt=s)&&!_?Kn(n,l,(l.subtreeFlags&8772)!==0):Xn(n,l),Yn=p,Nt=_}break;case 30:break;default:Xn(n,l)}}function U0(n){var s=n.alternate;s!==null&&(n.alternate=null,U0(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&Wo(s)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var ut=null,pi=!1;function Wn(n,s,l){for(l=l.child;l!==null;)q0(n,s,l),l=l.sibling}function q0(n,s,l){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Yt,l)}catch{}switch(l.tag){case 26:Nt||gn(l,s),Wn(n,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Nt||gn(l,s);var u=ut,p=pi;Rr(l.type)&&(ut=l.stateNode,pi=!1),Wn(n,s,l),Al(l.stateNode),ut=u,pi=p;break;case 5:Nt||gn(l,s);case 6:if(u=ut,p=pi,ut=null,Wn(n,s,l),ut=u,pi=p,ut!==null)if(pi)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(l.stateNode)}catch(_){Je(l,s,_)}else try{ut.removeChild(l.stateNode)}catch(_){Je(l,s,_)}break;case 18:ut!==null&&(pi?(n=ut,Lv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),yo(n)):Lv(ut,l.stateNode));break;case 4:u=ut,p=pi,ut=l.stateNode.containerInfo,pi=!0,Wn(n,s,l),ut=u,pi=p;break;case 0:case 11:case 14:case 15:Er(2,l,s),Nt||Er(4,l,s),Wn(n,s,l);break;case 1:Nt||(gn(l,s),u=l.stateNode,typeof u.componentWillUnmount=="function"&&z0(l,s,u)),Wn(n,s,l);break;case 21:Wn(n,s,l);break;case 22:Nt=(u=Nt)||l.memoizedState!==null,Wn(n,s,l),Nt=u;break;default:Wn(n,s,l)}}function V0(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{yo(n)}catch(l){Je(s,s.return,l)}}}function F0(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{yo(n)}catch(l){Je(s,s.return,l)}}function z2(n){switch(n.tag){case 31:case 13:case 19:var s=n.stateNode;return s===null&&(s=n.stateNode=new P0),s;case 22:return n=n.stateNode,s=n._retryCache,s===null&&(s=n._retryCache=new P0),s;default:throw Error(r(435,n.tag))}}function Lc(n,s){var l=z2(n);s.forEach(function(u){if(!l.has(u)){l.add(u);var p=F2.bind(null,n,u);u.then(p,p)}})}function gi(n,s){var l=s.deletions;if(l!==null)for(var u=0;u<l.length;u++){var p=l[u],_=n,x=s,D=x;e:for(;D!==null;){switch(D.tag){case 27:if(Rr(D.type)){ut=D.stateNode,pi=!1;break e}break;case 5:ut=D.stateNode,pi=!1;break e;case 3:case 4:ut=D.stateNode.containerInfo,pi=!0;break e}D=D.return}if(ut===null)throw Error(r(160));q0(_,x,p),ut=null,pi=!1,_=p.alternate,_!==null&&(_.return=null),p.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)$0(s,n),s=s.sibling}var nn=null;function $0(n,s){var l=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:gi(s,n),mi(n),u&4&&(Er(3,n,n.return),Sl(3,n),Er(5,n,n.return));break;case 1:gi(s,n),mi(n),u&512&&(Nt||l===null||gn(l,l.return)),u&64&&Yn&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var p=nn;if(gi(s,n),mi(n),u&512&&(Nt||l===null||gn(l,l.return)),u&4){var _=l!==null?l.memoizedState:null;if(u=n.memoizedState,l===null)if(u===null)if(n.stateNode===null){e:{u=n.type,l=n.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":_=p.getElementsByTagName("title")[0],(!_||_[Qr]||_[zt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=p.createElement(u),p.head.insertBefore(_,p.querySelector("head > title"))),Gt(_,u,l),_[zt]=n,Et(_),u=_;break e;case"link":var x=$v("link","href",p).get(u+(l.href||""));if(x){for(var D=0;D<x.length;D++)if(_=x[D],_.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&_.getAttribute("rel")===(l.rel==null?null:l.rel)&&_.getAttribute("title")===(l.title==null?null:l.title)&&_.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){x.splice(D,1);break t}}_=p.createElement(u),Gt(_,u,l),p.head.appendChild(_);break;case"meta":if(x=$v("meta","content",p).get(u+(l.content||""))){for(D=0;D<x.length;D++)if(_=x[D],_.getAttribute("content")===(l.content==null?null:""+l.content)&&_.getAttribute("name")===(l.name==null?null:l.name)&&_.getAttribute("property")===(l.property==null?null:l.property)&&_.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&_.getAttribute("charset")===(l.charSet==null?null:l.charSet)){x.splice(D,1);break t}}_=p.createElement(u),Gt(_,u,l),p.head.appendChild(_);break;default:throw Error(r(468,u))}_[zt]=n,Et(_),u=_}n.stateNode=u}else Yv(p,n.type,n.stateNode);else n.stateNode=Fv(p,u,n.memoizedProps);else _!==u?(_===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):_.count--,u===null?Yv(p,n.type,n.stateNode):Fv(p,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Gf(n,n.memoizedProps,l.memoizedProps)}break;case 27:gi(s,n),mi(n),u&512&&(Nt||l===null||gn(l,l.return)),l!==null&&u&4&&Gf(n,n.memoizedProps,l.memoizedProps);break;case 5:if(gi(s,n),mi(n),u&512&&(Nt||l===null||gn(l,l.return)),n.flags&32){p=n.stateNode;try{Us(p,"")}catch(ye){Je(n,n.return,ye)}}u&4&&n.stateNode!=null&&(p=n.memoizedProps,Gf(n,p,l!==null?l.memoizedProps:p)),u&1024&&(Jf=!0);break;case 6:if(gi(s,n),mi(n),u&4){if(n.stateNode===null)throw Error(r(162));u=n.memoizedProps,l=n.stateNode;try{l.nodeValue=u}catch(ye){Je(n,n.return,ye)}}break;case 3:if(Gc=null,p=nn,nn=Xc(s.containerInfo),gi(s,n),nn=p,mi(n),u&4&&l!==null&&l.memoizedState.isDehydrated)try{yo(s.containerInfo)}catch(ye){Je(n,n.return,ye)}Jf&&(Jf=!1,Y0(n));break;case 4:u=nn,nn=Xc(n.stateNode.containerInfo),gi(s,n),mi(n),nn=u;break;case 12:gi(s,n),mi(n);break;case 31:gi(s,n),mi(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Lc(n,u)));break;case 13:gi(s,n),mi(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Oc=Lt()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Lc(n,u)));break;case 22:p=n.memoizedState!==null;var W=l!==null&&l.memoizedState!==null,J=Yn,se=Nt;if(Yn=J||p,Nt=se||W,gi(s,n),Nt=se,Yn=J,mi(n),u&8192)e:for(s=n.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(l===null||W||Yn||Nt||gs(n)),l=null,s=n;;){if(s.tag===5||s.tag===26){if(l===null){W=l=s;try{if(_=W.stateNode,p)x=_.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{D=W.stateNode;var ae=W.memoizedProps.style,te=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;D.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(ye){Je(W,W.return,ye)}}}else if(s.tag===6){if(l===null){W=s;try{W.stateNode.nodeValue=p?"":W.memoizedProps}catch(ye){Je(W,W.return,ye)}}}else if(s.tag===18){if(l===null){W=s;try{var ie=W.stateNode;p?zv(ie,!0):zv(W.stateNode,!1)}catch(ye){Je(W,W.return,ye)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===n)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break e;for(;s.sibling===null;){if(s.return===null||s.return===n)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}u&4&&(u=n.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,Lc(n,l))));break;case 19:gi(s,n),mi(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Lc(n,u)));break;case 30:break;case 21:break;default:gi(s,n),mi(n)}}function mi(n){var s=n.flags;if(s&2){try{for(var l,u=n.return;u!==null;){if(H0(u)){l=u;break}u=u.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var p=l.stateNode,_=Zf(n);Bc(n,_,p);break;case 5:var x=l.stateNode;l.flags&32&&(Us(x,""),l.flags&=-33);var D=Zf(n);Bc(n,D,x);break;case 3:case 4:var W=l.stateNode.containerInfo,J=Zf(n);Qf(n,J,W);break;default:throw Error(r(161))}}catch(se){Je(n,n.return,se)}n.flags&=-3}s&4096&&(n.flags&=-4097)}function Y0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var s=n;Y0(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),n=n.sibling}}function Xn(n,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)I0(n,s.alternate,s),s=s.sibling}function gs(n){for(n=n.child;n!==null;){var s=n;switch(s.tag){case 0:case 11:case 14:case 15:Er(4,s,s.return),gs(s);break;case 1:gn(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&z0(s,s.return,l),gs(s);break;case 27:Al(s.stateNode);case 26:case 5:gn(s,s.return),gs(s);break;case 22:s.memoizedState===null&&gs(s);break;case 30:gs(s);break;default:gs(s)}n=n.sibling}}function Kn(n,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var u=s.alternate,p=n,_=s,x=_.flags;switch(_.tag){case 0:case 11:case 15:Kn(p,_,l),Sl(4,_);break;case 1:if(Kn(p,_,l),u=_,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(J){Je(u,u.return,J)}if(u=_,p=u.updateQueue,p!==null){var D=u.stateNode;try{var W=p.shared.hiddenCallbacks;if(W!==null)for(p.shared.hiddenCallbacks=null,p=0;p<W.length;p++)w_(W[p],D)}catch(J){Je(u,u.return,J)}}l&&x&64&&L0(_),bl(_,_.return);break;case 27:j0(_);case 26:case 5:Kn(p,_,l),l&&u===null&&x&4&&O0(_),bl(_,_.return);break;case 12:Kn(p,_,l);break;case 31:Kn(p,_,l),l&&x&4&&V0(p,_);break;case 13:Kn(p,_,l),l&&x&4&&F0(p,_);break;case 22:_.memoizedState===null&&Kn(p,_,l),bl(_,_.return);break;case 30:break;default:Kn(p,_,l)}s=s.sibling}}function ed(n,s){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&ll(l))}function td(n,s){n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&ll(n))}function rn(n,s,l,u){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)W0(n,s,l,u),s=s.sibling}function W0(n,s,l,u){var p=s.flags;switch(s.tag){case 0:case 11:case 15:rn(n,s,l,u),p&2048&&Sl(9,s);break;case 1:rn(n,s,l,u);break;case 3:rn(n,s,l,u),p&2048&&(n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&ll(n)));break;case 12:if(p&2048){rn(n,s,l,u),n=s.stateNode;try{var _=s.memoizedProps,x=_.id,D=_.onPostCommit;typeof D=="function"&&D(x,s.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(W){Je(s,s.return,W)}}else rn(n,s,l,u);break;case 31:rn(n,s,l,u);break;case 13:rn(n,s,l,u);break;case 23:break;case 22:_=s.stateNode,x=s.alternate,s.memoizedState!==null?_._visibility&2?rn(n,s,l,u):xl(n,s):_._visibility&2?rn(n,s,l,u):(_._visibility|=2,lo(n,s,l,u,(s.subtreeFlags&10256)!==0||!1)),p&2048&&ed(x,s);break;case 24:rn(n,s,l,u),p&2048&&td(s.alternate,s);break;default:rn(n,s,l,u)}}function lo(n,s,l,u,p){for(p=p&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var _=n,x=s,D=l,W=u,J=x.flags;switch(x.tag){case 0:case 11:case 15:lo(_,x,D,W,p),Sl(8,x);break;case 23:break;case 22:var se=x.stateNode;x.memoizedState!==null?se._visibility&2?lo(_,x,D,W,p):xl(_,x):(se._visibility|=2,lo(_,x,D,W,p)),p&&J&2048&&ed(x.alternate,x);break;case 24:lo(_,x,D,W,p),p&&J&2048&&td(x.alternate,x);break;default:lo(_,x,D,W,p)}s=s.sibling}}function xl(n,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=n,u=s,p=u.flags;switch(u.tag){case 22:xl(l,u),p&2048&&ed(u.alternate,u);break;case 24:xl(l,u),p&2048&&td(u.alternate,u);break;default:xl(l,u)}s=s.sibling}}var wl=8192;function ao(n,s,l){if(n.subtreeFlags&wl)for(n=n.child;n!==null;)X0(n,s,l),n=n.sibling}function X0(n,s,l){switch(n.tag){case 26:ao(n,s,l),n.flags&wl&&n.memoizedState!==null&&bE(l,nn,n.memoizedState,n.memoizedProps);break;case 5:ao(n,s,l);break;case 3:case 4:var u=nn;nn=Xc(n.stateNode.containerInfo),ao(n,s,l),nn=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=wl,wl=16777216,ao(n,s,l),wl=u):ao(n,s,l));break;default:ao(n,s,l)}}function K0(n){var s=n.alternate;if(s!==null&&(n=s.child,n!==null)){s.child=null;do s=n.sibling,n.sibling=null,n=s;while(n!==null)}}function Cl(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var u=s[l];It=u,Z0(u,n)}K0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)G0(n),n=n.sibling}function G0(n){switch(n.tag){case 0:case 11:case 15:Cl(n),n.flags&2048&&Er(9,n,n.return);break;case 3:Cl(n);break;case 12:Cl(n);break;case 22:var s=n.stateNode;n.memoizedState!==null&&s._visibility&2&&(n.return===null||n.return.tag!==13)?(s._visibility&=-3,zc(n)):Cl(n);break;default:Cl(n)}}function zc(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var u=s[l];It=u,Z0(u,n)}K0(n)}for(n=n.child;n!==null;){switch(s=n,s.tag){case 0:case 11:case 15:Er(8,s,s.return),zc(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,zc(s));break;default:zc(s)}n=n.sibling}}function Z0(n,s){for(;It!==null;){var l=It;switch(l.tag){case 0:case 11:case 15:Er(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:ll(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,It=u;else e:for(l=n;It!==null;){u=It;var p=u.sibling,_=u.return;if(U0(u),u===l){It=null;break e}if(p!==null){p.return=_,It=p;break e}It=_}}}var O2={getCacheForType:function(n){var s=Xt(kt),l=s.data.get(n);return l===void 0&&(l=n(),s.data.set(n,l)),l},cacheSignal:function(){return Xt(kt).controller.signal}},H2=typeof WeakMap=="function"?WeakMap:Map,Ke=0,rt=null,Pe=null,Ue=0,Qe=0,Ai=null,kr=!1,co=!1,id=!1,Gn=0,_t=0,Mr=0,ms=0,nd=0,Di=0,uo=0,El=null,_i=null,rd=!1,Oc=0,Q0=0,Hc=1/0,jc=null,Tr=null,Ot=0,Nr=null,ho=null,Zn=0,sd=0,od=null,J0=null,kl=0,ld=null;function Ri(){return(Ke&2)!==0&&Ue!==0?Ue&-Ue:M.T!==null?dd():qa()}function ev(){if(Di===0)if((Ue&536870912)===0||Ve){var n=zs;zs<<=1,(zs&3932160)===0&&(zs=262144),Di=n}else Di=536870912;return n=Ti.current,n!==null&&(n.flags|=32),Di}function vi(n,s,l){(n===rt&&(Qe===2||Qe===9)||n.cancelPendingCommit!==null)&&(fo(n,0),Ar(n,Ue,Di,!1)),Zr(n,l),((Ke&2)===0||n!==rt)&&(n===rt&&((Ke&2)===0&&(ms|=l),_t===4&&Ar(n,Ue,Di,!1)),mn(n))}function tv(n,s,l){if((Ke&6)!==0)throw Error(r(327));var u=!l&&(s&127)===0&&(s&n.expiredLanes)===0||Gr(n,s),p=u?I2(n,s):cd(n,s,!0),_=u;do{if(p===0){co&&!u&&Ar(n,s,0,!1);break}else{if(l=n.current.alternate,_&&!j2(l)){p=cd(n,s,!1),_=!1;continue}if(p===2){if(_=s,n.errorRecoveryDisabledLanes&_)var x=0;else x=n.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){s=x;e:{var D=n;p=El;var W=D.current.memoizedState.isDehydrated;if(W&&(fo(D,x).flags|=256),x=cd(D,x,!1),x!==2){if(id&&!W){D.errorRecoveryDisabledLanes|=_,ms|=_,p=4;break e}_=_i,_i=p,_!==null&&(_i===null?_i=_:_i.push.apply(_i,_))}p=x}if(_=!1,p!==2)continue}}if(p===1){fo(n,0),Ar(n,s,0,!0);break}e:{switch(u=n,_=p,_){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Ar(u,s,Di,!kr);break e;case 2:_i=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(p=Oc+300-Lt(),10<p)){if(Ar(u,s,Di,!kr),Hs(u,0,!0)!==0)break e;Zn=s,u.timeoutHandle=Rv(iv.bind(null,u,l,_i,jc,rd,s,Di,ms,uo,kr,_,"Throttled",-0,0),p);break e}iv(u,l,_i,jc,rd,s,Di,ms,uo,kr,_,null,-0,0)}}break}while(!0);mn(n)}function iv(n,s,l,u,p,_,x,D,W,J,se,ae,te,ie){if(n.timeoutHandle=-1,ae=s.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:On},X0(s,_,ae);var ye=(_&62914560)===_?Oc-Lt():(_&4194048)===_?Q0-Lt():0;if(ye=xE(ae,ye),ye!==null){Zn=_,n.cancelPendingCommit=ye(uv.bind(null,n,s,_,l,u,p,x,D,W,se,ae,null,te,ie)),Ar(n,_,x,!J);return}}uv(n,s,_,l,u,p,x,D,W)}function j2(n){for(var s=n;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var p=l[u],_=p.getSnapshot;p=p.value;try{if(!ki(_(),p))return!1}catch{return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ar(n,s,l,u){s&=~nd,s&=~ms,n.suspendedLanes|=s,n.pingedLanes&=~s,u&&(n.warmLanes|=s),u=n.expirationTimes;for(var p=s;0<p;){var _=31-Ze(p),x=1<<_;u[_]=-1,p&=~x}l!==0&&Pa(n,l,s)}function Pc(){return(Ke&6)===0?(Ml(0),!1):!0}function ad(){if(Pe!==null){if(Qe===0)var n=Pe.return;else n=Pe,In=ls=null,Cf(n),io=null,cl=0,n=Pe;for(;n!==null;)B0(n.alternate,n),n=n.return;Pe=null}}function fo(n,s){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,rE(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Zn=0,ad(),rt=n,Pe=l=jn(n.current,null),Ue=s,Qe=0,Ai=null,kr=!1,co=Gr(n,s),id=!1,uo=Di=nd=ms=Mr=_t=0,_i=El=null,rd=!1,(s&8)!==0&&(s|=s&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=s;0<u;){var p=31-Ze(u),_=1<<p;s|=n[p],u&=~_}return Gn=s,oc(),l}function nv(n,s){Re=null,M.H=_l,s===to||s===pc?(s=y_(),Qe=3):s===ff?(s=y_(),Qe=4):Qe=s===If?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Ai=s,Pe===null&&(_t=1,Tc(n,Ii(s,n.current)))}function rv(){var n=Ti.current;return n===null?!0:(Ue&4194048)===Ue?Fi===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?n===Fi:!1}function sv(){var n=M.H;return M.H=_l,n===null?_l:n}function ov(){var n=M.A;return M.A=O2,n}function Ic(){_t=4,kr||(Ue&4194048)!==Ue&&Ti.current!==null||(co=!0),(Mr&134217727)===0&&(ms&134217727)===0||rt===null||Ar(rt,Ue,Di,!1)}function cd(n,s,l){var u=Ke;Ke|=2;var p=sv(),_=ov();(rt!==n||Ue!==s)&&(jc=null,fo(n,s)),s=!1;var x=_t;e:do try{if(Qe!==0&&Pe!==null){var D=Pe,W=Ai;switch(Qe){case 8:ad(),x=6;break e;case 3:case 2:case 9:case 6:Ti.current===null&&(s=!0);var J=Qe;if(Qe=0,Ai=null,po(n,D,W,J),l&&co){x=0;break e}break;default:J=Qe,Qe=0,Ai=null,po(n,D,W,J)}}P2(),x=_t;break}catch(se){nv(n,se)}while(!0);return s&&n.shellSuspendCounter++,In=ls=null,Ke=u,M.H=p,M.A=_,Pe===null&&(rt=null,Ue=0,oc()),x}function P2(){for(;Pe!==null;)lv(Pe)}function I2(n,s){var l=Ke;Ke|=2;var u=sv(),p=ov();rt!==n||Ue!==s?(jc=null,Hc=Lt()+500,fo(n,s)):co=Gr(n,s);e:do try{if(Qe!==0&&Pe!==null){s=Pe;var _=Ai;t:switch(Qe){case 1:Qe=0,Ai=null,po(n,s,_,1);break;case 2:case 9:if(__(_)){Qe=0,Ai=null,av(s);break}s=function(){Qe!==2&&Qe!==9||rt!==n||(Qe=7),mn(n)},_.then(s,s);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:__(_)?(Qe=0,Ai=null,av(s)):(Qe=0,Ai=null,po(n,s,_,7));break;case 5:var x=null;switch(Pe.tag){case 26:x=Pe.memoizedState;case 5:case 27:var D=Pe;if(x?Wv(x):D.stateNode.complete){Qe=0,Ai=null;var W=D.sibling;if(W!==null)Pe=W;else{var J=D.return;J!==null?(Pe=J,Uc(J)):Pe=null}break t}}Qe=0,Ai=null,po(n,s,_,5);break;case 6:Qe=0,Ai=null,po(n,s,_,6);break;case 8:ad(),_t=6;break e;default:throw Error(r(462))}}U2();break}catch(se){nv(n,se)}while(!0);return In=ls=null,M.H=u,M.A=p,Ke=l,Pe!==null?0:(rt=null,Ue=0,oc(),_t)}function U2(){for(;Pe!==null&&!An();)lv(Pe)}function lv(n){var s=D0(n.alternate,n,Gn);n.memoizedProps=n.pendingProps,s===null?Uc(n):Pe=s}function av(n){var s=n,l=s.alternate;switch(s.tag){case 15:case 0:s=E0(l,s,s.pendingProps,s.type,void 0,Ue);break;case 11:s=E0(l,s,s.pendingProps,s.type.render,s.ref,Ue);break;case 5:Cf(s);default:B0(l,s),s=Pe=o_(s,Gn),s=D0(l,s,Gn)}n.memoizedProps=n.pendingProps,s===null?Uc(n):Pe=s}function po(n,s,l,u){In=ls=null,Cf(s),io=null,cl=0;var p=s.return;try{if(N2(n,p,s,l,Ue)){_t=1,Tc(n,Ii(l,n.current)),Pe=null;return}}catch(_){if(p!==null)throw Pe=p,_;_t=1,Tc(n,Ii(l,n.current)),Pe=null;return}s.flags&32768?(Ve||u===1?n=!0:co||(Ue&536870912)!==0?n=!1:(kr=n=!0,(u===2||u===9||u===3||u===6)&&(u=Ti.current,u!==null&&u.tag===13&&(u.flags|=16384))),cv(s,n)):Uc(s)}function Uc(n){var s=n;do{if((s.flags&32768)!==0){cv(s,kr);return}n=s.return;var l=R2(s.alternate,s,Gn);if(l!==null){Pe=l;return}if(s=s.sibling,s!==null){Pe=s;return}Pe=s=n}while(s!==null);_t===0&&(_t=5)}function cv(n,s){do{var l=B2(n.alternate,n);if(l!==null){l.flags&=32767,Pe=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(n=n.sibling,n!==null)){Pe=n;return}Pe=n=l}while(n!==null);_t=6,Pe=null}function uv(n,s,l,u,p,_,x,D,W){n.cancelPendingCommit=null;do qc();while(Ot!==0);if((Ke&6)!==0)throw Error(r(327));if(s!==null){if(s===n.current)throw Error(r(177));if(_=s.lanes|s.childLanes,_|=Gh,kh(n,l,_,x,D,W),n===rt&&(Pe=rt=null,Ue=0),ho=s,Nr=n,Zn=l,sd=_,od=p,J0=u,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,$2(ke,function(){return gv(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||u){u=M.T,M.T=null,p=j.p,j.p=2,x=Ke,Ke|=4;try{L2(n,s,l)}finally{Ke=x,j.p=p,M.T=u}}Ot=1,hv(),fv(),dv()}}function hv(){if(Ot===1){Ot=0;var n=Nr,s=ho,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=M.T,M.T=null;var u=j.p;j.p=2;var p=Ke;Ke|=4;try{$0(s,n);var _=bd,x=Zm(n.containerInfo),D=_.focusedElem,W=_.selectionRange;if(x!==D&&D&&D.ownerDocument&&Gm(D.ownerDocument.documentElement,D)){if(W!==null&&$h(D)){var J=W.start,se=W.end;if(se===void 0&&(se=J),"selectionStart"in D)D.selectionStart=J,D.selectionEnd=Math.min(se,D.value.length);else{var ae=D.ownerDocument||document,te=ae&&ae.defaultView||window;if(te.getSelection){var ie=te.getSelection(),ye=D.textContent.length,Me=Math.min(W.start,ye),it=W.end===void 0?Me:Math.min(W.end,ye);!ie.extend&&Me>it&&(x=it,it=Me,Me=x);var Z=Km(D,Me),K=Km(D,it);if(Z&&K&&(ie.rangeCount!==1||ie.anchorNode!==Z.node||ie.anchorOffset!==Z.offset||ie.focusNode!==K.node||ie.focusOffset!==K.offset)){var Q=ae.createRange();Q.setStart(Z.node,Z.offset),ie.removeAllRanges(),Me>it?(ie.addRange(Q),ie.extend(K.node,K.offset)):(Q.setEnd(K.node,K.offset),ie.addRange(Q))}}}}for(ae=[],ie=D;ie=ie.parentNode;)ie.nodeType===1&&ae.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ae.length;D++){var oe=ae[D];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}eu=!!Sd,bd=Sd=null}finally{Ke=p,j.p=u,M.T=l}}n.current=s,Ot=2}}function fv(){if(Ot===2){Ot=0;var n=Nr,s=ho,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=M.T,M.T=null;var u=j.p;j.p=2;var p=Ke;Ke|=4;try{I0(n,s.alternate,s)}finally{Ke=p,j.p=u,M.T=l}}Ot=3}}function dv(){if(Ot===4||Ot===3){Ot=0,Dn();var n=Nr,s=ho,l=Zn,u=J0;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Ot=5:(Ot=0,ho=Nr=null,pv(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Tr=null),Yo(l),s=s.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Yt,s,void 0,(s.current.flags&128)===128)}catch{}if(u!==null){s=M.T,p=j.p,j.p=2,M.T=null;try{for(var _=n.onRecoverableError,x=0;x<u.length;x++){var D=u[x];_(D.value,{componentStack:D.stack})}}finally{M.T=s,j.p=p}}(Zn&3)!==0&&qc(),mn(n),p=n.pendingLanes,(l&261930)!==0&&(p&42)!==0?n===ld?kl++:(kl=0,ld=n):kl=0,Ml(0)}}function pv(n,s){(n.pooledCacheLanes&=s)===0&&(s=n.pooledCache,s!=null&&(n.pooledCache=null,ll(s)))}function qc(){return hv(),fv(),dv(),gv()}function gv(){if(Ot!==5)return!1;var n=Nr,s=sd;sd=0;var l=Yo(Zn),u=M.T,p=j.p;try{j.p=32>l?32:l,M.T=null,l=od,od=null;var _=Nr,x=Zn;if(Ot=0,ho=Nr=null,Zn=0,(Ke&6)!==0)throw Error(r(331));var D=Ke;if(Ke|=4,G0(_.current),W0(_,_.current,x,l),Ke=D,Ml(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Yt,_)}catch{}return!0}finally{j.p=p,M.T=u,pv(n,s)}}function mv(n,s,l){s=Ii(l,s),s=Pf(n.stateNode,s,2),n=xr(n,s,2),n!==null&&(Zr(n,2),mn(n))}function Je(n,s,l){if(n.tag===3)mv(n,n,l);else for(;s!==null;){if(s.tag===3){mv(s,n,l);break}else if(s.tag===1){var u=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Tr===null||!Tr.has(u))){n=Ii(l,n),l=_0(2),u=xr(s,l,2),u!==null&&(v0(l,u,s,n),Zr(u,2),mn(u));break}}s=s.return}}function ud(n,s,l){var u=n.pingCache;if(u===null){u=n.pingCache=new H2;var p=new Set;u.set(s,p)}else p=u.get(s),p===void 0&&(p=new Set,u.set(s,p));p.has(l)||(id=!0,p.add(l),n=q2.bind(null,n,s,l),s.then(n,n))}function q2(n,s,l){var u=n.pingCache;u!==null&&u.delete(s),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,rt===n&&(Ue&l)===l&&(_t===4||_t===3&&(Ue&62914560)===Ue&&300>Lt()-Oc?(Ke&2)===0&&fo(n,0):nd|=l,uo===Ue&&(uo=0)),mn(n)}function _v(n,s){s===0&&(s=ja()),n=rs(n,s),n!==null&&(Zr(n,s),mn(n))}function V2(n){var s=n.memoizedState,l=0;s!==null&&(l=s.retryLane),_v(n,l)}function F2(n,s){var l=0;switch(n.tag){case 31:case 13:var u=n.stateNode,p=n.memoizedState;p!==null&&(l=p.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(s),_v(n,l)}function $2(n,s){return ui(n,s)}var Vc=null,go=null,hd=!1,Fc=!1,fd=!1,Dr=0;function mn(n){n!==go&&n.next===null&&(go===null?Vc=go=n:go=go.next=n),Fc=!0,hd||(hd=!0,W2())}function Ml(n,s){if(!fd&&Fc){fd=!0;do for(var l=!1,u=Vc;u!==null;){if(n!==0){var p=u.pendingLanes;if(p===0)var _=0;else{var x=u.suspendedLanes,D=u.pingedLanes;_=(1<<31-Ze(42|n)+1)-1,_&=p&~(x&~D),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(l=!0,bv(u,_))}else _=Ue,_=Hs(u,u===rt?_:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(_&3)===0||Gr(u,_)||(l=!0,bv(u,_));u=u.next}while(l);fd=!1}}function Y2(){vv()}function vv(){Fc=hd=!1;var n=0;Dr!==0&&nE()&&(n=Dr);for(var s=Lt(),l=null,u=Vc;u!==null;){var p=u.next,_=yv(u,s);_===0?(u.next=null,l===null?Vc=p:l.next=p,p===null&&(go=l)):(l=u,(n!==0||(_&3)!==0)&&(Fc=!0)),u=p}Ot!==0&&Ot!==5||Ml(n),Dr!==0&&(Dr=0)}function yv(n,s){for(var l=n.suspendedLanes,u=n.pingedLanes,p=n.expirationTimes,_=n.pendingLanes&-62914561;0<_;){var x=31-Ze(_),D=1<<x,W=p[x];W===-1?((D&l)===0||(D&u)!==0)&&(p[x]=Eh(D,s)):W<=s&&(n.expiredLanes|=D),_&=~D}if(s=rt,l=Ue,l=Hs(n,n===s?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,l===0||n===s&&(Qe===2||Qe===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&Qi(u),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||Gr(n,l)){if(s=l&-l,s===n.callbackPriority)return s;switch(u!==null&&Qi(u),Yo(l)){case 2:case 8:l=ge;break;case 32:l=ke;break;case 268435456:l=Fe;break;default:l=ke}return u=Sv.bind(null,n),l=ui(l,u),n.callbackPriority=s,n.callbackNode=l,s}return u!==null&&u!==null&&Qi(u),n.callbackPriority=2,n.callbackNode=null,2}function Sv(n,s){if(Ot!==0&&Ot!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(qc()&&n.callbackNode!==l)return null;var u=Ue;return u=Hs(n,n===rt?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(tv(n,u,s),yv(n,Lt()),n.callbackNode!=null&&n.callbackNode===l?Sv.bind(null,n):null)}function bv(n,s){if(qc())return null;tv(n,s,!0)}function W2(){sE(function(){(Ke&6)!==0?ui(re,Y2):vv()})}function dd(){if(Dr===0){var n=Js;n===0&&(n=Ls,Ls<<=1,(Ls&261888)===0&&(Ls=256)),Dr=n}return Dr}function xv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Qa(""+n)}function wv(n,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,n.id&&l.setAttribute("form",n.id),s.parentNode.insertBefore(l,s),n=new FormData(n),l.parentNode.removeChild(l),n}function X2(n,s,l,u,p){if(s==="submit"&&l&&l.stateNode===p){var _=xv((p[ti]||null).action),x=u.submitter;x&&(s=(s=x[ti]||null)?xv(s.formAction):x.getAttribute("formAction"),s!==null&&(_=s,x=null));var D=new ic("action","action",null,u,p);n.push({event:D,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Dr!==0){var W=x?wv(p,x):new FormData(p);Bf(l,{pending:!0,data:W,method:p.method,action:_},null,W)}}else typeof _=="function"&&(D.preventDefault(),W=x?wv(p,x):new FormData(p),Bf(l,{pending:!0,data:W,method:p.method,action:_},_,W))},currentTarget:p}]})}}for(var pd=0;pd<Kh.length;pd++){var gd=Kh[pd],K2=gd.toLowerCase(),G2=gd[0].toUpperCase()+gd.slice(1);tn(K2,"on"+G2)}tn(e_,"onAnimationEnd"),tn(t_,"onAnimationIteration"),tn(i_,"onAnimationStart"),tn("dblclick","onDoubleClick"),tn("focusin","onFocus"),tn("focusout","onBlur"),tn(f2,"onTransitionRun"),tn(d2,"onTransitionStart"),tn(p2,"onTransitionCancel"),tn(n_,"onTransitionEnd"),dr("onMouseEnter",["mouseout","mouseover"]),dr("onMouseLeave",["mouseout","mouseover"]),dr("onPointerEnter",["pointerout","pointerover"]),dr("onPointerLeave",["pointerout","pointerover"]),Ln("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ln("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ln("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ln("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ln("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ln("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tl="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(" "),Z2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tl));function Cv(n,s){s=(s&4)!==0;for(var l=0;l<n.length;l++){var u=n[l],p=u.event;u=u.listeners;e:{var _=void 0;if(s)for(var x=u.length-1;0<=x;x--){var D=u[x],W=D.instance,J=D.currentTarget;if(D=D.listener,W!==_&&p.isPropagationStopped())break e;_=D,p.currentTarget=J;try{_(p)}catch(se){sc(se)}p.currentTarget=null,_=W}else for(x=0;x<u.length;x++){if(D=u[x],W=D.instance,J=D.currentTarget,D=D.listener,W!==_&&p.isPropagationStopped())break e;_=D,p.currentTarget=J;try{_(p)}catch(se){sc(se)}p.currentTarget=null,_=W}}}}function Ie(n,s){var l=s[js];l===void 0&&(l=s[js]=new Set);var u=n+"__bubble";l.has(u)||(Ev(s,n,2,!1),l.add(u))}function md(n,s,l){var u=0;s&&(u|=4),Ev(l,n,u,s)}var $c="_reactListening"+Math.random().toString(36).slice(2);function _d(n){if(!n[$c]){n[$c]=!0,Ya.forEach(function(l){l!=="selectionchange"&&(Z2.has(l)||md(l,!1,n),md(l,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[$c]||(s[$c]=!0,md("selectionchange",!1,s))}}function Ev(n,s,l,u){switch(ey(s)){case 2:var p=EE;break;case 8:p=kE;break;default:p=Rd}l=p.bind(null,s,l,n),p=void 0,!Oh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),u?p!==void 0?n.addEventListener(s,l,{capture:!0,passive:p}):n.addEventListener(s,l,!0):p!==void 0?n.addEventListener(s,l,{passive:p}):n.addEventListener(s,l,!1)}function vd(n,s,l,u,p){var _=u;if((s&1)===0&&(s&2)===0&&u!==null)e:for(;;){if(u===null)return;var x=u.tag;if(x===3||x===4){var D=u.stateNode.containerInfo;if(D===p)break;if(x===4)for(x=u.return;x!==null;){var W=x.tag;if((W===3||W===4)&&x.stateNode.containerInfo===p)return;x=x.return}for(;D!==null;){if(x=cr(D),x===null)return;if(W=x.tag,W===5||W===6||W===26||W===27){u=_=x;continue e}D=D.parentNode}}u=u.return}Am(function(){var J=_,se=Lh(l),ae=[];e:{var te=r_.get(n);if(te!==void 0){var ie=ic,ye=n;switch(n){case"keypress":if(ec(l)===0)break e;case"keydown":case"keyup":ie=FC;break;case"focusin":ye="focus",ie=Ih;break;case"focusout":ye="blur",ie=Ih;break;case"beforeblur":case"afterblur":ie=Ih;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Bm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=RC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=WC;break;case e_:case t_:case i_:ie=zC;break;case n_:ie=KC;break;case"scroll":case"scrollend":ie=AC;break;case"wheel":ie=ZC;break;case"copy":case"cut":case"paste":ie=HC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=zm;break;case"toggle":case"beforetoggle":ie=JC}var Me=(s&4)!==0,it=!Me&&(n==="scroll"||n==="scrollend"),Z=Me?te!==null?te+"Capture":null:te;Me=[];for(var K=J,Q;K!==null;){var oe=K;if(Q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Q===null||Z===null||(oe=Go(K,Z),oe!=null&&Me.push(Nl(K,oe,Q))),it)break;K=K.return}0<Me.length&&(te=new ie(te,ye,null,l,se),ae.push({event:te,listeners:Me}))}}if((s&7)===0){e:{if(te=n==="mouseover"||n==="pointerover",ie=n==="mouseout"||n==="pointerout",te&&l!==Bh&&(ye=l.relatedTarget||l.fromElement)&&(cr(ye)||ye[Bn]))break e;if((ie||te)&&(te=se.window===se?se:(te=se.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(ye=l.relatedTarget||l.toElement,ie=J,ye=ye?cr(ye):null,ye!==null&&(it=a(ye),Me=ye.tag,ye!==it||Me!==5&&Me!==27&&Me!==6)&&(ye=null)):(ie=null,ye=J),ie!==ye)){if(Me=Bm,oe="onMouseLeave",Z="onMouseEnter",K="mouse",(n==="pointerout"||n==="pointerover")&&(Me=zm,oe="onPointerLeave",Z="onPointerEnter",K="pointer"),it=ie==null?te:hr(ie),Q=ye==null?te:hr(ye),te=new Me(oe,K+"leave",ie,l,se),te.target=it,te.relatedTarget=Q,oe=null,cr(se)===J&&(Me=new Me(Z,K+"enter",ye,l,se),Me.target=Q,Me.relatedTarget=it,oe=Me),it=oe,ie&&ye)t:{for(Me=Q2,Z=ie,K=ye,Q=0,oe=Z;oe;oe=Me(oe))Q++;oe=0;for(var Ee=K;Ee;Ee=Me(Ee))oe++;for(;0<Q-oe;)Z=Me(Z),Q--;for(;0<oe-Q;)K=Me(K),oe--;for(;Q--;){if(Z===K||K!==null&&Z===K.alternate){Me=Z;break t}Z=Me(Z),K=Me(K)}Me=null}else Me=null;ie!==null&&kv(ae,te,ie,Me,!1),ye!==null&&it!==null&&kv(ae,it,ye,Me,!0)}}e:{if(te=J?hr(J):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var We=Vm;else if(Um(te))if(Fm)We=c2;else{We=l2;var be=o2}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?J&&Rh(J.elementType)&&(We=Vm):We=a2;if(We&&(We=We(n,J))){qm(ae,We,l,se);break e}be&&be(n,te,J),n==="focusout"&&J&&te.type==="number"&&J.memoizedProps.value!=null&&Ko(te,"number",te.value)}switch(be=J?hr(J):window,n){case"focusin":(Um(be)||be.contentEditable==="true")&&($s=be,Yh=J,rl=null);break;case"focusout":rl=Yh=$s=null;break;case"mousedown":Wh=!0;break;case"contextmenu":case"mouseup":case"dragend":Wh=!1,Qm(ae,l,se);break;case"selectionchange":if(h2)break;case"keydown":case"keyup":Qm(ae,l,se)}var Be;if(qh)e:{switch(n){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Fs?Pm(n,l)&&(qe="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(qe="onCompositionStart");qe&&(Om&&l.locale!=="ko"&&(Fs||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Fs&&(Be=Dm()):(gr=se,Hh="value"in gr?gr.value:gr.textContent,Fs=!0)),be=Yc(J,qe),0<be.length&&(qe=new Lm(qe,n,null,l,se),ae.push({event:qe,listeners:be}),Be?qe.data=Be:(Be=Im(l),Be!==null&&(qe.data=Be)))),(Be=t2?i2(n,l):n2(n,l))&&(qe=Yc(J,"onBeforeInput"),0<qe.length&&(be=new Lm("onBeforeInput","beforeinput",null,l,se),ae.push({event:be,listeners:qe}),be.data=Be)),X2(ae,n,J,l,se)}Cv(ae,s)})}function Nl(n,s,l){return{instance:n,listener:s,currentTarget:l}}function Yc(n,s){for(var l=s+"Capture",u=[];n!==null;){var p=n,_=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||_===null||(p=Go(n,l),p!=null&&u.unshift(Nl(n,p,_)),p=Go(n,s),p!=null&&u.push(Nl(n,p,_))),n.tag===3)return u;n=n.return}return[]}function Q2(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function kv(n,s,l,u,p){for(var _=s._reactName,x=[];l!==null&&l!==u;){var D=l,W=D.alternate,J=D.stateNode;if(D=D.tag,W!==null&&W===u)break;D!==5&&D!==26&&D!==27||J===null||(W=J,p?(J=Go(l,_),J!=null&&x.unshift(Nl(l,J,W))):p||(J=Go(l,_),J!=null&&x.push(Nl(l,J,W)))),l=l.return}x.length!==0&&n.push({event:s,listeners:x})}var J2=/\r\n?/g,eE=/\u0000|\uFFFD/g;function Mv(n){return(typeof n=="string"?n:""+n).replace(J2,`
|
|
49
|
+
`).replace(eE,"")}function Tv(n,s){return s=Mv(s),Mv(n)===s}function tt(n,s,l,u,p,_){switch(l){case"children":typeof u=="string"?s==="body"||s==="textarea"&&u===""||Us(n,u):(typeof u=="number"||typeof u=="bigint")&&s!=="body"&&Us(n,""+u);break;case"className":Is(n,"class",u);break;case"tabIndex":Is(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Is(n,l,u);break;case"style":Tm(n,u,_);break;case"data":if(s!=="object"){Is(n,"data",u);break}case"src":case"href":if(u===""&&(s!=="a"||l!=="href")){n.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=Qa(""+u),n.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(l==="formAction"?(s!=="input"&&tt(n,s,"name",p.name,p,null),tt(n,s,"formEncType",p.formEncType,p,null),tt(n,s,"formMethod",p.formMethod,p,null),tt(n,s,"formTarget",p.formTarget,p,null)):(tt(n,s,"encType",p.encType,p,null),tt(n,s,"method",p.method,p,null),tt(n,s,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=Qa(""+u),n.setAttribute(l,u);break;case"onClick":u!=null&&(n.onclick=On);break;case"onScroll":u!=null&&Ie("scroll",n);break;case"onScrollEnd":u!=null&&Ie("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(r(60));n.innerHTML=l}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}l=Qa(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""+u):n.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":u===!0?n.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,u):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(l,u):n.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(l):n.setAttribute(l,u);break;case"popover":Ie("beforetoggle",n),Ie("toggle",n),Ps(n,"popover",u);break;case"xlinkActuate":en(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":en(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":en(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":en(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":en(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":en(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":en(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":en(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":en(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Ps(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=TC.get(l)||l,Ps(n,l,u))}}function yd(n,s,l,u,p,_){switch(l){case"style":Tm(n,u,_);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(r(60));n.innerHTML=l}}break;case"children":typeof u=="string"?Us(n,u):(typeof u=="number"||typeof u=="bigint")&&Us(n,""+u);break;case"onScroll":u!=null&&Ie("scroll",n);break;case"onScrollEnd":u!=null&&Ie("scrollend",n);break;case"onClick":u!=null&&(n.onclick=On);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wa.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),s=l.slice(2,p?l.length-7:void 0),_=n[ti]||null,_=_!=null?_[l]:null,typeof _=="function"&&n.removeEventListener(s,_,p),typeof u=="function")){typeof _!="function"&&_!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(s,u,p);break e}l in n?n[l]=u:u===!0?n.setAttribute(l,""):Ps(n,l,u)}}}function Gt(n,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",n),Ie("load",n);var u=!1,p=!1,_;for(_ in l)if(l.hasOwnProperty(_)){var x=l[_];if(x!=null)switch(_){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:tt(n,s,_,x,l,null)}}p&&tt(n,s,"srcSet",l.srcSet,l,null),u&&tt(n,s,"src",l.src,l,null);return;case"input":Ie("invalid",n);var D=_=x=p=null,W=null,J=null;for(u in l)if(l.hasOwnProperty(u)){var se=l[u];if(se!=null)switch(u){case"name":p=se;break;case"type":x=se;break;case"checked":W=se;break;case"defaultChecked":J=se;break;case"value":_=se;break;case"defaultValue":D=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,s));break;default:tt(n,s,u,se,l,null)}}Za(n,_,D,W,J,x,p,!1);return;case"select":Ie("invalid",n),u=x=_=null;for(p in l)if(l.hasOwnProperty(p)&&(D=l[p],D!=null))switch(p){case"value":_=D;break;case"defaultValue":x=D;break;case"multiple":u=D;default:tt(n,s,p,D,l,null)}s=_,l=x,n.multiple=!!u,s!=null?zn(n,!!u,s,!1):l!=null&&zn(n,!!u,l,!0);return;case"textarea":Ie("invalid",n),_=p=u=null;for(x in l)if(l.hasOwnProperty(x)&&(D=l[x],D!=null))switch(x){case"value":u=D;break;case"defaultValue":p=D;break;case"children":_=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(91));break;default:tt(n,s,x,D,l,null)}km(n,u,p,_);return;case"option":for(W in l)if(l.hasOwnProperty(W)&&(u=l[W],u!=null))switch(W){case"selected":n.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:tt(n,s,W,u,l,null)}return;case"dialog":Ie("beforetoggle",n),Ie("toggle",n),Ie("cancel",n),Ie("close",n);break;case"iframe":case"object":Ie("load",n);break;case"video":case"audio":for(u=0;u<Tl.length;u++)Ie(Tl[u],n);break;case"image":Ie("error",n),Ie("load",n);break;case"details":Ie("toggle",n);break;case"embed":case"source":case"link":Ie("error",n),Ie("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in l)if(l.hasOwnProperty(J)&&(u=l[J],u!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:tt(n,s,J,u,l,null)}return;default:if(Rh(s)){for(se in l)l.hasOwnProperty(se)&&(u=l[se],u!==void 0&&yd(n,s,se,u,l,void 0));return}}for(D in l)l.hasOwnProperty(D)&&(u=l[D],u!=null&&tt(n,s,D,u,l,null))}function tE(n,s,l,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,_=null,x=null,D=null,W=null,J=null,se=null;for(ie in l){var ae=l[ie];if(l.hasOwnProperty(ie)&&ae!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":W=ae;default:u.hasOwnProperty(ie)||tt(n,s,ie,null,u,ae)}}for(var te in u){var ie=u[te];if(ae=l[te],u.hasOwnProperty(te)&&(ie!=null||ae!=null))switch(te){case"type":_=ie;break;case"name":p=ie;break;case"checked":J=ie;break;case"defaultChecked":se=ie;break;case"value":x=ie;break;case"defaultValue":D=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,s));break;default:ie!==ae&&tt(n,s,te,ie,u,ae)}}es(n,x,D,W,J,se,_,p);return;case"select":ie=x=D=te=null;for(_ in l)if(W=l[_],l.hasOwnProperty(_)&&W!=null)switch(_){case"value":break;case"multiple":ie=W;default:u.hasOwnProperty(_)||tt(n,s,_,null,u,W)}for(p in u)if(_=u[p],W=l[p],u.hasOwnProperty(p)&&(_!=null||W!=null))switch(p){case"value":te=_;break;case"defaultValue":D=_;break;case"multiple":x=_;default:_!==W&&tt(n,s,p,_,u,W)}s=D,l=x,u=ie,te!=null?zn(n,!!l,te,!1):!!u!=!!l&&(s!=null?zn(n,!!l,s,!0):zn(n,!!l,l?[]:"",!1));return;case"textarea":ie=te=null;for(D in l)if(p=l[D],l.hasOwnProperty(D)&&p!=null&&!u.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:tt(n,s,D,null,u,p)}for(x in u)if(p=u[x],_=l[x],u.hasOwnProperty(x)&&(p!=null||_!=null))switch(x){case"value":te=p;break;case"defaultValue":ie=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==_&&tt(n,s,x,p,u,_)}Em(n,te,ie);return;case"option":for(var ye in l)if(te=l[ye],l.hasOwnProperty(ye)&&te!=null&&!u.hasOwnProperty(ye))switch(ye){case"selected":n.selected=!1;break;default:tt(n,s,ye,null,u,te)}for(W in u)if(te=u[W],ie=l[W],u.hasOwnProperty(W)&&te!==ie&&(te!=null||ie!=null))switch(W){case"selected":n.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:tt(n,s,W,te,u,ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in l)te=l[Me],l.hasOwnProperty(Me)&&te!=null&&!u.hasOwnProperty(Me)&&tt(n,s,Me,null,u,te);for(J in u)if(te=u[J],ie=l[J],u.hasOwnProperty(J)&&te!==ie&&(te!=null||ie!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,s));break;default:tt(n,s,J,te,u,ie)}return;default:if(Rh(s)){for(var it in l)te=l[it],l.hasOwnProperty(it)&&te!==void 0&&!u.hasOwnProperty(it)&&yd(n,s,it,void 0,u,te);for(se in u)te=u[se],ie=l[se],!u.hasOwnProperty(se)||te===ie||te===void 0&&ie===void 0||yd(n,s,se,te,u,ie);return}}for(var Z in l)te=l[Z],l.hasOwnProperty(Z)&&te!=null&&!u.hasOwnProperty(Z)&&tt(n,s,Z,null,u,te);for(ae in u)te=u[ae],ie=l[ae],!u.hasOwnProperty(ae)||te===ie||te==null&&ie==null||tt(n,s,ae,te,u,ie)}function Nv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iE(){if(typeof performance.getEntriesByType=="function"){for(var n=0,s=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var p=l[u],_=p.transferSize,x=p.initiatorType,D=p.duration;if(_&&D&&Nv(x)){for(x=0,D=p.responseEnd,u+=1;u<l.length;u++){var W=l[u],J=W.startTime;if(J>D)break;var se=W.transferSize,ae=W.initiatorType;se&&Nv(ae)&&(W=W.responseEnd,x+=se*(W<D?1:(D-J)/(W-J)))}if(--u,s+=8*(_+x)/(p.duration/1e3),n++,10<n)break}}if(0<n)return s/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Sd=null,bd=null;function Wc(n){return n.nodeType===9?n:n.ownerDocument}function Av(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dv(n,s){if(n===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&s==="foreignObject"?0:n}function xd(n,s){return n==="textarea"||n==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var wd=null;function nE(){var n=window.event;return n&&n.type==="popstate"?n===wd?!1:(wd=n,!0):(wd=null,!1)}var Rv=typeof setTimeout=="function"?setTimeout:void 0,rE=typeof clearTimeout=="function"?clearTimeout:void 0,Bv=typeof Promise=="function"?Promise:void 0,sE=typeof queueMicrotask=="function"?queueMicrotask:typeof Bv<"u"?function(n){return Bv.resolve(null).then(n).catch(oE)}:Rv;function oE(n){setTimeout(function(){throw n})}function Rr(n){return n==="head"}function Lv(n,s){var l=s,u=0;do{var p=l.nextSibling;if(n.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(u===0){n.removeChild(p),yo(s);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Al(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,Al(l);for(var _=l.firstChild;_;){var x=_.nextSibling,D=_.nodeName;_[Qr]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&_.rel.toLowerCase()==="stylesheet"||l.removeChild(_),_=x}}else l==="body"&&Al(n.ownerDocument.body);l=p}while(l);yo(s)}function zv(n,s){var l=n;n=0;do{var u=l.nextSibling;if(l.nodeType===1?s?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(s?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=u}while(l)}function Cd(n){var s=n.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Cd(l),Wo(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function lE(n,s,l,u){for(;n.nodeType===1;){var p=l;if(n.nodeName.toLowerCase()!==s.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[Qr])switch(s){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(_=n.getAttribute("rel"),_==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(_!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(_=n.getAttribute("src"),(_!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&_&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(s==="input"&&n.type==="hidden"){var _=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===_)return n}else return n;if(n=$i(n.nextSibling),n===null)break}return null}function aE(n,s,l){if(s==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=$i(n.nextSibling),n===null))return null;return n}function Ov(n,s){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=$i(n.nextSibling),n===null))return null;return n}function Ed(n){return n.data==="$?"||n.data==="$~"}function kd(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function cE(n,s){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=s;else if(n.data!=="$?"||l.readyState!=="loading")s();else{var u=function(){s(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function $i(n){for(;n!=null;n=n.nextSibling){var s=n.nodeType;if(s===1||s===3)break;if(s===8){if(s=n.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return n}var Md=null;function Hv(n){n=n.nextSibling;for(var s=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(s===0)return $i(n.nextSibling);s--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||s++}n=n.nextSibling}return null}function jv(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(s===0)return n;s--}else l!=="/$"&&l!=="/&"||s++}n=n.previousSibling}return null}function Pv(n,s,l){switch(s=Wc(l),n){case"html":if(n=s.documentElement,!n)throw Error(r(452));return n;case"head":if(n=s.head,!n)throw Error(r(453));return n;case"body":if(n=s.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function Al(n){for(var s=n.attributes;s.length;)n.removeAttributeNode(s[0]);Wo(n)}var Yi=new Map,Iv=new Set;function Xc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Qn=j.d;j.d={f:uE,r:hE,D:fE,C:dE,L:pE,m:gE,X:_E,S:mE,M:vE};function uE(){var n=Qn.f(),s=Pc();return n||s}function hE(n){var s=ur(n);s!==null&&s.tag===5&&s.type==="form"?n0(s):Qn.r(n)}var mo=typeof document>"u"?null:document;function Uv(n,s,l){var u=mo;if(u&&typeof s=="string"&&s){var p=fi(s);p='link[rel="'+n+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),Iv.has(p)||(Iv.add(p),n={rel:n,crossOrigin:l,href:s},u.querySelector(p)===null&&(s=u.createElement("link"),Gt(s,"link",n),Et(s),u.head.appendChild(s)))}}function fE(n){Qn.D(n),Uv("dns-prefetch",n,null)}function dE(n,s){Qn.C(n,s),Uv("preconnect",n,s)}function pE(n,s,l){Qn.L(n,s,l);var u=mo;if(u&&n&&s){var p='link[rel="preload"][as="'+fi(s)+'"]';s==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+fi(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+fi(l.imageSizes)+'"]')):p+='[href="'+fi(n)+'"]';var _=p;switch(s){case"style":_=_o(n);break;case"script":_=vo(n)}Yi.has(_)||(n=g({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:n,as:s},l),Yi.set(_,n),u.querySelector(p)!==null||s==="style"&&u.querySelector(Dl(_))||s==="script"&&u.querySelector(Rl(_))||(s=u.createElement("link"),Gt(s,"link",n),Et(s),u.head.appendChild(s)))}}function gE(n,s){Qn.m(n,s);var l=mo;if(l&&n){var u=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+fi(u)+'"][href="'+fi(n)+'"]',_=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=vo(n)}if(!Yi.has(_)&&(n=g({rel:"modulepreload",href:n},s),Yi.set(_,n),l.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Rl(_)))return}u=l.createElement("link"),Gt(u,"link",n),Et(u),l.head.appendChild(u)}}}function mE(n,s,l){Qn.S(n,s,l);var u=mo;if(u&&n){var p=fr(u).hoistableStyles,_=_o(n);s=s||"default";var x=p.get(_);if(!x){var D={loading:0,preload:null};if(x=u.querySelector(Dl(_)))D.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":s},l),(l=Yi.get(_))&&Td(n,l);var W=x=u.createElement("link");Et(W),Gt(W,"link",n),W._p=new Promise(function(J,se){W.onload=J,W.onerror=se}),W.addEventListener("load",function(){D.loading|=1}),W.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Kc(x,s,u)}x={type:"stylesheet",instance:x,count:1,state:D},p.set(_,x)}}}function _E(n,s){Qn.X(n,s);var l=mo;if(l&&n){var u=fr(l).hoistableScripts,p=vo(n),_=u.get(p);_||(_=l.querySelector(Rl(p)),_||(n=g({src:n,async:!0},s),(s=Yi.get(p))&&Nd(n,s),_=l.createElement("script"),Et(_),Gt(_,"link",n),l.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},u.set(p,_))}}function vE(n,s){Qn.M(n,s);var l=mo;if(l&&n){var u=fr(l).hoistableScripts,p=vo(n),_=u.get(p);_||(_=l.querySelector(Rl(p)),_||(n=g({src:n,async:!0,type:"module"},s),(s=Yi.get(p))&&Nd(n,s),_=l.createElement("script"),Et(_),Gt(_,"link",n),l.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},u.set(p,_))}}function qv(n,s,l,u){var p=(p=le.current)?Xc(p):null;if(!p)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=_o(l.href),l=fr(p).hoistableStyles,u=l.get(s),u||(u={type:"style",instance:null,count:0,state:null},l.set(s,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=_o(l.href);var _=fr(p).hoistableStyles,x=_.get(n);if(x||(p=p.ownerDocument||p,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(n,x),(_=p.querySelector(Dl(n)))&&!_._p&&(x.instance=_,x.state.loading=5),Yi.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Yi.set(n,l),_||yE(p,n,l,x.state))),s&&u===null)throw Error(r(528,""));return x}if(s&&u!==null)throw Error(r(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=vo(l),l=fr(p).hoistableScripts,u=l.get(s),u||(u={type:"script",instance:null,count:0,state:null},l.set(s,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function _o(n){return'href="'+fi(n)+'"'}function Dl(n){return'link[rel="stylesheet"]['+n+"]"}function Vv(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function yE(n,s,l,u){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?u.loading=1:(s=n.createElement("link"),u.preload=s,s.addEventListener("load",function(){return u.loading|=1}),s.addEventListener("error",function(){return u.loading|=2}),Gt(s,"link",l),Et(s),n.head.appendChild(s))}function vo(n){return'[src="'+fi(n)+'"]'}function Rl(n){return"script[async]"+n}function Fv(n,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var u=n.querySelector('style[data-href~="'+fi(l.href)+'"]');if(u)return s.instance=u,Et(u),u;var p=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Et(u),Gt(u,"style",p),Kc(u,l.precedence,n),s.instance=u;case"stylesheet":p=_o(l.href);var _=n.querySelector(Dl(p));if(_)return s.state.loading|=4,s.instance=_,Et(_),_;u=Vv(l),(p=Yi.get(p))&&Td(u,p),_=(n.ownerDocument||n).createElement("link"),Et(_);var x=_;return x._p=new Promise(function(D,W){x.onload=D,x.onerror=W}),Gt(_,"link",u),s.state.loading|=4,Kc(_,l.precedence,n),s.instance=_;case"script":return _=vo(l.src),(p=n.querySelector(Rl(_)))?(s.instance=p,Et(p),p):(u=l,(p=Yi.get(_))&&(u=g({},l),Nd(u,p)),n=n.ownerDocument||n,p=n.createElement("script"),Et(p),Gt(p,"link",u),n.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(u=s.instance,s.state.loading|=4,Kc(u,l.precedence,n));return s.instance}function Kc(n,s,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,_=p,x=0;x<u.length;x++){var D=u[x];if(D.dataset.precedence===s)_=D;else if(_!==p)break}_?_.parentNode.insertBefore(n,_.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(n,s.firstChild))}function Td(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.title==null&&(n.title=s.title)}function Nd(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.integrity==null&&(n.integrity=s.integrity)}var Gc=null;function $v(n,s,l){if(Gc===null){var u=new Map,p=Gc=new Map;p.set(l,u)}else p=Gc,u=p.get(l),u||(u=new Map,p.set(l,u));if(u.has(n))return u;for(u.set(n,null),l=l.getElementsByTagName(n),p=0;p<l.length;p++){var _=l[p];if(!(_[Qr]||_[zt]||n==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var x=_.getAttribute(s)||"";x=n+x;var D=u.get(x);D?D.push(_):u.set(x,[_])}}return u}function Yv(n,s,l){n=n.ownerDocument||n,n.head.insertBefore(l,s==="title"?n.querySelector("head > title"):null)}function SE(n,s,l){if(l===1||s.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return n=s.disabled,typeof s.precedence=="string"&&n==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Wv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function bE(n,s,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=_o(u.href),_=s.querySelector(Dl(p));if(_){s=_._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(n.count++,n=Zc.bind(n),s.then(n,n)),l.state.loading|=4,l.instance=_,Et(_);return}_=s.ownerDocument||s,u=Vv(u),(p=Yi.get(p))&&Td(u,p),_=_.createElement("link"),Et(_);var x=_;x._p=new Promise(function(D,W){x.onload=D,x.onerror=W}),Gt(_,"link",u),l.instance=_}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,s),(s=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=Zc.bind(n),s.addEventListener("load",l),s.addEventListener("error",l))}}var Ad=0;function xE(n,s){return n.stylesheets&&n.count===0&&Jc(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var u=setTimeout(function(){if(n.stylesheets&&Jc(n,n.stylesheets),n.unsuspend){var _=n.unsuspend;n.unsuspend=null,_()}},6e4+s);0<n.imgBytes&&Ad===0&&(Ad=62500*iE());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Jc(n,n.stylesheets),n.unsuspend)){var _=n.unsuspend;n.unsuspend=null,_()}},(n.imgBytes>Ad?50:800)+s);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function Zc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Jc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Qc=null;function Jc(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Qc=new Map,s.forEach(wE,n),Qc=null,Zc.call(n))}function wE(n,s){if(!(s.state.loading&4)){var l=Qc.get(n);if(l)var u=l.get(null);else{l=new Map,Qc.set(n,l);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<p.length;_++){var x=p[_];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(l.set(x.dataset.precedence,x),u=x)}u&&l.set(null,u)}p=s.instance,x=p.getAttribute("data-precedence"),_=l.get(x)||u,_===u&&l.set(null,p),l.set(x,p),this.count++,u=Zc.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),_?_.parentNode.insertBefore(p,_.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),s.state.loading|=4}}var Bl={$$typeof:E,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function CE(n,s,l,u,p,_,x,D,W){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fo(0),this.hiddenUpdates=Fo(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=_,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function Xv(n,s,l,u,p,_,x,D,W,J,se,ae){return n=new CE(n,s,l,x,W,J,se,ae,D),s=1,_===!0&&(s|=24),_=Mi(3,null,null,s),n.current=_,_.stateNode=n,s=cf(),s.refCount++,n.pooledCache=s,s.refCount++,_.memoizedState={element:u,isDehydrated:l,cache:s},df(_),n}function Kv(n){return n?(n=Xs,n):Xs}function Gv(n,s,l,u,p,_){p=Kv(p),u.context===null?u.context=p:u.pendingContext=p,u=br(s),u.payload={element:l},_=_===void 0?null:_,_!==null&&(u.callback=_),l=xr(n,u,s),l!==null&&(vi(l,n,s),hl(l,n,s))}function Zv(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<s?l:s}}function Dd(n,s){Zv(n,s),(n=n.alternate)&&Zv(n,s)}function Qv(n){if(n.tag===13||n.tag===31){var s=rs(n,67108864);s!==null&&vi(s,n,67108864),Dd(n,67108864)}}function Jv(n){if(n.tag===13||n.tag===31){var s=Ri();s=$o(s);var l=rs(n,s);l!==null&&vi(l,n,s),Dd(n,s)}}var eu=!0;function EE(n,s,l,u){var p=M.T;M.T=null;var _=j.p;try{j.p=2,Rd(n,s,l,u)}finally{j.p=_,M.T=p}}function kE(n,s,l,u){var p=M.T;M.T=null;var _=j.p;try{j.p=8,Rd(n,s,l,u)}finally{j.p=_,M.T=p}}function Rd(n,s,l,u){if(eu){var p=Bd(u);if(p===null)vd(n,s,u,tu,l),ty(n,u);else if(TE(p,n,s,l,u))u.stopPropagation();else if(ty(n,u),s&4&&-1<ME.indexOf(n)){for(;p!==null;){var _=ur(p);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var x=Rn(_.pendingLanes);if(x!==0){var D=_;for(D.pendingLanes|=2,D.entangledLanes|=2;x;){var W=1<<31-Ze(x);D.entanglements[1]|=W,x&=~W}mn(_),(Ke&6)===0&&(Hc=Lt()+500,Ml(0))}}break;case 31:case 13:D=rs(_,2),D!==null&&vi(D,_,2),Pc(),Dd(_,2)}if(_=Bd(u),_===null&&vd(n,s,u,tu,l),_===p)break;p=_}p!==null&&u.stopPropagation()}else vd(n,s,u,null,l)}}function Bd(n){return n=Lh(n),Ld(n)}var tu=null;function Ld(n){if(tu=null,n=cr(n),n!==null){var s=a(n);if(s===null)n=null;else{var l=s.tag;if(l===13){if(n=c(s),n!==null)return n;n=null}else if(l===31){if(n=h(s),n!==null)return n;n=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null)}}return tu=n,null}function ey(n){switch(n){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ar()){case re:return 2;case ge:return 8;case ke:case Oe:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var zd=!1,Br=null,Lr=null,zr=null,Ll=new Map,zl=new Map,Or=[],ME="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".split(" ");function ty(n,s){switch(n){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Lr=null;break;case"mouseover":case"mouseout":zr=null;break;case"pointerover":case"pointerout":Ll.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":zl.delete(s.pointerId)}}function Ol(n,s,l,u,p,_){return n===null||n.nativeEvent!==_?(n={blockedOn:s,domEventName:l,eventSystemFlags:u,nativeEvent:_,targetContainers:[p]},s!==null&&(s=ur(s),s!==null&&Qv(s)),n):(n.eventSystemFlags|=u,s=n.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),n)}function TE(n,s,l,u,p){switch(s){case"focusin":return Br=Ol(Br,n,s,l,u,p),!0;case"dragenter":return Lr=Ol(Lr,n,s,l,u,p),!0;case"mouseover":return zr=Ol(zr,n,s,l,u,p),!0;case"pointerover":var _=p.pointerId;return Ll.set(_,Ol(Ll.get(_)||null,n,s,l,u,p)),!0;case"gotpointercapture":return _=p.pointerId,zl.set(_,Ol(zl.get(_)||null,n,s,l,u,p)),!0}return!1}function iy(n){var s=cr(n.target);if(s!==null){var l=a(s);if(l!==null){if(s=l.tag,s===13){if(s=c(l),s!==null){n.blockedOn=s,Va(n.priority,function(){Jv(l)});return}}else if(s===31){if(s=h(l),s!==null){n.blockedOn=s,Va(n.priority,function(){Jv(l)});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function iu(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var l=Bd(n.nativeEvent);if(l===null){l=n.nativeEvent;var u=new l.constructor(l.type,l);Bh=u,l.target.dispatchEvent(u),Bh=null}else return s=ur(l),s!==null&&Qv(s),n.blockedOn=l,!1;s.shift()}return!0}function ny(n,s,l){iu(n)&&l.delete(s)}function NE(){zd=!1,Br!==null&&iu(Br)&&(Br=null),Lr!==null&&iu(Lr)&&(Lr=null),zr!==null&&iu(zr)&&(zr=null),Ll.forEach(ny),zl.forEach(ny)}function nu(n,s){n.blockedOn===s&&(n.blockedOn=null,zd||(zd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,NE)))}var ru=null;function ry(n){ru!==n&&(ru=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ru===n&&(ru=null);for(var s=0;s<n.length;s+=3){var l=n[s],u=n[s+1],p=n[s+2];if(typeof u!="function"){if(Ld(u||l)===null)continue;break}var _=ur(l);_!==null&&(n.splice(s,3),s-=3,Bf(_,{pending:!0,data:p,method:l.method,action:u},u,p))}}))}function yo(n){function s(W){return nu(W,n)}Br!==null&&nu(Br,n),Lr!==null&&nu(Lr,n),zr!==null&&nu(zr,n),Ll.forEach(s),zl.forEach(s);for(var l=0;l<Or.length;l++){var u=Or[l];u.blockedOn===n&&(u.blockedOn=null)}for(;0<Or.length&&(l=Or[0],l.blockedOn===null);)iy(l),l.blockedOn===null&&Or.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var p=l[u],_=l[u+1],x=p[ti]||null;if(typeof _=="function")x||ry(l);else if(x){var D=null;if(_&&_.hasAttribute("formAction")){if(p=_,x=_[ti]||null)D=x.formAction;else if(Ld(p)!==null)continue}else D=x.action;typeof D=="function"?l[u+1]=D:(l.splice(u,3),u-=3),ry(l)}}}function sy(){function n(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(x){return p=x})},focusReset:"manual",scroll:"manual"})}function s(){p!==null&&(p(),p=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),p!==null&&(p(),p=null)}}}function Od(n){this._internalRoot=n}su.prototype.render=Od.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(r(409));var l=s.current,u=Ri();Gv(l,u,n,s,null,null)},su.prototype.unmount=Od.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;Gv(n.current,2,null,n,null,null),Pc(),s[Bn]=null}};function su(n){this._internalRoot=n}su.prototype.unstable_scheduleHydration=function(n){if(n){var s=qa();n={blockedOn:null,target:n,priority:s};for(var l=0;l<Or.length&&s!==0&&s<Or[l].priority;l++);Or.splice(l,0,n),l===0&&iy(n)}};var oy=t.version;if(oy!=="19.2.4")throw Error(r(527,oy,"19.2.4"));j.findDOMNode=function(n){var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=f(s),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var AE={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ou.isDisabled&&ou.supportsFiber)try{Yt=ou.inject(AE),bt=ou}catch{}}return jl.createRoot=function(n,s){if(!o(n))throw Error(r(299));var l=!1,u="",p=d0,_=p0,x=g0;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(x=s.onRecoverableError)),s=Xv(n,1,!1,null,null,l,u,null,p,_,x,sy),n[Bn]=s.current,_d(n),new Od(s)},jl.hydrateRoot=function(n,s,l){if(!o(n))throw Error(r(299));var u=!1,p="",_=d0,x=p0,D=g0,W=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(_=l.onUncaughtError),l.onCaughtError!==void 0&&(x=l.onCaughtError),l.onRecoverableError!==void 0&&(D=l.onRecoverableError),l.formState!==void 0&&(W=l.formState)),s=Xv(n,1,!0,s,l??null,u,p,W,_,x,D,sy),s.context=Kv(null),l=s.current,u=Ri(),u=$o(u),p=br(u),p.callback=null,xr(l,p,u),l=u,s.current.lanes=l,Zr(s,l),mn(s),n[Bn]=s.current,_d(n),new su(s)},jl.version="19.2.4",jl}var my;function IE(){if(my)return Pd.exports;my=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Pd.exports=PE(),Pd.exports}var UE=IE();const qE=1e3,VE=1e4;function FE(){const[e,t]=q.useState({workflows:[],parseErrors:[]}),[i,r]=q.useState(!1),o=q.useRef(0),a=q.useRef(null),c=q.useRef(new EventTarget),h=q.useCallback(f=>{const m=a.current;m&&m.readyState===WebSocket.OPEN&&m.send(JSON.stringify(f))},[]),d=q.useCallback(()=>{const f=window.location.protocol==="https:"?"wss:":"ws:",m=new WebSocket(`${f}//${window.location.host}`);a.current=m,m.onopen=()=>{r(!0),o.current=0},m.onclose=()=>{r(!1),a.current=null;const g=Math.min(qE*2**o.current,VE);o.current++,setTimeout(d,g)},m.onerror=()=>{m.close()},m.onmessage=g=>{try{const v=JSON.parse(g.data);switch(v.type){case"full-sync":t(v.data);break;case"workflow-updated":t(y=>{const S=y.workflows.filter(k=>k.filePath!==v.data.filePath||k.workflowName!==v.data.workflowName);S.push(v.data);const b=y.parseErrors.filter(k=>k.filePath!==v.data.filePath);return{workflows:S,parseErrors:b}});break;case"workflow-removed":t(y=>({workflows:y.workflows.filter(S=>S.filePath!==v.data.filePath),parseErrors:y.parseErrors.filter(S=>S.filePath!==v.data.filePath)}));break;case"parse-error":t(y=>{const S=y.workflows.filter(k=>k.filePath!==v.data.filePath),b=y.parseErrors.filter(k=>k.filePath!==v.data.filePath);return b.push(v.data),{workflows:S,parseErrors:b}});break;case"pty-data":c.current.dispatchEvent(new CustomEvent("data",{detail:v.data}));break;case"pty-exit":c.current.dispatchEvent(new CustomEvent("exit",{detail:v.data.code}));break;case"pty-spawned":c.current.dispatchEvent(new CustomEvent("spawned",{detail:v.data.pid}));break}}catch{}}},[]);return q.useEffect(()=>(d(),()=>{var f;(f=a.current)==null||f.close()}),[d]),{state:e,connected:i,sendMessage:h,ptyEvents:c.current}}function $E(){const[e,t]=q.useState([]),[i,r]=q.useState(!0),[o,a]=q.useState(0),c=q.useCallback(async()=>{try{const m=await fetch("/api/connections");m.ok&&t(await m.json())}catch{}finally{r(!1)}},[]);q.useEffect(()=>{c()},[c]);const h=q.useCallback(async m=>{await fetch("/api/connections",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}),await c(),a(g=>g+1)},[c]),d=q.useCallback(async(m,g,v)=>{await fetch("/api/connections",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflow_name:m,node_name:g,integration_id:v})}),await c(),a(y=>y+1)},[c]),f=q.useCallback((m,g,v)=>e.find(y=>y.workflow_name===m&&y.node_name===g&&y.integration_id===v)??e.find(y=>y.workflow_name==="*"&&y.node_name==="*"&&y.integration_id===v)??null,[e]);return{connections:e,loading:i,upsert:h,remove:d,getForNode:f,refetch:c,mutationVersion:o}}function YE(){const[e,t]=q.useState([]),[i,r]=q.useState(!0);return q.useEffect(()=>{(async()=>{try{const o=await fetch("/api/nango/integrations");o.ok&&t(await o.json())}catch{}finally{r(!1)}})()},[]),{integrations:e,loading:i}}function db(e,t=0){const[i,r]=q.useState([]),[o,a]=q.useState(!1),c=q.useCallback(async()=>{if(!e)return[];a(!0);try{const h=await fetch(`/api/nango/connections/${encodeURIComponent(e)}`);if(h.ok){const d=await h.json();return r(d),d}}catch{}finally{a(!1)}return[]},[e]);return q.useEffect(()=>{c()},[c,t]),{nangoConnections:i,loading:o,refetch:c}}const WE=5e3;function pb(e){const[t,i]=q.useState([]),[r,o]=q.useState(!0),[a,c]=q.useState(!0),[h,d]=q.useState(null),[f,m]=q.useState(null),[g,v]=q.useState(!1),y=q.useRef(void 0),S=q.useCallback(async()=>{try{const k=new URLSearchParams;e&&k.set("workflow",e),k.set("limit","50");const C=await fetch(`/api/runs?${k}`);C.ok?(i(await C.json()),c(!0)):c(!1)}catch{c(!1)}finally{o(!1)}},[e]);q.useEffect(()=>(o(!0),S(),y.current=setInterval(S,WE),()=>clearInterval(y.current)),[S]);const b=q.useCallback(async k=>{if(d(k),!k){m(null);return}v(!0);try{const C=await fetch(`/api/runs/${k}/trace`);C.ok&&m(await C.json())}catch{}finally{v(!1)}},[]);return{runs:t,loading:r,available:a,selectedRunId:h,trace:f,traceLoading:g,selectRun:b,refresh:S}}/**
|
|
50
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
51
|
+
* @license MIT
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
54
|
+
* @license MIT
|
|
55
|
+
*
|
|
56
|
+
* Originally forked from (with the author's permission):
|
|
57
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
58
|
+
* http://bellard.org/jslinux/
|
|
59
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
60
|
+
*/var gb=Object.defineProperty,XE=Object.getOwnPropertyDescriptor,KE=(e,t)=>{for(var i in t)gb(e,i,{get:t[i],enumerable:!0})},yt=(e,t,i,r)=>{for(var o=r>1?void 0:r?XE(t,i):t,a=e.length-1,c;a>=0;a--)(c=e[a])&&(o=(r?c(t,i,o):c(o))||o);return r&&o&&gb(t,i,o),o},ve=(e,t)=>(i,r)=>t(i,r,e),_y="Terminal input",Np={get:()=>_y,set:e=>_y=e},vy="Too much output to announce, navigate to rows manually to read",Ap={get:()=>vy,set:e=>vy=e};function GE(e){return e.replace(/\r?\n/g,"\r")}function ZE(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function QE(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function JE(e,t,i,r){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");mb(o,t,i,r)}}function mb(e,t,i,r){e=GE(e),e=ZE(e,i.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function _b(e,t,i){let r=i.getBoundingClientRect(),o=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${o}px`,t.style.top=`${a}px`,t.style.zIndex="1000",t.focus()}function yy(e,t,i,r,o){_b(e,t,i),o&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Fr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function rh(e,t=0,i=e.length){let r="";for(let o=t;o<i;++o){let a=e[o];a>65535?(a-=65536,r+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):r+=String.fromCharCode(a)}return r}var ek=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let r=0,o=0;if(this._interim){let a=e.charCodeAt(o++);56320<=a&&a<=57343?t[r++]=(this._interim-55296)*1024+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0}for(let a=o;a<i;++a){let c=e.charCodeAt(a);if(55296<=c&&c<=56319){if(++a>=i)return this._interim=c,r;let h=e.charCodeAt(a);56320<=h&&h<=57343?t[r++]=(c-55296)*1024+h-56320+65536:(t[r++]=c,t[r++]=h);continue}c!==65279&&(t[r++]=c)}return r}},tk=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let r=0,o,a,c,h,d=0,f=0;if(this.interim[0]){let v=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let S=0,b;for(;(b=this.interim[++S]&63)&&S<4;)y<<=6,y|=b;let k=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,C=k-S;for(;f<C;){if(f>=i)return 0;if(b=e[f++],(b&192)!==128){f--,v=!0;break}else this.interim[S++]=b,y<<=6,y|=b&63}v||(k===2?y<128?f--:t[r++]=y:k===3?y<2048||y>=55296&&y<=57343||y===65279||(t[r++]=y):y<65536||y>1114111||(t[r++]=y)),this.interim.fill(0)}let m=i-4,g=f;for(;g<i;){for(;g<m&&!((o=e[g])&128)&&!((a=e[g+1])&128)&&!((c=e[g+2])&128)&&!((h=e[g+3])&128);)t[r++]=o,t[r++]=a,t[r++]=c,t[r++]=h,g+=4;if(o=e[g++],o<128)t[r++]=o;else if((o&224)===192){if(g>=i)return this.interim[0]=o,r;if(a=e[g++],(a&192)!==128){g--;continue}if(d=(o&31)<<6|a&63,d<128){g--;continue}t[r++]=d}else if((o&240)===224){if(g>=i)return this.interim[0]=o,r;if(a=e[g++],(a&192)!==128){g--;continue}if(g>=i)return this.interim[0]=o,this.interim[1]=a,r;if(c=e[g++],(c&192)!==128){g--;continue}if(d=(o&15)<<12|(a&63)<<6|c&63,d<2048||d>=55296&&d<=57343||d===65279)continue;t[r++]=d}else if((o&248)===240){if(g>=i)return this.interim[0]=o,r;if(a=e[g++],(a&192)!==128){g--;continue}if(g>=i)return this.interim[0]=o,this.interim[1]=a,r;if(c=e[g++],(c&192)!==128){g--;continue}if(g>=i)return this.interim[0]=o,this.interim[1]=a,this.interim[2]=c,r;if(h=e[g++],(h&192)!==128){g--;continue}if(d=(o&7)<<18|(a&63)<<12|(c&63)<<6|h&63,d<65536||d>1114111)continue;t[r++]=d}}return r}},vb="",Yr=" ",ka=class yb{constructor(){this.fg=0,this.bg=0,this.extended=new ju}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new yb;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ju=class Sb{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Sb(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Zi=class bb extends ka{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ju,this.combinedData=""}static fromCharData(t){let i=new bb;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Fr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(r-55296)*1024+o-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Sy="di$target",Dp="di$dependencies",Vd=new Map;function ik(e){return e[Dp]||[]}function $t(e){if(Vd.has(e))return Vd.get(e);let t=function(i,r,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");nk(t,i,o)};return t._id=e,Vd.set(e,t),t}function nk(e,t,i){t[Sy]===t?t[Dp].push({id:e,index:i}):(t[Dp]=[{id:e,index:i}],t[Sy]=t)}var ai=$t("BufferService"),xb=$t("CoreMouseService"),Rs=$t("CoreService"),rk=$t("CharsetService"),Og=$t("InstantiationService"),wb=$t("LogService"),ci=$t("OptionsService"),Cb=$t("OscLinkService"),sk=$t("UnicodeService"),Ma=$t("DecorationService"),Rp=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){var m;let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let r=[],o=this._optionsService.rawOptions.linkHandler,a=new Zi,c=i.getTrimmedLength(),h=-1,d=-1,f=!1;for(let g=0;g<c;g++)if(!(d===-1&&!i.hasContent(g))){if(i.loadCell(g,a),a.hasExtendedAttrs()&&a.extended.urlId)if(d===-1){d=g,h=a.extended.urlId;continue}else f=a.extended.urlId!==h;else d!==-1&&(f=!0);if(f||d!==-1&&g===c-1){let v=(m=this._oscLinkService.getLinkData(h))==null?void 0:m.uri;if(v){let y={start:{x:d+1,y:e},end:{x:g+(!f&&g===c-1?1:0),y:e}},S=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{let b=new URL(v);["http:","https:"].includes(b.protocol)||(S=!0)}catch{S=!0}S||r.push({text:v,range:y,activate:(b,k)=>o?o.activate(b,k,y):ok(b,k),hover:(b,k)=>{var C;return(C=o==null?void 0:o.hover)==null?void 0:C.call(o,b,k,y)},leave:(b,k)=>{var C;return(C=o==null?void 0:o.leave)==null?void 0:C.call(o,b,k,y)}})}f=!1,a.hasExtendedAttrs()&&a.extended.urlId?(d=g,h=a.extended.urlId):(d=-1,h=-1)}}t(r)}};Rp=yt([ve(0,ai),ve(1,ci),ve(2,Cb)],Rp);function ok(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
61
|
+
|
|
62
|
+
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var sh=$t("CharSizeService"),sr=$t("CoreBrowserService"),Hg=$t("MouseService"),or=$t("RenderService"),lk=$t("SelectionService"),Eb=$t("CharacterJoinerService"),Io=$t("ThemeService"),kb=$t("LinkProviderService"),ak=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?by.isErrorNoTelemetry(e)?new by(e.message+`
|
|
63
|
+
|
|
64
|
+
`+e.stack):new Error(e.message+`
|
|
65
|
+
|
|
66
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},ck=new ak;function Eu(e){uk(e)||ck.onUnexpectedError(e)}var Bp="Canceled";function uk(e){return e instanceof hk?!0:e instanceof Error&&e.name===Bp&&e.message===Bp}var hk=class extends Error{constructor(){super(Bp),this.name=this.message}};function fk(e){return new Error(`Illegal argument: ${e}`)}var by=class Lp extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Lp)return t;let i=new Lp;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},zp=class Mb extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Mb.prototype)}};function Bi(e,t=0){return e[e.length-(1+t)]}var dk;(e=>{function t(a){return a<0}e.isLessThan=t;function i(a){return a<=0}e.isLessThanOrEqual=i;function r(a){return a>0}e.isGreaterThan=r;function o(a){return a===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(dk||(dk={}));function pk(e,t){let i=this,r=!1,o;return function(){return r||(r=!0,t||(o=e.apply(i,arguments))),o}}var Tb;(e=>{function t(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function r(){return i}e.empty=r;function*o(T){yield T}e.single=o;function a(T){return t(T)?T:o(T)}e.wrap=a;function c(T){return T||i}e.from=c;function*h(T){for(let P=T.length-1;P>=0;P--)yield T[P]}e.reverse=h;function d(T){return!T||T[Symbol.iterator]().next().done===!0}e.isEmpty=d;function f(T){return T[Symbol.iterator]().next().value}e.first=f;function m(T,P){let R=0;for(let U of T)if(P(U,R++))return!0;return!1}e.some=m;function g(T,P){for(let R of T)if(P(R))return R}e.find=g;function*v(T,P){for(let R of T)P(R)&&(yield R)}e.filter=v;function*y(T,P){let R=0;for(let U of T)yield P(U,R++)}e.map=y;function*S(T,P){let R=0;for(let U of T)yield*P(U,R++)}e.flatMap=S;function*b(...T){for(let P of T)yield*P}e.concat=b;function k(T,P,R){let U=R;for(let X of T)U=P(U,X);return U}e.reduce=k;function*C(T,P,R=T.length){for(P<0&&(P+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);P<R;P++)yield T[P]}e.slice=C;function z(T,P=Number.POSITIVE_INFINITY){let R=[];if(P===0)return[R,T];let U=T[Symbol.iterator]();for(let X=0;X<P;X++){let G=U.next();if(G.done)return[R,e.empty()];R.push(G.value)}return[R,{[Symbol.iterator](){return U}}]}e.consume=z;async function E(T){let P=[];for await(let R of T)P.push(R);return Promise.resolve(P)}e.asyncToArray=E})(Tb||(Tb={}));function ks(e){if(Tb.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function gk(...e){return ht(()=>ks(e))}function ht(e){return{dispose:pk(()=>{e()})}}var Nb=class Ab{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ks(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Ab.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};Nb.DISABLE_DISPOSED_WARNING=!1;var Wr=Nb,je=class{constructor(){this._store=new Wr,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};je.None=Object.freeze({dispose(){}});var Ro=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},tr=typeof window=="object"?window:globalThis,Op=class Hp{constructor(t){this.element=t,this.next=Hp.Undefined,this.prev=Hp.Undefined}};Op.Undefined=new Op(void 0);var pt=Op,xy=class{constructor(){this._first=pt.Undefined,this._last=pt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===pt.Undefined}clear(){let e=this._first;for(;e!==pt.Undefined;){let t=e.next;e.prev=pt.Undefined,e.next=pt.Undefined,e=t}this._first=pt.Undefined,this._last=pt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new pt(e);if(this._first===pt.Undefined)this._first=i,this._last=i;else if(t){let o=this._last;this._last=i,i.prev=o,o.next=i}else{let o=this._first;this._first=i,i.next=o,o.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first!==pt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==pt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==pt.Undefined&&e.next!==pt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===pt.Undefined&&e.next===pt.Undefined?(this._first=pt.Undefined,this._last=pt.Undefined):e.next===pt.Undefined?(this._last=this._last.prev,this._last.next=pt.Undefined):e.prev===pt.Undefined&&(this._first=this._first.next,this._first.prev=pt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==pt.Undefined;)yield e.element,e=e.next}},mk=globalThis.performance&&typeof globalThis.performance.now=="function",_k=class Db{static create(t){return new Db(t)}constructor(t){this._now=mk&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Qt;(e=>{e.None=()=>je.None;function t(I,F){return g(I,()=>{},0,void 0,!0,void 0,F)}e.defer=t;function i(I){return(F,B=null,O)=>{let M=!1,j;return j=I(H=>{if(!M)return j?j.dispose():M=!0,F.call(B,H)},null,O),M&&j.dispose(),j}}e.once=i;function r(I,F,B){return f((O,M=null,j)=>I(H=>O.call(M,F(H)),null,j),B)}e.map=r;function o(I,F,B){return f((O,M=null,j)=>I(H=>{F(H),O.call(M,H)},null,j),B)}e.forEach=o;function a(I,F,B){return f((O,M=null,j)=>I(H=>F(H)&&O.call(M,H),null,j),B)}e.filter=a;function c(I){return I}e.signal=c;function h(...I){return(F,B=null,O)=>{let M=gk(...I.map(j=>j(H=>F.call(B,H))));return m(M,O)}}e.any=h;function d(I,F,B,O){let M=B;return r(I,j=>(M=F(M,j),M),O)}e.reduce=d;function f(I,F){let B,O={onWillAddFirstListener(){B=I(M.fire,M)},onDidRemoveLastListener(){B==null||B.dispose()}},M=new _e(O);return F==null||F.add(M),M.event}function m(I,F){return F instanceof Array?F.push(I):F&&F.add(I),I}function g(I,F,B=100,O=!1,M=!1,j,H){let $,N,L,Y=0,A,ee={leakWarningThreshold:j,onWillAddFirstListener(){$=I(le=>{Y++,N=F(N,le),O&&!L&&(ce.fire(N),N=void 0),A=()=>{let fe=N;N=void 0,L=void 0,(!O||Y>1)&&ce.fire(fe),Y=0},typeof B=="number"?(clearTimeout(L),L=setTimeout(A,B)):L===void 0&&(L=0,queueMicrotask(A))})},onWillRemoveListener(){M&&Y>0&&(A==null||A())},onDidRemoveLastListener(){A=void 0,$.dispose()}},ce=new _e(ee);return H==null||H.add(ce),ce.event}e.debounce=g;function v(I,F=0,B){return e.debounce(I,(O,M)=>O?(O.push(M),O):[M],F,void 0,!0,void 0,B)}e.accumulate=v;function y(I,F=(O,M)=>O===M,B){let O=!0,M;return a(I,j=>{let H=O||!F(j,M);return O=!1,M=j,H},B)}e.latch=y;function S(I,F,B){return[e.filter(I,F,B),e.filter(I,O=>!F(O),B)]}e.split=S;function b(I,F=!1,B=[],O){let M=B.slice(),j=I(N=>{M?M.push(N):$.fire(N)});O&&O.add(j);let H=()=>{M==null||M.forEach(N=>$.fire(N)),M=null},$=new _e({onWillAddFirstListener(){j||(j=I(N=>$.fire(N)),O&&O.add(j))},onDidAddFirstListener(){M&&(F?setTimeout(H):H())},onDidRemoveLastListener(){j&&j.dispose(),j=null}});return O&&O.add($),$.event}e.buffer=b;function k(I,F){return(B,O,M)=>{let j=F(new z);return I(function(H){let $=j.evaluate(H);$!==C&&B.call(O,$)},void 0,M)}}e.chain=k;let C=Symbol("HaltChainable");class z{constructor(){this.steps=[]}map(F){return this.steps.push(F),this}forEach(F){return this.steps.push(B=>(F(B),B)),this}filter(F){return this.steps.push(B=>F(B)?B:C),this}reduce(F,B){let O=B;return this.steps.push(M=>(O=F(O,M),O)),this}latch(F=(B,O)=>B===O){let B=!0,O;return this.steps.push(M=>{let j=B||!F(M,O);return B=!1,O=M,j?M:C}),this}evaluate(F){for(let B of this.steps)if(F=B(F),F===C)break;return F}}function E(I,F,B=O=>O){let O=(...$)=>H.fire(B(...$)),M=()=>I.on(F,O),j=()=>I.removeListener(F,O),H=new _e({onWillAddFirstListener:M,onDidRemoveLastListener:j});return H.event}e.fromNodeEventEmitter=E;function T(I,F,B=O=>O){let O=(...$)=>H.fire(B(...$)),M=()=>I.addEventListener(F,O),j=()=>I.removeEventListener(F,O),H=new _e({onWillAddFirstListener:M,onDidRemoveLastListener:j});return H.event}e.fromDOMEventEmitter=T;function P(I){return new Promise(F=>i(I)(F))}e.toPromise=P;function R(I){let F=new _e;return I.then(B=>{F.fire(B)},()=>{F.fire(void 0)}).finally(()=>{F.dispose()}),F.event}e.fromPromise=R;function U(I,F){return I(B=>F.fire(B))}e.forward=U;function X(I,F,B){return F(B),I(O=>F(O))}e.runAndSubscribe=X;class G{constructor(F,B){this._observable=F,this._counter=0,this._hasChanged=!1;let O={onWillAddFirstListener:()=>{F.addObserver(this)},onDidRemoveLastListener:()=>{F.removeObserver(this)}};this.emitter=new _e(O),B&&B.add(this.emitter)}beginUpdate(F){this._counter++}handlePossibleChange(F){}handleChange(F,B){this._hasChanged=!0}endUpdate(F){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ne(I,F){return new G(I,F).emitter.event}e.fromObservable=ne;function V(I){return(F,B,O)=>{let M=0,j=!1,H={beginUpdate(){M++},endUpdate(){M--,M===0&&(I.reportChanges(),j&&(j=!1,F.call(B)))},handlePossibleChange(){},handleChange(){j=!0}};I.addObserver(H),I.reportChanges();let $={dispose(){I.removeObserver(H)}};return O instanceof Wr?O.add($):Array.isArray(O)&&O.push($),$}}e.fromObservableLight=V})(Qt||(Qt={}));var jp=class Pp{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Pp._idPool++}`,Pp.all.add(this)}start(t){this._stopWatch=new _k,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};jp.all=new Set,jp._idPool=0;var vk=jp,yk=-1,Rb=class Bb{constructor(t,i,r=(Bb._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,i){let r=this.threshold;if(r<=0||i<r)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[a,c]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${c}):`;console.warn(h),console.warn(a);let d=new xk(h,a);this._errorHandler(d)}return()=>{let a=this._stacks.get(t.value)||0;this._stacks.set(t.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[r,o]of this._stacks)(!t||i<o)&&(t=[r,o],i=o);return t}};Rb._idPool=1;var Sk=Rb,bk=class Lb{constructor(t){this.value=t}static create(){let t=new Error;return new Lb(t.stack??"")}print(){console.warn(this.value.split(`
|
|
67
|
+
`).slice(2).join(`
|
|
68
|
+
`))}},xk=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},wk=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},Ck=0,Fd=class{constructor(e){this.value=e,this.id=Ck++}},Ek=2,kk,_e=class{constructor(t){var i,r,o,a;this._size=0,this._options=t,this._leakageMon=(i=this._options)!=null&&i.leakWarningThreshold?new Sk((t==null?void 0:t.onListenerError)??Eu,((r=this._options)==null?void 0:r.leakWarningThreshold)??yk):void 0,this._perfMon=(o=this._options)!=null&&o._profName?new vk(this._options._profName):void 0,this._deliveryQueue=(a=this._options)==null?void 0:a.deliveryQueue}dispose(){var t,i,r,o;this._disposed||(this._disposed=!0,((t=this._deliveryQueue)==null?void 0:t.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(i=this._options)==null?void 0:i.onDidRemoveLastListener)==null||r.call(i),(o=this._leakageMon)==null||o.dispose())}get event(){return this._event??(this._event=(t,i,r)=>{var h,d,f,m,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let v=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(v);let y=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],S=new wk(`${v}. HINT: Stack shows most frequent listener (${y[1]}-times)`,y[0]);return(((h=this._options)==null?void 0:h.onListenerError)||Eu)(S),je.None}if(this._disposed)return je.None;i&&(t=t.bind(i));let o=new Fd(t),a;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=bk.create(),a=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof Fd?(this._deliveryQueue??(this._deliveryQueue=new Mk),this._listeners=[this._listeners,o]):this._listeners.push(o):((f=(d=this._options)==null?void 0:d.onWillAddFirstListener)==null||f.call(d,this),this._listeners=o,(g=(m=this._options)==null?void 0:m.onDidAddFirstListener)==null||g.call(m,this)),this._size++;let c=ht(()=>{a==null||a(),this._removeListener(o)});return r instanceof Wr?r.add(c):Array.isArray(r)&&r.push(c),c}),this._event}_removeListener(t){var a,c,h,d;if((c=(a=this._options)==null?void 0:a.onWillRemoveListener)==null||c.call(a,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(d=(h=this._options)==null?void 0:h.onDidRemoveLastListener)==null||d.call(h,this),this._size=0;return}let i=this._listeners,r=i.indexOf(t);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[r]=void 0;let o=this._deliveryQueue.current===this;if(this._size*Ek<=i.length){let f=0;for(let m=0;m<i.length;m++)i[m]?i[f++]=i[m]:o&&(this._deliveryQueue.end--,f<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=f}}_deliver(t,i){var o;if(!t)return;let r=((o=this._options)==null?void 0:o.onListenerError)||Eu;if(!r){t.value(i);return}try{t.value(i)}catch(a){r(a)}}_deliverQueue(t){let i=t.current._listeners;for(;t.i<t.end;)this._deliver(i[t.i++],t.value);t.reset()}fire(t){var i,r,o,a;if((i=this._deliveryQueue)!=null&&i.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(o=this._perfMon)==null||o.start(this._size),this._listeners)if(this._listeners instanceof Fd)this._deliver(this._listeners,t);else{let c=this._deliveryQueue;c.enqueue(this,t,this._listeners.length),this._deliverQueue(c)}(a=this._perfMon)==null||a.stop()}hasListeners(){return this._size>0}},Mk=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ip=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new _e,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new _e,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let r=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let r=this.getWindowId(i);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Ip.INSTANCE=new Ip;var jg=Ip;function Tk(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}jg.INSTANCE.onDidChangeZoomLevel;function Nk(e){return jg.INSTANCE.getZoomFactor(e)}jg.INSTANCE.onDidChangeFullscreen;var Uo=typeof navigator=="object"?navigator.userAgent:"",Up=Uo.indexOf("Firefox")>=0,Ak=Uo.indexOf("AppleWebKit")>=0,Pg=Uo.indexOf("Chrome")>=0,Dk=!Pg&&Uo.indexOf("Safari")>=0;Uo.indexOf("Electron/")>=0;Uo.indexOf("Android")>=0;var $d=!1;if(typeof tr.matchMedia=="function"){let e=tr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=tr.matchMedia("(display-mode: fullscreen)");$d=e.matches,Tk(tr,e,({matches:i})=>{$d&&t.matches||($d=i)})}var Eo="en",qp=!1,Vp=!1,ku=!1,zb=!1,lu,Mu=Eo,wy=Eo,Rk,sn,ws=globalThis,Zt,cb;typeof ws.vscode<"u"&&typeof ws.vscode.process<"u"?Zt=ws.vscode.process:typeof process<"u"&&typeof((cb=process==null?void 0:process.versions)==null?void 0:cb.node)=="string"&&(Zt=process);var ub,Bk=typeof((ub=Zt==null?void 0:Zt.versions)==null?void 0:ub.electron)=="string",Lk=Bk&&(Zt==null?void 0:Zt.type)==="renderer",hb;if(typeof Zt=="object"){qp=Zt.platform==="win32",Vp=Zt.platform==="darwin",ku=Zt.platform==="linux",ku&&Zt.env.SNAP&&Zt.env.SNAP_REVISION,Zt.env.CI||Zt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,lu=Eo,Mu=Eo;let e=Zt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);lu=t.userLocale,wy=t.osLocale,Mu=t.resolvedLanguage||Eo,Rk=(hb=t.languagePack)==null?void 0:hb.translationsConfigFile}catch{}zb=!0}else typeof navigator=="object"&&!Lk?(sn=navigator.userAgent,qp=sn.indexOf("Windows")>=0,Vp=sn.indexOf("Macintosh")>=0,(sn.indexOf("Macintosh")>=0||sn.indexOf("iPad")>=0||sn.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ku=sn.indexOf("Linux")>=0,(sn==null?void 0:sn.indexOf("Mobi"))>=0,Mu=globalThis._VSCODE_NLS_LANGUAGE||Eo,lu=navigator.language.toLowerCase(),wy=lu):console.error("Unable to resolve platform.");var Ob=qp,Cn=Vp,zk=ku,Cy=zb,kn=sn,jr=Mu,Ok;(e=>{function t(){return jr}e.value=t;function i(){return jr.length===2?jr==="en":jr.length>=3?jr[0]==="e"&&jr[1]==="n"&&jr[2]==="-":!1}e.isDefaultVariant=i;function r(){return jr==="en"}e.isDefault=r})(Ok||(Ok={}));var Hk=typeof ws.postMessage=="function"&&!ws.importScripts;(()=>{if(Hk){let e=[];ws.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let r=0,o=e.length;r<o;r++){let a=e[r];if(a.id===i.data.vscodeScheduleAsyncWork){e.splice(r,1),a.callback();return}}});let t=0;return i=>{let r=++t;e.push({id:r,callback:i}),ws.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var jk=!!(kn&&kn.indexOf("Chrome")>=0);kn&&kn.indexOf("Firefox")>=0;!jk&&kn&&kn.indexOf("Safari")>=0;kn&&kn.indexOf("Edg/")>=0;kn&&kn.indexOf("Android")>=0;var So=typeof navigator=="object"?navigator:{};Cy||document.queryCommandSupported&&document.queryCommandSupported("copy")||So&&So.clipboard&&So.clipboard.writeText,Cy||So&&So.clipboard&&So.clipboard.readText;var Ig=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Yd=new Ig,Ey=new Ig,ky=new Ig,Pk=new Array(230),Hb;(e=>{function t(h){return Yd.keyCodeToStr(h)}e.toString=t;function i(h){return Yd.strToKeyCode(h)}e.fromString=i;function r(h){return Ey.keyCodeToStr(h)}e.toUserSettingsUS=r;function o(h){return ky.keyCodeToStr(h)}e.toUserSettingsGeneral=o;function a(h){return Ey.strToKeyCode(h)||ky.strToKeyCode(h)}e.fromUserSettings=a;function c(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Yd.keyCodeToStr(h)}e.toElectronAccelerator=c})(Hb||(Hb={}));var Ik=class jb{constructor(t,i,r,o,a){this.ctrlKey=t,this.shiftKey=i,this.altKey=r,this.metaKey=o,this.keyCode=a}equals(t){return t instanceof jb&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",r=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${i}${r}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new Uk([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},Uk=class{constructor(e){if(e.length===0)throw fk("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function qk(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return Hb.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(Up)switch(t){case 59:return 85;case 60:if(zk)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Cn)return 57;break}else if(Ak&&(Cn&&t===93||!Cn&&t===92))return 57;return Pk[t]||0}var Vk=Cn?256:2048,Fk=512,$k=1024,Yk=Cn?2048:256,My=class{constructor(e){var i;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(i=t.getModifierState)==null?void 0:i.call(t,"AltGraph"),this.keyCode=qk(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Vk),this.altKey&&(t|=Fk),this.shiftKey&&(t|=$k),this.metaKey&&(t|=Yk),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Ik(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Ty=new WeakMap;function Wk(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}var Xk=class{static getSameOriginWindowChain(e){let t=Ty.get(e);if(!t){t=[],Ty.set(e,t);let i=e,r;do r=Wk(i),r?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=r;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,r=0,o=this.getSameOriginWindowChain(e);for(let a of o){let c=a.window.deref();if(i+=(c==null?void 0:c.scrollY)??0,r+=(c==null?void 0:c.scrollX)??0,c===t||!a.iframeElement)break;let h=a.iframeElement.getBoundingClientRect();i+=h.top,r+=h.left}return{top:i,left:r}}},au=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let i=Xk.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Ny=class{constructor(e,t=0,i=0){var o;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let r=!1;if(Pg){let a=navigator.userAgent.match(/Chrome\/(\d+)/);r=(a?parseInt(a[1]):123)<=122}if(e){let a=e,c=e,h=((o=e.view)==null?void 0:o.devicePixelRatio)||1;if(typeof a.wheelDeltaY<"u")r?this.deltaY=a.wheelDeltaY/(120*h):this.deltaY=a.wheelDeltaY/120;else if(typeof c.VERTICAL_AXIS<"u"&&c.axis===c.VERTICAL_AXIS)this.deltaY=-c.detail/3;else if(e.type==="wheel"){let d=e;d.deltaMode===d.DOM_DELTA_LINE?Up&&!Cn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")Dk&&Ob?this.deltaX=-(a.wheelDeltaX/120):r?this.deltaX=a.wheelDeltaX/(120*h):this.deltaX=a.wheelDeltaX/120;else if(typeof c.HORIZONTAL_AXIS<"u"&&c.axis===c.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let d=e;d.deltaMode===d.DOM_DELTA_LINE?Up&&!Cn?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*h):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},Pb=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),Kk;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof Gk?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Qt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Pb})})(Kk||(Kk={}));var Gk=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Pb:(this._emitter||(this._emitter=new _e),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Ug=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new zp("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new zp("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Zk=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new zp("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=i.setInterval(()=>{e()},t);this.disposable=ht(()=>{i.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Qk;(e=>{async function t(r){let o,a=await Promise.all(r.map(c=>c.then(h=>h,h=>{o||(o=h)})));if(typeof o<"u")throw o;return a}e.settled=t;function i(r){return new Promise(async(o,a)=>{try{await r(o,a)}catch(c){a(c)}})}e.withAsyncBody=i})(Qk||(Qk={}));var Ay=class Xi{static fromArray(t){return new Xi(i=>{i.emitMany(t)})}static fromPromise(t){return new Xi(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Xi(async i=>{await Promise.all(t.map(async r=>i.emitOne(await r)))})}static merge(t){return new Xi(async i=>{await Promise.all(t.map(async r=>{for await(let o of r)i.emitOne(o)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new _e,queueMicrotask(async()=>{let r={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(r)),this.resolve()}catch(o){this.reject(o)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Qt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var i;return(i=this._onReturn)==null||i.call(this),{done:!0,value:void 0}}}}static map(t,i){return new Xi(async r=>{for await(let o of t)r.emitOne(i(o))})}map(t){return Xi.map(this,t)}static filter(t,i){return new Xi(async r=>{for await(let o of t)i(o)&&r.emitOne(o)})}filter(t){return Xi.filter(this,t)}static coalesce(t){return Xi.filter(t,i=>!!i)}coalesce(){return Xi.coalesce(this)}static async toPromise(t){let i=[];for await(let r of t)i.push(r);return i}toPromise(){return Xi.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Ay.EMPTY=Ay.fromArray([]);var{getWindow:wn,getWindowId:Jk,onDidRegisterWindow:e5}=(function(){let e=new Map,t={window:tr,disposables:new Wr};e.set(tr.vscodeWindowId,t);let i=new _e,r=new _e,o=new _e;function a(c,h){return(typeof c=="number"?e.get(c):void 0)??(h?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:r.event,registerWindow(c){if(e.has(c.vscodeWindowId))return je.None;let h=new Wr,d={window:c,disposables:h.add(new Wr)};return e.set(c.vscodeWindowId,d),h.add(ht(()=>{e.delete(c.vscodeWindowId),r.fire(c)})),h.add(Te(c,Ut.BEFORE_UNLOAD,()=>{o.fire(c)})),i.fire(d),h},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(c){return c.vscodeWindowId},hasWindow(c){return e.has(c)},getWindowById:a,getWindow(c){var f;let h=c;if((f=h==null?void 0:h.ownerDocument)!=null&&f.defaultView)return h.ownerDocument.defaultView.window;let d=c;return d!=null&&d.view?d.view.window:tr},getDocument(c){return wn(c).document}}})(),t5=class{constructor(e,t,i,r){this._node=e,this._type=t,this._handler=i,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Te(e,t,i,r){return new t5(e,t,i,r)}var Dy=function(e,t,i,r){return Te(e,t,i,r)},qg,i5=class extends Zk{constructor(e){super(),this.defaultTarget=e&&wn(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},Ry=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Eu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,r=new Map,o=a=>{i.set(a,!1);let c=e.get(a)??[];for(t.set(a,c),e.set(a,[]),r.set(a,!0);c.length>0;)c.sort(Ry.sort),c.shift().execute();r.set(a,!1)};qg=(a,c,h=0)=>{let d=Jk(a),f=new Ry(c,h),m=e.get(d);return m||(m=[],e.set(d,m)),m.push(f),i.get(d)||(i.set(d,!0),a.requestAnimationFrame(()=>o(d))),f}})();function n5(e){let t=e.getBoundingClientRect(),i=wn(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var Ut={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},r5=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=yi(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=yi(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=yi(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=yi(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=yi(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=yi(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=yi(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=yi(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=yi(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=yi(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=yi(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=yi(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=yi(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=yi(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function yi(e){return typeof e=="number"?`${e}px`:e}function ra(e){return new r5(e)}var Ib=class{constructor(){this._hooks=new Wr,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let a=e;try{e.setPointerCapture(t),this._hooks.add(ht(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=wn(e)}this._hooks.add(Te(a,Ut.POINTER_MOVE,c=>{if(c.buttons!==i){this.stopMonitoring(!0);return}c.preventDefault(),this._pointerMoveCallback(c)})),this._hooks.add(Te(a,Ut.POINTER_UP,c=>this.stopMonitoring(!0)))}};function s5(e,t,i){let r=null,o=null;if(typeof i.value=="function"?(r="value",o=i.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(r="get",o=i.get),!o)throw new Error("not supported");let a=`$memoize$${t}`;i[r]=function(...c){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,c)}),this[a]}}var yn;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(yn||(yn={}));var Zl=class ni extends je{constructor(){super(),this.dispatched=!1,this.targets=new xy,this.ignoreTargets=new xy,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Qt.runAndSubscribe(e5,({window:t,disposables:i})=>{i.add(Te(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),i.add(Te(t.document,"touchend",r=>this.onTouchEnd(t,r))),i.add(Te(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:tr,disposables:this._store}))}static addTarget(t){if(!ni.isTouchDevice())return je.None;ni.INSTANCE||(ni.INSTANCE=new ni);let i=ni.INSTANCE.targets.push(t);return ht(i)}static ignoreTarget(t){if(!ni.isTouchDevice())return je.None;ni.INSTANCE||(ni.INSTANCE=new ni);let i=ni.INSTANCE.ignoreTargets.push(t);return ht(i)}static isTouchDevice(){return"ontouchstart"in tr||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,o=t.targetTouches.length;r<o;r++){let a=t.targetTouches.item(r);this.activeTouches[a.identifier]={id:a.identifier,initialTarget:a.target,initialTimeStamp:i,initialPageX:a.pageX,initialPageY:a.pageY,rollingTimestamps:[i],rollingPageX:[a.pageX],rollingPageY:[a.pageY]};let c=this.newGestureEvent(yn.Start,a.target);c.pageX=a.pageX,c.pageY=a.pageY,this.dispatchEvent(c)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let r=Date.now(),o=Object.keys(this.activeTouches).length;for(let a=0,c=i.changedTouches.length;a<c;a++){let h=i.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let d=this.activeTouches[h.identifier],f=Date.now()-d.initialTimeStamp;if(f<ni.HOLD_DELAY&&Math.abs(d.initialPageX-Bi(d.rollingPageX))<30&&Math.abs(d.initialPageY-Bi(d.rollingPageY))<30){let m=this.newGestureEvent(yn.Tap,d.initialTarget);m.pageX=Bi(d.rollingPageX),m.pageY=Bi(d.rollingPageY),this.dispatchEvent(m)}else if(f>=ni.HOLD_DELAY&&Math.abs(d.initialPageX-Bi(d.rollingPageX))<30&&Math.abs(d.initialPageY-Bi(d.rollingPageY))<30){let m=this.newGestureEvent(yn.Contextmenu,d.initialTarget);m.pageX=Bi(d.rollingPageX),m.pageY=Bi(d.rollingPageY),this.dispatchEvent(m)}else if(o===1){let m=Bi(d.rollingPageX),g=Bi(d.rollingPageY),v=Bi(d.rollingTimestamps)-d.rollingTimestamps[0],y=m-d.rollingPageX[0],S=g-d.rollingPageY[0],b=[...this.targets].filter(k=>d.initialTarget instanceof Node&&k.contains(d.initialTarget));this.inertia(t,b,r,Math.abs(y)/v,y>0?1:-1,m,Math.abs(S)/v,S>0?1:-1,g)}this.dispatchEvent(this.newGestureEvent(yn.End,d.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=i,r.tapCount=0,r}dispatchEvent(t){if(t.type===yn.Tap){let i=new Date().getTime(),r=0;i-this._lastSetTapCountTime>ni.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=i,t.tapCount=r}else(t.type===yn.Change||t.type===yn.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let i=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let o=0,a=t.initialTarget;for(;a&&a!==r;)o++,a=a.parentElement;i.push([o,r])}i.sort((r,o)=>r[0]-o[0]);for(let[r,o]of i)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,r,o,a,c,h,d,f){this.handle=qg(t,()=>{let m=Date.now(),g=m-r,v=0,y=0,S=!0;o+=ni.SCROLL_FRICTION*g,h+=ni.SCROLL_FRICTION*g,o>0&&(S=!1,v=a*o*g),h>0&&(S=!1,y=d*h*g);let b=this.newGestureEvent(yn.Change);b.translationX=v,b.translationY=y,i.forEach(k=>k.dispatchEvent(b)),S||this.inertia(t,i,m,o,a,c+v,h,d,f+y)})}onTouchMove(t){let i=Date.now();for(let r=0,o=t.changedTouches.length;r<o;r++){let a=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("end of an UNKNOWN touch",a);continue}let c=this.activeTouches[a.identifier],h=this.newGestureEvent(yn.Change,c.initialTarget);h.translationX=a.pageX-Bi(c.rollingPageX),h.translationY=a.pageY-Bi(c.rollingPageY),h.pageX=a.pageX,h.pageY=a.pageY,this.dispatchEvent(h),c.rollingPageX.length>3&&(c.rollingPageX.shift(),c.rollingPageY.shift(),c.rollingTimestamps.shift()),c.rollingPageX.push(a.pageX),c.rollingPageY.push(a.pageY),c.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Zl.SCROLL_FRICTION=-.005,Zl.HOLD_DELAY=700,Zl.CLEAR_TAP_COUNT_TIME=400,yt([s5],Zl,"isTouchDevice",1);var o5=Zl,Vg=class extends je{onclick(e,t){this._register(Te(e,Ut.CLICK,i=>t(new au(wn(e),i))))}onmousedown(e,t){this._register(Te(e,Ut.MOUSE_DOWN,i=>t(new au(wn(e),i))))}onmouseover(e,t){this._register(Te(e,Ut.MOUSE_OVER,i=>t(new au(wn(e),i))))}onmouseleave(e,t){this._register(Te(e,Ut.MOUSE_LEAVE,i=>t(new au(wn(e),i))))}onkeydown(e,t){this._register(Te(e,Ut.KEY_DOWN,i=>t(new My(i))))}onkeyup(e,t){this._register(Te(e,Ut.KEY_UP,i=>t(new My(i))))}oninput(e,t){this._register(Te(e,Ut.INPUT,t))}onblur(e,t){this._register(Te(e,Ut.BLUR,t))}onfocus(e,t){this._register(Te(e,Ut.FOCUS,t))}onchange(e,t){this._register(Te(e,Ut.CHANGE,t))}ignoreGesture(e){return o5.ignoreTarget(e)}},By=11,l5=class extends Vg{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=By+"px",this.domNode.style.height=By+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Ib),this._register(Dy(this.bgDomNode,Ut.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Dy(this.domNode,Ut.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new i5),this._pointerdownScheduleRepeatTimer=this._register(new Ug)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,wn(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},a5=class Fp{constructor(t,i,r,o,a,c,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,r=r|0,o=o|0,a=a|0,c=c|0,h=h|0),this.rawScrollLeft=o,this.rawScrollTop=h,i<0&&(i=0),o+i>r&&(o=r-i),o<0&&(o=0),a<0&&(a=0),h+a>c&&(h=c-a),h<0&&(h=0),this.width=i,this.scrollWidth=r,this.scrollLeft=o,this.height=a,this.scrollHeight=c,this.scrollTop=h}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new Fp(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Fp(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let r=this.width!==t.width,o=this.scrollWidth!==t.scrollWidth,a=this.scrollLeft!==t.scrollLeft,c=this.height!==t.height,h=this.scrollHeight!==t.scrollHeight,d=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:o,scrollLeftChanged:a,heightChanged:c,scrollHeightChanged:h,scrollTopChanged:d}}},c5=class extends je{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new a5(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var r;let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let r;t?r=new zy(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=zy.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},Ly=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function Wd(e,t){let i=t-e;return function(r){return e+i*f5(r)}}function u5(e,t,i){return function(r){return r<i?e(r/i):t((r-i)/(1-i))}}var zy=class $p{constructor(t,i,r,o){this.from=t,this.to=i,this.duration=o,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,i,r){if(Math.abs(t-i)>2.5*r){let o,a;return t<i?(o=t+.75*r,a=i-.75*r):(o=t-.75*r,a=i+.75*r),u5(Wd(t,o),Wd(a,i),.33)}return Wd(t,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let i=(t-this.startTime)/this.duration;if(i<1){let r=this.scrollLeft(i),o=this.scrollTop(i);return new Ly(r,o,!1)}return new Ly(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,r){return $p.start(t,i,r)}static start(t,i,r){r=r+10;let o=Date.now()-10;return new $p(t,i,o,r)}};function h5(e){return Math.pow(e,3)}function f5(e){return 1-h5(1-e)}var d5=class extends je{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Ug)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},p5=140,Ub=class extends Vg{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new d5(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Ib),this._shouldRender=!0,this.domNode=ra(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Te(this.domNode.domNode,Ut.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new l5(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,r){this.slider=ra(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Te(this.slider.domNode,Ut.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let o=n5(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}let r=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let a=this._sliderOrthogonalPointerPosition(o),c=Math.abs(a-i);if(Ob&&c>p5){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let h=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(h))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},qb=class Yp{constructor(t,i,r,o,a,c){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=o,this._scrollSize=a,this._scrollPosition=c,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Yp(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,r,o,a){let c=Math.max(0,r-t),h=Math.max(0,c-2*i),d=o>0&&o>r;if(!d)return{computedAvailableSize:Math.round(c),computedIsNeeded:d,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(r*h/o))),m=(h-f)/(o-r),g=a*m;return{computedAvailableSize:Math.round(c),computedIsNeeded:d,computedSliderSize:Math.round(f),computedSliderRatio:m,computedSliderPosition:Math.round(g)}}_refreshComputedValues(){let t=Yp._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,r=this._scrollPosition;return i<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},g5=class extends Ub{constructor(e,t,i){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new qb(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},m5=class extends Ub{constructor(e,t,i){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new qb(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},_5=500,Oy=50,v5=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},Wp=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,i=0,r=1,o=this._rear;do{let a=o===this._front?t:Math.pow(2,-r);if(t-=a,i+=this._memory[o].score*a,o===this._front)break;o=(this._capacity+o-1)%this._capacity,r++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(Pg){let i=wn(t.browserEvent),r=Nk(i);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,r){let o=null,a=new v5(t,i,r);this._front===-1&&this._rear===-1?(this._memory[0]=a,this._front=0,this._rear=0):(o=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=a),a.score=this._computeScore(a,o)}_computeScore(t,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),i){let o=Math.abs(t.deltaX),a=Math.abs(t.deltaY),c=Math.abs(i.deltaX),h=Math.abs(i.deltaY),d=Math.max(Math.min(o,c),1),f=Math.max(Math.min(a,h),1),m=Math.max(o,c),g=Math.max(a,h);m%d===0&&g%f===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Wp.INSTANCE=new Wp;var y5=Wp,S5=class extends Vg{constructor(e,t,i){super(),this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new _e),this.onWillScroll=this._onWillScroll.event,this._options=x5(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new m5(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new g5(this._scrollable,this._options,r)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ra(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ra(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ra(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Ug),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ks(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Cn&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Ny(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ks(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new Ny(i))};this._mouseWheelToDispose.push(Te(this._listenOnDomNode,Ut.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var o;if((o=e.browserEvent)!=null&&o.defaultPrevented)return;let t=y5.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,c=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&c+a===0?c=a=0:Math.abs(a)>=Math.abs(c)?c=0:a=0),this._options.flipAxes&&([a,c]=[c,a]);let h=!Cn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||h)&&!c&&(c=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(c=c*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let d=this._scrollable.getFutureScrollPosition(),f={};if(a){let m=Oy*a,g=d.scrollTop-(m<0?Math.floor(m):Math.ceil(m));this._verticalScrollbar.writeScrollPosition(f,g)}if(c){let m=Oy*c,g=d.scrollLeft-(m<0?Math.floor(m):Math.ceil(m));this._horizontalScrollbar.writeScrollPosition(f,g)}f=this._scrollable.validateScrollPosition(f),(d.scrollLeft!==f.scrollLeft||d.scrollTop!==f.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(f):this._scrollable.setScrollPositionNow(f),i=!0)}let r=i;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,r=i?" left":"",o=t?" top":"",a=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${o}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),_5)}},b5=class extends S5{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function x5(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Cn&&(t.className+=" mac"),t}var Xp=class extends je{constructor(e,t,i,r,o,a,c,h){super(),this._bufferService=i,this._optionsService=c,this._renderService=h,this._onRequestScrollLines=this._register(new _e),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let d=this._register(new c5({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>qg(r.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{d.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new b5(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},d)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(f=>{this._scrollableElement.updateOptions({handleMouseWheel:!(f&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Qt.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ht(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ht(()=>this._styleElement.remove())),this._register(Qt.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${a.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${a.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${a.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
69
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(f=>this._handleScroll(f)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};Xp=yt([ve(2,ai),ve(3,sr),ve(4,xb),ve(5,Io),ve(6,ci),ve(7,or)],Xp);var Kp=class extends je{constructor(e,t,i,r,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=r,this._renderService=o,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(a=>this._removeDecoration(a))),this._register(ht(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Kp=yt([ve(1,ai),ve(2,sr),ve(3,Ma),ve(4,or)],Kp);var w5=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},_n={full:0,left:0,center:0,right:0},Pr={full:0,left:0,center:0,right:0},Pl={full:0,left:0,center:0,right:0},Pu=class extends je{constructor(e,t,i,r,o,a,c,h){var f;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=r,this._renderService=o,this._optionsService=a,this._themeService=c,this._coreBrowserService=h,this._colorZoneStore=new w5,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(),(f=this._viewportElement.parentElement)==null||f.insertBefore(this._canvas,this._viewportElement),this._register(ht(()=>{var m;return(m=this._canvas)==null?void 0:m.remove()}));let d=this._canvas.getContext("2d");if(d)this._ctx=d;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Pr.full=this._canvas.width,Pr.left=e,Pr.center=t,Pr.right=e,this._refreshDrawHeightConstants(),Pl.full=1,Pl.left=1,Pl.center=1+Pr.left,Pl.right=1+Pr.left+Pr.center}_refreshDrawHeightConstants(){_n.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);_n.left=t,_n.center=t,_n.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_n.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_n.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_n.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_n.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(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Pl[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-_n[e.position||"full"]/2),Pr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+_n[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Pu=yt([ve(2,ai),ve(3,Ma),ve(4,or),ve(5,ci),ve(6,Io),ve(7,sr)],Pu);var ue;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
70
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(ue||(ue={}));var Tu;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Tu||(Tu={}));var Vb;(e=>e.ST=`${ue.ESC}\\`)(Vb||(Vb={}));var Gp=class{constructor(e,t,i,r,o,a){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=r,this._coreService=o,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ue.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let a=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Gp=yt([ve(2,ai),ve(3,ci),ve(4,Rs),ve(5,or)],Gp);var qt=0,Vt=0,Ft=0,vt=0,Hy={css:"#00000000",rgba:0},Rt;(e=>{function t(o,a,c,h){return h!==void 0?`#${_s(o)}${_s(a)}${_s(c)}${_s(h)}`:`#${_s(o)}${_s(a)}${_s(c)}`}e.toCss=t;function i(o,a,c,h=255){return(o<<24|a<<16|c<<8|h)>>>0}e.toRgba=i;function r(o,a,c,h){return{css:e.toCss(o,a,c,h),rgba:e.toRgba(o,a,c,h)}}e.toColor=r})(Rt||(Rt={}));var ct;(e=>{function t(d,f){if(vt=(f.rgba&255)/255,vt===1)return{css:f.css,rgba:f.rgba};let m=f.rgba>>24&255,g=f.rgba>>16&255,v=f.rgba>>8&255,y=d.rgba>>24&255,S=d.rgba>>16&255,b=d.rgba>>8&255;qt=y+Math.round((m-y)*vt),Vt=S+Math.round((g-S)*vt),Ft=b+Math.round((v-b)*vt);let k=Rt.toCss(qt,Vt,Ft),C=Rt.toRgba(qt,Vt,Ft);return{css:k,rgba:C}}e.blend=t;function i(d){return(d.rgba&255)===255}e.isOpaque=i;function r(d,f,m){let g=Nu.ensureContrastRatio(d.rgba,f.rgba,m);if(g)return Rt.toColor(g>>24&255,g>>16&255,g>>8&255)}e.ensureContrastRatio=r;function o(d){let f=(d.rgba|255)>>>0;return[qt,Vt,Ft]=Nu.toChannels(f),{css:Rt.toCss(qt,Vt,Ft),rgba:f}}e.opaque=o;function a(d,f){return vt=Math.round(f*255),[qt,Vt,Ft]=Nu.toChannels(d.rgba),{css:Rt.toCss(qt,Vt,Ft,vt),rgba:Rt.toRgba(qt,Vt,Ft,vt)}}e.opacity=a;function c(d,f){return vt=d.rgba&255,a(d,vt*f/255)}e.multiplyOpacity=c;function h(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}e.toColorRGB=h})(ct||(ct={}));var gt;(e=>{let t,i;try{let o=document.createElement("canvas");o.width=1,o.height=1;let a=o.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function r(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return qt=parseInt(o.slice(1,2).repeat(2),16),Vt=parseInt(o.slice(2,3).repeat(2),16),Ft=parseInt(o.slice(3,4).repeat(2),16),Rt.toColor(qt,Vt,Ft);case 5:return qt=parseInt(o.slice(1,2).repeat(2),16),Vt=parseInt(o.slice(2,3).repeat(2),16),Ft=parseInt(o.slice(3,4).repeat(2),16),vt=parseInt(o.slice(4,5).repeat(2),16),Rt.toColor(qt,Vt,Ft,vt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let a=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return qt=parseInt(a[1]),Vt=parseInt(a[2]),Ft=parseInt(a[3]),vt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Rt.toColor(qt,Vt,Ft,vt);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=o,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[qt,Vt,Ft,vt]=t.getImageData(0,0,1,1).data,vt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Rt.toRgba(qt,Vt,Ft,vt),css:o}}e.toColor=r})(gt||(gt={}));var li;(e=>{function t(r){return i(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function i(r,o,a){let c=r/255,h=o/255,d=a/255,f=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),m=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),g=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return f*.2126+m*.7152+g*.0722}e.relativeLuminance2=i})(li||(li={}));var Nu;(e=>{function t(c,h){if(vt=(h&255)/255,vt===1)return h;let d=h>>24&255,f=h>>16&255,m=h>>8&255,g=c>>24&255,v=c>>16&255,y=c>>8&255;return qt=g+Math.round((d-g)*vt),Vt=v+Math.round((f-v)*vt),Ft=y+Math.round((m-y)*vt),Rt.toRgba(qt,Vt,Ft)}e.blend=t;function i(c,h,d){let f=li.relativeLuminance(c>>8),m=li.relativeLuminance(h>>8);if(Jn(f,m)<d){if(m<f){let y=r(c,h,d),S=Jn(f,li.relativeLuminance(y>>8));if(S<d){let b=o(c,h,d),k=Jn(f,li.relativeLuminance(b>>8));return S>k?y:b}return y}let g=o(c,h,d),v=Jn(f,li.relativeLuminance(g>>8));if(v<d){let y=r(c,h,d),S=Jn(f,li.relativeLuminance(y>>8));return v>S?g:y}return g}}e.ensureContrastRatio=i;function r(c,h,d){let f=c>>24&255,m=c>>16&255,g=c>>8&255,v=h>>24&255,y=h>>16&255,S=h>>8&255,b=Jn(li.relativeLuminance2(v,y,S),li.relativeLuminance2(f,m,g));for(;b<d&&(v>0||y>0||S>0);)v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),b=Jn(li.relativeLuminance2(v,y,S),li.relativeLuminance2(f,m,g));return(v<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=r;function o(c,h,d){let f=c>>24&255,m=c>>16&255,g=c>>8&255,v=h>>24&255,y=h>>16&255,S=h>>8&255,b=Jn(li.relativeLuminance2(v,y,S),li.relativeLuminance2(f,m,g));for(;b<d&&(v<255||y<255||S<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),b=Jn(li.relativeLuminance2(v,y,S),li.relativeLuminance2(f,m,g));return(v<<24|y<<16|S<<8|255)>>>0}e.increaseLuminance=o;function a(c){return[c>>24&255,c>>16&255,c>>8&255,c&255]}e.toChannels=a})(Nu||(Nu={}));function _s(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Jn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var C5=class extends ka{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Iu=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Zi}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let i=[],r=t.translateToString(!0),o=0,a=0,c=0,h=t.getFg(0),d=t.getBg(0);for(let f=0;f<t.getTrimmedLength();f++)if(t.loadCell(f,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==h||this._workCell.bg!==d){if(f-o>1){let m=this._getJoinedRanges(r,c,a,t,o);for(let g=0;g<m.length;g++)i.push(m[g])}o=f,c=a,h=this._workCell.fg,d=this._workCell.bg}a+=this._workCell.getChars().length||Yr.length}if(this._bufferService.cols-o>1){let f=this._getJoinedRanges(r,c,a,t,o);for(let m=0;m<f.length;m++)i.push(f[m])}return i}_getJoinedRanges(e,t,i,r,o){let a=e.substring(t,i),c=[];try{c=this._characterJoiners[0].handler(a)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let d=this._characterJoiners[h].handler(a);for(let f=0;f<d.length;f++)Iu._mergeRanges(c,d[f])}catch(d){console.error(d)}return this._stringRangesToCellRanges(c,r,o),c}_stringRangesToCellRanges(e,t,i){let r=0,o=!1,a=0,c=e[r];if(c){for(let h=i;h<this._bufferService.cols;h++){let d=t.getWidth(h),f=t.getString(h).length||Yr.length;if(d!==0){if(!o&&c[0]<=a&&(c[0]=h,o=!0),c[1]<=a){if(c[1]=h,c=e[++r],!c)break;c[0]<=a?(c[0]=h,o=!0):o=!1}a+=f}}c&&(c[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let r=0;r<e.length;r++){let o=e[r];if(i){if(t[1]<=o[0])return e[r-1][1]=t[1],e;if(t[1]<=o[1])return e[r-1][1]=Math.max(t[1],o[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=o[0])return e.splice(r,0,t),e;if(t[1]<=o[1])return o[0]=Math.min(t[0],o[0]),e;t[0]<o[1]&&(o[0]=Math.min(t[0],o[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};Iu=yt([ve(0,ai)],Iu);function E5(e){return 57508<=e&&e<=57558}function k5(e){return 9472<=e&&e<=9631}function M5(e){return E5(e)||k5(e)}function T5(){return{css:{canvas:cu(),cell:cu()},device:{canvas:cu(),cell:cu(),char:{width:0,height:0,left:0,top:0}}}}function cu(){return{width:0,height:0}}var Zp=class{constructor(e,t,i,r,o,a,c){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=r,this._coreService=o,this._decorationService=a,this._themeService=c,this._workCell=new Zi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,r,o,a,c,h,d,f,m){let g=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,S=e.getNoBgTrimmedLength();i&&S<a+1&&(S=a+1);let b,k=0,C="",z=0,E=0,T=0,P=0,R=!1,U=0,X=!1,G=0,ne=0,V=[],I=f!==-1&&m!==-1;for(let F=0;F<S;F++){e.loadCell(F,this._workCell);let B=this._workCell.getWidth();if(B===0)continue;let O=!1,M=F>=ne,j=F,H=this._workCell;if(v.length>0&&F===v[0][0]&&M){let me=v.shift(),Ae=this._isCellInSelection(me[0],t);for(z=me[0]+1;z<me[1];z++)M&&(M=Ae===this._isCellInSelection(z,t));M&&(M=!i||a<me[0]||a>=me[1]),M?(O=!0,H=new C5(this._workCell,e.translateToString(!0,me[0],me[1]),me[1]-me[0]),j=me[1]-1,B=H.getWidth()):ne=me[1]}let $=this._isCellInSelection(F,t),N=i&&F===a,L=I&&F>=f&&F<=m,Y=!1;this._decorationService.forEachDecorationAtCell(F,t,void 0,me=>{Y=!0});let A=H.getChars()||Yr;if(A===" "&&(H.isUnderline()||H.isOverline())&&(A=" "),G=B*h-d.get(A,H.isBold(),H.isItalic()),!b)b=this._document.createElement("span");else if(k&&($&&X||!$&&!X&&H.bg===E)&&($&&X&&y.selectionForeground||H.fg===T)&&H.extended.ext===P&&L===R&&G===U&&!N&&!O&&!Y&&M){H.isInvisible()?C+=Yr:C+=A,k++;continue}else k&&(b.textContent=C),b=this._document.createElement("span"),k=0,C="";if(E=H.bg,T=H.fg,P=H.extended.ext,R=L,U=G,X=$,O&&a>=F&&a<=j&&(a=F),!this._coreService.isCursorHidden&&N&&this._coreService.isCursorInitialized){if(V.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&V.push("xterm-cursor-blink"),V.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":V.push("xterm-cursor-outline");break;case"block":V.push("xterm-cursor-block");break;case"bar":V.push("xterm-cursor-bar");break;case"underline":V.push("xterm-cursor-underline");break}}if(H.isBold()&&V.push("xterm-bold"),H.isItalic()&&V.push("xterm-italic"),H.isDim()&&V.push("xterm-dim"),H.isInvisible()?C=Yr:C=H.getChars()||Yr,H.isUnderline()&&(V.push(`xterm-underline-${H.extended.underlineStyle}`),C===" "&&(C=" "),!H.isUnderlineColorDefault()))if(H.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${ka.toColorRGB(H.getUnderlineColor()).join(",")})`;else{let me=H.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&H.isBold()&&me<8&&(me+=8),b.style.textDecorationColor=y.ansi[me].css}H.isOverline()&&(V.push("xterm-overline"),C===" "&&(C=" ")),H.isStrikethrough()&&V.push("xterm-strikethrough"),L&&(b.style.textDecoration="underline");let ee=H.getFgColor(),ce=H.getFgColorMode(),le=H.getBgColor(),fe=H.getBgColorMode(),he=!!H.isInverse();if(he){let me=ee;ee=le,le=me;let Ae=ce;ce=fe,fe=Ae}let pe,Ce,xe=!1;this._decorationService.forEachDecorationAtCell(F,t,void 0,me=>{me.options.layer!=="top"&&xe||(me.backgroundColorRGB&&(fe=50331648,le=me.backgroundColorRGB.rgba>>8&16777215,pe=me.backgroundColorRGB),me.foregroundColorRGB&&(ce=50331648,ee=me.foregroundColorRGB.rgba>>8&16777215,Ce=me.foregroundColorRGB),xe=me.options.layer==="top")}),!xe&&$&&(pe=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,le=pe.rgba>>8&16777215,fe=50331648,xe=!0,y.selectionForeground&&(ce=50331648,ee=y.selectionForeground.rgba>>8&16777215,Ce=y.selectionForeground)),xe&&V.push("xterm-decoration-top");let Se;switch(fe){case 16777216:case 33554432:Se=y.ansi[le],V.push(`xterm-bg-${le}`);break;case 50331648:Se=Rt.toColor(le>>16,le>>8&255,le&255),this._addStyle(b,`background-color:#${jy((le>>>0).toString(16),"0",6)}`);break;case 0:default:he?(Se=y.foreground,V.push("xterm-bg-257")):Se=y.background}switch(pe||H.isDim()&&(pe=ct.multiplyOpacity(Se,.5)),ce){case 16777216:case 33554432:H.isBold()&&ee<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ee+=8),this._applyMinimumContrast(b,Se,y.ansi[ee],H,pe,void 0)||V.push(`xterm-fg-${ee}`);break;case 50331648:let me=Rt.toColor(ee>>16&255,ee>>8&255,ee&255);this._applyMinimumContrast(b,Se,me,H,pe,Ce)||this._addStyle(b,`color:#${jy(ee.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(b,Se,y.foreground,H,pe,Ce)||he&&V.push("xterm-fg-257")}V.length&&(b.className=V.join(" "),V.length=0),!N&&!O&&!Y&&M?k++:b.textContent=C,G!==this.defaultSpacing&&(b.style.letterSpacing=`${G}px`),g.push(b),F=j}return b&&k&&(b.textContent=C),g}_applyMinimumContrast(e,t,i,r,o,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||M5(r.getCode()))return!1;let c=this._getContrastCache(r),h;if(!o&&!a&&(h=c.getColor(t.rgba,i.rgba)),h===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);h=ct.ensureContrastRatio(o||t,a||i,d),c.setColor((o||t).rgba,(a||i).rgba,h??null)}return h?(this._addStyle(e,`color:${h.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,r=this._selectionEnd;return!i||!r?!1:this._columnSelectMode?i[0]<=r[0]?e>=i[0]&&t>=i[1]&&e<r[0]&&t<=r[1]:e<i[0]&&t>=i[1]&&e>=r[0]&&t<=r[1]:t>i[1]&&t<r[1]||i[1]===r[1]&&t===i[1]&&e>=i[0]&&e<r[0]||i[1]<r[1]&&t===r[1]&&e<r[0]||i[1]<r[1]&&t===i[1]&&e>=i[0]}};Zp=yt([ve(1,Eb),ve(2,ci),ve(3,sr),ve(4,Rs),ve(5,Ma),ve(6,Io)],Zp);function jy(e,t,i){for(;e.length<i;)e=t+e;return e}var N5=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let i=e.createElement("span");i.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontStyle="italic";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold",a.style.fontStyle="italic",this._measureElements=[i,r,o,a],this._container.appendChild(i),this._container.appendChild(r),this._container.appendChild(o),this._container.appendChild(a),t.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(e,t,i,r){e===this._font&&t===this._fontSize&&i===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,i){let r=0;if(!t&&!i&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let c=this._measure(e,0);return c>0&&(this._flat[r]=c),c}let o=e;t&&(o+="B"),i&&(o+="I");let a=this._holey.get(o);if(a===void 0){let c=0;t&&(c|=1),i&&(c|=2),a=this._measure(e,c),a>0&&this._holey.set(o,a)}return a}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},A5=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,r=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let o=e.buffers.active.ydisp,a=t[1]-o,c=i[1]-o,h=Math.max(a,0),d=Math.min(c,e.rows-1);if(h>=e.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=c,this.viewportCappedStartRow=h,this.viewportCappedEndRow=d,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function D5(){return new A5}var Xd="xterm-dom-renderer-owner-",Wi="xterm-rows",uu="xterm-fg-",Py="xterm-bg-",Il="xterm-focus",hu="xterm-selection",R5=1,Qp=class extends je{constructor(e,t,i,r,o,a,c,h,d,f,m,g,v,y){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=r,this._viewportElement=o,this._helperContainer=a,this._linkifier2=c,this._charSizeService=d,this._optionsService=f,this._bufferService=m,this._coreService=g,this._coreBrowserService=v,this._themeService=y,this._terminalClass=R5++,this._rowElements=[],this._selectionRenderModel=D5(),this.onRequestRedraw=this._register(new _e).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Wi),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(hu),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=T5(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(S=>this._injectCss(S))),this._injectCss(this._themeService.colors),this._rowFactory=h.createInstance(Zp,document),this._element.classList.add(Xd+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(S=>this._handleLinkHover(S))),this._register(this._linkifier2.onHideLinkUnderline(S=>this._handleLinkLeave(S))),this._register(ht(()=>{this._element.classList.remove(Xd+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new N5(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Wi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Wi} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Wi} .xterm-dim { color: ${ct.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let i=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Wi}.${Il} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Wi}.${Il} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Wi}.${Il} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${Wi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Wi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Wi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Wi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Wi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${hu} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${hu} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${hu} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,c]of e.ansi.entries())t+=`${this._terminalSelector} .${uu}${a} { color: ${c.css}; }${this._terminalSelector} .${uu}${a}.xterm-dim { color: ${ct.multiplyOpacity(c,.5).css}; }${this._terminalSelector} .${Py}${a} { background-color: ${c.css}; }`;t+=`${this._terminalSelector} .${uu}257 { color: ${ct.opaque(e.background).css}; }${this._terminalSelector} .${uu}257.xterm-dim { color: ${ct.multiplyOpacity(ct.opaque(e.background),.5).css}; }${this._terminalSelector} .${Py}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(Il),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Il),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,c=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(i){let d=e[0]>t[0];h.appendChild(this._createSelectionElement(a,d?t[0]:e[0],d?e[0]:t[0],c-a+1))}else{let d=r===a?e[0]:0,f=a===o?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(a,d,f));let m=c-a-1;if(h.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,m)),a!==c){let g=o===c?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(c,0,g))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,t,i,r=1){let o=this._document.createElement("div"),a=t*this.dimensions.css.cell.width,c=this.dimensions.css.cell.width*(i-t);return a+c>this.dimensions.css.canvas.width&&(c=this.dimensions.css.canvas.width-a),o.style.height=`${r*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${a}px`,o.style.width=`${c}px`,o}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,r=i.ybase+i.y,o=Math.min(i.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,c=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let d=e;d<=t;d++){let f=d+i.ydisp,m=this._rowElements[d],g=i.lines.get(f);if(!m||!g)break;m.replaceChildren(...this._rowFactory.createRow(g,f,f===r,c,h,o,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Xd}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,r,o,a){i<0&&(e=0),r<0&&(t=0);let c=this._bufferService.rows-1;i=Math.max(Math.min(i,c),0),r=Math.max(Math.min(r,c),0),o=Math.min(o,this._bufferService.cols);let h=this._bufferService.buffer,d=h.ybase+h.y,f=Math.min(h.x,o-1),m=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=i;y<=r;++y){let S=y+h.ydisp,b=this._rowElements[y],k=h.lines.get(S);if(!b||!k)break;b.replaceChildren(...this._rowFactory.createRow(k,S,S===d,g,v,f,m,this.dimensions.css.cell.width,this._widthCache,a?y===i?e:0:-1,a?(y===r?t:o)-1:-1))}}};Qp=yt([ve(7,Og),ve(8,sh),ve(9,ci),ve(10,ai),ve(11,Rs),ve(12,sr),ve(13,Io)],Qp);var Jp=class extends je{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new _e),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new L5(this._optionsService))}catch{this._measureStrategy=this._register(new B5(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Jp=yt([ve(2,ci)],Jp);var Fb=class extends je{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},B5=class extends Fb{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,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}},L5=class extends Fb{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},z5=class extends je{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new O5(this._window)),this._onDprChange=this._register(new _e),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new _e),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(Qt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Te(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Te(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},O5=class extends je{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ro),this._onDprChange=this._register(new _e),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ht(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Te(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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)}},H5=class extends je{constructor(){super(),this.linkProviders=[],this._register(ht(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Fg(e,t,i){let r=i.getBoundingClientRect(),o=e.getComputedStyle(i),a=parseInt(o.getPropertyValue("padding-left")),c=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-r.left-a,t.clientY-r.top-c]}function j5(e,t,i,r,o,a,c,h,d){if(!a)return;let f=Fg(e,t,i);if(f)return f[0]=Math.ceil((f[0]+(d?c/2:0))/c),f[1]=Math.ceil(f[1]/h),f[0]=Math.min(Math.max(f[0],1),r+(d?1:0)),f[1]=Math.min(Math.max(f[1],1),o),f}var eg=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,r,o){return j5(window,e,t,i,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let i=Fg(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};eg=yt([ve(0,or),ve(1,sh)],eg);var P5=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},$b={};KE($b,{getSafariVersion:()=>U5,isChromeOS:()=>Kb,isFirefox:()=>Yb,isIpad:()=>q5,isIphone:()=>V5,isLegacyEdge:()=>I5,isLinux:()=>$g,isMac:()=>Uu,isNode:()=>oh,isSafari:()=>Wb,isWindows:()=>Xb});var oh=typeof process<"u"&&"title"in process,Ta=oh?"node":navigator.userAgent,Na=oh?"node":navigator.platform,Yb=Ta.includes("Firefox"),I5=Ta.includes("Edge"),Wb=/^((?!chrome|android).)*safari/i.test(Ta);function U5(){if(!Wb)return 0;let e=Ta.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Uu=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Na),q5=Na==="iPad",V5=Na==="iPhone",Xb=["Windows","Win16","Win32","WinCE"].includes(Na),$g=Na.indexOf("Linux")>=0,Kb=/\bCrOS\b/.test(Ta),Gb=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,i=0,r=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),o=e.timeRemaining(),i*1.5>o){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=o}this.clear()}},F5=class extends Gb{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},$5=class extends Gb{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},qu=!oh&&"requestIdleCallback"in window?$5:F5,Y5=class{constructor(){this._queue=new qu}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},tg=class extends je{constructor(e,t,i,r,o,a,c,h,d){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=r,this._coreService=o,this._coreBrowserService=h,this._renderer=this._register(new Ro),this._pausedResizeTask=new Y5,this._observerDisposable=this._register(new Ro),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 _e),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new _e),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new _e),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new _e),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new P5((f,m)=>this._renderRows(f,m),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new W5(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ht(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(c.onResize(()=>this._fullRefresh())),this._register(c.buffers.onBufferActivate(()=>{var f;return(f=this._renderer.value)==null?void 0:f.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(c.cols,c.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(c.buffer.y,c.buffer.y,!0))),this._register(d.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(f=>this._registerIntersectionObserver(f,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=ht(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var i;return(i=this._renderer.value)==null?void 0:i.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,i){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,i)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};tg=yt([ve(2,ci),ve(3,sh),ve(4,Rs),ve(5,Ma),ve(6,ai),ve(7,sr),ve(8,Io)],tg);var W5=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function X5(e,t,i,r){let o=i.buffer.x,a=i.buffer.y;if(!i.buffer.hasScrollback)return Z5(o,a,e,t,i,r)+lh(a,t,i,r)+Q5(o,a,e,t,i,r);let c;if(a===t)return c=o>e?"D":"C",ha(Math.abs(o-e),ua(c,r));c=a>t?"D":"C";let h=Math.abs(a-t),d=G5(a>t?e:o,i)+(h-1)*i.cols+1+K5(a>t?o:e);return ha(d,ua(c,r))}function K5(e,t){return e-1}function G5(e,t){return t.cols-e}function Z5(e,t,i,r,o,a){return lh(t,r,o,a).length===0?"":ha(Qb(e,t,e,t-Ms(t,o),!1,o).length,ua("D",a))}function lh(e,t,i,r){let o=e-Ms(e,i),a=t-Ms(t,i),c=Math.abs(o-a)-J5(e,t,i);return ha(c,ua(Zb(e,t),r))}function Q5(e,t,i,r,o,a){let c;lh(t,r,o,a).length>0?c=r-Ms(r,o):c=t;let h=r,d=eM(e,t,i,r,o,a);return ha(Qb(e,c,i,h,d==="C",o).length,ua(d,a))}function J5(e,t,i){var c;let r=0,o=e-Ms(e,i),a=t-Ms(t,i);for(let h=0;h<Math.abs(o-a);h++){let d=Zb(e,t)==="A"?-1:1;(c=i.buffer.lines.get(o+d*h))!=null&&c.isWrapped&&r++}return r}function Ms(e,t){let i=0,r=t.buffer.lines.get(e),o=r==null?void 0:r.isWrapped;for(;o&&e>=0&&e<t.rows;)i++,r=t.buffer.lines.get(--e),o=r==null?void 0:r.isWrapped;return i}function eM(e,t,i,r,o,a){let c;return lh(i,r,o,a).length>0?c=r-Ms(r,o):c=t,e<i&&c<=r||e>=i&&c<r?"C":"D"}function Zb(e,t){return e>t?"A":"B"}function Qb(e,t,i,r,o,a){let c=e,h=t,d="";for(;(c!==i||h!==r)&&h>=0&&h<a.buffer.lines.length;)c+=o?1:-1,o&&c>a.cols-1?(d+=a.buffer.translateBufferLineToString(h,!1,e,c),c=0,e=0,h++):!o&&c<0&&(d+=a.buffer.translateBufferLineToString(h,!1,0,e+1),c=a.cols-1,e=c,h--);return d+a.buffer.translateBufferLineToString(h,!1,e,c)}function ua(e,t){let i=t?"O":"[";return ue.ESC+i+e}function ha(e,t){e=Math.floor(e);let i="";for(let r=0;r<e;r++)i+=t;return i}var tM=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Iy(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Kd=50,iM=15,nM=50,rM=500,sM=" ",oM=new RegExp(sM,"g"),ig=class extends je{constructor(e,t,i,r,o,a,c,h,d){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=r,this._coreService=o,this._mouseService=a,this._optionsService=c,this._renderService=h,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Zi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new _e),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new _e),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new _e),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new _e),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 tM(this._bufferService),this._activeSelectionMode=0,this._register(ht(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(f=>{f.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let o=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let c=e[1];c<=t[1];c++){let h=i.translateBufferLineToString(c,!0,o,a);r.push(h)}}else{let o=e[1]===t[1]?t[0]:void 0;r.push(i.translateBufferLineToString(e[1],!0,e[0],o));for(let a=e[1]+1;a<=t[1]-1;a++){let c=i.lines.get(a),h=i.translateBufferLineToString(a,!0);c!=null&&c.isWrapped?r[r.length-1]+=h:r.push(h)}if(e[1]!==t[1]){let a=i.lines.get(t[1]),c=i.translateBufferLineToString(t[1],!0,0,t[0]);a&&a.isWrapped?r[r.length-1]+=c:r.push(c)}}return r.map(o=>o.replace(oM," ")).join(Xb?`\r
|
|
71
|
+
`:`
|
|
72
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),$g&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!i||!r||!t?!1:this._areCoordsInSelection(t,i,r)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!i||!r?!1:this._areCoordsInSelection([e,t],i,r)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var o,a;let i=(a=(o=this._linkifier.currentLink)==null?void 0:o.link)==null?void 0:a.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=Iy(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Fg(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-Kd),Kd),t/=Kd,t/Math.abs(t)+Math.round(t*(iM-1)))}shouldForceSelection(e){return Uu?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),nM)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Uu&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let r=i.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<rM&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let r=X5(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let r=0;t>=r;r++){let o=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:o>1&&t!==r&&(i+=o-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,a=o.lines.get(e[1]);if(!a)return;let c=o.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(a,e[0]),d=h,f=e[0]-h,m=0,g=0,v=0,y=0;if(c.charAt(h)===" "){for(;h>0&&c.charAt(h-1)===" ";)h--;for(;d<c.length&&c.charAt(d+1)===" ";)d++}else{let k=e[0],C=e[0];a.getWidth(k)===0&&(m++,k--),a.getWidth(C)===2&&(g++,C++);let z=a.getString(C).length;for(z>1&&(y+=z-1,d+=z-1);k>0&&h>0&&!this._isCharWordSeparator(a.loadCell(k-1,this._workCell));){a.loadCell(k-1,this._workCell);let E=this._workCell.getChars().length;this._workCell.getWidth()===0?(m++,k--):E>1&&(v+=E-1,h-=E-1),h--,k--}for(;C<a.length&&d+1<c.length&&!this._isCharWordSeparator(a.loadCell(C+1,this._workCell));){a.loadCell(C+1,this._workCell);let E=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,C++):E>1&&(y+=E-1,d+=E-1),d++,C++}}d++;let S=h+f-m+v,b=Math.min(this._bufferService.cols,d-h+m+g-v-y);if(!(!t&&c.slice(h,d).trim()==="")){if(i&&S===0&&a.getCodePoint(0)!==32){let k=o.lines.get(e[1]-1);if(k&&a.isWrapped&&k.getCodePoint(this._bufferService.cols-1)!==32){let C=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(C){let z=this._bufferService.cols-C.start;S-=z,b+=z}}}if(r&&S+b===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let k=o.lines.get(e[1]+1);if(k!=null&&k.isWrapped&&k.getCodePoint(0)!==32){let C=this._getWordAt([0,e[1]+1],!1,!1,!0);C&&(b+=C.length)}}return{start:S,length:b}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Iy(i,this._bufferService.cols)}};ig=yt([ve(3,ai),ve(4,Rs),ve(5,Hg),ve(6,ci),ve(7,or),ve(8,sr)],ig);var Uy=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},qy=class{constructor(){this._color=new Uy,this._css=new Uy}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Ht=Object.freeze((()=>{let e=[gt.toColor("#2e3436"),gt.toColor("#cc0000"),gt.toColor("#4e9a06"),gt.toColor("#c4a000"),gt.toColor("#3465a4"),gt.toColor("#75507b"),gt.toColor("#06989a"),gt.toColor("#d3d7cf"),gt.toColor("#555753"),gt.toColor("#ef2929"),gt.toColor("#8ae234"),gt.toColor("#fce94f"),gt.toColor("#729fcf"),gt.toColor("#ad7fa8"),gt.toColor("#34e2e2"),gt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let r=t[i/36%6|0],o=t[i/6%6|0],a=t[i%6];e.push({css:Rt.toCss(r,o,a),rgba:Rt.toRgba(r,o,a)})}for(let i=0;i<24;i++){let r=8+i*10;e.push({css:Rt.toCss(r,r,r),rgba:Rt.toRgba(r,r,r)})}return e})()),vs=gt.toColor("#ffffff"),Ql=gt.toColor("#000000"),Vy=gt.toColor("#ffffff"),Fy=Ql,Ul={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},lM=vs,ng=class extends je{constructor(e){super(),this._optionsService=e,this._contrastCache=new qy,this._halfContrastCache=new qy,this._onChangeColors=this._register(new _e),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:vs,background:Ql,cursor:Vy,cursorAccent:Fy,selectionForeground:void 0,selectionBackgroundTransparent:Ul,selectionBackgroundOpaque:ct.blend(Ql,Ul),selectionInactiveBackgroundTransparent:Ul,selectionInactiveBackgroundOpaque:ct.blend(Ql,Ul),scrollbarSliderBackground:ct.opacity(vs,.2),scrollbarSliderHoverBackground:ct.opacity(vs,.4),scrollbarSliderActiveBackground:ct.opacity(vs,.5),overviewRulerBorder:vs,ansi:Ht.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=nt(e.foreground,vs),t.background=nt(e.background,Ql),t.cursor=ct.blend(t.background,nt(e.cursor,Vy)),t.cursorAccent=ct.blend(t.background,nt(e.cursorAccent,Fy)),t.selectionBackgroundTransparent=nt(e.selectionBackground,Ul),t.selectionBackgroundOpaque=ct.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=nt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ct.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?nt(e.selectionForeground,Hy):void 0,t.selectionForeground===Hy&&(t.selectionForeground=void 0),ct.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ct.opacity(t.selectionBackgroundTransparent,.3)),ct.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ct.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=nt(e.scrollbarSliderBackground,ct.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=nt(e.scrollbarSliderHoverBackground,ct.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=nt(e.scrollbarSliderActiveBackground,ct.opacity(t.foreground,.5)),t.overviewRulerBorder=nt(e.overviewRulerBorder,lM),t.ansi=Ht.slice(),t.ansi[0]=nt(e.black,Ht[0]),t.ansi[1]=nt(e.red,Ht[1]),t.ansi[2]=nt(e.green,Ht[2]),t.ansi[3]=nt(e.yellow,Ht[3]),t.ansi[4]=nt(e.blue,Ht[4]),t.ansi[5]=nt(e.magenta,Ht[5]),t.ansi[6]=nt(e.cyan,Ht[6]),t.ansi[7]=nt(e.white,Ht[7]),t.ansi[8]=nt(e.brightBlack,Ht[8]),t.ansi[9]=nt(e.brightRed,Ht[9]),t.ansi[10]=nt(e.brightGreen,Ht[10]),t.ansi[11]=nt(e.brightYellow,Ht[11]),t.ansi[12]=nt(e.brightBlue,Ht[12]),t.ansi[13]=nt(e.brightMagenta,Ht[13]),t.ansi[14]=nt(e.brightCyan,Ht[14]),t.ansi[15]=nt(e.brightWhite,Ht[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<i;r++)t.ansi[r+16]=nt(e.extendedAnsi[r],Ht[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};ng=yt([ve(0,ci)],ng);function nt(e,t){if(e!==void 0)try{return gt.toColor(e)}catch{}return t}var aM=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},cM=class{constructor(){this._services=new aM,this._services.set(Og,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=ik(e).sort((a,c)=>a.index-c.index),r=[];for(let a of i){let c=this._services.get(a.id);if(!c)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id._id}.`);r.push(c)}let o=i.length>0?i[0].index:t.length;if(t.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},uM={trace:0,debug:1,info:2,warn:3,error:4,off:5},hM="xterm.js: ",rg=class extends je{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=uM[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":hM)+t,...i)}trace(e,...t){var i;this._logLevel<=0&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var i;this._logLevel<=1&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var i;this._logLevel<=2&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var i;this._logLevel<=3&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var i;this._logLevel<=4&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,e,t)}};rg=yt([ve(0,ci)],rg);var $y=class extends je{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new _e),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new _e),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new _e),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,t,...i){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+i.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<i.length;r++)this._array[this._getCyclicIndex(e+r)]=i[r];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let r=this._length+i.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let o=t-1;o>=0;o--)this.set(e+o+i,this.get(e+o));let r=e+t+i-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+i,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},He=3,Dt=Object.freeze(new ka),fu=0,Gd=2,Jl=class Jb{constructor(t,i,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*He);let o=i||Zi.fromCharData([0,vb,1,0]);for(let a=0;a<t;++a)this.setCell(a,o);this.length=t}get(t){let i=this._data[t*He+0],r=i&2097151;return[this._data[t*He+1],i&2097152?this._combined[t]:r?Fr(r):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,i){this._data[t*He+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*He+0]=t|2097152|i[2]<<22):this._data[t*He+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*He+0]>>22}hasWidth(t){return this._data[t*He+0]&12582912}getFg(t){return this._data[t*He+1]}getBg(t){return this._data[t*He+2]}hasContent(t){return this._data[t*He+0]&4194303}getCodePoint(t){let i=this._data[t*He+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*He+0]&2097152}getString(t){let i=this._data[t*He+0];return i&2097152?this._combined[t]:i&2097151?Fr(i&2097151):""}isProtected(t){return this._data[t*He+2]&536870912}loadCell(t,i){return fu=t*He,i.content=this._data[fu+0],i.fg=this._data[fu+1],i.bg=this._data[fu+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*He+0]=i.content,this._data[t*He+1]=i.fg,this._data[t*He+2]=i.bg}setCellFromCodepoint(t,i,r,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*He+0]=i|r<<22,this._data[t*He+1]=o.fg,this._data[t*He+2]=o.bg}addCodepointToCell(t,i,r){let o=this._data[t*He+0];o&2097152?this._combined[t]+=Fr(i):o&2097151?(this._combined[t]=Fr(o&2097151)+Fr(i),o&=-2097152,o|=2097152):o=i|1<<22,r&&(o&=-12582913,o|=r<<22),this._data[t*He+0]=o}insertCells(t,i,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),i<this.length-t){let o=new Zi;for(let a=this.length-t-i-1;a>=0;--a)this.setCell(t+i+a,this.loadCell(t+a,o));for(let a=0;a<i;++a)this.setCell(t+a,r)}else for(let o=t;o<this.length;++o)this.setCell(o,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,i,r){if(t%=this.length,i<this.length-t){let o=new Zi;for(let a=0;a<this.length-t-i;++a)this.setCell(t+a,this.loadCell(t+i+a,o));for(let a=this.length-i;a<this.length;++a)this.setCell(a,r)}else for(let o=t;o<this.length;++o)this.setCell(o,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,i,r,o=!1){if(o){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,r);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,r);t<i&&t<this.length;)this.setCell(t++,r)}resize(t,i){if(t===this.length)return this._data.length*4*Gd<this._data.buffer.byteLength;let r=t*He;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let o=new Uint32Array(r);o.set(this._data),this._data=o}for(let o=this.length;o<t;++o)this.setCell(o,i)}else{this._data=this._data.subarray(0,r);let o=Object.keys(this._combined);for(let c=0;c<o.length;c++){let h=parseInt(o[c],10);h>=t&&delete this._combined[h]}let a=Object.keys(this._extendedAttrs);for(let c=0;c<a.length;c++){let h=parseInt(a[c],10);h>=t&&delete this._extendedAttrs[h]}}return this.length=t,r*4*Gd<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Gd<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new Jb(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*He+0]&4194303)return t+(this._data[t*He+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*He+0]&4194303||this._data[t*He+2]&50331648)return t+(this._data[t*He+0]>>22);return 0}copyCellsFrom(t,i,r,o,a){let c=t._data;if(a)for(let d=o-1;d>=0;d--){for(let f=0;f<He;f++)this._data[(r+d)*He+f]=c[(i+d)*He+f];c[(i+d)*He+2]&268435456&&(this._extendedAttrs[r+d]=t._extendedAttrs[i+d])}else for(let d=0;d<o;d++){for(let f=0;f<He;f++)this._data[(r+d)*He+f]=c[(i+d)*He+f];c[(i+d)*He+2]&268435456&&(this._extendedAttrs[r+d]=t._extendedAttrs[i+d])}let h=Object.keys(t._combined);for(let d=0;d<h.length;d++){let f=parseInt(h[d],10);f>=i&&(this._combined[f-i+r]=t._combined[f])}}translateToString(t,i,r,o){i=i??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),o&&(o.length=0);let a="";for(;i<r;){let c=this._data[i*He+0],h=c&2097151,d=c&2097152?this._combined[i]:h?Fr(h):Yr;if(a+=d,o)for(let f=0;f<d.length;++f)o.push(i);i+=c>>22||1}return o&&o.push(i),a}};function fM(e,t,i,r,o,a){let c=[];for(let h=0;h<e.length-1;h++){let d=h,f=e.get(++d);if(!f.isWrapped)continue;let m=[e.get(h)];for(;d<e.length&&f.isWrapped;)m.push(f),f=e.get(++d);if(!a&&r>=h&&r<d){h+=m.length-1;continue}let g=0,v=fa(m,g,t),y=1,S=0;for(;y<m.length;){let k=fa(m,y,t),C=k-S,z=i-v,E=Math.min(C,z);m[g].copyCellsFrom(m[y],S,v,E,!1),v+=E,v===i&&(g++,v=0),S+=E,S===k&&(y++,S=0),v===0&&g!==0&&m[g-1].getWidth(i-1)===2&&(m[g].copyCellsFrom(m[g-1],i-1,v++,1,!1),m[g-1].setCell(i-1,o))}m[g].replaceCells(v,i,o);let b=0;for(let k=m.length-1;k>0&&(k>g||m[k].getTrimmedLength()===0);k--)b++;b>0&&(c.push(h+m.length-b),c.push(b)),h+=m.length-1}return c}function dM(e,t){let i=[],r=0,o=t[r],a=0;for(let c=0;c<e.length;c++)if(o===c){let h=t[++r];e.onDeleteEmitter.fire({index:c-a,amount:h}),c+=h-1,a+=h,o=t[++r]}else i.push(c);return{layout:i,countRemoved:a}}function pM(e,t){let i=[];for(let r=0;r<t.length;r++)i.push(e.get(t[r]));for(let r=0;r<i.length;r++)e.set(r,i[r]);e.length=t.length}function gM(e,t,i){let r=[],o=e.map((d,f)=>fa(e,f,t)).reduce((d,f)=>d+f),a=0,c=0,h=0;for(;h<o;){if(o-h<i){r.push(o-h);break}a+=i;let d=fa(e,c,t);a>d&&(a-=d,c++);let f=e[c].getWidth(a-1)===2;f&&a--;let m=f?i-1:i;r.push(m),h+=m}return r}function fa(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,o=e[t+1].getWidth(0)===2;return r&&o?i-1:i}var ex=class tx{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=tx._nextId++,this._onDispose=this.register(new _e),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ks(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};ex._nextId=1;var mM=ex,Pt={},ys=Pt.B;Pt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Pt.A={"#":"£"};Pt.B=void 0;Pt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Pt.C=Pt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Pt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Pt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Pt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Pt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Pt.E=Pt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Pt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Pt.H=Pt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Pt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Yy=4294967295,Wy=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Dt.clone(),this.savedCharset=ys,this.markers=[],this._nullCell=Zi.fromCharData([0,vb,1,0]),this._whitespaceCell=Zi.fromCharData([0,Yr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new qu,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new $y(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new ju),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new ju),this._whitespaceCell}getBlankLine(e,t){return new Jl(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>Yy?Yy:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Dt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new $y(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(Dt),r=0,o=this._getCorrectBufferLength(t);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let c=0;c<this.lines.length;c++)r+=+this.lines.get(c).resize(e,i);let a=0;if(this._rows<t)for(let c=this._rows;c<t;c++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Jl(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new Jl(e,i)));else for(let c=this._rows;c>t;c--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let c=this.lines.length-o;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,r=fM(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Dt),i);if(r.length>0){let o=dM(this.lines,r);pM(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let r=this.getNullCell(Dt),o=i;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Jl(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(Dt),o=[],a=0;for(let c=this.lines.length-1;c>=0;c--){let h=this.lines.get(c);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;let d=[h];for(;h.isWrapped&&c>0;)h=this.lines.get(--c),d.unshift(h);if(!i){let E=this.ybase+this.y;if(E>=c&&E<c+d.length)continue}let f=d[d.length-1].getTrimmedLength(),m=gM(d,this._cols,e),g=m.length-d.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+g):v=Math.max(0,this.lines.length-this.lines.maxLength+g);let y=[];for(let E=0;E<g;E++){let T=this.getBlankLine(Dt,!0);y.push(T)}y.length>0&&(o.push({start:c+d.length+a,newLines:y}),a+=y.length),d.push(...y);let S=m.length-1,b=m[S];b===0&&(S--,b=m[S]);let k=d.length-g-1,C=f;for(;k>=0;){let E=Math.min(C,b);if(d[S]===void 0)break;if(d[S].copyCellsFrom(d[k],C-E,b-E,E,!0),b-=E,b===0&&(S--,b=m[S]),C-=E,C===0){k--;let T=Math.max(k,0);C=fa(d,T,this._cols)}}for(let E=0;E<d.length;E++)m[E]<e&&d[E].setCell(m[E],r);let z=g-v;for(;z-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+g,this.ybase+t-1)}if(o.length>0){let c=[],h=[];for(let b=0;b<this.lines.length;b++)h.push(this.lines.get(b));let d=this.lines.length,f=d-1,m=0,g=o[m];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let v=0;for(let b=Math.min(this.lines.maxLength-1,d+a-1);b>=0;b--)if(g&&g.start>f+v){for(let k=g.newLines.length-1;k>=0;k--)this.lines.set(b--,g.newLines[k]);b++,c.push({index:f+1,amount:g.newLines.length}),v+=g.newLines.length,g=o[++m]}else this.lines.set(b,h[f--]);let y=0;for(let b=c.length-1;b>=0;b--)c[b].index+=y,this.lines.onInsertEmitter.fire(c[b]),y+=c[b].amount;let S=Math.max(0,d+a-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}translateBufferLineToString(e,t,i=0,r){let o=this.lines.get(e);return o?o.translateToString(t,i,r):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new mM(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},_M=class extends je{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new _e),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 Wy(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Wy(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},ix=2,nx=1,sg=class extends je{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new _e),this.onResize=this._onResize.event,this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,ix),this.rows=Math.max(e.rawOptions.rows||0,nx),this.buffers=this._register(new _M(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=i.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let o=i.ybase+i.scrollTop,a=i.ybase+i.scrollBottom;if(i.scrollTop===0){let c=i.lines.isFull;a===i.lines.length-1?c?i.lines.recycle().copyFrom(r):i.lines.push(r.clone()):i.lines.splice(a+1,0,r.clone()),c?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let c=a-o+1;i.lines.shiftElements(o+1,c-1,-1),i.lines.set(a,r.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let r=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),r!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};sg=yt([ve(0,ci)],sg);var bo={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Uu,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},vM=["normal","bold","100","200","300","400","500","600","700","800","900"],yM=class extends je{constructor(e){super(),this._onOptionChange=this._register(new _e),this.onOptionChange=this._onOptionChange.event;let t={...bo};for(let i in e)if(i in t)try{let r=e[i];t[i]=this._sanitizeAndValidateOption(i,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ht(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in bo))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,r)=>{if(!(i in bo))throw new Error(`No option with key "${i}"`);r=this._sanitizeAndValidateOption(i,r),this.rawOptions[i]!==r&&(this.rawOptions[i]=r,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let r={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=bo[e]),!SM(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=bo[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=vM.includes(t)?t:bo[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function SM(e){return e==="block"||e==="underline"||e==="bar"}function ea(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let r in e)i[r]=t<=1?e[r]:e[r]&&ea(e[r],t-1);return i}var Xy=Object.freeze({insertMode:!1}),Ky=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),og=class extends je{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new _e),this.onData=this._onData.event,this._onUserInput=this._register(new _e),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new _e),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new _e),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ea(Xy),this.decPrivateModes=ea(Ky)}reset(){this.modes=ea(Xy),this.decPrivateModes=ea(Ky)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};og=yt([ve(0,ai),ve(1,wb),ve(2,ci)],og);var Gy={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Zd(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var Qd=String.fromCharCode,Zy={DEFAULT:e=>{let t=[Zd(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Qd(t[0])}${Qd(t[1])}${Qd(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Zd(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Zd(e,!0)};${e.x};${e.y}${t}`}},lg=class extends je{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new _e),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(Gy))this.addProtocol(r,Gy[r]);for(let r of Object.keys(Zy))this.addEncoding(r,Zy[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let r=t/i,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=r+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};lg=yt([ve(0,ai),ve(1,Rs),ve(2,ci)],lg);var Jd=[[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]],bM=[[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]],jt;function xM(e,t){let i=0,r=t.length-1,o;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=i;)if(o=i+r>>1,e>t[o][1])i=o+1;else if(e<t[o][0])r=o-1;else return!0;return!1}var wM=class{constructor(){if(this.version="6",!jt){jt=new Uint8Array(65536),jt.fill(1),jt[0]=0,jt.fill(0,1,32),jt.fill(0,127,160),jt.fill(2,4352,4448),jt[9001]=2,jt[9002]=2,jt.fill(2,11904,42192),jt[12351]=1,jt.fill(2,44032,55204),jt.fill(2,63744,64256),jt.fill(2,65040,65050),jt.fill(2,65072,65136),jt.fill(2,65280,65377),jt.fill(2,65504,65511);for(let e=0;e<Jd.length;++e)jt.fill(0,Jd[e][0],Jd[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?jt[e]:xM(e,bM)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),r=i===0&&t!==0;if(r){let o=bs.extractWidth(t);o===0?r=!1:o>i&&(i=o)}return bs.createPropertyValue(0,i,r)}},bs=class Au{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new _e,this.onChange=this._onChange.event;let t=new wM;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,r=!1){return(t&16777215)<<3|(i&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,r=0,o=t.length;for(let a=0;a<o;++a){let c=t.charCodeAt(a);if(55296<=c&&c<=56319){if(++a>=o)return i+this.wcwidth(c);let f=t.charCodeAt(a);56320<=f&&f<=57343?c=(c-55296)*1024+f-56320+65536:i+=this.wcwidth(f)}let h=this.charProperties(c,r),d=Au.extractWidth(h);Au.extractShouldJoin(h)&&(d-=Au.extractWidth(r)),i+=d,r=h}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},CM=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Qy(e){var r;let t=(r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:r.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var ql=2147483647,EM=256,rx=class ag{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>EM)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new ag;if(!t.length)return i;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let o=t[r];if(Array.isArray(o))for(let a=0;a<o.length;++a)i.addSubParam(o[a]);else i.addParam(o)}return i}clone(){let t=new ag(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let r=this._subParamsIdx[i]>>8,o=this._subParamsIdx[i]&255;o-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,o))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>ql?ql:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>ql?ql:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-i>0?this._subParams.subarray(i,r):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let r=this._subParamsIdx[i]>>8,o=this._subParamsIdx[i]&255;o-r>0&&(t[i]=this._subParams.slice(r,o))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,o=r[i-1];r[i-1]=~o?Math.min(o*10+t,ql):t}},Vl=[],kM=class{constructor(){this._state=0,this._active=Vl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Vl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Vl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Vl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",rh(e,t,i));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,i=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&i===!1){for(;r>=0&&(i=this._active[r].end(e),i!==!0);r--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,i;r--}for(;r>=0;r--)if(i=this._active[r].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,i}this._active=Vl,this._id=-1,this._state=0}}},Li=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=rh(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},Fl=[],MM=class{constructor(){this._handlers=Object.create(null),this._active=Fl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Fl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Fl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Fl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",rh(e,t,i));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,i=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&i===!1){for(;r>=0&&(i=this._active[r].unhook(e),i!==!0);r--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,i;r--}for(;r>=0;r--)if(i=this._active[r].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,i}this._active=Fl,this._ident=0}},ta=new rx;ta.addParam(0);var Jy=class{constructor(e){this._handler=e,this._data="",this._params=ta,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ta,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=rh(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=ta,this._data="",this._hitLimit=!1,i));return this._params=ta,this._data="",this._hitLimit=!1,t}},TM=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,r){this.table[t<<8|e]=i<<4|r}addMany(e,t,i,r){for(let o=0;o<e.length;o++)this.table[t<<8|e[o]]=i<<4|r}},Ki=160,NM=(function(){let e=new TM(4095),t=Array.apply(null,Array(256)).map((h,d)=>d),i=(h,d)=>t.slice(h,d),r=i(32,127),o=i(0,24);o.push(25),o.push.apply(o,i(28,32));let a=i(0,14),c;e.setDefault(1,0),e.addMany(r,0,2,0);for(c in a)e.addMany([24,26,153,154],c,3,0),e.addMany(i(128,144),c,3,0),e.addMany(i(144,152),c,3,0),e.add(156,c,0,0),e.add(27,c,11,1),e.add(157,c,4,8),e.addMany([152,158,159],c,0,7),e.add(155,c,11,3),e.add(144,c,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ki,0,2,0),e.add(Ki,8,5,8),e.add(Ki,6,0,6),e.add(Ki,11,0,11),e.add(Ki,13,13,13),e})(),AM=class extends je{constructor(e=NM){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new rx,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ht(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new kM),this._dcsParser=this._register(new MM),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let o=0;o<e.intermediates.length;++o){let a=e.intermediates.charCodeAt(o);if(32>a||a>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=a}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=r,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let r=this._escHandlers[i];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let r=this._csiHandlers[i];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,i,r,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=r,this._parseStack.chunkPos=o}parse(e,t,i){let r=0,o=0,a=0,c;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let h=this._parseStack.handlers,d=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&d>-1){for(;d>=0&&(c=h[d](this._params),c!==!0);d--)if(c instanceof Promise)return this._parseStack.handlerPos=d,c}this._parseStack.handlers=[];break;case 4:if(i===!1&&d>-1){for(;d>=0&&(c=h[d](),c!==!0);d--)if(c instanceof Promise)return this._parseStack.handlerPos=d,c}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],c=this._dcsParser.unhook(r!==24&&r!==26,i),c)return c;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],c=this._oscParser.end(r!==24&&r!==26,i),c)return c;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let h=a;h<t;++h){switch(r=e[h],o=this._transitions.table[this.currentState<<8|(r<160?r:Ki)],o>>4){case 2:for(let v=h+1;;++v){if(v>=t||(r=e[v])<32||r>126&&r<Ki){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Ki){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Ki){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Ki){this._printHandler(e,h,v),h=v-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|r],f=d?d.length-1:-1;for(;f>=0&&(c=d[f](this._params),c!==!0);f--)if(c instanceof Promise)return this._preserveStack(3,d,f,o,h),c;f<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++h<t&&(r=e[h])>47&&r<60);h--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let m=this._escHandlers[this._collect<<8|r],g=m?m.length-1:-1;for(;g>=0&&(c=m[g](),c!==!0);g--)if(c instanceof Promise)return this._preserveStack(4,m,g,o,h),c;g<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let v=h+1;;++v)if(v>=t||(r=e[v])===24||r===26||r===27||r>127&&r<Ki){this._dcsParser.put(e,h,v),h=v-1;break}break;case 14:if(c=this._dcsParser.unhook(r!==24&&r!==26),c)return this._preserveStack(6,[],0,o,h),c;r===27&&(o|=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 v=h+1;;v++)if(v>=t||(r=e[v])<32||r>127&&r<Ki){this._oscParser.put(e,h,v),h=v-1;break}break;case 6:if(c=this._oscParser.end(r!==24&&r!==26),c)return this._preserveStack(5,[],0,o,h),c;r===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},DM=/^([\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})$/,RM=/^[\da-f]+$/;function e1(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=DM.exec(t);if(i){let r=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/r*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/r*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),RM.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,r=[0,0,0];for(let o=0;o<3;++o){let a=parseInt(t.slice(i*o,i*o+i),16);r[o]=i===1?a<<4:i===2?a:i===3?a>>4:a>>8}return r}}function ep(e,t){let i=e.toString(16),r=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function BM(e,t=16){let[i,r,o]=e;return`rgb:${ep(i,t)}/${ep(r,t)}/${ep(o,t)}`}var LM={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ir=131072,t1=10;function i1(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var n1=5e3,r1=0,zM=class extends je{constructor(e,t,i,r,o,a,c,h,d=new AM){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=r,this._optionsService=o,this._oscLinkService=a,this._coreMouseService=c,this._unicodeService=h,this._parser=d,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new ek,this._utf8Decoder=new tk,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Dt.clone(),this._eraseAttrDataInternal=Dt.clone(),this._onRequestBell=this._register(new _e),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new _e),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new _e),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new _e),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new _e),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new _e),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new _e),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new _e),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new _e),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new _e),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new _e),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new _e),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 cg(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,m)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:m.toArray()})}),this._parser.setEscHandlerFallback(f=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(f)})}),this._parser.setExecuteHandlerFallback(f=>{this._logService.debug("Unknown EXECUTE code: ",{code:f})}),this._parser.setOscHandlerFallback((f,m,g)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:m,data:g})}),this._parser.setDcsHandlerFallback((f,m,g)=>{m==="HOOK"&&(g=g.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:m,payload:g})}),this._parser.setPrintHandler((f,m,g)=>this.print(f,m,g)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(ue.BEL,()=>this.bell()),this._parser.setExecuteHandler(ue.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ue.BS,()=>this.backspace()),this._parser.setExecuteHandler(ue.HT,()=>this.tab()),this._parser.setExecuteHandler(ue.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ue.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Tu.IND,()=>this.index()),this._parser.setExecuteHandler(Tu.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Tu.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Li(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new Li(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new Li(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new Li(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new Li(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new Li(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new Li(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new Li(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new Li(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new Li(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new Li(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new Li(f=>this.restoreCursorColor(f))),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(let f in Pt)this._parser.registerEscHandler({intermediates:"(",final:f},()=>this.selectCharset("("+f)),this._parser.registerEscHandler({intermediates:")",final:f},()=>this.selectCharset(")"+f)),this._parser.registerEscHandler({intermediates:"*",final:f},()=>this.selectCharset("*"+f)),this._parser.registerEscHandler({intermediates:"+",final:f},()=>this.selectCharset("+"+f)),this._parser.registerEscHandler({intermediates:"-",final:f},()=>this.selectCharset("-"+f)),this._parser.registerEscHandler({intermediates:".",final:f},()=>this.selectCharset("."+f)),this._parser.registerEscHandler({intermediates:"/",final:f},()=>this.selectCharset("/"+f));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(f=>(this._logService.error("Parsing error: ",f),f)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Jy((f,m)=>this.requestStatusString(f,m)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),n1))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${n1} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,r=this._activeBuffer.x,o=this._activeBuffer.y,a=0,c=this._parseStack.paused;if(c){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;r=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Ir&&(a=this._parseStack.position+Ir)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,f=>String.fromCharCode(f)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(f=>f.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Ir&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ir))),c||this._dirtyRowTracker.clearRange(),e.length>Ir)for(let f=a;f<e.length;f+=Ir){let m=f+Ir<e.length?f+Ir:e.length,g=typeof e=="string"?this._stringDecoder.decode(e.substring(f,m),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,m),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,g))return this._preserveStack(r,o,g,f),this._logSlowResolvingAsync(i),i}else if(!c){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,f))return this._preserveStack(r,o,f,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==r||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let h=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),d=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);d<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(d,this._bufferService.rows-1),end:Math.min(h,this._bufferService.rows-1)})}print(e,t,i){let r,o,a=this._charsetService.charset,c=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,d=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,m=this._curAttrData,g=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&g.getWidth(this._activeBuffer.x-1)===2&&g.setCellFromCodepoint(this._activeBuffer.x-1,0,1,m);let v=this._parser.precedingJoinState;for(let y=t;y<i;++y){if(r=e[y],r<127&&a){let C=a[String.fromCharCode(r)];C&&(r=C.charCodeAt(0))}let S=this._unicodeService.charProperties(r,v);o=bs.extractWidth(S);let b=bs.extractShouldJoin(S),k=b?bs.extractWidth(v):0;if(v=S,c&&this._onA11yChar.fire(Fr(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-k>h){if(d){let C=g,z=this._activeBuffer.x-k;for(this._activeBuffer.x=k,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),k>0&&g instanceof Jl&&g.copyCellsFrom(C,z,0,k,!1);z<h;)C.setCellFromCodepoint(z++,0,1,m)}else if(this._activeBuffer.x=h-1,o===2)continue}if(b&&this._activeBuffer.x){let C=g.getWidth(this._activeBuffer.x-1)?1:2;g.addCodepointToCell(this._activeBuffer.x-C,r,o);for(let z=o-k;--z>=0;)g.setCellFromCodepoint(this._activeBuffer.x++,0,0,m);continue}if(f&&(g.insertCells(this._activeBuffer.x,o-k,this._activeBuffer.getNullCell(m)),g.getWidth(h-1)===2&&g.setCellFromCodepoint(h-1,0,1,m)),g.setCellFromCodepoint(this._activeBuffer.x++,r,o,m),o>0)for(;--o;)g.setCellFromCodepoint(this._activeBuffer.x++,0,0,m)}this._parser.precedingJoinState=v,this._activeBuffer.x<h&&i-t>0&&g.getWidth(this._activeBuffer.x)===0&&!g.hasContent(this._activeBuffer.x)&&g.setCellFromCodepoint(this._activeBuffer.x,0,1,m),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>i1(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Jy(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Li(t))}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 e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,r=!1,o=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),o),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+i))!=null&&r.getTrimmedLength()););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let o=this._activeBuffer.lines.length-this._bufferService.rows;o>0&&(this._activeBuffer.lines.trimStart(o),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-o,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-o,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(o-1,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}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(Dt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let i=e.params[0]||1,r=bs.extractWidth(t),o=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),c=new Uint32Array(a.length*i),h=0;for(let f=0;f<a.length;){let m=a.codePointAt(f)||0;c[h++]=m,f+=m>65535?2:1}let d=h;for(let f=1;f<i;++f)c.copyWithin(d,0,h),d+=h;return this.print(c,0,d),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ue.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ue.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ue.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ue.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ue.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,ys),this._charsetService.setgCharset(1,ys),this._charsetService.setgCharset(2,ys),this._charsetService.setgCharset(3,ys);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(b=>(b[b.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",b[b.SET=1]="SET",b[b.RESET=2]="RESET",b[b.PERMANENTLY_SET=3]="PERMANENTLY_SET",b[b.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(i={}));let r=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:a}=this._coreMouseService,c=this._coreService,{buffers:h,cols:d}=this._bufferService,{active:f,alt:m}=h,g=this._optionsService.rawOptions,v=(b,k)=>(c.triggerDataEvent(`${ue.ESC}[${t?"":"?"}${b};${k}$y`),!0),y=b=>b?1:2,S=e.params[0];return t?S===2?v(S,4):S===4?v(S,y(c.modes.insertMode)):S===12?v(S,3):S===20?v(S,y(g.convertEol)):v(S,0):S===1?v(S,y(r.applicationCursorKeys)):S===3?v(S,g.windowOptions.setWinLines?d===80?2:d===132?1:0:0):S===6?v(S,y(r.origin)):S===7?v(S,y(r.wraparound)):S===8?v(S,3):S===9?v(S,y(o==="X10")):S===12?v(S,y(g.cursorBlink)):S===25?v(S,y(!c.isCursorHidden)):S===45?v(S,y(r.reverseWraparound)):S===66?v(S,y(r.applicationKeypad)):S===67?v(S,4):S===1e3?v(S,y(o==="VT200")):S===1002?v(S,y(o==="DRAG")):S===1003?v(S,y(o==="ANY")):S===1004?v(S,y(r.sendFocus)):S===1005?v(S,4):S===1006?v(S,y(a==="SGR")):S===1015?v(S,4):S===1016?v(S,y(a==="SGR_PIXELS")):S===1048?v(S,1):S===47||S===1047||S===1049?v(S,y(f===m)):S===2004?v(S,y(r.bracketedPasteMode)):S===2026?v(S,y(r.synchronizedOutput)):v(S,0)}_updateAttrColor(e,t,i,r,o){return t===2?(e|=50331648,e&=-16777216,e|=ka.fromColorRGB([i,r,o])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let r=[0,0,-1,0,0,0],o=0,a=0;do{if(r[a+o]=e.params[t+a],e.hasSubParams(t+a)){let c=e.getSubParams(t+a),h=0;do r[1]===5&&(o=1),r[a+h+1+o]=c[h];while(++h<c.length&&h+a+1+o<r.length);break}if(r[1]===5&&a+o>=2||r[1]===2&&a+o>=5)break;r[1]&&(o=1)}while(++a+t<e.length&&a+o<r.length);for(let c=2;c<r.length;++c)r[c]===-1&&(r[c]=0);switch(r[0]){case 38:i.fg=this._updateAttrColor(i.fg,r[1],r[3],r[4],r[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,r[1],r[3],r[4],r[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Dt.fg,e.bg=Dt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,r=this._curAttrData;for(let o=0;o<t;o++)i=e.params[o],i>=30&&i<=37?(r.fg&=-50331904,r.fg|=16777216|i-30):i>=40&&i<=47?(r.bg&=-50331904,r.bg|=16777216|i-40):i>=90&&i<=97?(r.fg&=-50331904,r.fg|=16777216|i-90|8):i>=100&&i<=107?(r.bg&=-50331904,r.bg|=16777216|i-100|8):i===0?this._processSGR0(r):i===1?r.fg|=134217728:i===3?r.bg|=67108864:i===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,r)):i===5?r.fg|=536870912:i===7?r.fg|=67108864:i===8?r.fg|=1073741824:i===9?r.fg|=2147483648:i===2?r.bg|=134217728:i===21?this._processUnderline(2,r):i===22?(r.fg&=-134217729,r.bg&=-134217729):i===23?r.bg&=-67108865:i===24?(r.fg&=-268435457,this._processUnderline(0,r)):i===25?r.fg&=-536870913:i===27?r.fg&=-67108865:i===28?r.fg&=-1073741825:i===29?r.fg&=2147483647:i===39?(r.fg&=-67108864,r.fg|=Dt.fg&16777215):i===49?(r.bg&=-67108864,r.bg|=Dt.bg&16777215):i===38||i===48||i===58?o+=this._extractColor(e,o,r):i===53?r.bg|=1073741824:i===55?r.bg&=-1073741825:i===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):i===100?(r.fg&=-67108864,r.fg|=Dt.fg&16777215,r.bg&=-67108864,r.bg|=Dt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ue.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ue.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ue.ESC}[?${t};${i}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Dt.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!i1(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ue.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>t1&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>t1&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let r=i.shift(),o=i.shift();if(/^\d+$/.exec(r)){let a=parseInt(r);if(s1(a))if(o==="?")t.push({type:0,index:a});else{let c=e1(o);c&&t.push({type:1,index:a,color:c})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(i,r):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),r,o=i.findIndex(a=>a.startsWith("id="));return o!==-1&&(r=i[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let r=0;r<i.length&&!(t>=this._specialColors.length);++r,++t)if(i[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=e1(i[r]);o&&this._onColor.fire([{type:1,index:this._specialColors[t],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let r=0;r<i.length;++r)if(/^\d+$/.exec(i[r])){let o=parseInt(i[r]);s1(o)&&t.push({type:2,index:o})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,ys),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(LM[e[0]],Pt[e[1]]||ys),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=Dt.clone(),this._eraseAttrDataInternal=Dt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Zi;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(i);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=c=>(this._coreService.triggerDataEvent(`${ue.ESC}${c}${ue.ESC}\\`),!0),r=this._bufferService.buffer,o=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},cg=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(r1=e,e=t,t=r1),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};cg=yt([ve(0,ai)],cg);function s1(e){return 0<=e&&e<256}var OM=5e7,o1=12,HM=50,jM=class extends je{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new _e),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>OM)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],o=this._action(r,t);if(o){let c=h=>performance.now()-i>=o1?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(i,h);o.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(c);return}let a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-i>=o1)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>HM&&(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()}},ug=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let h=t.addMarker(t.ybase+t.y),d={data:e,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(d,h)),this._dataByLinkId.set(d.id,d),d.id}let i=e,r=this._getEntryIdKey(i),o=this._entriesWithId.get(r);if(o)return this.addLineToLink(o.id,t.ybase+t.y),o.id;let a=t.addMarker(t.ybase+t.y),c={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(c,a)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);i.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(i,r))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};ug=yt([ve(0,ai)],ug);var l1=!1,PM=class extends je{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ro),this._onBinary=this._register(new _e),this.onBinary=this._onBinary.event,this._onData=this._register(new _e),this.onData=this._onData.event,this._onLineFeed=this._register(new _e),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new _e),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new _e),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new _e),this._instantiationService=new cM,this.optionsService=this._register(new yM(e)),this._instantiationService.setService(ci,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(sg)),this._instantiationService.setService(ai,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(rg)),this._instantiationService.setService(wb,this._logService),this.coreService=this._register(this._instantiationService.createInstance(og)),this._instantiationService.setService(Rs,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(lg)),this._instantiationService.setService(xb,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(bs)),this._instantiationService.setService(sk,this.unicodeService),this._charsetService=this._instantiationService.createInstance(CM),this._instantiationService.setService(rk,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(ug),this._instantiationService.setService(Cb,this._oscLinkService),this._inputHandler=this._register(new zM(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Qt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Qt.forward(this._bufferService.onResize,this._onResize)),this._register(Qt.forward(this.coreService.onData,this._onData)),this._register(Qt.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new jM((t,i)=>this._inputHandler.parse(t,i))),this._register(Qt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new _e),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!l1&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l1=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,ix),t=Math.max(t,nx),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Qy.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Qy(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ht(()=>{for(let t of e)t.dispose()})}}},IM={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:["'",'"']};function UM(e,t,i,r){var c;let o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?o.key=ue.ESC+"OA":o.key=ue.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=ue.ESC+"OD":o.key=ue.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=ue.ESC+"OC":o.key=ue.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=ue.ESC+"OB":o.key=ue.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":ue.DEL,e.altKey&&(o.key=ue.ESC+o.key);break;case 9:if(e.shiftKey){o.key=ue.ESC+"[Z";break}o.key=ue.HT,o.cancel=!0;break;case 13:o.key=e.altKey?ue.ESC+ue.CR:ue.CR,o.cancel=!0;break;case 27:o.key=ue.ESC,e.altKey&&(o.key=ue.ESC+ue.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?o.key=ue.ESC+"[1;"+(a+1)+"D":t?o.key=ue.ESC+"OD":o.key=ue.ESC+"[D";break;case 39:if(e.metaKey)break;a?o.key=ue.ESC+"[1;"+(a+1)+"C":t?o.key=ue.ESC+"OC":o.key=ue.ESC+"[C";break;case 38:if(e.metaKey)break;a?o.key=ue.ESC+"[1;"+(a+1)+"A":t?o.key=ue.ESC+"OA":o.key=ue.ESC+"[A";break;case 40:if(e.metaKey)break;a?o.key=ue.ESC+"[1;"+(a+1)+"B":t?o.key=ue.ESC+"OB":o.key=ue.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=ue.ESC+"[2~");break;case 46:a?o.key=ue.ESC+"[3;"+(a+1)+"~":o.key=ue.ESC+"[3~";break;case 36:a?o.key=ue.ESC+"[1;"+(a+1)+"H":t?o.key=ue.ESC+"OH":o.key=ue.ESC+"[H";break;case 35:a?o.key=ue.ESC+"[1;"+(a+1)+"F":t?o.key=ue.ESC+"OF":o.key=ue.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=ue.ESC+"[5;"+(a+1)+"~":o.key=ue.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=ue.ESC+"[6;"+(a+1)+"~":o.key=ue.ESC+"[6~";break;case 112:a?o.key=ue.ESC+"[1;"+(a+1)+"P":o.key=ue.ESC+"OP";break;case 113:a?o.key=ue.ESC+"[1;"+(a+1)+"Q":o.key=ue.ESC+"OQ";break;case 114:a?o.key=ue.ESC+"[1;"+(a+1)+"R":o.key=ue.ESC+"OR";break;case 115:a?o.key=ue.ESC+"[1;"+(a+1)+"S":o.key=ue.ESC+"OS";break;case 116:a?o.key=ue.ESC+"[15;"+(a+1)+"~":o.key=ue.ESC+"[15~";break;case 117:a?o.key=ue.ESC+"[17;"+(a+1)+"~":o.key=ue.ESC+"[17~";break;case 118:a?o.key=ue.ESC+"[18;"+(a+1)+"~":o.key=ue.ESC+"[18~";break;case 119:a?o.key=ue.ESC+"[19;"+(a+1)+"~":o.key=ue.ESC+"[19~";break;case 120:a?o.key=ue.ESC+"[20;"+(a+1)+"~":o.key=ue.ESC+"[20~";break;case 121:a?o.key=ue.ESC+"[21;"+(a+1)+"~":o.key=ue.ESC+"[21~";break;case 122:a?o.key=ue.ESC+"[23;"+(a+1)+"~":o.key=ue.ESC+"[23~";break;case 123:a?o.key=ue.ESC+"[24;"+(a+1)+"~":o.key=ue.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=ue.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=ue.DEL:e.keyCode===219?o.key=ue.ESC:e.keyCode===220?o.key=ue.FS:e.keyCode===221&&(o.key=ue.GS);else if((!i||r)&&e.altKey&&!e.metaKey){let h=(c=IM[e.keyCode])==null?void 0:c[e.shiftKey?1:0];if(h)o.key=ue.ESC+h;else if(e.keyCode>=65&&e.keyCode<=90){let d=e.ctrlKey?e.keyCode-64:e.keyCode+32,f=String.fromCharCode(d);e.shiftKey&&(f=f.toUpperCase()),o.key=ue.ESC+f}else if(e.keyCode===32)o.key=ue.ESC+(e.ctrlKey?ue.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let d=e.code.slice(3,4);e.shiftKey||(d=d.toLowerCase()),o.key=ue.ESC+d,o.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=ue.US),e.key==="@"&&(o.key=ue.NUL));break}return o}var Ct=0,qM=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new qu,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new qu,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((o,a)=>this._getKey(o)-this._getKey(a)),t=0,i=0,r=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<r.length;o++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(r[o]=e[t],t++):r[o]=this._array[i++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Ct=this._search(t),Ct===-1)||this._getKey(this._array[Ct])!==t)return!1;do if(this._array[Ct]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Ct),!0;while(++Ct<this._array.length&&this._getKey(this._array[Ct])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,a)=>o-a),t=0,i=new Array(this._array.length-e.length),r=0;for(let o=0;o<this._array.length;o++)e[t]===o?t++:i[r++]=this._array[o];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ct=this._search(e),!(Ct<0||Ct>=this._array.length)&&this._getKey(this._array[Ct])===e))do yield this._array[Ct];while(++Ct<this._array.length&&this._getKey(this._array[Ct])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ct=this._search(e),!(Ct<0||Ct>=this._array.length)&&this._getKey(this._array[Ct])===e))do t(this._array[Ct]);while(++Ct<this._array.length&&this._getKey(this._array[Ct])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let r=t+i>>1,o=this._getKey(this._array[r]);if(o>e)i=r-1;else if(o<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},tp=0,a1=0,VM=class extends je{constructor(){super(),this._decorations=new qM(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new _e),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new _e),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ht(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new FM(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let r=0,o=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,o=r+(a.options.width??1),e>=r&&e<o&&(!i||(a.options.layer??"bottom")===i)&&(yield a)}forEachDecorationAtCell(e,t,i,r){this._decorations.forEachByKey(t,o=>{tp=o.options.x??0,a1=tp+(o.options.width??1),e>=tp&&e<a1&&(!i||(o.options.layer??"bottom")===i)&&r(o)})}},FM=class extends Wr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new _e),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new _e),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=gt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=gt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},$M=1e3,YM=class{constructor(e,t=$M){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=r-this._lastRefreshMs,a=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},a)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},c1=20,Vu=class extends je{constructor(e,t,i,r){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let a=0;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);if(this._topBoundaryFocusListener=a=>this._handleBoundaryFocus(a,0),this._bottomBoundaryFocusListener=a=>this._handleBoundaryFocus(a,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new YM(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(a=>this._handleResize(a.rows))),this._register(this._terminal.onRender(a=>this._refreshRows(a.start,a.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(a=>this._handleChar(a))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
73
|
+
`))),this._register(this._terminal.onA11yTab(a=>this._handleTab(a))),this._register(this._terminal.onKey(a=>this._handleKey(a.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Te(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ht(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<c1+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
74
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===c1+1&&(this._liveRegion.textContent+=Ap.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,r=i.lines.length.toString();for(let o=e;o<=t;o++){let a=i.lines.get(i.ydisp+o),c=[],h=(a==null?void 0:a.translateToString(!0,void 0,void 0,c))||"",d=(i.ydisp+o+1).toString(),f=this._rowElements[o];f&&(h.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=h,this._rowColumns.set(f,c)),f.setAttribute("aria-posinset",d),f.setAttribute("aria-setsize",r),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],o=i.getAttribute("aria-posinset"),a=t===0?"1":`${this._terminal.buffer.lines.length}`;if(o===a||e.relatedTarget!==r)return;let c,h;if(t===0?(c=i,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(c=this._rowElements.shift(),h=i,this._rowContainer.removeChild(c)),c.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let d=this._createAccessibilityTreeNode();this._rowElements.unshift(d),this._rowContainer.insertAdjacentElement("afterbegin",d)}else{let d=this._createAccessibilityTreeNode();this._rowElements.push(d),this._rowContainer.appendChild(d)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var h;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:r,offset:((h=r.textContent)==null?void 0:h.length)??0}),!this._rowContainer.contains(i.node))return;let o=({node:d,offset:f})=>{let m=d instanceof Text?d.parentNode:d,g=parseInt(m==null?void 0:m.getAttribute("aria-posinset"),10)-1;if(isNaN(g))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(m);if(!v)return console.warn("columns is null. Race condition?"),null;let y=f<v.length?v[f]:v.slice(-1)[0]+1;return y>=this._terminal.cols&&(++g,y=0),{row:g,column:y}},a=o(t),c=o(i);if(!(!a||!c)){if(a.row>c.row||a.row===c.row&&a.column>=c.column)throw new Error("invalid range");this._terminal.select(a.column,a.row,(c.row-a.row)*this._terminal.cols-a.column+c.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var o,a;e.style.transform="";let t=e.getBoundingClientRect().width,i=(a=(o=this._rowColumns.get(e))==null?void 0:o.slice(-1))==null?void 0:a[0];if(!i)return;let r=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};Vu=yt([ve(1,Og),ve(2,sr),ve(3,or)],Vu);var hg=class extends je{constructor(e,t,i,r,o){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=r,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new _e),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new _e),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(ht(()=>{var a;ks(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(a=this._activeProviderReplies)==null||a.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Te(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Te(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Te(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Te(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let r=0;r<i.length;r++){let o=i[r];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var r,o;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(a=>{a==null||a.forEach(c=>{c.link.dispose&&c.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[a,c]of this._linkProviderService.linkProviders.entries())t?(o=this._activeProviderReplies)!=null&&o.get(a)&&(i=this._checkLinkProviderResult(a,e,i)):c.provideLinks(e.y,h=>{var f,m;if(this._isMouseOut)return;let d=h==null?void 0:h.map(g=>({link:g}));(f=this._activeProviderReplies)==null||f.set(a,d),i=this._checkLinkProviderResult(a,e,i),((m=this._activeProviderReplies)==null?void 0:m.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let r=0;r<t.size;r++){let o=t.get(r);if(o)for(let a=0;a<o.length;a++){let c=o[a],h=c.link.range.start.y<e?0:c.link.range.start.x,d=c.link.range.end.y>e?this._bufferService.cols:c.link.range.end.x;for(let f=h;f<=d;f++){if(i.has(f)){o.splice(a--,1);break}i.add(f)}}}}_checkLinkProviderResult(e,t,i){var a;if(!this._activeProviderReplies)return i;let r=this._activeProviderReplies.get(e),o=!1;for(let c=0;c<e;c++)(!this._activeProviderReplies.has(c)||this._activeProviderReplies.get(c))&&(o=!0);if(!o&&r){let c=r.find(h=>this._linkAtPosition(h.link,t));c&&(i=!0,this._handleNewLink(c))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let c=0;c<this._activeProviderReplies.size;c++){let h=(a=this._activeProviderReplies.get(c))==null?void 0:a.find(d=>this._linkAtPosition(d.link,t));if(h){i=!0,this._handleNewLink(h);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&WM(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,ks(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var i,r;return(r=(i=this._currentLink)==null?void 0:i.state)==null?void 0:r.decorations.pointerCursor},set:i=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>{var i,r;return(r=(i=this._currentLink)==null?void 0:i.state)==null?void 0:r.decorations.underline},set:i=>{var r,o,a;(r=this._currentLink)!=null&&r.state&&((a=(o=this._currentLink)==null?void 0:o.state)==null?void 0:a.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let r=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(r,o),this._lastMouseEvent)){let a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,t,i){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,r=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-r-1,i.end.x,i.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,t,i){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return i<=o&&o<=r}_positionFromMouseEvent(e,t,i){let r=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,r,o){return{x1:e,y1:t,x2:i,y2:r,cols:this._bufferService.cols,fg:o}}};hg=yt([ve(1,Hg),ve(2,or),ve(3,ai),ve(4,kb)],hg);function WM(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var XM=class extends PM{constructor(e={}){super(e),this._linkifier=this._register(new Ro),this.browser=$b,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ro),this._onCursorMove=this._register(new _e),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new _e),this.onKey=this._onKey.event,this._onRender=this._register(new _e),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new _e),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new _e),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new _e),this.onBell=this._onBell.event,this._onFocus=this._register(new _e),this._onBlur=this._register(new _e),this._onA11yCharEmitter=this._register(new _e),this._onA11yTabEmitter=this._register(new _e),this._onWillOpen=this._register(new _e),this._setup(),this._decorationService=this._instantiationService.createInstance(VM),this._instantiationService.setService(Ma,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(H5),this._instantiationService.setService(kb,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Rp)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Qt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Qt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Qt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Qt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ht(()=>{var t,i;this._customKeyEventHandler=void 0,(i=(t=this.element)==null?void 0:t.parentNode)==null||i.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,r="";switch(t.index){case 256:i="foreground",r="10";break;case 257:i="background",r="11";break;case 258:i="cursor",r="12";break;default:i="ansi",r="4;"+t.index}switch(t.type){case 0:let o=ct.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${ue.ESC}]${r};${BM(o)}${Vb.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(a=>a.ansi[t.index]=Rt.toColor(...t.color));else{let a=i;this._themeService.modifyColors(c=>c[a]=Rt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Vu,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ue.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ue.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,o=t.getWidth(i),a=this._renderService.dimensions.css.cell.width*o,c=this.buffer.y*this._renderService.dimensions.css.cell.height,h=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=h+"px",this.textarea.style.top=c+"px",this.textarea.style.width=a+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Te(this.element,"copy",t=>{this.hasSelection()&&QE(t,this._selectionService)}));let e=t=>JE(t,this.textarea,this.coreService,this.optionsService);this._register(Te(this.textarea,"paste",e)),this._register(Te(this.element,"paste",e)),Yb?this._register(Te(this.element,"mousedown",t=>{t.button===2&&yy(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Te(this.element,"contextmenu",t=>{yy(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),$g&&this._register(Te(this.element,"auxclick",t=>{t.button===1&&_b(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Te(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Te(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Te(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Te(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Te(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Te(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Te(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var o;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((o=this.element)==null?void 0:o.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Te(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Np.get()),Kb||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(z5,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(sr,this._coreBrowserService),this._register(Te(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Te(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Jp,this._document,this._helperContainer),this._instantiationService.setService(sh,this._charSizeService),this._themeService=this._instantiationService.createInstance(ng),this._instantiationService.setService(Io,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Iu),this._instantiationService.setService(Eb,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(tg,this.rows,this.screenElement)),this._instantiationService.setService(or,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Gp,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(eg),this._instantiationService.setService(Hg,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(hg,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(Xp,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(ig,this.element,this.screenElement,r)),this._instantiationService.setService(lk,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(Qt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var a;this._selectionService.refresh(),(a=this._viewport)==null||a.queueSync()})),this._register(this._instantiationService.createInstance(Kp,this.screenElement)),this._register(Te(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),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(Vu,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Pu,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Pu,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Qp,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(a){var f,m,g,v,y;let c=e._mouseService.getMouseReportCoords(a,e.screenElement);if(!c)return!1;let h,d;switch(a.overrideType||a.type){case"mousemove":d=32,a.buttons===void 0?(h=3,a.button!==void 0&&(h=a.button<3?a.button:3)):h=a.buttons&1?0:a.buttons&4?1:a.buttons&2?2:3;break;case"mouseup":d=0,h=a.button<3?a.button:3;break;case"mousedown":d=1,h=a.button<3?a.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(a)===!1)return!1;let S=a.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(a,(v=(g=(m=(f=e._renderService)==null?void 0:f.dimensions)==null?void 0:m.device)==null?void 0:g.cell)==null?void 0:v.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;d=S<0?0:1,h=4;break;default:return!1}return d===void 0||h===void 0||h>4?!1:e.coreMouseService.triggerMouseEvent({col:c.col,row:c.row,x:c.x,y:c.y,button:h,action:d,ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:a=>(i(a),a.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(a)),wheel:a=>(i(a),this.cancel(a,!0)),mousedrag:a=>{a.buttons&&i(a)},mousemove:a=>{a.buttons||i(a)}};this._register(this.coreMouseService.onProtocolChange(a=>{a?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(a)),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()),a&8?r.mousemove||(t.addEventListener("mousemove",o.mousemove),r.mousemove=o.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),a&16?r.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),r.wheel=o.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),a&2?r.mouseup||(r.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),a&4?r.mousedrag||(r.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Te(t,"mousedown",a=>{if(a.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(a)))return i(a),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(a)})),this._register(Te(t,"wheel",a=>{var c,h,d,f,m;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(a)===!1)return!1;if(!this.buffer.hasScrollback){if(a.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(a,(f=(d=(h=(c=e._renderService)==null?void 0:c.dimensions)==null?void 0:h.device)==null?void 0:d.cell)==null?void 0:f.height,(m=e._coreBrowserService)==null?void 0:m.dpr)===0)return this.cancel(a,!0);let g=ue.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(a.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(g,!0),this.cancel(a,!0)}}},{passive:!1}))}refresh(e,t){var i;(i=this._renderService)==null||i.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){mb(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}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 e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var i;(i=this._selectionService)==null||i.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=UM(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let r=this.rows-1;return this.scrollLines(i.type===2?-r:r),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===ue.ETX||i.key===ue.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(KM(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var i;(i=this._charSizeService)==null||i.measure()}clear(){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Dt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(ue.ESC+"[I"):this.coreService.triggerDataEvent(ue.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ue.ESC}[4;${i};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ue.ESC}[6;${o};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function KM(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var GM=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},ZM=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Zi)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},u1=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new ZM(t)}getNullCell(){return new Zi}},QM=class extends je{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new _e),this.onBufferChange=this._onBufferChange.event,this._normal=new u1(this._core.buffers.normal,"normal"),this._alternate=new u1(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)}},JM=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,r)=>t(i,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},e3=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},t3=["cols","rows"],vn=0,i3=class extends je{constructor(e){super(),this._core=this._register(new XM(e)),this._addonManager=this._register(new GM),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],i=(r,o)=>{this._checkReadonlyOptions(r),this._core.options[r]=o};for(let r in this._core.options){let o={get:t.bind(this,r),set:i.bind(this,r)};Object.defineProperty(this._publicOptions,r,o)}}_checkReadonlyOptions(e){if(t3.includes(e))throw new Error(`Option "${e}" 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 JM(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new e3(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 QM(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
75
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Np.get()},set promptLabel(e){Np.set(e)},get tooMuchOutput(){return Ap.get()},set tooMuchOutput(e){Ap.set(e)}}}_verifyIntegers(...e){for(vn of e)if(vn===1/0||isNaN(vn)||vn%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(vn of e)if(vn&&(vn===1/0||isNaN(vn)||vn%1!==0||vn<0))throw new Error("This API only accepts positive integers")}};/**
|
|
76
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
77
|
+
* @license MIT
|
|
78
|
+
*
|
|
79
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
80
|
+
* @license MIT
|
|
81
|
+
*
|
|
82
|
+
* Originally forked from (with the author's permission):
|
|
83
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
84
|
+
* http://bellard.org/jslinux/
|
|
85
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
86
|
+
*/var n3=2,r3=1,s3=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var g;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((g=this._terminal.options.overviewRuler)==null?void 0:g.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(i.getPropertyValue("height")),o=Math.max(0,parseInt(i.getPropertyValue("width"))),a=window.getComputedStyle(this._terminal.element),c={top:parseInt(a.getPropertyValue("padding-top")),bottom:parseInt(a.getPropertyValue("padding-bottom")),right:parseInt(a.getPropertyValue("padding-right")),left:parseInt(a.getPropertyValue("padding-left"))},h=c.top+c.bottom,d=c.right+c.left,f=r-h,m=o-d-t;return{cols:Math.max(n3,Math.floor(m/e.css.cell.width)),rows:Math.max(r3,Math.floor(f/e.css.cell.height))}}};/**
|
|
87
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
88
|
+
* @license MIT
|
|
89
|
+
*
|
|
90
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
91
|
+
* @license MIT
|
|
92
|
+
*
|
|
93
|
+
* Originally forked from (with the author's permission):
|
|
94
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
95
|
+
* http://bellard.org/jslinux/
|
|
96
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
97
|
+
*/var o3=class{constructor(e,t,i,r={}){this._terminal=e,this._regex=t,this._handler=i,this._options=r}provideLinks(e,t){let i=a3.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(i))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(i,r)=>{if(this._options.hover){let{range:o}=t;this._options.hover(i,r,o)}},t))}};function l3(e){try{let t=new URL(e),i=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())}catch{return!1}}var a3=class Du{static computeLink(t,i,r,o){let a=new RegExp(i.source,(i.flags||"")+"g"),[c,h]=Du._getWindowedLineStrings(t-1,r),d=c.join(""),f,m=[];for(;f=a.exec(d);){let g=f[0];if(!l3(g))continue;let[v,y]=Du._mapStrIdx(r,h,0,f.index),[S,b]=Du._mapStrIdx(r,v,y,g.length);if(v===-1||y===-1||S===-1||b===-1)continue;let k={start:{x:y+1,y:v+1},end:{x:b,y:S+1}};m.push({range:k,text:g,activate:o})}return m}static _getWindowedLineStrings(t,i){let r,o=t,a=t,c=0,h="",d=[];if(r=i.buffer.active.getLine(t)){let f=r.translateToString(!0);if(r.isWrapped&&f[0]!==" "){for(c=0;(r=i.buffer.active.getLine(--o))&&c<2048&&(h=r.translateToString(!0),c+=h.length,d.push(h),!(!r.isWrapped||h.indexOf(" ")!==-1)););d.reverse()}for(d.push(f),c=0;(r=i.buffer.active.getLine(++a))&&r.isWrapped&&c<2048&&(h=r.translateToString(!0),c+=h.length,d.push(h),h.indexOf(" ")===-1););}return[d,o]}static _mapStrIdx(t,i,r,o){let a=t.buffer.active,c=a.getNullCell(),h=r;for(;o;){let d=a.getLine(i);if(!d)return[-1,-1];for(let f=h;f<d.length;++f){d.getCell(f,c);let m=c.getChars();if(c.getWidth()&&(o-=m.length||1,f===d.length-1&&m==="")){let g=a.getLine(i+1);g&&g.isWrapped&&(g.getCell(0,c),c.getWidth()===2&&(o+=1))}if(o<0)return[i,f]}i++,h=0}return[i,h]}},c3=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u3(e,t){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var h3=class{constructor(e=u3,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,i=t.urlRegex||c3;this._linkProvider=this._terminal.registerLinkProvider(new o3(this._terminal,i,this._handler,t))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};function f3(e){const t=new i3({fontFamily:"'SF Mono', Menlo, Monaco, 'Courier New', monospace",fontSize:12,lineHeight:1.2,theme:{background:"#1a1a1a",foreground:"#e8e4df",cursor:"#1a1a1a",cursorAccent:"#1a1a1a",selectionBackground:"rgba(255, 255, 255, 0.15)",black:"#1a1a1a",brightBlack:"#787068",white:"#e8e4df",brightWhite:"#faf9f7",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee"},cursorBlink:!1,cursorInactiveStyle:"none",scrollback:1e4,convertEol:!0}),i=new s3;return t.loadAddon(i),t.loadAddon(new h3),t.onData(r=>{e.current({type:"pty-input",data:r})}),{term:t,fitAddon:i}}function d3({sendMessage:e,ptyEvents:t}){const[i,r]=q.useState(!1),[o,a]=q.useState(!1),c=q.useRef(e);c.current=e;const h=q.useRef(null);h.current||(h.current=f3(c));const{term:d,fitAddon:f}=h.current,m=q.useRef(!1),g=q.useRef([]);q.useEffect(()=>()=>{d.dispose(),h.current=null},[d]),q.useEffect(()=>{const b=z=>{const E=z.detail;m.current?(d.write(E),a(!0)):g.current.push(E)},k=z=>{r(!1);const E=`\r
|
|
98
|
+
\x1B[90m[Process exited with code ${z.detail}. Press Enter to restart.]\x1B[0m`;m.current?d.writeln(E):g.current.push(E+`\r
|
|
99
|
+
`)},C=()=>{r(!0)};return t.addEventListener("data",b),t.addEventListener("exit",k),t.addEventListener("spawned",C),()=>{t.removeEventListener("data",b),t.removeEventListener("exit",k),t.removeEventListener("spawned",C)}},[t,d]);const v=q.useCallback(b=>{if(b){if(m.current)d.element&&b.appendChild(d.element);else if(d.open(b),m.current=!0,g.current.length>0){for(const k of g.current)d.write(k);g.current=[],a(!0)}f.fit(),d.focus(),c.current({type:"pty-resize",data:{cols:d.cols,rows:d.rows}})}},[d,f]),y=q.useCallback(()=>{f.fit(),c.current({type:"pty-resize",data:{cols:d.cols,rows:d.rows}})},[d,f]),S=q.useCallback(()=>{d.clear(),c.current({type:"pty-spawn"})},[d]);return{attachTo:v,fit:y,ptyAlive:i,hasData:o,restart:S}}function p3(){const[e,t]=q.useState(window.location.pathname),i=q.useCallback(r=>{r!==e&&(history.pushState(null,"",r),t(r))},[e]);return q.useEffect(()=>{const r=()=>t(window.location.pathname);return window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)},[]),{path:e,navigate:i}}function g3(e,t){const i=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean);if(i.length!==r.length)return null;const o={};for(let a=0;a<r.length;a++)if(r[a].startsWith(":"))o[r[a].slice(1)]=decodeURIComponent(i[a]);else if(r[a]!==i[a])return null;return o}const m3=[{path:"/",label:"Dashboard",icon:w.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"1.5",y:"1.5",width:"5",height:"5",rx:"1"}),w.jsx("rect",{x:"9.5",y:"1.5",width:"5",height:"5",rx:"1"}),w.jsx("rect",{x:"1.5",y:"9.5",width:"5",height:"5",rx:"1"}),w.jsx("rect",{x:"9.5",y:"9.5",width:"5",height:"5",rx:"1"})]})},{path:"/credentials",label:"Credentials",icon:w.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M10 5.5a3.5 3.5 0 1 0-3 3.46V11H5.5v2H7v1.5h2V8.96A3.5 3.5 0 0 0 10 5.5Z"}),w.jsx("circle",{cx:"6.5",cy:"5.5",r:"1",fill:"currentColor",stroke:"none"})]})},{path:"/settings",label:"Settings",icon:w.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"8",cy:"8",r:"2"}),w.jsx("path",{d:"M13.5 8a5.5 5.5 0 0 0-.1-.8l1.3-1-.7-1.2-1.5.5a5.5 5.5 0 0 0-1.2-.7L11 3.3H9.6l-.4 1.5a5.5 5.5 0 0 0-1.2.7L6.5 5l-.7 1.2 1.3 1a5.5 5.5 0 0 0 0 1.6l-1.3 1 .7 1.2 1.5-.5a5.5 5.5 0 0 0 1.2.7l.4 1.5h1.4l.4-1.5a5.5 5.5 0 0 0 1.2-.7l1.5.5.7-1.2-1.3-1a5.5 5.5 0 0 0 .1-.8Z"})]})}];function _3(e,t){return t==="/"?e==="/"||e.startsWith("/workflows/"):e.startsWith(t)}function v3({currentPath:e,navigate:t,connected:i,collapsed:r,onToggleCollapse:o,appName:a}){return w.jsxs("div",{className:"flex flex-col bg-[#f3ede5] shrink-0 border-r border-border transition-[width] duration-200",style:{width:r?56:224},children:[w.jsxs("div",{className:`py-4 flex items-center gap-2 ${r?"px-3 justify-center":"px-4"}`,children:[w.jsx("div",{className:"w-6 h-6 rounded-full bg-foreground text-background flex items-center justify-center text-[10px] font-bold shrink-0",children:"0p"}),!r&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sm font-bold text-foreground font-serif tracking-wide",children:a||"0pflow"}),w.jsx("span",{className:`w-2 h-2 rounded-full ml-auto ${i?"bg-green-400":"bg-red-400"}`,title:i?"Connected":"Disconnected"})]})]}),w.jsx("nav",{className:`flex-1 py-2 flex flex-col gap-0.5 ${r?"px-2":"px-3"}`,children:m3.map(c=>{const h=_3(e,c.path);return w.jsxs("button",{onClick:()=>t(c.path),title:r?c.label:void 0,className:`
|
|
100
|
+
flex items-center rounded-lg text-sm transition-colors cursor-pointer text-left
|
|
101
|
+
${r?"justify-center px-0 py-2":"gap-3 px-3 py-2"}
|
|
102
|
+
${h?"bg-[#e8e0d4] text-foreground font-medium shadow-[inset_0_0_0_1px_rgba(0,0,0,0.04)]":"text-muted-foreground hover:bg-[#ece5db] hover:text-foreground"}
|
|
103
|
+
`,children:[w.jsx("span",{className:"shrink-0 opacity-80",children:c.icon}),!r&&c.label]},c.path)})}),w.jsx("div",{className:`py-3 border-t border-border ${r?"px-2":"px-3"}`,children:w.jsxs("button",{onClick:o,className:`flex items-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer rounded-lg hover:bg-[#ece5db] text-xs
|
|
104
|
+
${r?"justify-center w-full py-2 px-0":"gap-2 px-3 py-2 w-full"}
|
|
105
|
+
`,title:r?"Expand sidebar":"Collapse sidebar",children:[w.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:`shrink-0 transition-transform duration-200 ${r?"rotate-180":""}`,children:w.jsx("path",{d:"M9 3L5 7L9 11"})}),!r&&w.jsx("span",{children:"Collapse"})]})})]})}function y3({onClose:e}){const t=q.useRef(null);q.useEffect(()=>{const r=setTimeout(e,4500);return()=>clearTimeout(r)},[e]);const i=q.useCallback(r=>{r.target===t.current&&e()},[e]);return w.jsxs("div",{ref:t,onClick:i,className:"fixed inset-0 z-50 flex items-center justify-center",style:{animation:"ssh-backdrop 4.5s ease both"},children:[w.jsxs("div",{className:"relative w-[480px] h-[300px] rounded-xl border-2 border-foreground/20 bg-card shadow-2xl overflow-hidden",style:{animation:"ssh-screen 4.5s ease both"},children:[w.jsxs("div",{className:"absolute inset-y-0 left-0 w-1/2 flex flex-col items-center justify-center gap-3",style:{animation:"ssh-pane-left 4.5s ease both"},children:[w.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#1a1a1a] flex items-center justify-center",children:w.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#e8e4df",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("polyline",{points:"4 17 10 11 4 5"}),w.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}),w.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Claude Code"}),w.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Your terminal"})]}),w.jsx("div",{className:"absolute top-0 left-1/2 w-[2px] h-full bg-foreground/15 -translate-x-1/2",style:{animation:"ssh-divider 4.5s ease both"}}),w.jsxs("div",{className:"absolute inset-y-0 right-0 w-1/2 flex flex-col items-center justify-center gap-3",style:{animation:"ssh-pane-right 4.5s ease both"},children:[w.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#f3ede5] border border-border flex items-center justify-center",children:w.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-foreground",children:[w.jsx("rect",{x:"3",y:"3",width:"7",height:"5",rx:"1.5"}),w.jsx("rect",{x:"14",y:"3",width:"7",height:"5",rx:"1.5"}),w.jsx("rect",{x:"8.5",y:"16",width:"7",height:"5",rx:"1.5"}),w.jsx("path",{d:"M6.5 8v3.5a2 2 0 002 2h7a2 2 0 002-2V8"}),w.jsx("path",{d:"M12 13.5V16"})]})}),w.jsx("span",{className:"text-sm font-semibold text-foreground",children:"0pflow"}),w.jsx("span",{className:"text-[10px] text-muted-foreground",children:"This browser"})]}),w.jsx("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 bg-foreground text-background text-[11px] font-medium px-3 py-1 rounded-full",style:{animation:"ssh-banner 4.5s ease both"},children:"Copied to clipboard"})]}),w.jsx("style",{children:`
|
|
106
|
+
@keyframes ssh-backdrop {
|
|
107
|
+
0% { background: rgba(0,0,0,0); }
|
|
108
|
+
5% { background: rgba(0,0,0,0.2); }
|
|
109
|
+
88% { background: rgba(0,0,0,0.2); }
|
|
110
|
+
100% { background: rgba(0,0,0,0); }
|
|
111
|
+
}
|
|
112
|
+
@keyframes ssh-screen {
|
|
113
|
+
0% { opacity: 0; transform: scale(0.95); }
|
|
114
|
+
5% { opacity: 1; transform: scale(1); }
|
|
115
|
+
88% { opacity: 1; transform: scale(1); }
|
|
116
|
+
100% { opacity: 0; transform: scale(0.97); }
|
|
117
|
+
}
|
|
118
|
+
@keyframes ssh-divider {
|
|
119
|
+
0%, 7% { transform: translateX(-50%) scaleY(0); }
|
|
120
|
+
17% { transform: translateX(-50%) scaleY(1); }
|
|
121
|
+
88% { opacity: 1; }
|
|
122
|
+
100% { opacity: 0; }
|
|
123
|
+
}
|
|
124
|
+
@keyframes ssh-pane-left {
|
|
125
|
+
0%, 15% { opacity: 0; }
|
|
126
|
+
25% { opacity: 1; }
|
|
127
|
+
88% { opacity: 1; }
|
|
128
|
+
100% { opacity: 0; }
|
|
129
|
+
}
|
|
130
|
+
@keyframes ssh-pane-right {
|
|
131
|
+
0%, 20% { opacity: 0; }
|
|
132
|
+
30% { opacity: 1; }
|
|
133
|
+
88% { opacity: 1; }
|
|
134
|
+
100% { opacity: 0; }
|
|
135
|
+
}
|
|
136
|
+
@keyframes ssh-banner {
|
|
137
|
+
0%, 5% { opacity: 0; transform: translateX(-50%) translateY(8px); }
|
|
138
|
+
12% { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
139
|
+
75% { opacity: 1; }
|
|
140
|
+
88% { opacity: 0; }
|
|
141
|
+
100% { opacity: 0; }
|
|
142
|
+
}
|
|
143
|
+
`})]})}const S3=150,b3=400;function x3({tabs:e,defaultTab:t,onClose:i}){var E,T;const[r,o]=q.useState(t??((E=e[0])==null?void 0:E.id)??""),[a,c]=q.useState(b3),[h,d]=q.useState(null),[f,m]=q.useState(!1),[g,v]=q.useState(!1),y=q.useRef(!1),S=q.useRef(0),b=q.useRef(0),k=q.useCallback(P=>{P.preventDefault(),y.current=!0,S.current=P.clientY,b.current=a},[a]);q.useEffect(()=>{const P=U=>{if(!y.current)return;const X=window.innerHeight*.6,G=S.current-U.clientY;c(Math.max(S3,Math.min(X,b.current+G)))},R=()=>{y.current=!1};return window.addEventListener("mousemove",P),window.addEventListener("mouseup",R),()=>{window.removeEventListener("mousemove",P),window.removeEventListener("mouseup",R)}},[]),q.useEffect(()=>{fetch("/api/claude-command").then(P=>P.ok?P.json():null).then(P=>{P!=null&&P.isCloud?d("0pflow cloud claude --continue"):P!=null&&P.projectRoot&&d(`cd ${P.projectRoot} && claude --continue`)}).catch(()=>{})},[]);const C=q.useCallback(()=>{h&&navigator.clipboard.writeText(h).then(()=>{m(!0),v(!0),setTimeout(()=>m(!1),1500)})},[h]),z=(T=e.find(P=>P.id===r))==null?void 0:T.content;return w.jsxs("div",{className:"border-t border-border flex flex-col bg-background",style:{height:a},children:[w.jsx("div",{onMouseDown:k,className:"h-1 cursor-ns-resize hover:bg-accent shrink-0"}),w.jsxs("div",{className:"shrink-0 px-3 flex items-center gap-0 border-b border-border",children:[e.map(P=>w.jsxs("button",{onClick:()=>o(P.id),className:`relative text-[12px] tracking-wide px-3 py-2 cursor-pointer transition-colors ${r===P.id?"text-foreground":"text-muted-foreground hover:text-foreground/70"}`,children:[P.label,r===P.id&&w.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-[1.5px] bg-[#b8ad9e] rounded-full"})]},P.id)),w.jsx("div",{className:"flex-1"}),h&&w.jsxs("button",{onClick:C,className:"flex items-center gap-1.5 text-[10px] text-muted-foreground hover:text-foreground transition-colors cursor-pointer mr-2 max-w-[50%] group",title:"Copy to open in your terminal",children:[w.jsx("span",{className:"shrink-0",children:"Prefer your own terminal?"}),w.jsx("span",{className:"truncate font-mono",children:h}),f?w.jsx("span",{className:"text-[10px] text-emerald-600 shrink-0",children:"Copied!"}):w.jsxs("svg",{className:"w-3 h-3 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[w.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),w.jsx("path",{d:"M5 11H3.5A1.5 1.5 0 012 9.5v-7A1.5 1.5 0 013.5 1h7A1.5 1.5 0 0112 2.5V5"})]})]}),w.jsx("button",{onClick:i,className:"text-muted-foreground hover:text-foreground text-sm px-1.5 py-0.5 cursor-pointer",title:"Close panel",children:"×"})]}),w.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:z}),g&&w.jsx(y3,{onClose:()=>v(!1)})]})}function w3({attachTo:e,fit:t,ptyAlive:i,hasData:r,restart:o}){const a=q.useRef(null);return q.useEffect(()=>(a.current&&e(a.current),()=>e(null)),[e]),q.useEffect(()=>{if(!a.current)return;const c=new ResizeObserver(()=>{requestAnimationFrame(t)});return c.observe(a.current),()=>c.disconnect()},[t]),q.useEffect(()=>{const c=setTimeout(t,50);return()=>clearTimeout(c)},[t]),q.useEffect(()=>{if(i)return;const c=a.current;if(!c)return;const h=d=>{d.key==="Enter"&&o()};return c.addEventListener("keydown",h),()=>c.removeEventListener("keydown",h)},[i,o]),w.jsxs("div",{className:"relative h-full w-full overflow-hidden bg-[#1a1a1a] px-4 py-2",children:[w.jsx("div",{ref:a,className:"h-full w-full"}),!r&&w.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:w.jsxs("div",{className:"flex items-center gap-3 text-zinc-500",children:[w.jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),w.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),w.jsx("span",{children:"Starting Claude Code..."})]})})]})}function ip({icon:e,label:t,value:i}){return w.jsxs("div",{className:"bg-card rounded-xl border border-border px-5 py-4 flex-1 min-w-0",children:[w.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground text-xs uppercase tracking-wider mb-2",children:[w.jsx("span",{className:"shrink-0 opacity-70",children:e}),t]}),w.jsx("div",{className:"text-2xl font-semibold text-foreground",children:i})]})}function C3(e,t){const i=t.filter(o=>o.name===e);if(i.length===0)return{label:"Draft",className:"bg-[#f0ebe3] text-muted-foreground"};const r=i[0];return r.status==="SUCCESS"?{label:"Active",className:"bg-accent text-green-700"}:r.status==="ERROR"?{label:"Error",className:"bg-red-50 text-red-700"}:{label:"Running",className:"bg-blue-50 text-blue-700"}}function E3(e){var r;const t=e.nodes.filter(o=>o.type!=="input"&&o.type!=="output").length,i=(r=e.nodes.find(o=>o.description))==null?void 0:r.description;return i?i.slice(0,120):`${t} node${t!==1?"s":""}`}function k3({workflows:e,runs:t,runsAvailable:i,navigate:r}){const o=q.useMemo(()=>{const a=new Date;a.setHours(0,0,0,0);const c=t.filter(f=>new Date(f.created_at)>=a).length,h=t.filter(f=>f.status==="SUCCESS"||f.status==="ERROR"),d=h.length>0?Math.round(h.filter(f=>f.status==="SUCCESS").length/h.length*100):null;return{runsToday:c,successRate:d}},[t]);return w.jsx("div",{className:"h-full overflow-y-auto",children:w.jsxs("div",{className:"max-w-[1200px] mx-auto px-8 py-8",children:[w.jsx("h1",{className:"text-3xl font-bold text-foreground font-serif",children:"Workflows"}),w.jsx("p",{className:"text-muted-foreground mt-1 mb-6",children:"Manage and monitor your automation workflows"}),i&&w.jsxs("div",{className:"flex gap-4 mb-6",children:[w.jsx(ip,{icon:w.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:w.jsx("path",{d:"M2 4h10M2 7h10M2 10h10"})}),label:"Total",value:e.length}),w.jsx(ip,{icon:w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[w.jsx("path",{d:"M7 1v6l3 3"}),w.jsx("circle",{cx:"7",cy:"7",r:"6"})]}),label:"Runs Today",value:o.runsToday}),w.jsx(ip,{icon:w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[w.jsx("path",{d:"M3 7.5l3 3 5-5"}),w.jsx("circle",{cx:"7",cy:"7",r:"6"})]}),label:"Success Rate",value:o.successRate!==null?`${o.successRate}%`:"—"})]}),e.length===0?w.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[w.jsx("p",{className:"text-sm",children:"No workflow files found."}),w.jsx("p",{className:"text-xs mt-1",children:"Create a workflow to get started."})]}):w.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(a=>{const c=C3(a.workflowName,t);return w.jsxs("button",{onClick:()=>r(`/workflows/${encodeURIComponent(a.workflowName)}`),className:"bg-card rounded-xl border border-border p-5 text-left hover:shadow-[0_2px_8px_rgba(0,0,0,0.06)] transition-shadow cursor-pointer group",children:[w.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[w.jsx("h3",{className:"text-sm font-semibold text-foreground truncate group-hover:text-foreground/90",children:a.workflowName}),w.jsx("span",{className:`text-[11px] px-2 py-0.5 rounded-full shrink-0 ${c.className}`,children:c.label})]}),w.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:E3(a)})]},`${a.filePath}:${a.workflowName}`)})})]})})}function Bt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let i=0,r;i<e.length;i++)(r=Bt(e[i]))!==""&&(t+=(t&&" ")+r);else for(let i in e)e[i]&&(t+=(t&&" ")+i);return t}var M3={value:()=>{}};function ah(){for(var e=0,t=arguments.length,i={},r;e<t;++e){if(!(r=arguments[e]+"")||r in i||/[\s.]/.test(r))throw new Error("illegal type: "+r);i[r]=[]}return new Ru(i)}function Ru(e){this._=e}function T3(e,t){return e.trim().split(/^|\s+/).map(function(i){var r="",o=i.indexOf(".");if(o>=0&&(r=i.slice(o+1),i=i.slice(0,o)),i&&!t.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:r}})}Ru.prototype=ah.prototype={constructor:Ru,on:function(e,t){var i=this._,r=T3(e+"",i),o,a=-1,c=r.length;if(arguments.length<2){for(;++a<c;)if((o=(e=r[a]).type)&&(o=N3(i[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<c;)if(o=(e=r[a]).type)i[o]=h1(i[o],e.name,t);else if(t==null)for(o in i)i[o]=h1(i[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new Ru(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var i=new Array(o),r=0,o,a;r<o;++r)i[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,o=a.length;r<o;++r)a[r].value.apply(t,i)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,a=r.length;o<a;++o)r[o].value.apply(t,i)}};function N3(e,t){for(var i=0,r=e.length,o;i<r;++i)if((o=e[i]).name===t)return o.value}function h1(e,t,i){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=M3,e=e.slice(0,r).concat(e.slice(r+1));break}return i!=null&&e.push({name:t,value:i}),e}var fg="http://www.w3.org/1999/xhtml";const f1={svg:"http://www.w3.org/2000/svg",xhtml:fg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ch(e){var t=e+="",i=t.indexOf(":");return i>=0&&(t=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),f1.hasOwnProperty(t)?{space:f1[t],local:e}:e}function A3(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===fg&&t.documentElement.namespaceURI===fg?t.createElement(e):t.createElementNS(i,e)}}function D3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function sx(e){var t=ch(e);return(t.local?D3:A3)(t)}function R3(){}function Yg(e){return e==null?R3:function(){return this.querySelector(e)}}function B3(e){typeof e!="function"&&(e=Yg(e));for(var t=this._groups,i=t.length,r=new Array(i),o=0;o<i;++o)for(var a=t[o],c=a.length,h=r[o]=new Array(c),d,f,m=0;m<c;++m)(d=a[m])&&(f=e.call(d,d.__data__,m,a))&&("__data__"in d&&(f.__data__=d.__data__),h[m]=f);return new ji(r,this._parents)}function L3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function z3(){return[]}function ox(e){return e==null?z3:function(){return this.querySelectorAll(e)}}function O3(e){return function(){return L3(e.apply(this,arguments))}}function H3(e){typeof e=="function"?e=O3(e):e=ox(e);for(var t=this._groups,i=t.length,r=[],o=[],a=0;a<i;++a)for(var c=t[a],h=c.length,d,f=0;f<h;++f)(d=c[f])&&(r.push(e.call(d,d.__data__,f,c)),o.push(d));return new ji(r,o)}function lx(e){return function(){return this.matches(e)}}function ax(e){return function(t){return t.matches(e)}}var j3=Array.prototype.find;function P3(e){return function(){return j3.call(this.children,e)}}function I3(){return this.firstElementChild}function U3(e){return this.select(e==null?I3:P3(typeof e=="function"?e:ax(e)))}var q3=Array.prototype.filter;function V3(){return Array.from(this.children)}function F3(e){return function(){return q3.call(this.children,e)}}function $3(e){return this.selectAll(e==null?V3:F3(typeof e=="function"?e:ax(e)))}function Y3(e){typeof e!="function"&&(e=lx(e));for(var t=this._groups,i=t.length,r=new Array(i),o=0;o<i;++o)for(var a=t[o],c=a.length,h=r[o]=[],d,f=0;f<c;++f)(d=a[f])&&e.call(d,d.__data__,f,a)&&h.push(d);return new ji(r,this._parents)}function cx(e){return new Array(e.length)}function W3(){return new ji(this._enter||this._groups.map(cx),this._parents)}function Fu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Fu.prototype={constructor:Fu,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 X3(e){return function(){return e}}function K3(e,t,i,r,o,a){for(var c=0,h,d=t.length,f=a.length;c<f;++c)(h=t[c])?(h.__data__=a[c],r[c]=h):i[c]=new Fu(e,a[c]);for(;c<d;++c)(h=t[c])&&(o[c]=h)}function G3(e,t,i,r,o,a,c){var h,d,f=new Map,m=t.length,g=a.length,v=new Array(m),y;for(h=0;h<m;++h)(d=t[h])&&(v[h]=y=c.call(d,d.__data__,h,t)+"",f.has(y)?o[h]=d:f.set(y,d));for(h=0;h<g;++h)y=c.call(e,a[h],h,a)+"",(d=f.get(y))?(r[h]=d,d.__data__=a[h],f.delete(y)):i[h]=new Fu(e,a[h]);for(h=0;h<m;++h)(d=t[h])&&f.get(v[h])===d&&(o[h]=d)}function Z3(e){return e.__data__}function Q3(e,t){if(!arguments.length)return Array.from(this,Z3);var i=t?G3:K3,r=this._parents,o=this._groups;typeof e!="function"&&(e=X3(e));for(var a=o.length,c=new Array(a),h=new Array(a),d=new Array(a),f=0;f<a;++f){var m=r[f],g=o[f],v=g.length,y=J3(e.call(m,m&&m.__data__,f,r)),S=y.length,b=h[f]=new Array(S),k=c[f]=new Array(S),C=d[f]=new Array(v);i(m,g,b,k,C,y,t);for(var z=0,E=0,T,P;z<S;++z)if(T=b[z]){for(z>=E&&(E=z+1);!(P=k[E])&&++E<S;);T._next=P||null}}return c=new ji(c,r),c._enter=h,c._exit=d,c}function J3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eT(){return new ji(this._exit||this._groups.map(cx),this._parents)}function tT(e,t,i){var r=this.enter(),o=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),i==null?a.remove():i(a),r&&o?r.merge(o).order():o}function iT(e){for(var t=e.selection?e.selection():e,i=this._groups,r=t._groups,o=i.length,a=r.length,c=Math.min(o,a),h=new Array(o),d=0;d<c;++d)for(var f=i[d],m=r[d],g=f.length,v=h[d]=new Array(g),y,S=0;S<g;++S)(y=f[S]||m[S])&&(v[S]=y);for(;d<o;++d)h[d]=i[d];return new ji(h,this._parents)}function nT(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var r=e[t],o=r.length-1,a=r[o],c;--o>=0;)(c=r[o])&&(a&&c.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(c,a),a=c);return this}function rT(e){e||(e=sT);function t(g,v){return g&&v?e(g.__data__,v.__data__):!g-!v}for(var i=this._groups,r=i.length,o=new Array(r),a=0;a<r;++a){for(var c=i[a],h=c.length,d=o[a]=new Array(h),f,m=0;m<h;++m)(f=c[m])&&(d[m]=f);d.sort(t)}return new ji(o,this._parents).order()}function sT(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function oT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function lT(){return Array.from(this)}function aT(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var c=r[o];if(c)return c}return null}function cT(){let e=0;for(const t of this)++e;return e}function uT(){return!this.node()}function hT(e){for(var t=this._groups,i=0,r=t.length;i<r;++i)for(var o=t[i],a=0,c=o.length,h;a<c;++a)(h=o[a])&&e.call(h,h.__data__,a,o);return this}function fT(e){return function(){this.removeAttribute(e)}}function dT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pT(e,t){return function(){this.setAttribute(e,t)}}function gT(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mT(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function _T(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function vT(e,t){var i=ch(e);if(arguments.length<2){var r=this.node();return i.local?r.getAttributeNS(i.space,i.local):r.getAttribute(i)}return this.each((t==null?i.local?dT:fT:typeof t=="function"?i.local?_T:mT:i.local?gT:pT)(i,t))}function ux(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yT(e){return function(){this.style.removeProperty(e)}}function ST(e,t,i){return function(){this.style.setProperty(e,t,i)}}function bT(e,t,i){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,i)}}function xT(e,t,i){return arguments.length>1?this.each((t==null?yT:typeof t=="function"?bT:ST)(e,t,i??"")):Bo(this.node(),e)}function Bo(e,t){return e.style.getPropertyValue(t)||ux(e).getComputedStyle(e,null).getPropertyValue(t)}function wT(e){return function(){delete this[e]}}function CT(e,t){return function(){this[e]=t}}function ET(e,t){return function(){var i=t.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function kT(e,t){return arguments.length>1?this.each((t==null?wT:typeof t=="function"?ET:CT)(e,t)):this.node()[e]}function hx(e){return e.trim().split(/^|\s+/)}function Wg(e){return e.classList||new fx(e)}function fx(e){this._node=e,this._names=hx(e.getAttribute("class")||"")}fx.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 dx(e,t){for(var i=Wg(e),r=-1,o=t.length;++r<o;)i.add(t[r])}function px(e,t){for(var i=Wg(e),r=-1,o=t.length;++r<o;)i.remove(t[r])}function MT(e){return function(){dx(this,e)}}function TT(e){return function(){px(this,e)}}function NT(e,t){return function(){(t.apply(this,arguments)?dx:px)(this,e)}}function AT(e,t){var i=hx(e+"");if(arguments.length<2){for(var r=Wg(this.node()),o=-1,a=i.length;++o<a;)if(!r.contains(i[o]))return!1;return!0}return this.each((typeof t=="function"?NT:t?MT:TT)(i,t))}function DT(){this.textContent=""}function RT(e){return function(){this.textContent=e}}function BT(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function LT(e){return arguments.length?this.each(e==null?DT:(typeof e=="function"?BT:RT)(e)):this.node().textContent}function zT(){this.innerHTML=""}function OT(e){return function(){this.innerHTML=e}}function HT(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function jT(e){return arguments.length?this.each(e==null?zT:(typeof e=="function"?HT:OT)(e)):this.node().innerHTML}function PT(){this.nextSibling&&this.parentNode.appendChild(this)}function IT(){return this.each(PT)}function UT(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qT(){return this.each(UT)}function VT(e){var t=typeof e=="function"?e:sx(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function FT(){return null}function $T(e,t){var i=typeof e=="function"?e:sx(e),r=t==null?FT:typeof t=="function"?t:Yg(t);return this.select(function(){return this.insertBefore(i.apply(this,arguments),r.apply(this,arguments)||null)})}function YT(){var e=this.parentNode;e&&e.removeChild(this)}function WT(){return this.each(YT)}function XT(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KT(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function GT(e){return this.select(e?KT:XT)}function ZT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function QT(e){return function(t){e.call(this,t,this.__data__)}}function JT(e){return e.trim().split(/^|\s+/).map(function(t){var i="",r=t.indexOf(".");return r>=0&&(i=t.slice(r+1),t=t.slice(0,r)),{type:t,name:i}})}function eN(e){return function(){var t=this.__on;if(t){for(var i=0,r=-1,o=t.length,a;i<o;++i)a=t[i],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function tN(e,t,i){return function(){var r=this.__on,o,a=QT(t);if(r){for(var c=0,h=r.length;c<h;++c)if((o=r[c]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=i),o.value=t;return}}this.addEventListener(e.type,a,i),o={type:e.type,name:e.name,value:t,listener:a,options:i},r?r.push(o):this.__on=[o]}}function iN(e,t,i){var r=JT(e+""),o,a=r.length,c;if(arguments.length<2){var h=this.node().__on;if(h){for(var d=0,f=h.length,m;d<f;++d)for(o=0,m=h[d];o<a;++o)if((c=r[o]).type===m.type&&c.name===m.name)return m.value}return}for(h=t?tN:eN,o=0;o<a;++o)this.each(h(r[o],t,i));return this}function gx(e,t,i){var r=ux(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,i):(o=r.document.createEvent("Event"),i?(o.initEvent(t,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function nN(e,t){return function(){return gx(this,e,t)}}function rN(e,t){return function(){return gx(this,e,t.apply(this,arguments))}}function sN(e,t){return this.each((typeof t=="function"?rN:nN)(e,t))}function*oN(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var r=e[t],o=0,a=r.length,c;o<a;++o)(c=r[o])&&(yield c)}var mx=[null];function ji(e,t){this._groups=e,this._parents=t}function Aa(){return new ji([[document.documentElement]],mx)}function lN(){return this}ji.prototype=Aa.prototype={constructor:ji,select:B3,selectAll:H3,selectChild:U3,selectChildren:$3,filter:Y3,data:Q3,enter:W3,exit:eT,join:tT,merge:iT,selection:lN,order:nT,sort:rT,call:oT,nodes:lT,node:aT,size:cT,empty:uT,each:hT,attr:vT,style:xT,property:kT,classed:AT,text:LT,html:jT,raise:IT,lower:qT,append:VT,insert:$T,remove:WT,clone:GT,datum:ZT,on:iN,dispatch:sN,[Symbol.iterator]:oN};function Oi(e){return typeof e=="string"?new ji([[document.querySelector(e)]],[document.documentElement]):new ji([[e]],mx)}function aN(e){let t;for(;t=e.sourceEvent;)e=t;return e}function on(e,t){if(e=aN(e),t===void 0&&(t=e.currentTarget),t){var i=t.ownerSVGElement||t;if(i.createSVGPoint){var r=i.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const cN={passive:!1},da={capture:!0,passive:!1};function np(e){e.stopImmediatePropagation()}function To(e){e.preventDefault(),e.stopImmediatePropagation()}function _x(e){var t=e.document.documentElement,i=Oi(e).on("dragstart.drag",To,da);"onselectstart"in t?i.on("selectstart.drag",To,da):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function vx(e,t){var i=e.document.documentElement,r=Oi(e).on("dragstart.drag",null);t&&(r.on("click.drag",To,da),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in i?r.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const du=e=>()=>e;function dg(e,{sourceEvent:t,subject:i,target:r,identifier:o,active:a,x:c,y:h,dx:d,dy:f,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:m}})}dg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uN(e){return!e.ctrlKey&&!e.button}function hN(){return this.parentNode}function fN(e,t){return t??{x:e.x,y:e.y}}function dN(){return navigator.maxTouchPoints||"ontouchstart"in this}function yx(){var e=uN,t=hN,i=fN,r=dN,o={},a=ah("start","drag","end"),c=0,h,d,f,m,g=0;function v(T){T.on("mousedown.drag",y).filter(r).on("touchstart.drag",k).on("touchmove.drag",C,cN).on("touchend.drag touchcancel.drag",z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(T,P){if(!(m||!e.call(this,T,P))){var R=E(this,t.call(this,T,P),T,P,"mouse");R&&(Oi(T.view).on("mousemove.drag",S,da).on("mouseup.drag",b,da),_x(T.view),np(T),f=!1,h=T.clientX,d=T.clientY,R("start",T))}}function S(T){if(To(T),!f){var P=T.clientX-h,R=T.clientY-d;f=P*P+R*R>g}o.mouse("drag",T)}function b(T){Oi(T.view).on("mousemove.drag mouseup.drag",null),vx(T.view,f),To(T),o.mouse("end",T)}function k(T,P){if(e.call(this,T,P)){var R=T.changedTouches,U=t.call(this,T,P),X=R.length,G,ne;for(G=0;G<X;++G)(ne=E(this,U,T,P,R[G].identifier,R[G]))&&(np(T),ne("start",T,R[G]))}}function C(T){var P=T.changedTouches,R=P.length,U,X;for(U=0;U<R;++U)(X=o[P[U].identifier])&&(To(T),X("drag",T,P[U]))}function z(T){var P=T.changedTouches,R=P.length,U,X;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),U=0;U<R;++U)(X=o[P[U].identifier])&&(np(T),X("end",T,P[U]))}function E(T,P,R,U,X,G){var ne=a.copy(),V=on(G||R,P),I,F,B;if((B=i.call(T,new dg("beforestart",{sourceEvent:R,target:v,identifier:X,active:c,x:V[0],y:V[1],dx:0,dy:0,dispatch:ne}),U))!=null)return I=B.x-V[0]||0,F=B.y-V[1]||0,function O(M,j,H){var $=V,N;switch(M){case"start":o[X]=O,N=c++;break;case"end":delete o[X],--c;case"drag":V=on(H||j,P),N=c;break}ne.call(M,T,new dg(M,{sourceEvent:j,subject:B,target:v,identifier:X,active:N,x:V[0]+I,y:V[1]+F,dx:V[0]-$[0],dy:V[1]-$[1],dispatch:ne}),U)}}return v.filter=function(T){return arguments.length?(e=typeof T=="function"?T:du(!!T),v):e},v.container=function(T){return arguments.length?(t=typeof T=="function"?T:du(T),v):t},v.subject=function(T){return arguments.length?(i=typeof T=="function"?T:du(T),v):i},v.touchable=function(T){return arguments.length?(r=typeof T=="function"?T:du(!!T),v):r},v.on=function(){var T=a.on.apply(a,arguments);return T===a?v:T},v.clickDistance=function(T){return arguments.length?(g=(T=+T)*T,v):Math.sqrt(g)},v}function Xg(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function Sx(e,t){var i=Object.create(e.prototype);for(var r in t)i[r]=t[r];return i}function Da(){}var pa=.7,$u=1/pa,No="\\s*([+-]?\\d+)\\s*",ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",En="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pN=/^#([0-9a-f]{3,8})$/,gN=new RegExp(`^rgb\\(${No},${No},${No}\\)$`),mN=new RegExp(`^rgb\\(${En},${En},${En}\\)$`),_N=new RegExp(`^rgba\\(${No},${No},${No},${ga}\\)$`),vN=new RegExp(`^rgba\\(${En},${En},${En},${ga}\\)$`),yN=new RegExp(`^hsl\\(${ga},${En},${En}\\)$`),SN=new RegExp(`^hsla\\(${ga},${En},${En},${ga}\\)$`),d1={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};Xg(Da,Ts,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:p1,formatHex:p1,formatHex8:bN,formatHsl:xN,formatRgb:g1,toString:g1});function p1(){return this.rgb().formatHex()}function bN(){return this.rgb().formatHex8()}function xN(){return bx(this).formatHsl()}function g1(){return this.rgb().formatRgb()}function Ts(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=pN.exec(e))?(i=t[1].length,t=parseInt(t[1],16),i===6?m1(t):i===3?new bi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):i===8?pu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):i===4?pu(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=gN.exec(e))?new bi(t[1],t[2],t[3],1):(t=mN.exec(e))?new bi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_N.exec(e))?pu(t[1],t[2],t[3],t[4]):(t=vN.exec(e))?pu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yN.exec(e))?y1(t[1],t[2]/100,t[3]/100,1):(t=SN.exec(e))?y1(t[1],t[2]/100,t[3]/100,t[4]):d1.hasOwnProperty(e)?m1(d1[e]):e==="transparent"?new bi(NaN,NaN,NaN,0):null}function m1(e){return new bi(e>>16&255,e>>8&255,e&255,1)}function pu(e,t,i,r){return r<=0&&(e=t=i=NaN),new bi(e,t,i,r)}function wN(e){return e instanceof Da||(e=Ts(e)),e?(e=e.rgb(),new bi(e.r,e.g,e.b,e.opacity)):new bi}function pg(e,t,i,r){return arguments.length===1?wN(e):new bi(e,t,i,r??1)}function bi(e,t,i,r){this.r=+e,this.g=+t,this.b=+i,this.opacity=+r}Xg(bi,pg,Sx(Da,{brighter(e){return e=e==null?$u:Math.pow($u,e),new bi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pa:Math.pow(pa,e),new bi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new bi(Cs(this.r),Cs(this.g),Cs(this.b),Yu(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:_1,formatHex:_1,formatHex8:CN,formatRgb:v1,toString:v1}));function _1(){return`#${xs(this.r)}${xs(this.g)}${xs(this.b)}`}function CN(){return`#${xs(this.r)}${xs(this.g)}${xs(this.b)}${xs((isNaN(this.opacity)?1:this.opacity)*255)}`}function v1(){const e=Yu(this.opacity);return`${e===1?"rgb(":"rgba("}${Cs(this.r)}, ${Cs(this.g)}, ${Cs(this.b)}${e===1?")":`, ${e})`}`}function Yu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xs(e){return e=Cs(e),(e<16?"0":"")+e.toString(16)}function y1(e,t,i,r){return r<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new ln(e,t,i,r)}function bx(e){if(e instanceof ln)return new ln(e.h,e.s,e.l,e.opacity);if(e instanceof Da||(e=Ts(e)),!e)return new ln;if(e instanceof ln)return e;e=e.rgb();var t=e.r/255,i=e.g/255,r=e.b/255,o=Math.min(t,i,r),a=Math.max(t,i,r),c=NaN,h=a-o,d=(a+o)/2;return h?(t===a?c=(i-r)/h+(i<r)*6:i===a?c=(r-t)/h+2:c=(t-i)/h+4,h/=d<.5?a+o:2-a-o,c*=60):h=d>0&&d<1?0:c,new ln(c,h,d,e.opacity)}function EN(e,t,i,r){return arguments.length===1?bx(e):new ln(e,t,i,r??1)}function ln(e,t,i,r){this.h=+e,this.s=+t,this.l=+i,this.opacity=+r}Xg(ln,EN,Sx(Da,{brighter(e){return e=e==null?$u:Math.pow($u,e),new ln(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pa:Math.pow(pa,e),new ln(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,i=this.l,r=i+(i<.5?i:1-i)*t,o=2*i-r;return new bi(rp(e>=240?e-240:e+120,o,r),rp(e,o,r),rp(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new ln(S1(this.h),gu(this.s),gu(this.l),Yu(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=Yu(this.opacity);return`${e===1?"hsl(":"hsla("}${S1(this.h)}, ${gu(this.s)*100}%, ${gu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function S1(e){return e=(e||0)%360,e<0?e+360:e}function gu(e){return Math.max(0,Math.min(1,e||0))}function rp(e,t,i){return(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)*255}const Kg=e=>()=>e;function kN(e,t){return function(i){return e+i*t}}function MN(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(r){return Math.pow(e+r*t,i)}}function TN(e){return(e=+e)==1?xx:function(t,i){return i-t?MN(t,i,e):Kg(isNaN(t)?i:t)}}function xx(e,t){var i=t-e;return i?kN(e,i):Kg(isNaN(e)?t:e)}const Wu=(function e(t){var i=TN(t);function r(o,a){var c=i((o=pg(o)).r,(a=pg(a)).r),h=i(o.g,a.g),d=i(o.b,a.b),f=xx(o.opacity,a.opacity);return function(m){return o.r=c(m),o.g=h(m),o.b=d(m),o.opacity=f(m),o+""}}return r.gamma=e,r})(1);function NN(e,t){t||(t=[]);var i=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(a){for(o=0;o<i;++o)r[o]=e[o]*(1-a)+t[o]*a;return r}}function AN(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function DN(e,t){var i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),a=new Array(i),c;for(c=0;c<r;++c)o[c]=sa(e[c],t[c]);for(;c<i;++c)a[c]=t[c];return function(h){for(c=0;c<r;++c)a[c]=o[c](h);return a}}function RN(e,t){var i=new Date;return e=+e,t=+t,function(r){return i.setTime(e*(1-r)+t*r),i}}function bn(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}function BN(e,t){var i={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?i[o]=sa(e[o],t[o]):r[o]=t[o];return function(a){for(o in i)r[o]=i[o](a);return r}}var gg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sp=new RegExp(gg.source,"g");function LN(e){return function(){return e}}function zN(e){return function(t){return e(t)+""}}function wx(e,t){var i=gg.lastIndex=sp.lastIndex=0,r,o,a,c=-1,h=[],d=[];for(e=e+"",t=t+"";(r=gg.exec(e))&&(o=sp.exec(t));)(a=o.index)>i&&(a=t.slice(i,a),h[c]?h[c]+=a:h[++c]=a),(r=r[0])===(o=o[0])?h[c]?h[c]+=o:h[++c]=o:(h[++c]=null,d.push({i:c,x:bn(r,o)})),i=sp.lastIndex;return i<t.length&&(a=t.slice(i),h[c]?h[c]+=a:h[++c]=a),h.length<2?d[0]?zN(d[0].x):LN(t):(t=d.length,function(f){for(var m=0,g;m<t;++m)h[(g=d[m]).i]=g.x(f);return h.join("")})}function sa(e,t){var i=typeof t,r;return t==null||i==="boolean"?Kg(t):(i==="number"?bn:i==="string"?(r=Ts(t))?(t=r,Wu):wx:t instanceof Ts?Wu:t instanceof Date?RN:AN(t)?NN:Array.isArray(t)?DN:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?BN:bn)(e,t)}var b1=180/Math.PI,mg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Cx(e,t,i,r,o,a){var c,h,d;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(d=e*i+t*r)&&(i-=e*d,r-=t*d),(h=Math.sqrt(i*i+r*r))&&(i/=h,r/=h,d/=h),e*r<t*i&&(e=-e,t=-t,d=-d,c=-c),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*b1,skewX:Math.atan(d)*b1,scaleX:c,scaleY:h}}var mu;function ON(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?mg:Cx(t.a,t.b,t.c,t.d,t.e,t.f)}function HN(e){return e==null||(mu||(mu=document.createElementNS("http://www.w3.org/2000/svg","g")),mu.setAttribute("transform",e),!(e=mu.transform.baseVal.consolidate()))?mg:(e=e.matrix,Cx(e.a,e.b,e.c,e.d,e.e,e.f))}function Ex(e,t,i,r){function o(f){return f.length?f.pop()+" ":""}function a(f,m,g,v,y,S){if(f!==g||m!==v){var b=y.push("translate(",null,t,null,i);S.push({i:b-4,x:bn(f,g)},{i:b-2,x:bn(m,v)})}else(g||v)&&y.push("translate("+g+t+v+i)}function c(f,m,g,v){f!==m?(f-m>180?m+=360:m-f>180&&(f+=360),v.push({i:g.push(o(g)+"rotate(",null,r)-2,x:bn(f,m)})):m&&g.push(o(g)+"rotate("+m+r)}function h(f,m,g,v){f!==m?v.push({i:g.push(o(g)+"skewX(",null,r)-2,x:bn(f,m)}):m&&g.push(o(g)+"skewX("+m+r)}function d(f,m,g,v,y,S){if(f!==g||m!==v){var b=y.push(o(y)+"scale(",null,",",null,")");S.push({i:b-4,x:bn(f,g)},{i:b-2,x:bn(m,v)})}else(g!==1||v!==1)&&y.push(o(y)+"scale("+g+","+v+")")}return function(f,m){var g=[],v=[];return f=e(f),m=e(m),a(f.translateX,f.translateY,m.translateX,m.translateY,g,v),c(f.rotate,m.rotate,g,v),h(f.skewX,m.skewX,g,v),d(f.scaleX,f.scaleY,m.scaleX,m.scaleY,g,v),f=m=null,function(y){for(var S=-1,b=v.length,k;++S<b;)g[(k=v[S]).i]=k.x(y);return g.join("")}}}var jN=Ex(ON,"px, ","px)","deg)"),PN=Ex(HN,", ",")",")"),IN=1e-12;function x1(e){return((e=Math.exp(e))+1/e)/2}function UN(e){return((e=Math.exp(e))-1/e)/2}function qN(e){return((e=Math.exp(2*e))-1)/(e+1)}const Bu=(function e(t,i,r){function o(a,c){var h=a[0],d=a[1],f=a[2],m=c[0],g=c[1],v=c[2],y=m-h,S=g-d,b=y*y+S*S,k,C;if(b<IN)C=Math.log(v/f)/t,k=function(U){return[h+U*y,d+U*S,f*Math.exp(t*U*C)]};else{var z=Math.sqrt(b),E=(v*v-f*f+r*b)/(2*f*i*z),T=(v*v-f*f-r*b)/(2*v*i*z),P=Math.log(Math.sqrt(E*E+1)-E),R=Math.log(Math.sqrt(T*T+1)-T);C=(R-P)/t,k=function(U){var X=U*C,G=x1(P),ne=f/(i*z)*(G*qN(t*X+P)-UN(P));return[h+ne*y,d+ne*S,f*G/x1(t*X+P)]}}return k.duration=C*1e3*t/Math.SQRT2,k}return o.rho=function(a){var c=Math.max(.001,+a),h=c*c,d=h*h;return e(c,h,d)},o})(Math.SQRT2,2,4);var Lo=0,ia=0,$l=0,kx=1e3,Xu,na,Ku=0,Ns=0,uh=0,ma=typeof performance=="object"&&performance.now?performance:Date,Mx=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Gg(){return Ns||(Mx(VN),Ns=ma.now()+uh)}function VN(){Ns=0}function Gu(){this._call=this._time=this._next=null}Gu.prototype=Tx.prototype={constructor:Gu,restart:function(e,t,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Gg():+i)+(t==null?0:+t),!this._next&&na!==this&&(na?na._next=this:Xu=this,na=this),this._call=e,this._time=i,_g()},stop:function(){this._call&&(this._call=null,this._time=1/0,_g())}};function Tx(e,t,i){var r=new Gu;return r.restart(e,t,i),r}function FN(){Gg(),++Lo;for(var e=Xu,t;e;)(t=Ns-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Lo}function w1(){Ns=(Ku=ma.now())+uh,Lo=ia=0;try{FN()}finally{Lo=0,YN(),Ns=0}}function $N(){var e=ma.now(),t=e-Ku;t>kx&&(uh-=t,Ku=e)}function YN(){for(var e,t=Xu,i,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(i=t._next,t._next=null,t=e?e._next=i:Xu=i);na=e,_g(r)}function _g(e){if(!Lo){ia&&(ia=clearTimeout(ia));var t=e-Ns;t>24?(e<1/0&&(ia=setTimeout(w1,e-ma.now()-uh)),$l&&($l=clearInterval($l))):($l||(Ku=ma.now(),$l=setInterval($N,kx)),Lo=1,Mx(w1))}}function C1(e,t,i){var r=new Gu;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,i),r}var WN=ah("start","end","cancel","interrupt"),XN=[],Nx=0,E1=1,vg=2,Lu=3,k1=4,yg=5,zu=6;function hh(e,t,i,r,o,a){var c=e.__transition;if(!c)e.__transition={};else if(i in c)return;KN(e,i,{name:t,index:r,group:o,on:WN,tween:XN,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Nx})}function Zg(e,t){var i=un(e,t);if(i.state>Nx)throw new Error("too late; already scheduled");return i}function Nn(e,t){var i=un(e,t);if(i.state>Lu)throw new Error("too late; already running");return i}function un(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function KN(e,t,i){var r=e.__transition,o;r[t]=i,i.timer=Tx(a,0,i.time);function a(f){i.state=E1,i.timer.restart(c,i.delay,i.time),i.delay<=f&&c(f-i.delay)}function c(f){var m,g,v,y;if(i.state!==E1)return d();for(m in r)if(y=r[m],y.name===i.name){if(y.state===Lu)return C1(c);y.state===k1?(y.state=zu,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[m]):+m<t&&(y.state=zu,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[m])}if(C1(function(){i.state===Lu&&(i.state=k1,i.timer.restart(h,i.delay,i.time),h(f))}),i.state=vg,i.on.call("start",e,e.__data__,i.index,i.group),i.state===vg){for(i.state=Lu,o=new Array(v=i.tween.length),m=0,g=-1;m<v;++m)(y=i.tween[m].value.call(e,e.__data__,i.index,i.group))&&(o[++g]=y);o.length=g+1}}function h(f){for(var m=f<i.duration?i.ease.call(null,f/i.duration):(i.timer.restart(d),i.state=yg,1),g=-1,v=o.length;++g<v;)o[g].call(e,m);i.state===yg&&(i.on.call("end",e,e.__data__,i.index,i.group),d())}function d(){i.state=zu,i.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Ou(e,t){var i=e.__transition,r,o,a=!0,c;if(i){t=t==null?null:t+"";for(c in i){if((r=i[c]).name!==t){a=!1;continue}o=r.state>vg&&r.state<yg,r.state=zu,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete i[c]}a&&delete e.__transition}}function GN(e){return this.each(function(){Ou(this,e)})}function ZN(e,t){var i,r;return function(){var o=Nn(this,e),a=o.tween;if(a!==i){r=i=a;for(var c=0,h=r.length;c<h;++c)if(r[c].name===t){r=r.slice(),r.splice(c,1);break}}o.tween=r}}function QN(e,t,i){var r,o;if(typeof i!="function")throw new Error;return function(){var a=Nn(this,e),c=a.tween;if(c!==r){o=(r=c).slice();for(var h={name:t,value:i},d=0,f=o.length;d<f;++d)if(o[d].name===t){o[d]=h;break}d===f&&o.push(h)}a.tween=o}}function JN(e,t){var i=this._id;if(e+="",arguments.length<2){for(var r=un(this.node(),i).tween,o=0,a=r.length,c;o<a;++o)if((c=r[o]).name===e)return c.value;return null}return this.each((t==null?ZN:QN)(i,e,t))}function Qg(e,t,i){var r=e._id;return e.each(function(){var o=Nn(this,r);(o.value||(o.value={}))[t]=i.apply(this,arguments)}),function(o){return un(o,r).value[t]}}function Ax(e,t){var i;return(typeof t=="number"?bn:t instanceof Ts?Wu:(i=Ts(t))?(t=i,Wu):wx)(e,t)}function eA(e){return function(){this.removeAttribute(e)}}function tA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function iA(e,t,i){var r,o=i+"",a;return function(){var c=this.getAttribute(e);return c===o?null:c===r?a:a=t(r=c,i)}}function nA(e,t,i){var r,o=i+"",a;return function(){var c=this.getAttributeNS(e.space,e.local);return c===o?null:c===r?a:a=t(r=c,i)}}function rA(e,t,i){var r,o,a;return function(){var c,h=i(this),d;return h==null?void this.removeAttribute(e):(c=this.getAttribute(e),d=h+"",c===d?null:c===r&&d===o?a:(o=d,a=t(r=c,h)))}}function sA(e,t,i){var r,o,a;return function(){var c,h=i(this),d;return h==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),d=h+"",c===d?null:c===r&&d===o?a:(o=d,a=t(r=c,h)))}}function oA(e,t){var i=ch(e),r=i==="transform"?PN:Ax;return this.attrTween(e,typeof t=="function"?(i.local?sA:rA)(i,r,Qg(this,"attr."+e,t)):t==null?(i.local?tA:eA)(i):(i.local?nA:iA)(i,r,t))}function lA(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}function aA(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}function cA(e,t){var i,r;function o(){var a=t.apply(this,arguments);return a!==r&&(i=(r=a)&&aA(e,a)),i}return o._value=t,o}function uA(e,t){var i,r;function o(){var a=t.apply(this,arguments);return a!==r&&(i=(r=a)&&lA(e,a)),i}return o._value=t,o}function hA(e,t){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;var r=ch(e);return this.tween(i,(r.local?cA:uA)(r,t))}function fA(e,t){return function(){Zg(this,e).delay=+t.apply(this,arguments)}}function dA(e,t){return t=+t,function(){Zg(this,e).delay=t}}function pA(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fA:dA)(t,e)):un(this.node(),t).delay}function gA(e,t){return function(){Nn(this,e).duration=+t.apply(this,arguments)}}function mA(e,t){return t=+t,function(){Nn(this,e).duration=t}}function _A(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gA:mA)(t,e)):un(this.node(),t).duration}function vA(e,t){if(typeof t!="function")throw new Error;return function(){Nn(this,e).ease=t}}function yA(e){var t=this._id;return arguments.length?this.each(vA(t,e)):un(this.node(),t).ease}function SA(e,t){return function(){var i=t.apply(this,arguments);if(typeof i!="function")throw new Error;Nn(this,e).ease=i}}function bA(e){if(typeof e!="function")throw new Error;return this.each(SA(this._id,e))}function xA(e){typeof e!="function"&&(e=lx(e));for(var t=this._groups,i=t.length,r=new Array(i),o=0;o<i;++o)for(var a=t[o],c=a.length,h=r[o]=[],d,f=0;f<c;++f)(d=a[f])&&e.call(d,d.__data__,f,a)&&h.push(d);return new rr(r,this._parents,this._name,this._id)}function wA(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,r=t.length,o=i.length,a=Math.min(r,o),c=new Array(r),h=0;h<a;++h)for(var d=t[h],f=i[h],m=d.length,g=c[h]=new Array(m),v,y=0;y<m;++y)(v=d[y]||f[y])&&(g[y]=v);for(;h<r;++h)c[h]=t[h];return new rr(c,this._parents,this._name,this._id)}function CA(e){return(e+"").trim().split(/^|\s+/).every(function(t){var i=t.indexOf(".");return i>=0&&(t=t.slice(0,i)),!t||t==="start"})}function EA(e,t,i){var r,o,a=CA(t)?Zg:Nn;return function(){var c=a(this,e),h=c.on;h!==r&&(o=(r=h).copy()).on(t,i),c.on=o}}function kA(e,t){var i=this._id;return arguments.length<2?un(this.node(),i).on.on(e):this.each(EA(i,e,t))}function MA(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}function TA(){return this.on("end.remove",MA(this._id))}function NA(e){var t=this._name,i=this._id;typeof e!="function"&&(e=Yg(e));for(var r=this._groups,o=r.length,a=new Array(o),c=0;c<o;++c)for(var h=r[c],d=h.length,f=a[c]=new Array(d),m,g,v=0;v<d;++v)(m=h[v])&&(g=e.call(m,m.__data__,v,h))&&("__data__"in m&&(g.__data__=m.__data__),f[v]=g,hh(f[v],t,i,v,f,un(m,i)));return new rr(a,this._parents,t,i)}function AA(e){var t=this._name,i=this._id;typeof e!="function"&&(e=ox(e));for(var r=this._groups,o=r.length,a=[],c=[],h=0;h<o;++h)for(var d=r[h],f=d.length,m,g=0;g<f;++g)if(m=d[g]){for(var v=e.call(m,m.__data__,g,d),y,S=un(m,i),b=0,k=v.length;b<k;++b)(y=v[b])&&hh(y,t,i,b,v,S);a.push(v),c.push(m)}return new rr(a,c,t,i)}var DA=Aa.prototype.constructor;function RA(){return new DA(this._groups,this._parents)}function BA(e,t){var i,r,o;return function(){var a=Bo(this,e),c=(this.style.removeProperty(e),Bo(this,e));return a===c?null:a===i&&c===r?o:o=t(i=a,r=c)}}function Dx(e){return function(){this.style.removeProperty(e)}}function LA(e,t,i){var r,o=i+"",a;return function(){var c=Bo(this,e);return c===o?null:c===r?a:a=t(r=c,i)}}function zA(e,t,i){var r,o,a;return function(){var c=Bo(this,e),h=i(this),d=h+"";return h==null&&(d=h=(this.style.removeProperty(e),Bo(this,e))),c===d?null:c===r&&d===o?a:(o=d,a=t(r=c,h))}}function OA(e,t){var i,r,o,a="style."+t,c="end."+a,h;return function(){var d=Nn(this,e),f=d.on,m=d.value[a]==null?h||(h=Dx(t)):void 0;(f!==i||o!==m)&&(r=(i=f).copy()).on(c,o=m),d.on=r}}function HA(e,t,i){var r=(e+="")=="transform"?jN:Ax;return t==null?this.styleTween(e,BA(e,r)).on("end.style."+e,Dx(e)):typeof t=="function"?this.styleTween(e,zA(e,r,Qg(this,"style."+e,t))).each(OA(this._id,e)):this.styleTween(e,LA(e,r,t),i).on("end.style."+e,null)}function jA(e,t,i){return function(r){this.style.setProperty(e,t.call(this,r),i)}}function PA(e,t,i){var r,o;function a(){var c=t.apply(this,arguments);return c!==o&&(r=(o=c)&&jA(e,c,i)),r}return a._value=t,a}function IA(e,t,i){var r="style."+(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;return this.tween(r,PA(e,t,i??""))}function UA(e){return function(){this.textContent=e}}function qA(e){return function(){var t=e(this);this.textContent=t??""}}function VA(e){return this.tween("text",typeof e=="function"?qA(Qg(this,"text",e)):UA(e==null?"":e+""))}function FA(e){return function(t){this.textContent=e.call(this,t)}}function $A(e){var t,i;function r(){var o=e.apply(this,arguments);return o!==i&&(t=(i=o)&&FA(o)),t}return r._value=e,r}function YA(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,$A(e))}function WA(){for(var e=this._name,t=this._id,i=Rx(),r=this._groups,o=r.length,a=0;a<o;++a)for(var c=r[a],h=c.length,d,f=0;f<h;++f)if(d=c[f]){var m=un(d,t);hh(d,e,i,f,c,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new rr(r,this._parents,e,i)}function XA(){var e,t,i=this,r=i._id,o=i.size();return new Promise(function(a,c){var h={value:c},d={value:function(){--o===0&&a()}};i.each(function(){var f=Nn(this,r),m=f.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(h),t._.interrupt.push(h),t._.end.push(d)),f.on=t}),o===0&&a()})}var KA=0;function rr(e,t,i,r){this._groups=e,this._parents=t,this._name=i,this._id=r}function Rx(){return++KA}var er=Aa.prototype;rr.prototype={constructor:rr,select:NA,selectAll:AA,selectChild:er.selectChild,selectChildren:er.selectChildren,filter:xA,merge:wA,selection:RA,transition:WA,call:er.call,nodes:er.nodes,node:er.node,size:er.size,empty:er.empty,each:er.each,on:kA,attr:oA,attrTween:hA,style:HA,styleTween:IA,text:VA,textTween:YA,remove:TA,tween:JN,delay:pA,duration:_A,ease:yA,easeVarying:bA,end:XA,[Symbol.iterator]:er[Symbol.iterator]};function GA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ZA={time:null,delay:0,duration:250,ease:GA};function QA(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}function JA(e){var t,i;e instanceof rr?(t=e._id,e=e._name):(t=Rx(),(i=ZA).time=Gg(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,a=0;a<o;++a)for(var c=r[a],h=c.length,d,f=0;f<h;++f)(d=c[f])&&hh(d,e,t,f,c,i||QA(d,t));return new rr(r,this._parents,e,t)}Aa.prototype.interrupt=GN;Aa.prototype.transition=JA;const _u=e=>()=>e;function eD(e,{sourceEvent:t,target:i,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function ir(e,t,i){this.k=e,this.x=t,this.y=i}ir.prototype={constructor:ir,scale:function(e){return e===1?this:new ir(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ir(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 fh=new ir(1,0,0);Bx.prototype=ir.prototype;function Bx(e){for(;!e.__zoom;)if(!(e=e.parentNode))return fh;return e.__zoom}function op(e){e.stopImmediatePropagation()}function Yl(e){e.preventDefault(),e.stopImmediatePropagation()}function tD(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function iD(){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 M1(){return this.__zoom||fh}function nD(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rD(){return navigator.maxTouchPoints||"ontouchstart"in this}function sD(e,t,i){var r=e.invertX(t[0][0])-i[0][0],o=e.invertX(t[1][0])-i[1][0],a=e.invertY(t[0][1])-i[0][1],c=e.invertY(t[1][1])-i[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),c>a?(a+c)/2:Math.min(0,a)||Math.max(0,c))}function Lx(){var e=tD,t=iD,i=sD,r=nD,o=rD,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],h=250,d=Bu,f=ah("start","zoom","end"),m,g,v,y=500,S=150,b=0,k=10;function C(B){B.property("__zoom",M1).on("wheel.zoom",X,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",ne).filter(o).on("touchstart.zoom",V).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(B,O,M,j){var H=B.selection?B.selection():B;H.property("__zoom",M1),B!==H?P(B,O,M,j):H.interrupt().each(function(){R(this,arguments).event(j).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},C.scaleBy=function(B,O,M,j){C.scaleTo(B,function(){var H=this.__zoom.k,$=typeof O=="function"?O.apply(this,arguments):O;return H*$},M,j)},C.scaleTo=function(B,O,M,j){C.transform(B,function(){var H=t.apply(this,arguments),$=this.__zoom,N=M==null?T(H):typeof M=="function"?M.apply(this,arguments):M,L=$.invert(N),Y=typeof O=="function"?O.apply(this,arguments):O;return i(E(z($,Y),N,L),H,c)},M,j)},C.translateBy=function(B,O,M,j){C.transform(B,function(){return i(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),c)},null,j)},C.translateTo=function(B,O,M,j,H){C.transform(B,function(){var $=t.apply(this,arguments),N=this.__zoom,L=j==null?T($):typeof j=="function"?j.apply(this,arguments):j;return i(fh.translate(L[0],L[1]).scale(N.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof M=="function"?-M.apply(this,arguments):-M),$,c)},j,H)};function z(B,O){return O=Math.max(a[0],Math.min(a[1],O)),O===B.k?B:new ir(O,B.x,B.y)}function E(B,O,M){var j=O[0]-M[0]*B.k,H=O[1]-M[1]*B.k;return j===B.x&&H===B.y?B:new ir(B.k,j,H)}function T(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function P(B,O,M,j){B.on("start.zoom",function(){R(this,arguments).event(j).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(j).end()}).tween("zoom",function(){var H=this,$=arguments,N=R(H,$).event(j),L=t.apply(H,$),Y=M==null?T(L):typeof M=="function"?M.apply(H,$):M,A=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),ee=H.__zoom,ce=typeof O=="function"?O.apply(H,$):O,le=d(ee.invert(Y).concat(A/ee.k),ce.invert(Y).concat(A/ce.k));return function(fe){if(fe===1)fe=ce;else{var he=le(fe),pe=A/he[2];fe=new ir(pe,Y[0]-he[0]*pe,Y[1]-he[1]*pe)}N.zoom(null,fe)}})}function R(B,O,M){return!M&&B.__zooming||new U(B,O)}function U(B,O){this.that=B,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(B,O),this.taps=0}U.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,O){return this.mouse&&B!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var O=Oi(this.that).datum();f.call(B,this.that,new eD(B,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:f}),O)}};function X(B,...O){if(!e.apply(this,arguments))return;var M=R(this,O).event(B),j=this.__zoom,H=Math.max(a[0],Math.min(a[1],j.k*Math.pow(2,r.apply(this,arguments)))),$=on(B);if(M.wheel)(M.mouse[0][0]!==$[0]||M.mouse[0][1]!==$[1])&&(M.mouse[1]=j.invert(M.mouse[0]=$)),clearTimeout(M.wheel);else{if(j.k===H)return;M.mouse=[$,j.invert($)],Ou(this),M.start()}Yl(B),M.wheel=setTimeout(N,S),M.zoom("mouse",i(E(z(j,H),M.mouse[0],M.mouse[1]),M.extent,c));function N(){M.wheel=null,M.end()}}function G(B,...O){if(v||!e.apply(this,arguments))return;var M=B.currentTarget,j=R(this,O,!0).event(B),H=Oi(B.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",A,!0),$=on(B,M),N=B.clientX,L=B.clientY;_x(B.view),op(B),j.mouse=[$,this.__zoom.invert($)],Ou(this),j.start();function Y(ee){if(Yl(ee),!j.moved){var ce=ee.clientX-N,le=ee.clientY-L;j.moved=ce*ce+le*le>b}j.event(ee).zoom("mouse",i(E(j.that.__zoom,j.mouse[0]=on(ee,M),j.mouse[1]),j.extent,c))}function A(ee){H.on("mousemove.zoom mouseup.zoom",null),vx(ee.view,j.moved),Yl(ee),j.event(ee).end()}}function ne(B,...O){if(e.apply(this,arguments)){var M=this.__zoom,j=on(B.changedTouches?B.changedTouches[0]:B,this),H=M.invert(j),$=M.k*(B.shiftKey?.5:2),N=i(E(z(M,$),j,H),t.apply(this,O),c);Yl(B),h>0?Oi(this).transition().duration(h).call(P,N,j,B):Oi(this).call(C.transform,N,j,B)}}function V(B,...O){if(e.apply(this,arguments)){var M=B.touches,j=M.length,H=R(this,O,B.changedTouches.length===j).event(B),$,N,L,Y;for(op(B),N=0;N<j;++N)L=M[N],Y=on(L,this),Y=[Y,this.__zoom.invert(Y),L.identifier],H.touch0?!H.touch1&&H.touch0[2]!==Y[2]&&(H.touch1=Y,H.taps=0):(H.touch0=Y,$=!0,H.taps=1+!!m);m&&(m=clearTimeout(m)),$&&(H.taps<2&&(g=Y[0],m=setTimeout(function(){m=null},y)),Ou(this),H.start())}}function I(B,...O){if(this.__zooming){var M=R(this,O).event(B),j=B.changedTouches,H=j.length,$,N,L,Y;for(Yl(B),$=0;$<H;++$)N=j[$],L=on(N,this),M.touch0&&M.touch0[2]===N.identifier?M.touch0[0]=L:M.touch1&&M.touch1[2]===N.identifier&&(M.touch1[0]=L);if(N=M.that.__zoom,M.touch1){var A=M.touch0[0],ee=M.touch0[1],ce=M.touch1[0],le=M.touch1[1],fe=(fe=ce[0]-A[0])*fe+(fe=ce[1]-A[1])*fe,he=(he=le[0]-ee[0])*he+(he=le[1]-ee[1])*he;N=z(N,Math.sqrt(fe/he)),L=[(A[0]+ce[0])/2,(A[1]+ce[1])/2],Y=[(ee[0]+le[0])/2,(ee[1]+le[1])/2]}else if(M.touch0)L=M.touch0[0],Y=M.touch0[1];else return;M.zoom("touch",i(E(N,L,Y),M.extent,c))}}function F(B,...O){if(this.__zooming){var M=R(this,O).event(B),j=B.changedTouches,H=j.length,$,N;for(op(B),v&&clearTimeout(v),v=setTimeout(function(){v=null},y),$=0;$<H;++$)N=j[$],M.touch0&&M.touch0[2]===N.identifier?delete M.touch0:M.touch1&&M.touch1[2]===N.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(N=on(N,this),Math.hypot(g[0]-N[0],g[1]-N[1])<k)){var L=Oi(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return C.wheelDelta=function(B){return arguments.length?(r=typeof B=="function"?B:_u(+B),C):r},C.filter=function(B){return arguments.length?(e=typeof B=="function"?B:_u(!!B),C):e},C.touchable=function(B){return arguments.length?(o=typeof B=="function"?B:_u(!!B),C):o},C.extent=function(B){return arguments.length?(t=typeof B=="function"?B:_u([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),C):t},C.scaleExtent=function(B){return arguments.length?(a[0]=+B[0],a[1]=+B[1],C):[a[0],a[1]]},C.translateExtent=function(B){return arguments.length?(c[0][0]=+B[0][0],c[1][0]=+B[1][0],c[0][1]=+B[0][1],c[1][1]=+B[1][1],C):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},C.constrain=function(B){return arguments.length?(i=B,C):i},C.duration=function(B){return arguments.length?(h=+B,C):h},C.interpolate=function(B){return arguments.length?(d=B,C):d},C.on=function(){var B=f.on.apply(f,arguments);return B===f?C:B},C.clickDistance=function(B){return arguments.length?(b=(B=+B)*B,C):Math.sqrt(b)},C.tapDistance=function(B){return arguments.length?(k=+B,C):k},C}const Mn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.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 React Flow 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:i,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:r}", 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."},_a=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],zx=["Enter"," ","Escape"],Ox={"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:i})=>`Moved selected node ${e}. New position, x: ${t}, y: ${i}`,"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 zo;(function(e){e.Strict="strict",e.Loose="loose"})(zo||(zo={}));var Es;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Es||(Es={}));var va;(function(e){e.Partial="partial",e.Full="full"})(va||(va={}));const Hx={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var $r;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})($r||($r={}));var ya;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ya||(ya={}));var we;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(we||(we={}));const T1={[we.Left]:we.Right,[we.Right]:we.Left,[we.Top]:we.Bottom,[we.Bottom]:we.Top};function jx(e){return e===null?null:e?"valid":"invalid"}const Px=e=>"id"in e&&"source"in e&&"target"in e,oD=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Jg=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ra=(e,t=[0,0])=>{const{width:i,height:r}=lr(e),o=e.origin??t,a=i*o[0],c=r*o[1];return{x:e.position.x-a,y:e.position.y-c}},lD=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((r,o)=>{const a=typeof o=="string";let c=!t.nodeLookup&&!a?o:void 0;t.nodeLookup&&(c=a?t.nodeLookup.get(o):Jg(o)?o:t.nodeLookup.get(o.id));const h=c?Zu(c,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return dh(r,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ph(i)},Ba=(e,t={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(i=dh(i,Zu(o)),r=!0)}),r?ph(i):{x:0,y:0,width:0,height:0}},em=(e,t,[i,r,o]=[0,0,1],a=!1,c=!1)=>{const h={...za(t,[i,r,o]),width:t.width/o,height:t.height/o},d=[];for(const f of e.values()){const{measured:m,selectable:g=!0,hidden:v=!1}=f;if(c&&!g||v)continue;const y=m.width??f.width??f.initialWidth??null,S=m.height??f.height??f.initialHeight??null,b=Sa(h,Ho(f)),k=(y??0)*(S??0),C=a&&b>0;(!f.internals.handleBounds||C||b>=k||f.dragging)&&d.push(f)}return d},aD=(e,t)=>{const i=new Set;return e.forEach(r=>{i.add(r.id)}),t.filter(r=>i.has(r.source)||i.has(r.target))};function cD(e,t){const i=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&i.set(o.id,o)}),i}async function uD({nodes:e,width:t,height:i,panZoom:r,minZoom:o,maxZoom:a},c){if(e.size===0)return Promise.resolve(!0);const h=cD(e,c),d=Ba(h),f=tm(d,t,i,(c==null?void 0:c.minZoom)??o,(c==null?void 0:c.maxZoom)??a,(c==null?void 0:c.padding)??.1);return await r.setViewport(f,{duration:c==null?void 0:c.duration,ease:c==null?void 0:c.ease,interpolate:c==null?void 0:c.interpolate}),Promise.resolve(!0)}function Ix({nodeId:e,nextPosition:t,nodeLookup:i,nodeOrigin:r=[0,0],nodeExtent:o,onError:a}){const c=i.get(e),h=c.parentId?i.get(c.parentId):void 0,{x:d,y:f}=h?h.internals.positionAbsolute:{x:0,y:0},m=c.origin??r;let g=c.extent||o;if(c.extent==="parent"&&!c.expandParent)if(!h)a==null||a("005",Mn.error005());else{const y=h.measured.width,S=h.measured.height;y&&S&&(g=[[d,f],[d+y,f+S]])}else h&&jo(c.extent)&&(g=[[c.extent[0][0]+d,c.extent[0][1]+f],[c.extent[1][0]+d,c.extent[1][1]+f]]);const v=jo(g)?As(t,g,c.measured):t;return(c.measured.width===void 0||c.measured.height===void 0)&&(a==null||a("015",Mn.error015())),{position:{x:v.x-d+(c.measured.width??0)*m[0],y:v.y-f+(c.measured.height??0)*m[1]},positionAbsolute:v}}async function hD({nodesToRemove:e=[],edgesToRemove:t=[],nodes:i,edges:r,onBeforeDelete:o}){const a=new Set(e.map(v=>v.id)),c=[];for(const v of i){if(v.deletable===!1)continue;const y=a.has(v.id),S=!y&&v.parentId&&c.find(b=>b.id===v.parentId);(y||S)&&c.push(v)}const h=new Set(t.map(v=>v.id)),d=r.filter(v=>v.deletable!==!1),m=aD(c,d);for(const v of d)h.has(v.id)&&!m.find(S=>S.id===v.id)&&m.push(v);if(!o)return{edges:m,nodes:c};const g=await o({nodes:c,edges:m});return typeof g=="boolean"?g?{edges:m,nodes:c}:{edges:[],nodes:[]}:g}const Oo=(e,t=0,i=1)=>Math.min(Math.max(e,t),i),As=(e={x:0,y:0},t,i)=>({x:Oo(e.x,t[0][0],t[1][0]-((i==null?void 0:i.width)??0)),y:Oo(e.y,t[0][1],t[1][1]-((i==null?void 0:i.height)??0))});function Ux(e,t,i){const{width:r,height:o}=lr(i),{x:a,y:c}=i.internals.positionAbsolute;return As(e,[[a,c],[a+r,c+o]],t)}const N1=(e,t,i)=>e<t?Oo(Math.abs(e-t),1,t)/t:e>i?-Oo(Math.abs(e-i),1,t)/t:0,qx=(e,t,i=15,r=40)=>{const o=N1(e.x,r,t.width-r)*i,a=N1(e.y,r,t.height-r)*i;return[o,a]},dh=(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)}),Sg=({x:e,y:t,width:i,height:r})=>({x:e,y:t,x2:e+i,y2:t+r}),ph=({x:e,y:t,x2:i,y2:r})=>({x:e,y:t,width:i-e,height:r-t}),Ho=(e,t=[0,0])=>{var o,a;const{x:i,y:r}=Jg(e)?e.internals.positionAbsolute:Ra(e,t);return{x:i,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},Zu=(e,t=[0,0])=>{var o,a;const{x:i,y:r}=Jg(e)?e.internals.positionAbsolute:Ra(e,t);return{x:i,y:r,x2:i+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},Vx=(e,t)=>ph(dh(Sg(e),Sg(t))),Sa=(e,t)=>{const i=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(i*r)},A1=e=>an(e.width)&&an(e.height)&&an(e.x)&&an(e.y),an=e=>!isNaN(e)&&isFinite(e),fD=(e,t)=>{},La=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),za=({x:e,y:t},[i,r,o],a=!1,c=[1,1])=>{const h={x:(e-i)/o,y:(t-r)/o};return a?La(h,c):h},Qu=({x:e,y:t},[i,r,o])=>({x:e*o+i,y:t*o+r});function xo(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(t*i*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function dD(e,t,i){if(typeof e=="string"||typeof e=="number"){const r=xo(e,i),o=xo(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=xo(e.top??e.y??0,i),o=xo(e.bottom??e.y??0,i),a=xo(e.left??e.x??0,t),c=xo(e.right??e.x??0,t);return{top:r,right:c,bottom:o,left:a,x:a+c,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function pD(e,t,i,r,o,a){const{x:c,y:h}=Qu(e,[t,i,r]),{x:d,y:f}=Qu({x:e.x+e.width,y:e.y+e.height},[t,i,r]),m=o-d,g=a-f;return{left:Math.floor(c),top:Math.floor(h),right:Math.floor(m),bottom:Math.floor(g)}}const tm=(e,t,i,r,o,a)=>{const c=dD(a,t,i),h=(t-c.x)/e.width,d=(i-c.y)/e.height,f=Math.min(h,d),m=Oo(f,r,o),g=e.x+e.width/2,v=e.y+e.height/2,y=t/2-g*m,S=i/2-v*m,b=pD(e,y,S,m,t,i),k={left:Math.min(b.left-c.left,0),top:Math.min(b.top-c.top,0),right:Math.min(b.right-c.right,0),bottom:Math.min(b.bottom-c.bottom,0)};return{x:y-k.left+k.right,y:S-k.top+k.bottom,zoom:m}},ba=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function jo(e){return e!=null&&e!=="parent"}function lr(e){var t,i;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}}function Fx(e){var t,i;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight)!==void 0}function $x(e,t={width:0,height:0},i,r,o){const a={...e},c=r.get(i);if(c){const h=c.origin||o;a.x+=c.internals.positionAbsolute.x-(t.width??0)*h[0],a.y+=c.internals.positionAbsolute.y-(t.height??0)*h[1]}return a}function D1(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function gD(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function mD(e){return{...Ox,...e||{}}}function oa(e,{snapGrid:t=[0,0],snapToGrid:i=!1,transform:r,containerBounds:o}){const{x:a,y:c}=cn(e),h=za({x:a-((o==null?void 0:o.left)??0),y:c-((o==null?void 0:o.top)??0)},r),{x:d,y:f}=i?La(h,t):h;return{xSnapped:d,ySnapped:f,...h}}const im=e=>({width:e.offsetWidth,height:e.offsetHeight}),Yx=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},_D=["INPUT","SELECT","TEXTAREA"];function Wx(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:_D.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Xx=e=>"clientX"in e,cn=(e,t)=>{var a,c;const i=Xx(e),r=i?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,o=i?e.clientY:(c=e.touches)==null?void 0:c[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},R1=(e,t,i,r,o)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(c=>{const h=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:o,position:c.getAttribute("data-handlepos"),x:(h.left-i.left)/r,y:(h.top-i.top)/r,...im(c)}})};function Kx({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:a,targetControlX:c,targetControlY:h}){const d=e*.125+o*.375+c*.375+i*.125,f=t*.125+a*.375+h*.375+r*.125,m=Math.abs(d-e),g=Math.abs(f-t);return[d,f,m,g]}function vu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function B1({pos:e,x1:t,y1:i,x2:r,y2:o,c:a}){switch(e){case we.Left:return[t-vu(t-r,a),i];case we.Right:return[t+vu(r-t,a),i];case we.Top:return[t,i-vu(i-o,a)];case we.Bottom:return[t,i+vu(o-i,a)]}}function nm({sourceX:e,sourceY:t,sourcePosition:i=we.Bottom,targetX:r,targetY:o,targetPosition:a=we.Top,curvature:c=.25}){const[h,d]=B1({pos:i,x1:e,y1:t,x2:r,y2:o,c}),[f,m]=B1({pos:a,x1:r,y1:o,x2:e,y2:t,c}),[g,v,y,S]=Kx({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:h,sourceControlY:d,targetControlX:f,targetControlY:m});return[`M${e},${t} C${h},${d} ${f},${m} ${r},${o}`,g,v,y,S]}function Gx({sourceX:e,sourceY:t,targetX:i,targetY:r}){const o=Math.abs(i-e)/2,a=i<e?i+o:i-o,c=Math.abs(r-t)/2,h=r<t?r+c:r-c;return[a,h,o,c]}function vD({sourceNode:e,targetNode:t,selected:i=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:a="basic"}){if(a==="manual")return r;const c=o&&i?r+1e3:r,h=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return c+h}function yD({sourceNode:e,targetNode:t,width:i,height:r,transform:o}){const a=dh(Zu(e),Zu(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const c={x:-o[0]/o[2],y:-o[1]/o[2],width:i/o[2],height:r/o[2]};return Sa(c,ph(a))>0}const SD=({source:e,sourceHandle:t,target:i,targetHandle:r})=>`xy-edge__${e}${t||""}-${i}${r||""}`,bD=(e,t)=>t.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),xD=(e,t,i={})=>{if(!e.source||!e.target)return t;const r=i.getEdgeId||SD;let o;return Px(e)?o={...e}:o={...e,id:r(e)},bD(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Zx({sourceX:e,sourceY:t,targetX:i,targetY:r}){const[o,a,c,h]=Gx({sourceX:e,sourceY:t,targetX:i,targetY:r});return[`M ${e},${t}L ${i},${r}`,o,a,c,h]}const L1={[we.Left]:{x:-1,y:0},[we.Right]:{x:1,y:0},[we.Top]:{x:0,y:-1},[we.Bottom]:{x:0,y:1}},wD=({source:e,sourcePosition:t=we.Bottom,target:i})=>t===we.Left||t===we.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},z1=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function CD({source:e,sourcePosition:t=we.Bottom,target:i,targetPosition:r=we.Top,center:o,offset:a,stepPosition:c}){const h=L1[t],d=L1[r],f={x:e.x+h.x*a,y:e.y+h.y*a},m={x:i.x+d.x*a,y:i.y+d.y*a},g=wD({source:f,sourcePosition:t,target:m}),v=g.x!==0?"x":"y",y=g[v];let S=[],b,k;const C={x:0,y:0},z={x:0,y:0},[,,E,T]=Gx({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(h[v]*d[v]===-1){v==="x"?(b=o.x??f.x+(m.x-f.x)*c,k=o.y??(f.y+m.y)/2):(b=o.x??(f.x+m.x)/2,k=o.y??f.y+(m.y-f.y)*c);const R=[{x:b,y:f.y},{x:b,y:m.y}],U=[{x:f.x,y:k},{x:m.x,y:k}];h[v]===y?S=v==="x"?R:U:S=v==="x"?U:R}else{const R=[{x:f.x,y:m.y}],U=[{x:m.x,y:f.y}];if(v==="x"?S=h.x===y?U:R:S=h.y===y?R:U,t===r){const I=Math.abs(e[v]-i[v]);if(I<=a){const F=Math.min(a-1,a-I);h[v]===y?C[v]=(f[v]>e[v]?-1:1)*F:z[v]=(m[v]>i[v]?-1:1)*F}}if(t!==r){const I=v==="x"?"y":"x",F=h[v]===d[I],B=f[I]>m[I],O=f[I]<m[I];(h[v]===1&&(!F&&B||F&&O)||h[v]!==1&&(!F&&O||F&&B))&&(S=v==="x"?R:U)}const X={x:f.x+C.x,y:f.y+C.y},G={x:m.x+z.x,y:m.y+z.y},ne=Math.max(Math.abs(X.x-S[0].x),Math.abs(G.x-S[0].x)),V=Math.max(Math.abs(X.y-S[0].y),Math.abs(G.y-S[0].y));ne>=V?(b=(X.x+G.x)/2,k=S[0].y):(b=S[0].x,k=(X.y+G.y)/2)}return[[e,{x:f.x+C.x,y:f.y+C.y},...S,{x:m.x+z.x,y:m.y+z.y},i],b,k,E,T]}function ED(e,t,i,r){const o=Math.min(z1(e,t)/2,z1(t,i)/2,r),{x:a,y:c}=t;if(e.x===a&&a===i.x||e.y===c&&c===i.y)return`L${a} ${c}`;if(e.y===c){const f=e.x<i.x?-1:1,m=e.y<i.y?1:-1;return`L ${a+o*f},${c}Q ${a},${c} ${a},${c+o*m}`}const h=e.x<i.x?1:-1,d=e.y<i.y?-1:1;return`L ${a},${c+o*d}Q ${a},${c} ${a+o*h},${c}`}function bg({sourceX:e,sourceY:t,sourcePosition:i=we.Bottom,targetX:r,targetY:o,targetPosition:a=we.Top,borderRadius:c=5,centerX:h,centerY:d,offset:f=20,stepPosition:m=.5}){const[g,v,y,S,b]=CD({source:{x:e,y:t},sourcePosition:i,target:{x:r,y:o},targetPosition:a,center:{x:h,y:d},offset:f,stepPosition:m});return[g.reduce((C,z,E)=>{let T="";return E>0&&E<g.length-1?T=ED(g[E-1],z,g[E+1],c):T=`${E===0?"M":"L"}${z.x} ${z.y}`,C+=T,C},""),v,y,S,b]}function O1(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function kD(e){var g;const{sourceNode:t,targetNode:i}=e;if(!O1(t)||!O1(i))return null;const r=t.internals.handleBounds||H1(t.handles),o=i.internals.handleBounds||H1(i.handles),a=j1((r==null?void 0:r.source)??[],e.sourceHandle),c=j1(e.connectionMode===zo.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!a||!c)return(g=e.onError)==null||g.call(e,"008",Mn.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const h=(a==null?void 0:a.position)||we.Bottom,d=(c==null?void 0:c.position)||we.Top,f=Ds(t,a,h),m=Ds(i,c,d);return{sourceX:f.x,sourceY:f.y,targetX:m.x,targetY:m.y,sourcePosition:h,targetPosition:d}}function H1(e){if(!e)return null;const t=[],i=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&i.push(r);return{source:t,target:i}}function Ds(e,t,i=we.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:c,height:h}=t??lr(e);if(r)return{x:o+c/2,y:a+h/2};switch((t==null?void 0:t.position)??i){case we.Top:return{x:o+c/2,y:a};case we.Right:return{x:o+c,y:a+h/2};case we.Bottom:return{x:o+c/2,y:a+h};case we.Left:return{x:o,y:a+h/2}}}function j1(e,t){return e&&(t?e.find(i=>i.id===t):e[0])||null}function xg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function MD(e,{id:t,defaultColor:i,defaultMarkerStart:r,defaultMarkerEnd:o}){const a=new Set;return e.reduce((c,h)=>([h.markerStart||r,h.markerEnd||o].forEach(d=>{if(d&&typeof d=="object"){const f=xg(d,t);a.has(f)||(c.push({id:f,color:d.color||i,...d}),a.add(f))}}),c),[]).sort((c,h)=>c.id.localeCompare(h.id))}const Qx=1e3,TD=10,rm={nodeOrigin:[0,0],nodeExtent:_a,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},ND={...rm,checkEquality:!0};function sm(e,t){const i={...e};for(const r in t)t[r]!==void 0&&(i[r]=t[r]);return i}function AD(e,t,i){const r=sm(rm,i);for(const o of e.values())if(o.parentId)lm(o,e,t,r);else{const a=Ra(o,r.nodeOrigin),c=jo(o.extent)?o.extent:r.nodeExtent,h=As(a,c,lr(o));o.internals.positionAbsolute=h}}function DD(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const i=[],r=[];for(const o of e.handles){const a={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?i.push(a):o.type==="target"&&r.push(a)}return{source:i,target:r}}function om(e){return e==="manual"}function wg(e,t,i,r={}){var f,m;const o=sm(ND,r),a={i:0},c=new Map(t),h=o!=null&&o.elevateNodesOnSelect&&!om(o.zIndexMode)?Qx:0;let d=e.length>0;t.clear(),i.clear();for(const g of e){let v=c.get(g.id);if(o.checkEquality&&g===(v==null?void 0:v.internals.userNode))t.set(g.id,v);else{const y=Ra(g,o.nodeOrigin),S=jo(g.extent)?g.extent:o.nodeExtent,b=As(y,S,lr(g));v={...o.defaults,...g,measured:{width:(f=g.measured)==null?void 0:f.width,height:(m=g.measured)==null?void 0:m.height},internals:{positionAbsolute:b,handleBounds:DD(g,v),z:Jx(g,h,o.zIndexMode),userNode:g}},t.set(g.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(d=!1),g.parentId&&lm(v,t,i,r,a)}return d}function RD(e,t){if(!e.parentId)return;const i=t.get(e.parentId);i?i.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function lm(e,t,i,r,o){const{elevateNodesOnSelect:a,nodeOrigin:c,nodeExtent:h,zIndexMode:d}=sm(rm,r),f=e.parentId,m=t.get(f);if(!m){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}RD(e,i),o&&!m.parentId&&m.internals.rootParentIndex===void 0&&d==="auto"&&(m.internals.rootParentIndex=++o.i,m.internals.z=m.internals.z+o.i*TD),o&&m.internals.rootParentIndex!==void 0&&(o.i=m.internals.rootParentIndex);const g=a&&!om(d)?Qx:0,{x:v,y,z:S}=BD(e,m,c,h,g,d),{positionAbsolute:b}=e.internals,k=v!==b.x||y!==b.y;(k||S!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:v,y}:b,z:S}})}function Jx(e,t,i){const r=an(e.zIndex)?e.zIndex:0;return om(i)?r:r+(e.selected?t:0)}function BD(e,t,i,r,o,a){const{x:c,y:h}=t.internals.positionAbsolute,d=lr(e),f=Ra(e,i),m=jo(e.extent)?As(f,e.extent,d):f;let g=As({x:c+m.x,y:h+m.y},r,d);e.extent==="parent"&&(g=Ux(g,d,t));const v=Jx(e,o,a),y=t.internals.z??0;return{x:g.x,y:g.y,z:y>=v?y+1:v}}function am(e,t,i,r=[0,0]){var c;const o=[],a=new Map;for(const h of e){const d=t.get(h.parentId);if(!d)continue;const f=((c=a.get(h.parentId))==null?void 0:c.expandedRect)??Ho(d),m=Vx(f,h.rect);a.set(h.parentId,{expandedRect:m,parent:d})}return a.size>0&&a.forEach(({expandedRect:h,parent:d},f)=>{var E;const m=d.internals.positionAbsolute,g=lr(d),v=d.origin??r,y=h.x<m.x?Math.round(Math.abs(m.x-h.x)):0,S=h.y<m.y?Math.round(Math.abs(m.y-h.y)):0,b=Math.max(g.width,Math.round(h.width)),k=Math.max(g.height,Math.round(h.height)),C=(b-g.width)*v[0],z=(k-g.height)*v[1];(y>0||S>0||C||z)&&(o.push({id:f,type:"position",position:{x:d.position.x-y+C,y:d.position.y-S+z}}),(E=i.get(f))==null||E.forEach(T=>{e.some(P=>P.id===T.id)||o.push({id:T.id,type:"position",position:{x:T.position.x+y,y:T.position.y+S}})})),(g.width<h.width||g.height<h.height||y||S)&&o.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:b+(y?v[0]*y-C:0),height:k+(S?v[1]*S-z:0)}})}),o}function LD(e,t,i,r,o,a,c){const h=r==null?void 0:r.querySelector(".xyflow__viewport");let d=!1;if(!h)return{changes:[],updatedInternals:d};const f=[],m=window.getComputedStyle(h),{m22:g}=new window.DOMMatrixReadOnly(m.transform),v=[];for(const y of e.values()){const S=t.get(y.id);if(!S)continue;if(S.hidden){t.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),d=!0;continue}const b=im(y.nodeElement),k=S.measured.width!==b.width||S.measured.height!==b.height;if(!!(b.width&&b.height&&(k||!S.internals.handleBounds||y.force))){const z=y.nodeElement.getBoundingClientRect(),E=jo(S.extent)?S.extent:a;let{positionAbsolute:T}=S.internals;S.parentId&&S.extent==="parent"?T=Ux(T,b,t.get(S.parentId)):E&&(T=As(T,E,b));const P={...S,measured:b,internals:{...S.internals,positionAbsolute:T,handleBounds:{source:R1("source",y.nodeElement,z,g,S.id),target:R1("target",y.nodeElement,z,g,S.id)}}};t.set(S.id,P),S.parentId&&lm(P,t,i,{nodeOrigin:o,zIndexMode:c}),d=!0,k&&(f.push({id:S.id,type:"dimensions",dimensions:b}),S.expandParent&&S.parentId&&v.push({id:S.id,parentId:S.parentId,rect:Ho(P,o)}))}}if(v.length>0){const y=am(v,t,i,o);f.push(...y)}return{changes:f,updatedInternals:d}}async function zD({delta:e,panZoom:t,transform:i,translateExtent:r,width:o,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const c=await t.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[o,a]],r),h=!!c&&(c.x!==i[0]||c.y!==i[1]||c.k!==i[2]);return Promise.resolve(h)}function P1(e,t,i,r,o,a){let c=o;const h=r.get(c)||new Map;r.set(c,h.set(i,t)),c=`${o}-${e}`;const d=r.get(c)||new Map;if(r.set(c,d.set(i,t)),a){c=`${o}-${e}-${a}`;const f=r.get(c)||new Map;r.set(c,f.set(i,t))}}function ew(e,t,i){e.clear(),t.clear();for(const r of i){const{source:o,target:a,sourceHandle:c=null,targetHandle:h=null}=r,d={edgeId:r.id,source:o,target:a,sourceHandle:c,targetHandle:h},f=`${o}-${c}--${a}-${h}`,m=`${a}-${h}--${o}-${c}`;P1("source",d,m,e,o,c),P1("target",d,f,e,a,h),t.set(r.id,r)}}function tw(e,t){if(!e.parentId)return!1;const i=t.get(e.parentId);return i?i.selected?!0:tw(i,t):!1}function I1(e,t,i){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===i)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function OD(e,t,i,r){const o=new Map;for(const[a,c]of e)if((c.selected||c.id===r)&&(!c.parentId||!tw(c,e))&&(c.draggable||t&&typeof c.draggable>"u")){const h=e.get(a);h&&o.set(a,{id:a,position:h.position||{x:0,y:0},distance:{x:i.x-h.internals.positionAbsolute.x,y:i.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return o}function lp({nodeId:e,dragItems:t,nodeLookup:i,dragging:r=!0}){var c,h,d;const o=[];for(const[f,m]of t){const g=(c=i.get(f))==null?void 0:c.internals.userNode;g&&o.push({...g,position:m.position,dragging:r})}if(!e)return[o[0],o];const a=(h=i.get(e))==null?void 0:h.internals.userNode;return[a?{...a,position:((d=t.get(e))==null?void 0:d.position)||a.position,dragging:r}:o[0],o]}function HD({dragItems:e,snapGrid:t,x:i,y:r}){const o=e.values().next().value;if(!o)return null;const a={x:i-o.distance.x,y:r-o.distance.y},c=La(a,t);return{x:c.x-a.x,y:c.y-a.y}}function jD({onNodeMouseDown:e,getStoreItems:t,onDragStart:i,onDrag:r,onDragStop:o}){let a={x:null,y:null},c=0,h=new Map,d=!1,f={x:0,y:0},m=null,g=!1,v=null,y=!1,S=!1,b=null;function k({noDragClassName:z,handleSelector:E,domNode:T,isSelectable:P,nodeId:R,nodeClickDistance:U=0}){v=Oi(T);function X({x:I,y:F}){const{nodeLookup:B,nodeExtent:O,snapGrid:M,snapToGrid:j,nodeOrigin:H,onNodeDrag:$,onSelectionDrag:N,onError:L,updateNodePositions:Y}=t();a={x:I,y:F};let A=!1;const ee=h.size>1,ce=ee&&O?Sg(Ba(h)):null,le=ee&&j?HD({dragItems:h,snapGrid:M,x:I,y:F}):null;for(const[fe,he]of h){if(!B.has(fe))continue;let pe={x:I-he.distance.x,y:F-he.distance.y};j&&(pe=le?{x:Math.round(pe.x+le.x),y:Math.round(pe.y+le.y)}:La(pe,M));let Ce=null;if(ee&&O&&!he.extent&&ce){const{positionAbsolute:me}=he.internals,Ae=me.x-ce.x+O[0][0],Ye=me.x+he.measured.width-ce.x2+O[1][0],ze=me.y-ce.y+O[0][1],St=me.y+he.measured.height-ce.y2+O[1][1];Ce=[[Ae,ze],[Ye,St]]}const{position:xe,positionAbsolute:Se}=Ix({nodeId:fe,nextPosition:pe,nodeLookup:B,nodeExtent:Ce||O,nodeOrigin:H,onError:L});A=A||he.position.x!==xe.x||he.position.y!==xe.y,he.position=xe,he.internals.positionAbsolute=Se}if(S=S||A,!!A&&(Y(h,!0),b&&(r||$||!R&&N))){const[fe,he]=lp({nodeId:R,dragItems:h,nodeLookup:B});r==null||r(b,h,fe,he),$==null||$(b,fe,he),R||N==null||N(b,he)}}async function G(){if(!m)return;const{transform:I,panBy:F,autoPanSpeed:B,autoPanOnNodeDrag:O}=t();if(!O){d=!1,cancelAnimationFrame(c);return}const[M,j]=qx(f,m,B);(M!==0||j!==0)&&(a.x=(a.x??0)-M/I[2],a.y=(a.y??0)-j/I[2],await F({x:M,y:j})&&X(a)),c=requestAnimationFrame(G)}function ne(I){var ee;const{nodeLookup:F,multiSelectionActive:B,nodesDraggable:O,transform:M,snapGrid:j,snapToGrid:H,selectNodesOnDrag:$,onNodeDragStart:N,onSelectionDragStart:L,unselectNodesAndEdges:Y}=t();g=!0,(!$||!P)&&!B&&R&&((ee=F.get(R))!=null&&ee.selected||Y()),P&&$&&R&&(e==null||e(R));const A=oa(I.sourceEvent,{transform:M,snapGrid:j,snapToGrid:H,containerBounds:m});if(a=A,h=OD(F,O,A,R),h.size>0&&(i||N||!R&&L)){const[ce,le]=lp({nodeId:R,dragItems:h,nodeLookup:F});i==null||i(I.sourceEvent,h,ce,le),N==null||N(I.sourceEvent,ce,le),R||L==null||L(I.sourceEvent,le)}}const V=yx().clickDistance(U).on("start",I=>{const{domNode:F,nodeDragThreshold:B,transform:O,snapGrid:M,snapToGrid:j}=t();m=(F==null?void 0:F.getBoundingClientRect())||null,y=!1,S=!1,b=I.sourceEvent,B===0&&ne(I),a=oa(I.sourceEvent,{transform:O,snapGrid:M,snapToGrid:j,containerBounds:m}),f=cn(I.sourceEvent,m)}).on("drag",I=>{const{autoPanOnNodeDrag:F,transform:B,snapGrid:O,snapToGrid:M,nodeDragThreshold:j,nodeLookup:H}=t(),$=oa(I.sourceEvent,{transform:B,snapGrid:O,snapToGrid:M,containerBounds:m});if(b=I.sourceEvent,(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||R&&!H.has(R))&&(y=!0),!y){if(!d&&F&&g&&(d=!0,G()),!g){const N=cn(I.sourceEvent,m),L=N.x-f.x,Y=N.y-f.y;Math.sqrt(L*L+Y*Y)>j&&ne(I)}(a.x!==$.xSnapped||a.y!==$.ySnapped)&&h&&g&&(f=cn(I.sourceEvent,m),X($))}}).on("end",I=>{if(!(!g||y)&&(d=!1,g=!1,cancelAnimationFrame(c),h.size>0)){const{nodeLookup:F,updateNodePositions:B,onNodeDragStop:O,onSelectionDragStop:M}=t();if(S&&(B(h,!1),S=!1),o||O||!R&&M){const[j,H]=lp({nodeId:R,dragItems:h,nodeLookup:F,dragging:!1});o==null||o(I.sourceEvent,h,j,H),O==null||O(I.sourceEvent,j,H),R||M==null||M(I.sourceEvent,H)}}}).filter(I=>{const F=I.target;return!I.button&&(!z||!I1(F,`.${z}`,T))&&(!E||I1(F,E,T))});v.call(V)}function C(){v==null||v.on(".drag",null)}return{update:k,destroy:C}}function PD(e,t,i){const r=[],o={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const a of t.values())Sa(o,Ho(a))>0&&r.push(a);return r}const ID=250;function UD(e,t,i,r){var h,d;let o=[],a=1/0;const c=PD(e,i,t+ID);for(const f of c){const m=[...((h=f.internals.handleBounds)==null?void 0:h.source)??[],...((d=f.internals.handleBounds)==null?void 0:d.target)??[]];for(const g of m){if(r.nodeId===g.nodeId&&r.type===g.type&&r.id===g.id)continue;const{x:v,y}=Ds(f,g,g.position,!0),S=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(y-e.y,2));S>t||(S<a?(o=[{...g,x:v,y}],a=S):S===a&&o.push({...g,x:v,y}))}}if(!o.length)return null;if(o.length>1){const f=r.type==="source"?"target":"source";return o.find(m=>m.type===f)??o[0]}return o[0]}function iw(e,t,i,r,o,a=!1){var f,m,g;const c=r.get(e);if(!c)return null;const h=o==="strict"?(f=c.internals.handleBounds)==null?void 0:f[t]:[...((m=c.internals.handleBounds)==null?void 0:m.source)??[],...((g=c.internals.handleBounds)==null?void 0:g.target)??[]],d=(i?h==null?void 0:h.find(v=>v.id===i):h==null?void 0:h[0])??null;return d&&a?{...d,...Ds(c,d,d.position,!0)}:d}function nw(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function qD(e,t){let i=null;return t?i=!0:e&&!t&&(i=!1),i}const rw=()=>!0;function VD(e,{connectionMode:t,connectionRadius:i,handleId:r,nodeId:o,edgeUpdaterType:a,isTarget:c,domNode:h,nodeLookup:d,lib:f,autoPanOnConnect:m,flowId:g,panBy:v,cancelConnection:y,onConnectStart:S,onConnect:b,onConnectEnd:k,isValidConnection:C=rw,onReconnectEnd:z,updateConnection:E,getTransform:T,getFromHandle:P,autoPanSpeed:R,dragThreshold:U=1,handleDomNode:X}){const G=Yx(e.target);let ne=0,V;const{x:I,y:F}=cn(e),B=nw(a,X),O=h==null?void 0:h.getBoundingClientRect();let M=!1;if(!O||!B)return;const j=iw(o,B,r,d,t);if(!j)return;let H=cn(e,O),$=!1,N=null,L=!1,Y=null;function A(){if(!m||!O)return;const[xe,Se]=qx(H,O,R);v({x:xe,y:Se}),ne=requestAnimationFrame(A)}const ee={...j,nodeId:o,type:B,position:j.position},ce=d.get(o);let fe={inProgress:!0,isValid:null,from:Ds(ce,ee,we.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:ce,to:H,toHandle:null,toPosition:T1[ee.position],toNode:null,pointer:H};function he(){M=!0,E(fe),S==null||S(e,{nodeId:o,handleId:r,handleType:B})}U===0&&he();function pe(xe){if(!M){const{x:St,y:Ci}=cn(xe),Jt=St-I,ui=Ci-F;if(!(Jt*Jt+ui*ui>U*U))return;he()}if(!P()||!ee){Ce(xe);return}const Se=T();H=cn(xe,O),V=UD(za(H,Se,!1,[1,1]),i,d,ee),$||(A(),$=!0);const me=sw(xe,{handle:V,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:c?"target":"source",isValidConnection:C,doc:G,lib:f,flowId:g,nodeLookup:d});Y=me.handleDomNode,N=me.connection,L=qD(!!V,me.isValid);const Ae=d.get(o),Ye=Ae?Ds(Ae,ee,we.Left,!0):fe.from,ze={...fe,from:Ye,isValid:L,to:me.toHandle&&L?Qu({x:me.toHandle.x,y:me.toHandle.y},Se):H,toHandle:me.toHandle,toPosition:L&&me.toHandle?me.toHandle.position:T1[ee.position],toNode:me.toHandle?d.get(me.toHandle.nodeId):null,pointer:H};E(ze),fe=ze}function Ce(xe){if(!("touches"in xe&&xe.touches.length>0)){if(M){(V||Y)&&N&&L&&(b==null||b(N));const{inProgress:Se,...me}=fe,Ae={...me,toPosition:fe.toHandle?fe.toPosition:null};k==null||k(xe,Ae),a&&(z==null||z(xe,Ae))}y(),cancelAnimationFrame(ne),$=!1,L=!1,N=null,Y=null,G.removeEventListener("mousemove",pe),G.removeEventListener("mouseup",Ce),G.removeEventListener("touchmove",pe),G.removeEventListener("touchend",Ce)}}G.addEventListener("mousemove",pe),G.addEventListener("mouseup",Ce),G.addEventListener("touchmove",pe),G.addEventListener("touchend",Ce)}function sw(e,{handle:t,connectionMode:i,fromNodeId:r,fromHandleId:o,fromType:a,doc:c,lib:h,flowId:d,isValidConnection:f=rw,nodeLookup:m}){const g=a==="target",v=t?c.querySelector(`.${h}-flow__handle[data-id="${d}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:S}=cn(e),b=c.elementFromPoint(y,S),k=b!=null&&b.classList.contains(`${h}-flow__handle`)?b:v,C={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const z=nw(void 0,k),E=k.getAttribute("data-nodeid"),T=k.getAttribute("data-handleid"),P=k.classList.contains("connectable"),R=k.classList.contains("connectableend");if(!E||!z)return C;const U={source:g?E:r,sourceHandle:g?T:o,target:g?r:E,targetHandle:g?o:T};C.connection=U;const G=P&&R&&(i===zo.Strict?g&&z==="source"||!g&&z==="target":E!==r||T!==o);C.isValid=G&&f(U),C.toHandle=iw(E,z,T,m,i,!0)}return C}const Cg={onPointerDown:VD,isValid:sw};function FD({domNode:e,panZoom:t,getTransform:i,getViewScale:r}){const o=Oi(e);function a({translateExtent:h,width:d,height:f,zoomStep:m=1,pannable:g=!0,zoomable:v=!0,inversePan:y=!1}){const S=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const T=i(),P=E.sourceEvent.ctrlKey&&ba()?10:1,R=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,U=T[2]*Math.pow(2,R*P);t.scaleTo(U)};let b=[0,0];const k=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(b=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},C=E=>{const T=i();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const P=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],R=[P[0]-b[0],P[1]-b[1]];b=P;const U=r()*Math.max(T[2],Math.log(T[2]))*(y?-1:1),X={x:T[0]-R[0]*U,y:T[1]-R[1]*U},G=[[0,0],[d,f]];t.setViewportConstrained({x:X.x,y:X.y,zoom:T[2]},G,h)},z=Lx().on("start",k).on("zoom",g?C:null).on("zoom.wheel",v?S:null);o.call(z,{})}function c(){o.on("zoom",null)}return{update:a,destroy:c,pointer:on}}const gh=e=>({x:e.x,y:e.y,zoom:e.k}),ap=({x:e,y:t,zoom:i})=>fh.translate(e,t).scale(i),ko=(e,t)=>e.target.closest(`.${t}`),ow=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),$D=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,cp=(e,t=0,i=$D,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(i).on("end",r):e},lw=e=>{const t=e.ctrlKey&&ba()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function YD({zoomPanValues:e,noWheelClassName:t,d3Selection:i,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:c,onPanZoomStart:h,onPanZoom:d,onPanZoomEnd:f}){return m=>{if(ko(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const g=i.property("__zoom").k||1;if(m.ctrlKey&&c){const k=on(m),C=lw(m),z=g*Math.pow(2,C);r.scaleTo(i,z,k,m);return}const v=m.deltaMode===1?20:1;let y=o===Es.Vertical?0:m.deltaX*v,S=o===Es.Horizontal?0:m.deltaY*v;!ba()&&m.shiftKey&&o!==Es.Vertical&&(y=m.deltaY*v,S=0),r.translateBy(i,-(y/g)*a,-(S/g)*a,{internal:!0});const b=gh(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(d==null||d(m,b),e.panScrollTimeout=setTimeout(()=>{f==null||f(m,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,h==null||h(m,b))}}function WD({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:i}){return function(r,o){const a=r.type==="wheel",c=!t&&a&&!r.ctrlKey,h=ko(r,e);if(r.ctrlKey&&a&&h&&r.preventDefault(),c||h)return null;r.preventDefault(),i.call(this,r,o)}}function XD({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:i}){return r=>{var a,c,h;if((a=r.sourceEvent)!=null&&a.internal)return;const o=gh(r.transform);e.mouseButton=((c=r.sourceEvent)==null?void 0:c.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((h=r.sourceEvent)==null?void 0:h.type)==="mousedown"&&t(!0),i&&(i==null||i(r.sourceEvent,o))}}function KD({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:i,onTransformChange:r,onPanZoom:o}){return a=>{var c,h;e.usedRightMouseButton=!!(i&&ow(t,e.mouseButton??0)),(c=a.sourceEvent)!=null&&c.sync||r([a.transform.x,a.transform.y,a.transform.k]),o&&!((h=a.sourceEvent)!=null&&h.internal)&&(o==null||o(a.sourceEvent,gh(a.transform)))}}function GD({zoomPanValues:e,panOnDrag:t,panOnScroll:i,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:a}){return c=>{var h;if(!((h=c.sourceEvent)!=null&&h.internal)&&(e.isZoomingOrPanning=!1,a&&ow(t,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&a(c.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const d=gh(c.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(c.sourceEvent,d)},i?150:0)}}}function ZD({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:i,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:a,userSelectionActive:c,noWheelClassName:h,noPanClassName:d,lib:f,connectionInProgress:m}){return g=>{var k;const v=e||t,y=i&&g.ctrlKey,S=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(ko(g,`${f}-flow__node`)||ko(g,`${f}-flow__edge`)))return!0;if(!r&&!v&&!o&&!a&&!i||c||m&&!S||ko(g,h)&&S||ko(g,d)&&(!S||o&&S&&!e)||!i&&g.ctrlKey&&S)return!1;if(!i&&g.type==="touchstart"&&((k=g.touches)==null?void 0:k.length)>1)return g.preventDefault(),!1;if(!v&&!o&&!y&&S||!r&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(r)&&!r.includes(g.button)&&g.type==="mousedown")return!1;const b=Array.isArray(r)&&r.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||S)&&b}}function QD({domNode:e,minZoom:t,maxZoom:i,translateExtent:r,viewport:o,onPanZoom:a,onPanZoomStart:c,onPanZoomEnd:h,onDraggingChange:d}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),g=Lx().scaleExtent([t,i]).translateExtent(r),v=Oi(e).call(g);z({x:o.x,y:o.y,zoom:Oo(o.zoom,t,i)},[[0,0],[m.width,m.height]],r);const y=v.on("wheel.zoom"),S=v.on("dblclick.zoom");g.wheelDelta(lw);function b(V,I){return v?new Promise(F=>{g==null||g.interpolate((I==null?void 0:I.interpolate)==="linear"?sa:Bu).transform(cp(v,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>F(!0)),V)}):Promise.resolve(!1)}function k({noWheelClassName:V,noPanClassName:I,onPaneContextMenu:F,userSelectionActive:B,panOnScroll:O,panOnDrag:M,panOnScrollMode:j,panOnScrollSpeed:H,preventScrolling:$,zoomOnPinch:N,zoomOnScroll:L,zoomOnDoubleClick:Y,zoomActivationKeyPressed:A,lib:ee,onTransformChange:ce,connectionInProgress:le,paneClickDistance:fe,selectionOnDrag:he}){B&&!f.isZoomingOrPanning&&C();const pe=O&&!A&&!B;g.clickDistance(he?1/0:!an(fe)||fe<0?0:fe);const Ce=pe?YD({zoomPanValues:f,noWheelClassName:V,d3Selection:v,d3Zoom:g,panOnScrollMode:j,panOnScrollSpeed:H,zoomOnPinch:N,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:h}):WD({noWheelClassName:V,preventScrolling:$,d3ZoomHandler:y});if(v.on("wheel.zoom",Ce,{passive:!1}),!B){const Se=XD({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:c});g.on("start",Se);const me=KD({zoomPanValues:f,panOnDrag:M,onPaneContextMenu:!!F,onPanZoom:a,onTransformChange:ce});g.on("zoom",me);const Ae=GD({zoomPanValues:f,panOnDrag:M,panOnScroll:O,onPaneContextMenu:F,onPanZoomEnd:h,onDraggingChange:d});g.on("end",Ae)}const xe=ZD({zoomActivationKeyPressed:A,panOnDrag:M,zoomOnScroll:L,panOnScroll:O,zoomOnDoubleClick:Y,zoomOnPinch:N,userSelectionActive:B,noPanClassName:I,noWheelClassName:V,lib:ee,connectionInProgress:le});g.filter(xe),Y?v.on("dblclick.zoom",S):v.on("dblclick.zoom",null)}function C(){g.on("zoom",null)}async function z(V,I,F){const B=ap(V),O=g==null?void 0:g.constrain()(B,I,F);return O&&await b(O),new Promise(M=>M(O))}async function E(V,I){const F=ap(V);return await b(F,I),new Promise(B=>B(F))}function T(V){if(v){const I=ap(V),F=v.property("__zoom");(F.k!==V.zoom||F.x!==V.x||F.y!==V.y)&&(g==null||g.transform(v,I,null,{sync:!0}))}}function P(){const V=v?Bx(v.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function R(V,I){return v?new Promise(F=>{g==null||g.interpolate((I==null?void 0:I.interpolate)==="linear"?sa:Bu).scaleTo(cp(v,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>F(!0)),V)}):Promise.resolve(!1)}function U(V,I){return v?new Promise(F=>{g==null||g.interpolate((I==null?void 0:I.interpolate)==="linear"?sa:Bu).scaleBy(cp(v,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>F(!0)),V)}):Promise.resolve(!1)}function X(V){g==null||g.scaleExtent(V)}function G(V){g==null||g.translateExtent(V)}function ne(V){const I=!an(V)||V<0?0:V;g==null||g.clickDistance(I)}return{update:k,destroy:C,setViewport:E,setViewportConstrained:z,getViewport:P,scaleTo:R,scaleBy:U,setScaleExtent:X,setTranslateExtent:G,syncViewport:T,setClickDistance:ne}}var Po;(function(e){e.Line="line",e.Handle="handle"})(Po||(Po={}));function JD({width:e,prevWidth:t,height:i,prevHeight:r,affectsX:o,affectsY:a}){const c=e-t,h=i-r,d=[c>0?1:c<0?-1:0,h>0?1:h<0?-1:0];return c&&o&&(d[0]=d[0]*-1),h&&a&&(d[1]=d[1]*-1),d}function U1(e){const t=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:i,affectsX:r,affectsY:o}}function Ur(e,t){return Math.max(0,t-e)}function qr(e,t){return Math.max(0,e-t)}function yu(e,t,i){return Math.max(0,t-e,e-i)}function q1(e,t){return e?!t:t}function eR(e,t,i,r,o,a,c,h){let{affectsX:d,affectsY:f}=t;const{isHorizontal:m,isVertical:g}=t,v=m&&g,{xSnapped:y,ySnapped:S}=i,{minWidth:b,maxWidth:k,minHeight:C,maxHeight:z}=r,{x:E,y:T,width:P,height:R,aspectRatio:U}=e;let X=Math.floor(m?y-e.pointerX:0),G=Math.floor(g?S-e.pointerY:0);const ne=P+(d?-X:X),V=R+(f?-G:G),I=-a[0]*P,F=-a[1]*R;let B=yu(ne,b,k),O=yu(V,C,z);if(c){let H=0,$=0;d&&X<0?H=Ur(E+X+I,c[0][0]):!d&&X>0&&(H=qr(E+ne+I,c[1][0])),f&&G<0?$=Ur(T+G+F,c[0][1]):!f&&G>0&&($=qr(T+V+F,c[1][1])),B=Math.max(B,H),O=Math.max(O,$)}if(h){let H=0,$=0;d&&X>0?H=qr(E+X,h[0][0]):!d&&X<0&&(H=Ur(E+ne,h[1][0])),f&&G>0?$=qr(T+G,h[0][1]):!f&&G<0&&($=Ur(T+V,h[1][1])),B=Math.max(B,H),O=Math.max(O,$)}if(o){if(m){const H=yu(ne/U,C,z)*U;if(B=Math.max(B,H),c){let $=0;!d&&!f||d&&!f&&v?$=qr(T+F+ne/U,c[1][1])*U:$=Ur(T+F+(d?X:-X)/U,c[0][1])*U,B=Math.max(B,$)}if(h){let $=0;!d&&!f||d&&!f&&v?$=Ur(T+ne/U,h[1][1])*U:$=qr(T+(d?X:-X)/U,h[0][1])*U,B=Math.max(B,$)}}if(g){const H=yu(V*U,b,k)/U;if(O=Math.max(O,H),c){let $=0;!d&&!f||f&&!d&&v?$=qr(E+V*U+I,c[1][0])/U:$=Ur(E+(f?G:-G)*U+I,c[0][0])/U,O=Math.max(O,$)}if(h){let $=0;!d&&!f||f&&!d&&v?$=Ur(E+V*U,h[1][0])/U:$=qr(E+(f?G:-G)*U,h[0][0])/U,O=Math.max(O,$)}}}G=G+(G<0?O:-O),X=X+(X<0?B:-B),o&&(v?ne>V*U?G=(q1(d,f)?-X:X)/U:X=(q1(d,f)?-G:G)*U:m?(G=X/U,f=d):(X=G*U,d=f));const M=d?E+X:E,j=f?T+G:T;return{width:P+(d?-X:X),height:R+(f?-G:G),x:a[0]*X*(d?-1:1)+M,y:a[1]*G*(f?-1:1)+j}}const aw={width:0,height:0,x:0,y:0},tR={...aw,pointerX:0,pointerY:0,aspectRatio:1};function iR(e){return[[0,0],[e.measured.width,e.measured.height]]}function nR(e,t,i){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,a=e.measured.width??0,c=e.measured.height??0,h=i[0]*a,d=i[1]*c;return[[r-h,o-d],[r+a-h,o+c-d]]}function rR({domNode:e,nodeId:t,getStoreItems:i,onChange:r,onEnd:o}){const a=Oi(e);let c={controlDirection:U1("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:f,boundaries:m,keepAspectRatio:g,resizeDirection:v,onResizeStart:y,onResize:S,onResizeEnd:b,shouldResize:k}){let C={...aw},z={...tR};c={boundaries:m,resizeDirection:v,keepAspectRatio:g,controlDirection:U1(f)};let E,T=null,P=[],R,U,X,G=!1;const ne=yx().on("start",V=>{const{nodeLookup:I,transform:F,snapGrid:B,snapToGrid:O,nodeOrigin:M,paneDomNode:j}=i();if(E=I.get(t),!E)return;T=(j==null?void 0:j.getBoundingClientRect())??null;const{xSnapped:H,ySnapped:$}=oa(V.sourceEvent,{transform:F,snapGrid:B,snapToGrid:O,containerBounds:T});C={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},z={...C,pointerX:H,pointerY:$,aspectRatio:C.width/C.height},R=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(R=I.get(E.parentId),U=R&&E.extent==="parent"?iR(R):void 0),P=[],X=void 0;for(const[N,L]of I)if(L.parentId===t&&(P.push({id:N,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const Y=nR(L,E,L.origin??M);X?X=[[Math.min(Y[0][0],X[0][0]),Math.min(Y[0][1],X[0][1])],[Math.max(Y[1][0],X[1][0]),Math.max(Y[1][1],X[1][1])]]:X=Y}y==null||y(V,{...C})}).on("drag",V=>{const{transform:I,snapGrid:F,snapToGrid:B,nodeOrigin:O}=i(),M=oa(V.sourceEvent,{transform:I,snapGrid:F,snapToGrid:B,containerBounds:T}),j=[];if(!E)return;const{x:H,y:$,width:N,height:L}=C,Y={},A=E.origin??O,{width:ee,height:ce,x:le,y:fe}=eR(z,c.controlDirection,M,c.boundaries,c.keepAspectRatio,A,U,X),he=ee!==N,pe=ce!==L,Ce=le!==H&&he,xe=fe!==$&&pe;if(!Ce&&!xe&&!he&&!pe)return;if((Ce||xe||A[0]===1||A[1]===1)&&(Y.x=Ce?le:C.x,Y.y=xe?fe:C.y,C.x=Y.x,C.y=Y.y,P.length>0)){const Ye=le-H,ze=fe-$;for(const St of P)St.position={x:St.position.x-Ye+A[0]*(ee-N),y:St.position.y-ze+A[1]*(ce-L)},j.push(St)}if((he||pe)&&(Y.width=he&&(!c.resizeDirection||c.resizeDirection==="horizontal")?ee:C.width,Y.height=pe&&(!c.resizeDirection||c.resizeDirection==="vertical")?ce:C.height,C.width=Y.width,C.height=Y.height),R&&E.expandParent){const Ye=A[0]*(Y.width??0);Y.x&&Y.x<Ye&&(C.x=Ye,z.x=z.x-(Y.x-Ye));const ze=A[1]*(Y.height??0);Y.y&&Y.y<ze&&(C.y=ze,z.y=z.y-(Y.y-ze))}const Se=JD({width:C.width,prevWidth:N,height:C.height,prevHeight:L,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),me={...C,direction:Se};(k==null?void 0:k(V,me))!==!1&&(G=!0,S==null||S(V,me),r(Y,j))}).on("end",V=>{G&&(b==null||b(V,{...C}),o==null||o({...C}),G=!1)});a.call(ne)}function d(){a.on(".drag",null)}return{update:h,destroy:d}}var up={exports:{}},hp={},fp={exports:{}},dp={};/**
|
|
144
|
+
* @license React
|
|
145
|
+
* use-sync-external-store-shim.production.js
|
|
146
|
+
*
|
|
147
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the MIT license found in the
|
|
150
|
+
* LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/var V1;function sR(){if(V1)return dp;V1=1;var e=Ea();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var i=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,a=e.useLayoutEffect,c=e.useDebugValue;function h(g,v){var y=v(),S=r({inst:{value:y,getSnapshot:v}}),b=S[0].inst,k=S[1];return a(function(){b.value=y,b.getSnapshot=v,d(b)&&k({inst:b})},[g,y,v]),o(function(){return d(b)&&k({inst:b}),g(function(){d(b)&&k({inst:b})})},[g]),c(y),y}function d(g){var v=g.getSnapshot;g=g.value;try{var y=v();return!i(g,y)}catch{return!0}}function f(g,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:h;return dp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,dp}var F1;function oR(){return F1||(F1=1,fp.exports=sR()),fp.exports}/**
|
|
152
|
+
* @license React
|
|
153
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
154
|
+
*
|
|
155
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the MIT license found in the
|
|
158
|
+
* LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/var $1;function lR(){if($1)return hp;$1=1;var e=Ea(),t=oR();function i(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:i,o=t.useSyncExternalStore,a=e.useRef,c=e.useEffect,h=e.useMemo,d=e.useDebugValue;return hp.useSyncExternalStoreWithSelector=function(f,m,g,v,y){var S=a(null);if(S.current===null){var b={hasValue:!1,value:null};S.current=b}else b=S.current;S=h(function(){function C(R){if(!z){if(z=!0,E=R,R=v(R),y!==void 0&&b.hasValue){var U=b.value;if(y(U,R))return T=U}return T=R}if(U=T,r(E,R))return U;var X=v(R);return y!==void 0&&y(U,X)?(E=R,U):(E=R,T=X)}var z=!1,E,T,P=g===void 0?null:g;return[function(){return C(m())},P===null?void 0:function(){return C(P())}]},[m,g,v,y]);var k=o(f,S[0],S[1]);return c(function(){b.hasValue=!0,b.value=k},[k]),d(k),k},hp}var Y1;function aR(){return Y1||(Y1=1,up.exports=lR()),up.exports}var cR=aR();const uR=nh(cR),hR={},W1=e=>{let t;const i=new Set,r=(m,g)=>{const v=typeof m=="function"?m(t):m;if(!Object.is(v,t)){const y=t;t=g??(typeof v!="object"||v===null)?v:Object.assign({},t,v),i.forEach(S=>S(t,y))}},o=()=>t,d={setState:r,getState:o,getInitialState:()=>f,subscribe:m=>(i.add(m),()=>i.delete(m)),destroy:()=>{(hR?"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."),i.clear()}},f=t=e(r,o,d);return d},fR=e=>e?W1(e):W1,{useDebugValue:dR}=zE,{useSyncExternalStoreWithSelector:pR}=uR,gR=e=>e;function cw(e,t=gR,i){const r=pR(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,i);return dR(r),r}const X1=(e,t)=>{const i=fR(e),r=(o,a=t)=>cw(i,o,a);return Object.assign(r,i),r},mR=(e,t)=>e?X1(e,t):X1;function ft(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[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(const r of i)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}fb();const mh=q.createContext(null),_R=mh.Provider,uw=Mn.error001();function $e(e,t){const i=q.useContext(mh);if(i===null)throw new Error(uw);return cw(i,e,t)}function dt(){const e=q.useContext(mh);if(e===null)throw new Error(uw);return q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const K1={display:"none"},vR={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},hw="react-flow__node-desc",fw="react-flow__edge-desc",yR="react-flow__aria-live",SR=e=>e.ariaLiveMessage,bR=e=>e.ariaLabelConfig;function xR({rfId:e}){const t=$e(SR);return w.jsx("div",{id:`${yR}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vR,children:t})}function wR({rfId:e,disableKeyboardA11y:t}){const i=$e(bR);return w.jsxs(w.Fragment,{children:[w.jsx("div",{id:`${hw}-${e}`,style:K1,children:t?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),w.jsx("div",{id:`${fw}-${e}`,style:K1,children:i["edge.a11yDescription.default"]}),!t&&w.jsx(xR,{rfId:e})]})}const _h=q.forwardRef(({position:e="top-left",children:t,className:i,style:r,...o},a)=>{const c=`${e}`.split("-");return w.jsx("div",{className:Bt(["react-flow__panel",i,...c]),style:r,ref:a,...o,children:t})});_h.displayName="Panel";function CR({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:w.jsx(_h,{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:w.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ER=e=>{const t=[],i=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&i.push(r);return{selectedNodes:t,selectedEdges:i}},Su=e=>e.id;function kR(e,t){return ft(e.selectedNodes.map(Su),t.selectedNodes.map(Su))&&ft(e.selectedEdges.map(Su),t.selectedEdges.map(Su))}function MR({onSelectionChange:e}){const t=dt(),{selectedNodes:i,selectedEdges:r}=$e(ER,kR);return q.useEffect(()=>{const o={nodes:i,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(a=>a(o))},[i,r,e]),null}const TR=e=>!!e.onSelectionChangeHandlers;function NR({onSelectionChange:e}){const t=$e(TR);return e||t?w.jsx(MR,{onSelectionChange:e}):null}const dw=[0,0],AR={x:0,y:0,zoom:1},DR=["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"],G1=[...DR,"rfId"],RR=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}),Z1={translateExtent:_a,nodeOrigin:dw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function BR(e){const{setNodes:t,setEdges:i,setMinZoom:r,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:c,reset:h,setDefaultNodesAndEdges:d}=$e(RR,ft),f=dt();q.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{m.current=Z1,h()}),[]);const m=q.useRef(Z1);return q.useEffect(()=>{for(const g of G1){const v=e[g],y=m.current[g];v!==y&&(typeof e[g]>"u"||(g==="nodes"?t(v):g==="edges"?i(v):g==="minZoom"?r(v):g==="maxZoom"?o(v):g==="translateExtent"?a(v):g==="nodeExtent"?c(v):g==="ariaLabelConfig"?f.setState({ariaLabelConfig:mD(v)}):g==="fitView"?f.setState({fitViewQueued:v}):g==="fitViewOptions"?f.setState({fitViewOptions:v}):f.setState({[g]:v})))}m.current=e},G1.map(g=>e[g])),null}function Q1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function LR(e){var r;const[t,i]=q.useState(e==="system"?null:e);return q.useEffect(()=>{if(e!=="system"){i(e);return}const o=Q1(),a=()=>i(o!=null&&o.matches?"dark":"light");return a(),o==null||o.addEventListener("change",a),()=>{o==null||o.removeEventListener("change",a)}},[e]),t!==null?t:(r=Q1())!=null&&r.matches?"dark":"light"}const J1=typeof document<"u"?document:null;function xa(e=null,t={target:J1,actInsideInputWithModifier:!0}){const[i,r]=q.useState(!1),o=q.useRef(!1),a=q.useRef(new Set([])),[c,h]=q.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
160
|
+
`).replace(`
|
|
161
|
+
|
|
162
|
+
`,`
|
|
163
|
+
+`).split(`
|
|
164
|
+
`)),m=f.reduce((g,v)=>g.concat(...v),[]);return[f,m]}return[[],[]]},[e]);return q.useEffect(()=>{const d=(t==null?void 0:t.target)??J1,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=y=>{var k,C;if(o.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!o.current||o.current&&!f)&&Wx(y))return!1;const b=tS(y.code,h);if(a.current.add(y[b]),eS(c,a.current,!1)){const z=((C=(k=y.composedPath)==null?void 0:k.call(y))==null?void 0:C[0])||y.target,E=(z==null?void 0:z.nodeName)==="BUTTON"||(z==null?void 0:z.nodeName)==="A";t.preventDefault!==!1&&(o.current||!E)&&y.preventDefault(),r(!0)}},g=y=>{const S=tS(y.code,h);eS(c,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(y[S]),y.key==="Meta"&&a.current.clear(),o.current=!1},v=()=>{a.current.clear(),r(!1)};return d==null||d.addEventListener("keydown",m),d==null||d.addEventListener("keyup",g),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{d==null||d.removeEventListener("keydown",m),d==null||d.removeEventListener("keyup",g),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,r]),i}function eS(e,t,i){return e.filter(r=>i||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function tS(e,t){return t.includes(e)?"code":"key"}const zR=()=>{const e=dt();return q.useMemo(()=>({zoomIn:t=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,i)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:i==null?void 0:i.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,i)=>{const{transform:[r,o,a],panZoom:c}=e.getState();return c?(await c.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??a},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,i,r]=e.getState().transform;return{x:t,y:i,zoom:r}},setCenter:async(t,i,r)=>e.getState().setCenter(t,i,r),fitBounds:async(t,i)=>{const{width:r,height:o,minZoom:a,maxZoom:c,panZoom:h}=e.getState(),d=tm(t,r,o,a,c,(i==null?void 0:i.padding)??.1);return h?(await h.setViewport(d,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,i={})=>{const{transform:r,snapGrid:o,snapToGrid:a,domNode:c}=e.getState();if(!c)return t;const{x:h,y:d}=c.getBoundingClientRect(),f={x:t.x-h,y:t.y-d},m=i.snapGrid??o,g=i.snapToGrid??a;return za(f,r,g,m)},flowToScreenPosition:t=>{const{transform:i,domNode:r}=e.getState();if(!r)return t;const{x:o,y:a}=r.getBoundingClientRect(),c=Qu(t,i);return{x:c.x+o,y:c.y+a}}}),[])};function pw(e,t){const i=[],r=new Map,o=[];for(const a of e)if(a.type==="add"){o.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const c=r.get(a.id);c?c.push(a):r.set(a.id,[a])}for(const a of t){const c=r.get(a.id);if(!c){i.push(a);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){i.push({...c[0].item});continue}const h={...a};for(const d of c)OR(d,h);i.push(h)}return o.length&&o.forEach(a=>{a.index!==void 0?i.splice(a.index,0,{...a.item}):i.push({...a.item})}),i}function OR(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 gw(e,t){return pw(e,t)}function mw(e,t){return pw(e,t)}function Ss(e,t){return{id:e,type:"select",selected:t}}function Mo(e,t=new Set,i=!1){const r=[];for(const[o,a]of e){const c=t.has(o);!(a.selected===void 0&&!c)&&a.selected!==c&&(i&&(a.selected=c),r.push(Ss(a.id,c)))}return r}function iS({items:e=[],lookup:t}){var o;const i=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,c]of e.entries()){const h=t.get(c.id),d=((o=h==null?void 0:h.internals)==null?void 0:o.userNode)??h;d!==void 0&&d!==c&&i.push({id:c.id,item:c,type:"replace"}),d===void 0&&i.push({item:c,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&i.push({id:a,type:"remove"});return i}function nS(e){return{id:e.id,type:"remove"}}const rS=e=>oD(e),HR=e=>Px(e);function _w(e){return q.forwardRef(e)}const jR=typeof window<"u"?q.useLayoutEffect:q.useEffect;function sS(e){const[t,i]=q.useState(BigInt(0)),[r]=q.useState(()=>PR(()=>i(o=>o+BigInt(1))));return jR(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function PR(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:i=>{t.push(i),e()}}}const vw=q.createContext(null);function IR({children:e}){const t=dt(),i=q.useCallback(h=>{const{nodes:d=[],setNodes:f,hasDefaultNodes:m,onNodesChange:g,nodeLookup:v,fitViewQueued:y,onNodesChangeMiddlewareMap:S}=t.getState();let b=d;for(const C of h)b=typeof C=="function"?C(b):C;let k=iS({items:b,lookup:v});for(const C of S.values())k=C(k);m&&f(b),k.length>0?g==null||g(k):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:z,setNodes:E}=t.getState();C&&E(z)})},[]),r=sS(i),o=q.useCallback(h=>{const{edges:d=[],setEdges:f,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:v}=t.getState();let y=d;for(const S of h)y=typeof S=="function"?S(y):S;m?f(y):g&&g(iS({items:y,lookup:v}))},[]),a=sS(o),c=q.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return w.jsx(vw.Provider,{value:c,children:e})}function UR(){const e=q.useContext(vw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const qR=e=>!!e.panZoom;function vh(){const e=zR(),t=dt(),i=UR(),r=$e(qR),o=q.useMemo(()=>{const a=g=>t.getState().nodeLookup.get(g),c=g=>{i.nodeQueue.push(g)},h=g=>{i.edgeQueue.push(g)},d=g=>{var C,z;const{nodeLookup:v,nodeOrigin:y}=t.getState(),S=rS(g)?g:v.get(g.id),b=S.parentId?$x(S.position,S.measured,S.parentId,v,y):S.position,k={...S,position:b,width:((C=S.measured)==null?void 0:C.width)??S.width,height:((z=S.measured)==null?void 0:z.height)??S.height};return Ho(k)},f=(g,v,y={replace:!1})=>{c(S=>S.map(b=>{if(b.id===g){const k=typeof v=="function"?v(b):v;return y.replace&&rS(k)?k:{...b,...k}}return b}))},m=(g,v,y={replace:!1})=>{h(S=>S.map(b=>{if(b.id===g){const k=typeof v=="function"?v(b):v;return y.replace&&HR(k)?k:{...b,...k}}return b}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>{var v;return(v=a(g))==null?void 0:v.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(v=>({...v}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:c,setEdges:h,addNodes:g=>{const v=Array.isArray(g)?g:[g];i.nodeQueue.push(y=>[...y,...v])},addEdges:g=>{const v=Array.isArray(g)?g:[g];i.edgeQueue.push(y=>[...y,...v])},toObject:()=>{const{nodes:g=[],edges:v=[],transform:y}=t.getState(),[S,b,k]=y;return{nodes:g.map(C=>({...C})),edges:v.map(C=>({...C})),viewport:{x:S,y:b,zoom:k}}},deleteElements:async({nodes:g=[],edges:v=[]})=>{const{nodes:y,edges:S,onNodesDelete:b,onEdgesDelete:k,triggerNodeChanges:C,triggerEdgeChanges:z,onDelete:E,onBeforeDelete:T}=t.getState(),{nodes:P,edges:R}=await hD({nodesToRemove:g,edgesToRemove:v,nodes:y,edges:S,onBeforeDelete:T}),U=R.length>0,X=P.length>0;if(U){const G=R.map(nS);k==null||k(R),z(G)}if(X){const G=P.map(nS);b==null||b(P),C(G)}return(X||U)&&(E==null||E({nodes:P,edges:R})),{deletedNodes:P,deletedEdges:R}},getIntersectingNodes:(g,v=!0,y)=>{const S=A1(g),b=S?g:d(g),k=y!==void 0;return b?(y||t.getState().nodes).filter(C=>{const z=t.getState().nodeLookup.get(C.id);if(z&&!S&&(C.id===g.id||!z.internals.positionAbsolute))return!1;const E=Ho(k?C:z),T=Sa(E,b);return v&&T>0||T>=E.width*E.height||T>=b.width*b.height}):[]},isNodeIntersecting:(g,v,y=!0)=>{const b=A1(g)?g:d(g);if(!b)return!1;const k=Sa(b,v);return y&&k>0||k>=v.width*v.height||k>=b.width*b.height},updateNode:f,updateNodeData:(g,v,y={replace:!1})=>{f(g,S=>{const b=typeof v=="function"?v(S):v;return y.replace?{...S,data:b}:{...S,data:{...S.data,...b}}},y)},updateEdge:m,updateEdgeData:(g,v,y={replace:!1})=>{m(g,S=>{const b=typeof v=="function"?v(S):v;return y.replace?{...S,data:b}:{...S,data:{...S.data,...b}}},y)},getNodesBounds:g=>{const{nodeLookup:v,nodeOrigin:y}=t.getState();return lD(g,{nodeLookup:v,nodeOrigin:y})},getHandleConnections:({type:g,id:v,nodeId:y})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${y}-${g}${v?`-${v}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:g,handleId:v,nodeId:y})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${y}${g?v?`-${g}-${v}`:`-${g}`:""}`))==null?void 0:S.values())??[])},fitView:async g=>{const v=t.getState().fitViewResolver??gD();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:v}),i.nodeQueue.push(y=>[...y]),v.promise}}},[]);return q.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const oS=e=>e.selected,VR=typeof window<"u"?window:void 0;function FR({deleteKeyCode:e,multiSelectionKeyCode:t}){const i=dt(),{deleteElements:r}=vh(),o=xa(e,{actInsideInputWithModifier:!1}),a=xa(t,{target:VR});q.useEffect(()=>{if(o){const{edges:c,nodes:h}=i.getState();r({nodes:h.filter(oS),edges:c.filter(oS)}),i.setState({nodesSelectionActive:!1})}},[o]),q.useEffect(()=>{i.setState({multiSelectionActive:a})},[a])}function $R(e){const t=dt();q.useEffect(()=>{const i=()=>{var o,a,c,h;if(!e.current||!(((a=(o=e.current).checkVisibility)==null?void 0:a.call(o))??!0))return!1;const r=im(e.current);(r.height===0||r.width===0)&&((h=(c=t.getState()).onError)==null||h.call(c,"004",Mn.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){i(),window.addEventListener("resize",i);const r=new ResizeObserver(()=>i());return r.observe(e.current),()=>{window.removeEventListener("resize",i),r&&e.current&&r.unobserve(e.current)}}},[])}const yh={position:"absolute",width:"100%",height:"100%",top:0,left:0},YR=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function WR({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:i=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:a=Es.Free,zoomOnDoubleClick:c=!0,panOnDrag:h=!0,defaultViewport:d,translateExtent:f,minZoom:m,maxZoom:g,zoomActivationKeyCode:v,preventScrolling:y=!0,children:S,noWheelClassName:b,noPanClassName:k,onViewportChange:C,isControlledViewport:z,paneClickDistance:E,selectionOnDrag:T}){const P=dt(),R=q.useRef(null),{userSelectionActive:U,lib:X,connectionInProgress:G}=$e(YR,ft),ne=xa(v),V=q.useRef();$R(R);const I=q.useCallback(F=>{C==null||C({x:F[0],y:F[1],zoom:F[2]}),z||P.setState({transform:F})},[C,z]);return q.useEffect(()=>{if(R.current){V.current=QD({domNode:R.current,minZoom:m,maxZoom:g,translateExtent:f,viewport:d,onDraggingChange:M=>P.setState({paneDragging:M}),onPanZoomStart:(M,j)=>{const{onViewportChangeStart:H,onMoveStart:$}=P.getState();$==null||$(M,j),H==null||H(j)},onPanZoom:(M,j)=>{const{onViewportChange:H,onMove:$}=P.getState();$==null||$(M,j),H==null||H(j)},onPanZoomEnd:(M,j)=>{const{onViewportChangeEnd:H,onMoveEnd:$}=P.getState();$==null||$(M,j),H==null||H(j)}});const{x:F,y:B,zoom:O}=V.current.getViewport();return P.setState({panZoom:V.current,transform:[F,B,O],domNode:R.current.closest(".react-flow")}),()=>{var M;(M=V.current)==null||M.destroy()}}},[]),q.useEffect(()=>{var F;(F=V.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:i,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:c,panOnDrag:h,zoomActivationKeyPressed:ne,preventScrolling:y,noPanClassName:k,userSelectionActive:U,noWheelClassName:b,lib:X,onTransformChange:I,connectionInProgress:G,selectionOnDrag:T,paneClickDistance:E})},[e,t,i,r,o,a,c,h,ne,y,k,U,b,X,I,G,T,E]),w.jsx("div",{className:"react-flow__renderer",ref:R,style:yh,children:S})}const XR=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function KR(){const{userSelectionActive:e,userSelectionRect:t}=$e(XR,ft);return e&&t?w.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 pp=(e,t)=>i=>{i.target===t.current&&(e==null||e(i))},GR=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function ZR({isSelecting:e,selectionKeyPressed:t,selectionMode:i=va.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:a,onSelectionStart:c,onSelectionEnd:h,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:y,children:S}){const b=dt(),{userSelectionActive:k,elementsSelectable:C,dragging:z,connectionInProgress:E}=$e(GR,ft),T=C&&(e||k),P=q.useRef(null),R=q.useRef(),U=q.useRef(new Set),X=q.useRef(new Set),G=q.useRef(!1),ne=H=>{if(G.current||E){G.current=!1;return}d==null||d(H),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},V=H=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){H.preventDefault();return}f==null||f(H)},I=m?H=>m(H):void 0,F=H=>{G.current&&(H.stopPropagation(),G.current=!1)},B=H=>{var ce,le;const{domNode:$}=b.getState();if(R.current=$==null?void 0:$.getBoundingClientRect(),!R.current)return;const N=H.target===P.current;if(!N&&!!H.target.closest(".nokey")||!e||!(a&&N||t)||H.button!==0||!H.isPrimary)return;(le=(ce=H.target)==null?void 0:ce.setPointerCapture)==null||le.call(ce,H.pointerId),G.current=!1;const{x:A,y:ee}=cn(H.nativeEvent,R.current);b.setState({userSelectionRect:{width:0,height:0,startX:A,startY:ee,x:A,y:ee}}),N||(H.stopPropagation(),H.preventDefault())},O=H=>{const{userSelectionRect:$,transform:N,nodeLookup:L,edgeLookup:Y,connectionLookup:A,triggerNodeChanges:ee,triggerEdgeChanges:ce,defaultEdgeOptions:le,resetSelectedElements:fe}=b.getState();if(!R.current||!$)return;const{x:he,y:pe}=cn(H.nativeEvent,R.current),{startX:Ce,startY:xe}=$;if(!G.current){const ze=t?0:o;if(Math.hypot(he-Ce,pe-xe)<=ze)return;fe(),c==null||c(H)}G.current=!0;const Se={startX:Ce,startY:xe,x:he<Ce?he:Ce,y:pe<xe?pe:xe,width:Math.abs(he-Ce),height:Math.abs(pe-xe)},me=U.current,Ae=X.current;U.current=new Set(em(L,Se,N,i===va.Partial,!0).map(ze=>ze.id)),X.current=new Set;const Ye=(le==null?void 0:le.selectable)??!0;for(const ze of U.current){const St=A.get(ze);if(St)for(const{edgeId:Ci}of St.values()){const Jt=Y.get(Ci);Jt&&(Jt.selectable??Ye)&&X.current.add(Ci)}}if(!D1(me,U.current)){const ze=Mo(L,U.current,!0);ee(ze)}if(!D1(Ae,X.current)){const ze=Mo(Y,X.current);ce(ze)}b.setState({userSelectionRect:Se,userSelectionActive:!0,nodesSelectionActive:!1})},M=H=>{var $,N;H.button===0&&((N=($=H.target)==null?void 0:$.releasePointerCapture)==null||N.call($,H.pointerId),!k&&H.target===P.current&&b.getState().userSelectionRect&&(ne==null||ne(H)),b.setState({userSelectionActive:!1,userSelectionRect:null}),G.current&&(h==null||h(H),b.setState({nodesSelectionActive:U.current.size>0})))},j=r===!0||Array.isArray(r)&&r.includes(0);return w.jsxs("div",{className:Bt(["react-flow__pane",{draggable:j,dragging:z,selection:e}]),onClick:T?void 0:pp(ne,P),onContextMenu:pp(V,P),onWheel:pp(I,P),onPointerEnter:T?void 0:g,onPointerMove:T?O:v,onPointerUp:T?M:void 0,onPointerDownCapture:T?B:void 0,onClickCapture:T?F:void 0,onPointerLeave:y,ref:P,style:yh,children:[S,w.jsx(KR,{})]})}function Eg({id:e,store:t,unselect:i=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:c,nodeLookup:h,onError:d}=t.getState(),f=h.get(e);if(!f){d==null||d("012",Mn.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(i||f.selected&&c)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):o([e])}function yw({nodeRef:e,disabled:t=!1,noDragClassName:i,handleSelector:r,nodeId:o,isSelectable:a,nodeClickDistance:c}){const h=dt(),[d,f]=q.useState(!1),m=q.useRef();return q.useEffect(()=>{m.current=jD({getStoreItems:()=>h.getState(),onNodeMouseDown:g=>{Eg({id:g,store:h,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),q.useEffect(()=>{var g,v;if(t)(g=m.current)==null||g.destroy();else if(e.current)return(v=m.current)==null||v.update({noDragClassName:i,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:o,nodeClickDistance:c}),()=>{var y;(y=m.current)==null||y.destroy()}},[i,r,t,a,e,o]),d}const QR=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Sw(){const e=dt();return q.useCallback(i=>{const{nodeExtent:r,snapToGrid:o,snapGrid:a,nodesDraggable:c,onError:h,updateNodePositions:d,nodeLookup:f,nodeOrigin:m}=e.getState(),g=new Map,v=QR(c),y=o?a[0]:5,S=o?a[1]:5,b=i.direction.x*y*i.factor,k=i.direction.y*S*i.factor;for(const[,C]of f){if(!v(C))continue;let z={x:C.internals.positionAbsolute.x+b,y:C.internals.positionAbsolute.y+k};o&&(z=La(z,a));const{position:E,positionAbsolute:T}=Ix({nodeId:C.id,nextPosition:z,nodeLookup:f,nodeExtent:r,nodeOrigin:m,onError:h});C.position=E,C.internals.positionAbsolute=T,g.set(C.id,C)}d(g)},[])}const cm=q.createContext(null),JR=cm.Provider;cm.Consumer;const bw=()=>q.useContext(cm),e4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),t4=(e,t,i)=>r=>{const{connectionClickStartHandle:o,connectionMode:a,connection:c}=r,{fromHandle:h,toHandle:d,isValid:f}=c,m=(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===i;return{connectingFrom:(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===t&&(h==null?void 0:h.type)===i,connectingTo:m,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===i,isPossibleEndHandle:a===zo.Strict?(h==null?void 0:h.type)!==i:e!==(h==null?void 0:h.nodeId)||t!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!o,valid:m&&f}};function i4({type:e="source",position:t=we.Top,isValidConnection:i,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:c,onConnect:h,children:d,className:f,onMouseDown:m,onTouchStart:g,...v},y){var O,M;const S=c||null,b=e==="target",k=dt(),C=bw(),{connectOnClick:z,noPanClassName:E,rfId:T}=$e(e4,ft),{connectingFrom:P,connectingTo:R,clickConnecting:U,isPossibleEndHandle:X,connectionInProcess:G,clickConnectionInProcess:ne,valid:V}=$e(t4(C,S,e),ft);C||(M=(O=k.getState()).onError)==null||M.call(O,"010",Mn.error010());const I=j=>{const{defaultEdgeOptions:H,onConnect:$,hasDefaultEdges:N}=k.getState(),L={...H,...j};if(N){const{edges:Y,setEdges:A}=k.getState();A(xD(L,Y))}$==null||$(L),h==null||h(L)},F=j=>{if(!C)return;const H=Xx(j.nativeEvent);if(o&&(H&&j.button===0||!H)){const $=k.getState();Cg.onPointerDown(j.nativeEvent,{handleDomNode:j.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:b,handleId:S,nodeId:C,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:$.onConnectEnd,updateConnection:$.updateConnection,onConnect:I,isValidConnection:i||$.isValidConnection,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}H?m==null||m(j):g==null||g(j)},B=j=>{const{onClickConnectStart:H,onClickConnectEnd:$,connectionClickStartHandle:N,connectionMode:L,isValidConnection:Y,lib:A,rfId:ee,nodeLookup:ce,connection:le}=k.getState();if(!C||!N&&!o)return;if(!N){H==null||H(j.nativeEvent,{nodeId:C,handleId:S,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:C,type:e,id:S}});return}const fe=Yx(j.target),he=i||Y,{connection:pe,isValid:Ce}=Cg.isValid(j.nativeEvent,{handle:{nodeId:C,id:S,type:e},connectionMode:L,fromNodeId:N.nodeId,fromHandleId:N.id||null,fromType:N.type,isValidConnection:he,flowId:ee,doc:fe,lib:A,nodeLookup:ce});Ce&&pe&&I(pe);const xe=structuredClone(le);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,$==null||$(j,xe),k.setState({connectionClickStartHandle:null})};return w.jsx("div",{"data-handleid":S,"data-nodeid":C,"data-handlepos":t,"data-id":`${T}-${C}-${S}-${e}`,className:Bt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,f,{source:!b,target:b,connectable:r,connectablestart:o,connectableend:a,clickconnecting:U,connectingfrom:P,connectingto:R,valid:V,connectionindicator:r&&(!G||X)&&(G||ne?a:o)}]),onMouseDown:F,onTouchStart:F,onClick:z?B:void 0,ref:y,...v,children:d})}const Xr=q.memo(_w(i4));function n4({data:e,isConnectable:t,sourcePosition:i=we.Bottom}){return w.jsxs(w.Fragment,{children:[e==null?void 0:e.label,w.jsx(Xr,{type:"source",position:i,isConnectable:t})]})}function r4({data:e,isConnectable:t,targetPosition:i=we.Top,sourcePosition:r=we.Bottom}){return w.jsxs(w.Fragment,{children:[w.jsx(Xr,{type:"target",position:i,isConnectable:t}),e==null?void 0:e.label,w.jsx(Xr,{type:"source",position:r,isConnectable:t})]})}function s4(){return null}function o4({data:e,isConnectable:t,targetPosition:i=we.Top}){return w.jsxs(w.Fragment,{children:[w.jsx(Xr,{type:"target",position:i,isConnectable:t}),e==null?void 0:e.label]})}const Ju={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},lS={input:n4,default:r4,output:o4,group:s4};function l4(e){var t,i,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((i=e.style)==null?void 0:i.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const a4=e=>{const{width:t,height:i,x:r,y:o}=Ba(e.nodeLookup,{filter:a=>!!a.selected});return{width:an(t)?t:null,height:an(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function c4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:i}){const r=dt(),{width:o,height:a,transformString:c,userSelectionActive:h}=$e(a4,ft),d=Sw(),f=q.useRef(null);if(q.useEffect(()=>{var v;i||(v=f.current)==null||v.focus({preventScroll:!0})},[i]),yw({nodeRef:f}),h||!o||!a)return null;const m=e?v=>{const y=r.getState().nodes.filter(S=>S.selected);e(v,y)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(Ju,v.key)&&(v.preventDefault(),d({direction:Ju[v.key],factor:v.shiftKey?4:1}))};return w.jsx("div",{className:Bt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c},children:w.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:i?void 0:-1,onKeyDown:i?void 0:g,style:{width:o,height:a}})})}const aS=typeof window<"u"?window:void 0,u4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function xw({children:e,onPaneClick:t,onPaneMouseEnter:i,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:c,paneClickDistance:h,deleteKeyCode:d,selectionKeyCode:f,selectionOnDrag:m,selectionMode:g,onSelectionStart:v,onSelectionEnd:y,multiSelectionKeyCode:S,panActivationKeyCode:b,zoomActivationKeyCode:k,elementsSelectable:C,zoomOnScroll:z,zoomOnPinch:E,panOnScroll:T,panOnScrollSpeed:P,panOnScrollMode:R,zoomOnDoubleClick:U,panOnDrag:X,defaultViewport:G,translateExtent:ne,minZoom:V,maxZoom:I,preventScrolling:F,onSelectionContextMenu:B,noWheelClassName:O,noPanClassName:M,disableKeyboardA11y:j,onViewportChange:H,isControlledViewport:$}){const{nodesSelectionActive:N,userSelectionActive:L}=$e(u4,ft),Y=xa(f,{target:aS}),A=xa(b,{target:aS}),ee=A||X,ce=A||T,le=m&&ee!==!0,fe=Y||L||le;return FR({deleteKeyCode:d,multiSelectionKeyCode:S}),w.jsx(WR,{onPaneContextMenu:a,elementsSelectable:C,zoomOnScroll:z,zoomOnPinch:E,panOnScroll:ce,panOnScrollSpeed:P,panOnScrollMode:R,zoomOnDoubleClick:U,panOnDrag:!Y&&ee,defaultViewport:G,translateExtent:ne,minZoom:V,maxZoom:I,zoomActivationKeyCode:k,preventScrolling:F,noWheelClassName:O,noPanClassName:M,onViewportChange:H,isControlledViewport:$,paneClickDistance:h,selectionOnDrag:le,children:w.jsxs(ZR,{onSelectionStart:v,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:i,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:c,panOnDrag:ee,isSelecting:!!fe,selectionMode:g,selectionKeyPressed:Y,paneClickDistance:h,selectionOnDrag:le,children:[e,N&&w.jsx(c4,{onSelectionContextMenu:B,noPanClassName:M,disableKeyboardA11y:j})]})})}xw.displayName="FlowRenderer";const h4=q.memo(xw),f4=e=>t=>e?em(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(i=>i.id):Array.from(t.nodeLookup.keys());function d4(e){return $e(q.useCallback(f4(e),[e]),ft)}const p4=e=>e.updateNodeInternals;function g4(){const e=$e(p4),[t]=q.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const r=new Map;i.forEach(o=>{const a=o.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:o.target,force:!0})}),e(r)}));return q.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function m4({node:e,nodeType:t,hasDimensions:i,resizeObserver:r}){const o=dt(),a=q.useRef(null),c=q.useRef(null),h=q.useRef(e.sourcePosition),d=q.useRef(e.targetPosition),f=q.useRef(t),m=i&&!!e.internals.handleBounds;return q.useEffect(()=>{a.current&&!e.hidden&&(!m||c.current!==a.current)&&(c.current&&(r==null||r.unobserve(c.current)),r==null||r.observe(a.current),c.current=a.current)},[m,e.hidden]),q.useEffect(()=>()=>{c.current&&(r==null||r.unobserve(c.current),c.current=null)},[]),q.useEffect(()=>{if(a.current){const g=f.current!==t,v=h.current!==e.sourcePosition,y=d.current!==e.targetPosition;(g||v||y)&&(f.current=t,h.current=e.sourcePosition,d.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function _4({id:e,onClick:t,onMouseEnter:i,onMouseMove:r,onMouseLeave:o,onContextMenu:a,onDoubleClick:c,nodesDraggable:h,elementsSelectable:d,nodesConnectable:f,nodesFocusable:m,resizeObserver:g,noDragClassName:v,noPanClassName:y,disableKeyboardA11y:S,rfId:b,nodeTypes:k,nodeClickDistance:C,onError:z}){const{node:E,internals:T,isParent:P}=$e(he=>{const pe=he.nodeLookup.get(e),Ce=he.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:Ce}},ft);let R=E.type||"default",U=(k==null?void 0:k[R])||lS[R];U===void 0&&(z==null||z("003",Mn.error003(R)),R="default",U=(k==null?void 0:k.default)||lS.default);const X=!!(E.draggable||h&&typeof E.draggable>"u"),G=!!(E.selectable||d&&typeof E.selectable>"u"),ne=!!(E.connectable||f&&typeof E.connectable>"u"),V=!!(E.focusable||m&&typeof E.focusable>"u"),I=dt(),F=Fx(E),B=m4({node:E,nodeType:R,hasDimensions:F,resizeObserver:g}),O=yw({nodeRef:B,disabled:E.hidden||!X,noDragClassName:v,handleSelector:E.dragHandle,nodeId:e,isSelectable:G,nodeClickDistance:C}),M=Sw();if(E.hidden)return null;const j=lr(E),H=l4(E),$=G||X||t||i||r||o,N=i?he=>i(he,{...T.userNode}):void 0,L=r?he=>r(he,{...T.userNode}):void 0,Y=o?he=>o(he,{...T.userNode}):void 0,A=a?he=>a(he,{...T.userNode}):void 0,ee=c?he=>c(he,{...T.userNode}):void 0,ce=he=>{const{selectNodesOnDrag:pe,nodeDragThreshold:Ce}=I.getState();G&&(!pe||!X||Ce>0)&&Eg({id:e,store:I,nodeRef:B}),t&&t(he,{...T.userNode})},le=he=>{if(!(Wx(he.nativeEvent)||S)){if(zx.includes(he.key)&&G){const pe=he.key==="Escape";Eg({id:e,store:I,unselect:pe,nodeRef:B})}else if(X&&E.selected&&Object.prototype.hasOwnProperty.call(Ju,he.key)){he.preventDefault();const{ariaLabelConfig:pe}=I.getState();I.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:he.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),M({direction:Ju[he.key],factor:he.shiftKey?4:1})}}},fe=()=>{var Ae;if(S||!((Ae=B.current)!=null&&Ae.matches(":focus-visible")))return;const{transform:he,width:pe,height:Ce,autoPanOnNodeFocus:xe,setCenter:Se}=I.getState();if(!xe)return;em(new Map([[e,E]]),{x:0,y:0,width:pe,height:Ce},he,!0).length>0||Se(E.position.x+j.width/2,E.position.y+j.height/2,{zoom:he[2]})};return w.jsx("div",{className:Bt(["react-flow__node",`react-flow__node-${R}`,{[y]:X},E.className,{selected:E.selected,selectable:G,parent:P,draggable:X,dragging:O}]),ref:B,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:F?"visible":"hidden",...E.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:N,onMouseMove:L,onMouseLeave:Y,onContextMenu:A,onClick:ce,onDoubleClick:ee,onKeyDown:V?le:void 0,tabIndex:V?0:void 0,onFocus:V?fe:void 0,role:E.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${hw}-${b}`,"aria-label":E.ariaLabel,...E.domAttributes,children:w.jsx(JR,{value:e,children:w.jsx(U,{id:e,data:E.data,type:R,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:E.selected??!1,selectable:G,draggable:X,deletable:E.deletable??!0,isConnectable:ne,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:O,dragHandle:E.dragHandle,zIndex:T.z,parentId:E.parentId,...j})})})}var v4=q.memo(_4);const y4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ww(e){const{nodesDraggable:t,nodesConnectable:i,nodesFocusable:r,elementsSelectable:o,onError:a}=$e(y4,ft),c=d4(e.onlyRenderVisibleElements),h=g4();return w.jsx("div",{className:"react-flow__nodes",style:yh,children:c.map(d=>w.jsx(v4,{id:d,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:h,nodesDraggable:t,nodesConnectable:i,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:a},d))})}ww.displayName="NodeRenderer";const S4=q.memo(ww);function b4(e){return $e(q.useCallback(i=>{if(!e)return i.edges.map(o=>o.id);const r=[];if(i.width&&i.height)for(const o of i.edges){const a=i.nodeLookup.get(o.source),c=i.nodeLookup.get(o.target);a&&c&&yD({sourceNode:a,targetNode:c,width:i.width,height:i.height,transform:i.transform})&&r.push(o.id)}return r},[e]),ft)}const x4=({color:e="none",strokeWidth:t=1})=>{const i={strokeWidth:t,...e&&{stroke:e}};return w.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},w4=({color:e="none",strokeWidth:t=1})=>{const i={strokeWidth:t,...e&&{stroke:e,fill:e}};return w.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cS={[ya.Arrow]:x4,[ya.ArrowClosed]:w4};function C4(e){const t=dt();return q.useMemo(()=>{var o,a;return Object.prototype.hasOwnProperty.call(cS,e)?cS[e]:((a=(o=t.getState()).onError)==null||a.call(o,"009",Mn.error009(e)),null)},[e])}const E4=({id:e,type:t,color:i,width:r=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:c,orient:h="auto-start-reverse"})=>{const d=C4(t);return d?w.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:h,refX:"0",refY:"0",children:w.jsx(d,{color:i,strokeWidth:c})}):null},Cw=({defaultColor:e,rfId:t})=>{const i=$e(a=>a.edges),r=$e(a=>a.defaultEdgeOptions),o=q.useMemo(()=>MD(i,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[i,r,t,e]);return o.length?w.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:w.jsx("defs",{children:o.map(a=>w.jsx(E4,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};Cw.displayName="MarkerDefinitions";var k4=q.memo(Cw);function Ew({x:e,y:t,label:i,labelStyle:r,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:c=[2,4],labelBgBorderRadius:h=2,children:d,className:f,...m}){const[g,v]=q.useState({x:1,y:0,width:0,height:0}),y=Bt(["react-flow__edge-textwrapper",f]),S=q.useRef(null);return q.useEffect(()=>{if(S.current){const b=S.current.getBBox();v({x:b.x,y:b.y,width:b.width,height:b.height})}},[i]),i?w.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:y,visibility:g.width?"visible":"hidden",...m,children:[o&&w.jsx("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:a,rx:h,ry:h}),w.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:S,style:r,children:i}),d]}):null}Ew.displayName="EdgeText";const M4=q.memo(Ew);function Sh({path:e,labelX:t,labelY:i,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,interactionWidth:f=20,...m}){return w.jsxs(w.Fragment,{children:[w.jsx("path",{...m,d:e,fill:"none",className:Bt(["react-flow__edge-path",m.className])}),f?w.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&an(t)&&an(i)?w.jsx(M4,{x:t,y:i,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d}):null]})}function uS({pos:e,x1:t,y1:i,x2:r,y2:o}){return e===we.Left||e===we.Right?[.5*(t+r),i]:[t,.5*(i+o)]}function kw({sourceX:e,sourceY:t,sourcePosition:i=we.Bottom,targetX:r,targetY:o,targetPosition:a=we.Top}){const[c,h]=uS({pos:i,x1:e,y1:t,x2:r,y2:o}),[d,f]=uS({pos:a,x1:r,y1:o,x2:e,y2:t}),[m,g,v,y]=Kx({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:c,sourceControlY:h,targetControlX:d,targetControlY:f});return[`M${e},${t} C${c},${h} ${d},${f} ${r},${o}`,m,g,v,y]}function Mw(e){return q.memo(({id:t,sourceX:i,sourceY:r,targetX:o,targetY:a,sourcePosition:c,targetPosition:h,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:S,markerEnd:b,markerStart:k,interactionWidth:C})=>{const[z,E,T]=kw({sourceX:i,sourceY:r,sourcePosition:c,targetX:o,targetY:a,targetPosition:h}),P=e.isInternal?void 0:t;return w.jsx(Sh,{id:P,path:z,labelX:E,labelY:T,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:S,markerEnd:b,markerStart:k,interactionWidth:C})})}const T4=Mw({isInternal:!1}),Tw=Mw({isInternal:!0});T4.displayName="SimpleBezierEdge";Tw.displayName="SimpleBezierEdgeInternal";function Nw(e){return q.memo(({id:t,sourceX:i,sourceY:r,targetX:o,targetY:a,label:c,labelStyle:h,labelShowBg:d,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:g,style:v,sourcePosition:y=we.Bottom,targetPosition:S=we.Top,markerEnd:b,markerStart:k,pathOptions:C,interactionWidth:z})=>{const[E,T,P]=bg({sourceX:i,sourceY:r,sourcePosition:y,targetX:o,targetY:a,targetPosition:S,borderRadius:C==null?void 0:C.borderRadius,offset:C==null?void 0:C.offset,stepPosition:C==null?void 0:C.stepPosition}),R=e.isInternal?void 0:t;return w.jsx(Sh,{id:R,path:E,labelX:T,labelY:P,label:c,labelStyle:h,labelShowBg:d,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:b,markerStart:k,interactionWidth:z})})}const Aw=Nw({isInternal:!1}),Dw=Nw({isInternal:!0});Aw.displayName="SmoothStepEdge";Dw.displayName="SmoothStepEdgeInternal";function Rw(e){return q.memo(({id:t,...i})=>{var o;const r=e.isInternal?void 0:t;return w.jsx(Aw,{...i,id:r,pathOptions:q.useMemo(()=>{var a;return{borderRadius:0,offset:(a=i.pathOptions)==null?void 0:a.offset}},[(o=i.pathOptions)==null?void 0:o.offset])})})}const N4=Rw({isInternal:!1}),Bw=Rw({isInternal:!0});N4.displayName="StepEdge";Bw.displayName="StepEdgeInternal";function Lw(e){return q.memo(({id:t,sourceX:i,sourceY:r,targetX:o,targetY:a,label:c,labelStyle:h,labelShowBg:d,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:y,markerStart:S,interactionWidth:b})=>{const[k,C,z]=Zx({sourceX:i,sourceY:r,targetX:o,targetY:a}),E=e.isInternal?void 0:t;return w.jsx(Sh,{id:E,path:k,labelX:C,labelY:z,label:c,labelStyle:h,labelShowBg:d,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:y,markerStart:S,interactionWidth:b})})}const A4=Lw({isInternal:!1}),zw=Lw({isInternal:!0});A4.displayName="StraightEdge";zw.displayName="StraightEdgeInternal";function Ow(e){return q.memo(({id:t,sourceX:i,sourceY:r,targetX:o,targetY:a,sourcePosition:c=we.Bottom,targetPosition:h=we.Top,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:S,markerEnd:b,markerStart:k,pathOptions:C,interactionWidth:z})=>{const[E,T,P]=nm({sourceX:i,sourceY:r,sourcePosition:c,targetX:o,targetY:a,targetPosition:h,curvature:C==null?void 0:C.curvature}),R=e.isInternal?void 0:t;return w.jsx(Sh,{id:R,path:E,labelX:T,labelY:P,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:S,markerEnd:b,markerStart:k,interactionWidth:z})})}const D4=Ow({isInternal:!1}),Hw=Ow({isInternal:!0});D4.displayName="BezierEdge";Hw.displayName="BezierEdgeInternal";const hS={default:Hw,straight:zw,step:Bw,smoothstep:Dw,simplebezier:Tw},fS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},R4=(e,t,i)=>i===we.Left?e-t:i===we.Right?e+t:e,B4=(e,t,i)=>i===we.Top?e-t:i===we.Bottom?e+t:e,dS="react-flow__edgeupdater";function pS({position:e,centerX:t,centerY:i,radius:r=10,onMouseDown:o,onMouseEnter:a,onMouseOut:c,type:h}){return w.jsx("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:c,className:Bt([dS,`${dS}-${h}`]),cx:R4(t,r,e),cy:B4(i,r,e),r,stroke:"transparent",fill:"transparent"})}function L4({isReconnectable:e,reconnectRadius:t,edge:i,sourceX:r,sourceY:o,targetX:a,targetY:c,sourcePosition:h,targetPosition:d,onReconnect:f,onReconnectStart:m,onReconnectEnd:g,setReconnecting:v,setUpdateHover:y}){const S=dt(),b=(T,P)=>{if(T.button!==0)return;const{autoPanOnConnect:R,domNode:U,isValidConnection:X,connectionMode:G,connectionRadius:ne,lib:V,onConnectStart:I,onConnectEnd:F,cancelConnection:B,nodeLookup:O,rfId:M,panBy:j,updateConnection:H}=S.getState(),$=P.type==="target",N=(A,ee)=>{v(!1),g==null||g(A,i,P.type,ee)},L=A=>f==null?void 0:f(i,A),Y=(A,ee)=>{v(!0),m==null||m(T,i,P.type),I==null||I(A,ee)};Cg.onPointerDown(T.nativeEvent,{autoPanOnConnect:R,connectionMode:G,connectionRadius:ne,domNode:U,handleId:P.id,nodeId:P.nodeId,nodeLookup:O,isTarget:$,edgeUpdaterType:P.type,lib:V,flowId:M,cancelConnection:B,panBy:j,isValidConnection:X,onConnect:L,onConnectStart:Y,onConnectEnd:F,onReconnectEnd:N,updateConnection:H,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},k=T=>b(T,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),C=T=>b(T,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),z=()=>y(!0),E=()=>y(!1);return w.jsxs(w.Fragment,{children:[(e===!0||e==="source")&&w.jsx(pS,{position:h,centerX:r,centerY:o,radius:t,onMouseDown:k,onMouseEnter:z,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&w.jsx(pS,{position:d,centerX:a,centerY:c,radius:t,onMouseDown:C,onMouseEnter:z,onMouseOut:E,type:"target"})]})}function z4({id:e,edgesFocusable:t,edgesReconnectable:i,elementsSelectable:r,onClick:o,onDoubleClick:a,onContextMenu:c,onMouseEnter:h,onMouseMove:d,onMouseLeave:f,reconnectRadius:m,onReconnect:g,onReconnectStart:v,onReconnectEnd:y,rfId:S,edgeTypes:b,noPanClassName:k,onError:C,disableKeyboardA11y:z}){let E=$e(Se=>Se.edgeLookup.get(e));const T=$e(Se=>Se.defaultEdgeOptions);E=T?{...T,...E}:E;let P=E.type||"default",R=(b==null?void 0:b[P])||hS[P];R===void 0&&(C==null||C("011",Mn.error011(P)),P="default",R=(b==null?void 0:b.default)||hS.default);const U=!!(E.focusable||t&&typeof E.focusable>"u"),X=typeof g<"u"&&(E.reconnectable||i&&typeof E.reconnectable>"u"),G=!!(E.selectable||r&&typeof E.selectable>"u"),ne=q.useRef(null),[V,I]=q.useState(!1),[F,B]=q.useState(!1),O=dt(),{zIndex:M,sourceX:j,sourceY:H,targetX:$,targetY:N,sourcePosition:L,targetPosition:Y}=$e(q.useCallback(Se=>{const me=Se.nodeLookup.get(E.source),Ae=Se.nodeLookup.get(E.target);if(!me||!Ae)return{zIndex:E.zIndex,...fS};const Ye=kD({id:e,sourceNode:me,targetNode:Ae,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:Se.connectionMode,onError:C});return{zIndex:vD({selected:E.selected,zIndex:E.zIndex,sourceNode:me,targetNode:Ae,elevateOnSelect:Se.elevateEdgesOnSelect,zIndexMode:Se.zIndexMode}),...Ye||fS}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),ft),A=q.useMemo(()=>E.markerStart?`url('#${xg(E.markerStart,S)}')`:void 0,[E.markerStart,S]),ee=q.useMemo(()=>E.markerEnd?`url('#${xg(E.markerEnd,S)}')`:void 0,[E.markerEnd,S]);if(E.hidden||j===null||H===null||$===null||N===null)return null;const ce=Se=>{var ze;const{addSelectedEdges:me,unselectNodesAndEdges:Ae,multiSelectionActive:Ye}=O.getState();G&&(O.setState({nodesSelectionActive:!1}),E.selected&&Ye?(Ae({nodes:[],edges:[E]}),(ze=ne.current)==null||ze.blur()):me([e])),o&&o(Se,E)},le=a?Se=>{a(Se,{...E})}:void 0,fe=c?Se=>{c(Se,{...E})}:void 0,he=h?Se=>{h(Se,{...E})}:void 0,pe=d?Se=>{d(Se,{...E})}:void 0,Ce=f?Se=>{f(Se,{...E})}:void 0,xe=Se=>{var me;if(!z&&zx.includes(Se.key)&&G){const{unselectNodesAndEdges:Ae,addSelectedEdges:Ye}=O.getState();Se.key==="Escape"?((me=ne.current)==null||me.blur(),Ae({edges:[E]})):Ye([e])}};return w.jsx("svg",{style:{zIndex:M},children:w.jsxs("g",{className:Bt(["react-flow__edge",`react-flow__edge-${P}`,E.className,k,{selected:E.selected,animated:E.animated,inactive:!G&&!o,updating:V,selectable:G}]),onClick:ce,onDoubleClick:le,onContextMenu:fe,onMouseEnter:he,onMouseMove:pe,onMouseLeave:Ce,onKeyDown:U?xe:void 0,tabIndex:U?0:void 0,role:E.ariaRole??(U?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":U?`${fw}-${S}`:void 0,ref:ne,...E.domAttributes,children:[!F&&w.jsx(R,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:G,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:j,sourceY:H,targetX:$,targetY:N,sourcePosition:L,targetPosition:Y,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:A,markerEnd:ee,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),X&&w.jsx(L4,{edge:E,isReconnectable:X,reconnectRadius:m,onReconnect:g,onReconnectStart:v,onReconnectEnd:y,sourceX:j,sourceY:H,targetX:$,targetY:N,sourcePosition:L,targetPosition:Y,setUpdateHover:I,setReconnecting:B})]})})}var O4=q.memo(z4);const H4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function jw({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:i,edgeTypes:r,noPanClassName:o,onReconnect:a,onEdgeContextMenu:c,onEdgeMouseEnter:h,onEdgeMouseMove:d,onEdgeMouseLeave:f,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:v,onReconnectStart:y,onReconnectEnd:S,disableKeyboardA11y:b}){const{edgesFocusable:k,edgesReconnectable:C,elementsSelectable:z,onError:E}=$e(H4,ft),T=b4(t);return w.jsxs("div",{className:"react-flow__edges",children:[w.jsx(k4,{defaultColor:e,rfId:i}),T.map(P=>w.jsx(O4,{id:P,edgesFocusable:k,edgesReconnectable:C,elementsSelectable:z,noPanClassName:o,onReconnect:a,onContextMenu:c,onMouseEnter:h,onMouseMove:d,onMouseLeave:f,onClick:m,reconnectRadius:g,onDoubleClick:v,onReconnectStart:y,onReconnectEnd:S,rfId:i,onError:E,edgeTypes:r,disableKeyboardA11y:b},P))]})}jw.displayName="EdgeRenderer";const j4=q.memo(jw),P4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function I4({children:e}){const t=$e(P4);return w.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function U4(e){const t=vh(),i=q.useRef(!1);q.useEffect(()=>{!i.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),i.current=!0)},[e,t.viewportInitialized])}const q4=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function V4(e){const t=$e(q4),i=dt();return q.useEffect(()=>{e&&(t==null||t(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function F4(e){return e.connection.inProgress?{...e.connection,to:za(e.connection.to,e.transform)}:{...e.connection}}function $4(e){return F4}function Y4(e){const t=$4();return $e(t,ft)}const W4=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function X4({containerStyle:e,style:t,type:i,component:r}){const{nodesConnectable:o,width:a,height:c,isValid:h,inProgress:d}=$e(W4,ft);return!(a&&o&&d)?null:w.jsx("svg",{style:e,width:a,height:c,className:"react-flow__connectionline react-flow__container",children:w.jsx("g",{className:Bt(["react-flow__connection",jx(h)]),children:w.jsx(Pw,{style:t,type:i,CustomComponent:r,isValid:h})})})}const Pw=({style:e,type:t=$r.Bezier,CustomComponent:i,isValid:r})=>{const{inProgress:o,from:a,fromNode:c,fromHandle:h,fromPosition:d,to:f,toNode:m,toHandle:g,toPosition:v,pointer:y}=Y4();if(!o)return;if(i)return w.jsx(i,{connectionLineType:t,connectionLineStyle:e,fromNode:c,fromHandle:h,fromX:a.x,fromY:a.y,toX:f.x,toY:f.y,fromPosition:d,toPosition:v,connectionStatus:jx(r),toNode:m,toHandle:g,pointer:y});let S="";const b={sourceX:a.x,sourceY:a.y,sourcePosition:d,targetX:f.x,targetY:f.y,targetPosition:v};switch(t){case $r.Bezier:[S]=nm(b);break;case $r.SimpleBezier:[S]=kw(b);break;case $r.Step:[S]=bg({...b,borderRadius:0});break;case $r.SmoothStep:[S]=bg(b);break;default:[S]=Zx(b)}return w.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};Pw.displayName="ConnectionLine";const K4={};function gS(e=K4){q.useRef(e),dt(),q.useEffect(()=>{},[e])}function G4(){dt(),q.useRef(!1),q.useEffect(()=>{},[])}function Iw({nodeTypes:e,edgeTypes:t,onInit:i,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:v,onSelectionEnd:y,connectionLineType:S,connectionLineStyle:b,connectionLineComponent:k,connectionLineContainerStyle:C,selectionKeyCode:z,selectionOnDrag:E,selectionMode:T,multiSelectionKeyCode:P,panActivationKeyCode:R,zoomActivationKeyCode:U,deleteKeyCode:X,onlyRenderVisibleElements:G,elementsSelectable:ne,defaultViewport:V,translateExtent:I,minZoom:F,maxZoom:B,preventScrolling:O,defaultMarkerColor:M,zoomOnScroll:j,zoomOnPinch:H,panOnScroll:$,panOnScrollSpeed:N,panOnScrollMode:L,zoomOnDoubleClick:Y,panOnDrag:A,onPaneClick:ee,onPaneMouseEnter:ce,onPaneMouseMove:le,onPaneMouseLeave:fe,onPaneScroll:he,onPaneContextMenu:pe,paneClickDistance:Ce,nodeClickDistance:xe,onEdgeContextMenu:Se,onEdgeMouseEnter:me,onEdgeMouseMove:Ae,onEdgeMouseLeave:Ye,reconnectRadius:ze,onReconnect:St,onReconnectStart:Ci,onReconnectEnd:Jt,noDragClassName:ui,noWheelClassName:Qi,noPanClassName:An,disableKeyboardA11y:Dn,nodeExtent:Lt,rfId:ar,viewport:re,onViewportChange:ge}){return gS(e),gS(t),G4(),U4(i),V4(re),w.jsx(h4,{onPaneClick:ee,onPaneMouseEnter:ce,onPaneMouseMove:le,onPaneMouseLeave:fe,onPaneContextMenu:pe,onPaneScroll:he,paneClickDistance:Ce,deleteKeyCode:X,selectionKeyCode:z,selectionOnDrag:E,selectionMode:T,onSelectionStart:v,onSelectionEnd:y,multiSelectionKeyCode:P,panActivationKeyCode:R,zoomActivationKeyCode:U,elementsSelectable:ne,zoomOnScroll:j,zoomOnPinch:H,zoomOnDoubleClick:Y,panOnScroll:$,panOnScrollSpeed:N,panOnScrollMode:L,panOnDrag:A,defaultViewport:V,translateExtent:I,minZoom:F,maxZoom:B,onSelectionContextMenu:g,preventScrolling:O,noDragClassName:ui,noWheelClassName:Qi,noPanClassName:An,disableKeyboardA11y:Dn,onViewportChange:ge,isControlledViewport:!!re,children:w.jsxs(I4,{children:[w.jsx(j4,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:c,onReconnect:St,onReconnectStart:Ci,onReconnectEnd:Jt,onlyRenderVisibleElements:G,onEdgeContextMenu:Se,onEdgeMouseEnter:me,onEdgeMouseMove:Ae,onEdgeMouseLeave:Ye,reconnectRadius:ze,defaultMarkerColor:M,noPanClassName:An,disableKeyboardA11y:Dn,rfId:ar}),w.jsx(X4,{style:b,type:S,component:k,containerStyle:C}),w.jsx("div",{className:"react-flow__edgelabel-renderer"}),w.jsx(S4,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:h,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:m,nodeClickDistance:xe,onlyRenderVisibleElements:G,noPanClassName:An,noDragClassName:ui,disableKeyboardA11y:Dn,nodeExtent:Lt,rfId:ar}),w.jsx("div",{className:"react-flow__viewport-portal"})]})})}Iw.displayName="GraphView";const Z4=q.memo(Iw),mS=({nodes:e,edges:t,defaultNodes:i,defaultEdges:r,width:o,height:a,fitView:c,fitViewOptions:h,minZoom:d=.5,maxZoom:f=2,nodeOrigin:m,nodeExtent:g,zIndexMode:v="basic"}={})=>{const y=new Map,S=new Map,b=new Map,k=new Map,C=r??t??[],z=i??e??[],E=m??[0,0],T=g??_a;ew(b,k,C);const P=wg(z,y,S,{nodeOrigin:E,nodeExtent:T,zIndexMode:v});let R=[0,0,1];if(c&&o&&a){const U=Ba(y,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:X,y:G,zoom:ne}=tm(U,o,a,d,f,(h==null?void 0:h.padding)??.1);R=[X,G,ne]}return{rfId:"1",width:o??0,height:a??0,transform:R,nodes:z,nodesInitialized:P,nodeLookup:y,parentLookup:S,edges:C,edgeLookup:k,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:d,maxZoom:f,translateExtent:_a,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:zo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,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:h,fitViewResolver:null,connection:{...Hx},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:fD,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ox,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Q4=({nodes:e,edges:t,defaultNodes:i,defaultEdges:r,width:o,height:a,fitView:c,fitViewOptions:h,minZoom:d,maxZoom:f,nodeOrigin:m,nodeExtent:g,zIndexMode:v})=>mR((y,S)=>{async function b(){const{nodeLookup:k,panZoom:C,fitViewOptions:z,fitViewResolver:E,width:T,height:P,minZoom:R,maxZoom:U}=S();C&&(await uD({nodes:k,width:T,height:P,panZoom:C,minZoom:R,maxZoom:U},z),E==null||E.resolve(!0),y({fitViewResolver:null}))}return{...mS({nodes:e,edges:t,width:o,height:a,fitView:c,fitViewOptions:h,minZoom:d,maxZoom:f,nodeOrigin:m,nodeExtent:g,defaultNodes:i,defaultEdges:r,zIndexMode:v}),setNodes:k=>{const{nodeLookup:C,parentLookup:z,nodeOrigin:E,elevateNodesOnSelect:T,fitViewQueued:P,zIndexMode:R}=S(),U=wg(k,C,z,{nodeOrigin:E,nodeExtent:g,elevateNodesOnSelect:T,checkEquality:!0,zIndexMode:R});P&&U?(b(),y({nodes:k,nodesInitialized:U,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:k,nodesInitialized:U})},setEdges:k=>{const{connectionLookup:C,edgeLookup:z}=S();ew(C,z,k),y({edges:k})},setDefaultNodesAndEdges:(k,C)=>{if(k){const{setNodes:z}=S();z(k),y({hasDefaultNodes:!0})}if(C){const{setEdges:z}=S();z(C),y({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:C,nodeLookup:z,parentLookup:E,domNode:T,nodeOrigin:P,nodeExtent:R,debug:U,fitViewQueued:X,zIndexMode:G}=S(),{changes:ne,updatedInternals:V}=LD(k,z,E,T,P,R,G);V&&(AD(z,E,{nodeOrigin:P,nodeExtent:R,zIndexMode:G}),X?(b(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(ne==null?void 0:ne.length)>0&&(U&&console.log("React Flow: trigger node changes",ne),C==null||C(ne)))},updateNodePositions:(k,C=!1)=>{const z=[];let E=[];const{nodeLookup:T,triggerNodeChanges:P,connection:R,updateConnection:U,onNodesChangeMiddlewareMap:X}=S();for(const[G,ne]of k){const V=T.get(G),I=!!(V!=null&&V.expandParent&&(V!=null&&V.parentId)&&(ne!=null&&ne.position)),F={id:G,type:"position",position:I?{x:Math.max(0,ne.position.x),y:Math.max(0,ne.position.y)}:ne.position,dragging:C};if(V&&R.inProgress&&R.fromNode.id===V.id){const B=Ds(V,R.fromHandle,we.Left,!0);U({...R,from:B})}I&&V.parentId&&z.push({id:G,parentId:V.parentId,rect:{...ne.internals.positionAbsolute,width:ne.measured.width??0,height:ne.measured.height??0}}),E.push(F)}if(z.length>0){const{parentLookup:G,nodeOrigin:ne}=S(),V=am(z,T,G,ne);E.push(...V)}for(const G of X.values())E=G(E);P(E)},triggerNodeChanges:k=>{const{onNodesChange:C,setNodes:z,nodes:E,hasDefaultNodes:T,debug:P}=S();if(k!=null&&k.length){if(T){const R=gw(k,E);z(R)}P&&console.log("React Flow: trigger node changes",k),C==null||C(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:C,setEdges:z,edges:E,hasDefaultEdges:T,debug:P}=S();if(k!=null&&k.length){if(T){const R=mw(k,E);z(R)}P&&console.log("React Flow: trigger edge changes",k),C==null||C(k)}},addSelectedNodes:k=>{const{multiSelectionActive:C,edgeLookup:z,nodeLookup:E,triggerNodeChanges:T,triggerEdgeChanges:P}=S();if(C){const R=k.map(U=>Ss(U,!0));T(R);return}T(Mo(E,new Set([...k]),!0)),P(Mo(z))},addSelectedEdges:k=>{const{multiSelectionActive:C,edgeLookup:z,nodeLookup:E,triggerNodeChanges:T,triggerEdgeChanges:P}=S();if(C){const R=k.map(U=>Ss(U,!0));P(R);return}P(Mo(z,new Set([...k]))),T(Mo(E,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:C}={})=>{const{edges:z,nodes:E,nodeLookup:T,triggerNodeChanges:P,triggerEdgeChanges:R}=S(),U=k||E,X=C||z,G=U.map(V=>{const I=T.get(V.id);return I&&(I.selected=!1),Ss(V.id,!1)}),ne=X.map(V=>Ss(V.id,!1));P(G),R(ne)},setMinZoom:k=>{const{panZoom:C,maxZoom:z}=S();C==null||C.setScaleExtent([k,z]),y({minZoom:k})},setMaxZoom:k=>{const{panZoom:C,minZoom:z}=S();C==null||C.setScaleExtent([z,k]),y({maxZoom:k})},setTranslateExtent:k=>{var C;(C=S().panZoom)==null||C.setTranslateExtent(k),y({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:C,triggerNodeChanges:z,triggerEdgeChanges:E,elementsSelectable:T}=S();if(!T)return;const P=C.reduce((U,X)=>X.selected?[...U,Ss(X.id,!1)]:U,[]),R=k.reduce((U,X)=>X.selected?[...U,Ss(X.id,!1)]:U,[]);z(P),E(R)},setNodeExtent:k=>{const{nodes:C,nodeLookup:z,parentLookup:E,nodeOrigin:T,elevateNodesOnSelect:P,nodeExtent:R,zIndexMode:U}=S();k[0][0]===R[0][0]&&k[0][1]===R[0][1]&&k[1][0]===R[1][0]&&k[1][1]===R[1][1]||(wg(C,z,E,{nodeOrigin:T,nodeExtent:k,elevateNodesOnSelect:P,checkEquality:!1,zIndexMode:U}),y({nodeExtent:k}))},panBy:k=>{const{transform:C,width:z,height:E,panZoom:T,translateExtent:P}=S();return zD({delta:k,panZoom:T,transform:C,translateExtent:P,width:z,height:E})},setCenter:async(k,C,z)=>{const{width:E,height:T,maxZoom:P,panZoom:R}=S();if(!R)return Promise.resolve(!1);const U=typeof(z==null?void 0:z.zoom)<"u"?z.zoom:P;return await R.setViewport({x:E/2-k*U,y:T/2-C*U,zoom:U},{duration:z==null?void 0:z.duration,ease:z==null?void 0:z.ease,interpolate:z==null?void 0:z.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{y({connection:{...Hx}})},updateConnection:k=>{y({connection:k})},reset:()=>y({...mS()})}},Object.is);function Uw({initialNodes:e,initialEdges:t,defaultNodes:i,defaultEdges:r,initialWidth:o,initialHeight:a,initialMinZoom:c,initialMaxZoom:h,initialFitViewOptions:d,fitView:f,nodeOrigin:m,nodeExtent:g,zIndexMode:v,children:y}){const[S]=q.useState(()=>Q4({nodes:e,edges:t,defaultNodes:i,defaultEdges:r,width:o,height:a,fitView:f,minZoom:c,maxZoom:h,fitViewOptions:d,nodeOrigin:m,nodeExtent:g,zIndexMode:v}));return w.jsx(_R,{value:S,children:w.jsx(IR,{children:y})})}function J4({children:e,nodes:t,edges:i,defaultNodes:r,defaultEdges:o,width:a,height:c,fitView:h,fitViewOptions:d,minZoom:f,maxZoom:m,nodeOrigin:g,nodeExtent:v,zIndexMode:y}){return q.useContext(mh)?w.jsx(w.Fragment,{children:e}):w.jsx(Uw,{initialNodes:t,initialEdges:i,defaultNodes:r,defaultEdges:o,initialWidth:a,initialHeight:c,fitView:h,initialFitViewOptions:d,initialMinZoom:f,initialMaxZoom:m,nodeOrigin:g,nodeExtent:v,zIndexMode:y,children:e})}const eB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function tB({nodes:e,edges:t,defaultNodes:i,defaultEdges:r,className:o,nodeTypes:a,edgeTypes:c,onNodeClick:h,onEdgeClick:d,onInit:f,onMove:m,onMoveStart:g,onMoveEnd:v,onConnect:y,onConnectStart:S,onConnectEnd:b,onClickConnectStart:k,onClickConnectEnd:C,onNodeMouseEnter:z,onNodeMouseMove:E,onNodeMouseLeave:T,onNodeContextMenu:P,onNodeDoubleClick:R,onNodeDragStart:U,onNodeDrag:X,onNodeDragStop:G,onNodesDelete:ne,onEdgesDelete:V,onDelete:I,onSelectionChange:F,onSelectionDragStart:B,onSelectionDrag:O,onSelectionDragStop:M,onSelectionContextMenu:j,onSelectionStart:H,onSelectionEnd:$,onBeforeDelete:N,connectionMode:L,connectionLineType:Y=$r.Bezier,connectionLineStyle:A,connectionLineComponent:ee,connectionLineContainerStyle:ce,deleteKeyCode:le="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:he=!1,selectionMode:pe=va.Full,panActivationKeyCode:Ce="Space",multiSelectionKeyCode:xe=ba()?"Meta":"Control",zoomActivationKeyCode:Se=ba()?"Meta":"Control",snapToGrid:me,snapGrid:Ae,onlyRenderVisibleElements:Ye=!1,selectNodesOnDrag:ze,nodesDraggable:St,autoPanOnNodeFocus:Ci,nodesConnectable:Jt,nodesFocusable:ui,nodeOrigin:Qi=dw,edgesFocusable:An,edgesReconnectable:Dn,elementsSelectable:Lt=!0,defaultViewport:ar=AR,minZoom:re=.5,maxZoom:ge=2,translateExtent:ke=_a,preventScrolling:Oe=!0,nodeExtent:Fe,defaultMarkerColor:si="#b1b1b7",zoomOnScroll:Ji=!0,zoomOnPinch:Yt=!0,panOnScroll:bt=!1,panOnScrollSpeed:ei=.5,panOnScrollMode:Ze=Es.Free,zoomOnDoubleClick:hn=!0,panOnDrag:Ei=!0,onPaneClick:Ch,onPaneMouseEnter:Ls,onPaneMouseMove:zs,onPaneMouseLeave:Os,onPaneScroll:Rn,onPaneContextMenu:Hs,paneClickDistance:Gr=1,nodeClickDistance:Eh=0,children:ja,onReconnect:Fo,onReconnectStart:Zr,onReconnectEnd:kh,onEdgeContextMenu:Pa,onEdgeDoubleClick:Ia,onEdgeMouseEnter:Ua,onEdgeMouseMove:$o,onEdgeMouseLeave:Yo,reconnectRadius:qa=10,onNodesChange:Va,onEdgesChange:fn,noDragClassName:zt="nodrag",noWheelClassName:ti="nowheel",noPanClassName:Bn="nopan",fitView:js,fitViewOptions:Fa,connectOnClick:Mh,attributionPosition:$a,proOptions:Qr,defaultEdgeOptions:Wo,elevateNodesOnSelect:cr=!0,elevateEdgesOnSelect:ur=!1,disableKeyboardA11y:hr=!1,autoPanOnConnect:fr,autoPanOnNodeDrag:Et,autoPanSpeed:Ya,connectionRadius:Wa,isValidConnection:Ln,onError:dr,style:Th,id:Xo,nodeDragThreshold:Xa,connectionDragThreshold:Nh,viewport:Ps,onViewportChange:Is,width:en,height:hi,colorMode:Ka="light",debug:Ah,onScroll:pr,ariaLabelConfig:Ga,zIndexMode:Jr="basic",...Dh},fi){const es=Xo||"1",Za=LR(Ka),Ko=q.useCallback(zn=>{zn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),pr==null||pr(zn)},[pr]);return w.jsx("div",{"data-testid":"rf__wrapper",...Dh,onScroll:Ko,style:{...Th,...eB},ref:fi,className:Bt(["react-flow",o,Za]),id:Xo,role:"application",children:w.jsxs(J4,{nodes:e,edges:t,width:en,height:hi,fitView:js,fitViewOptions:Fa,minZoom:re,maxZoom:ge,nodeOrigin:Qi,nodeExtent:Fe,zIndexMode:Jr,children:[w.jsx(Z4,{onInit:f,onNodeClick:h,onEdgeClick:d,onNodeMouseEnter:z,onNodeMouseMove:E,onNodeMouseLeave:T,onNodeContextMenu:P,onNodeDoubleClick:R,nodeTypes:a,edgeTypes:c,connectionLineType:Y,connectionLineStyle:A,connectionLineComponent:ee,connectionLineContainerStyle:ce,selectionKeyCode:fe,selectionOnDrag:he,selectionMode:pe,deleteKeyCode:le,multiSelectionKeyCode:xe,panActivationKeyCode:Ce,zoomActivationKeyCode:Se,onlyRenderVisibleElements:Ye,defaultViewport:ar,translateExtent:ke,minZoom:re,maxZoom:ge,preventScrolling:Oe,zoomOnScroll:Ji,zoomOnPinch:Yt,zoomOnDoubleClick:hn,panOnScroll:bt,panOnScrollSpeed:ei,panOnScrollMode:Ze,panOnDrag:Ei,onPaneClick:Ch,onPaneMouseEnter:Ls,onPaneMouseMove:zs,onPaneMouseLeave:Os,onPaneScroll:Rn,onPaneContextMenu:Hs,paneClickDistance:Gr,nodeClickDistance:Eh,onSelectionContextMenu:j,onSelectionStart:H,onSelectionEnd:$,onReconnect:Fo,onReconnectStart:Zr,onReconnectEnd:kh,onEdgeContextMenu:Pa,onEdgeDoubleClick:Ia,onEdgeMouseEnter:Ua,onEdgeMouseMove:$o,onEdgeMouseLeave:Yo,reconnectRadius:qa,defaultMarkerColor:si,noDragClassName:zt,noWheelClassName:ti,noPanClassName:Bn,rfId:es,disableKeyboardA11y:hr,nodeExtent:Fe,viewport:Ps,onViewportChange:Is}),w.jsx(BR,{nodes:e,edges:t,defaultNodes:i,defaultEdges:r,onConnect:y,onConnectStart:S,onConnectEnd:b,onClickConnectStart:k,onClickConnectEnd:C,nodesDraggable:St,autoPanOnNodeFocus:Ci,nodesConnectable:Jt,nodesFocusable:ui,edgesFocusable:An,edgesReconnectable:Dn,elementsSelectable:Lt,elevateNodesOnSelect:cr,elevateEdgesOnSelect:ur,minZoom:re,maxZoom:ge,nodeExtent:Fe,onNodesChange:Va,onEdgesChange:fn,snapToGrid:me,snapGrid:Ae,connectionMode:L,translateExtent:ke,connectOnClick:Mh,defaultEdgeOptions:Wo,fitView:js,fitViewOptions:Fa,onNodesDelete:ne,onEdgesDelete:V,onDelete:I,onNodeDragStart:U,onNodeDrag:X,onNodeDragStop:G,onSelectionDrag:O,onSelectionDragStart:B,onSelectionDragStop:M,onMove:m,onMoveStart:g,onMoveEnd:v,noPanClassName:Bn,nodeOrigin:Qi,rfId:es,autoPanOnConnect:fr,autoPanOnNodeDrag:Et,autoPanSpeed:Ya,onError:dr,connectionRadius:Wa,isValidConnection:Ln,selectNodesOnDrag:ze,nodeDragThreshold:Xa,connectionDragThreshold:Nh,onBeforeDelete:N,debug:Ah,ariaLabelConfig:Ga,zIndexMode:Jr}),w.jsx(NR,{onSelectionChange:F}),ja,w.jsx(CR,{proOptions:Qr,position:$a}),w.jsx(wR,{rfId:es,disableKeyboardA11y:hr})]})})}var iB=_w(tB);function nB(e){const[t,i]=q.useState(e),r=q.useCallback(o=>i(a=>gw(o,a)),[]);return[t,i,r]}function rB(e){const[t,i]=q.useState(e),r=q.useCallback(o=>i(a=>mw(o,a)),[]);return[t,i,r]}function sB({dimensions:e,lineWidth:t,variant:i,className:r}){return w.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Bt(["react-flow__background-pattern",i,r])})}function oB({radius:e,className:t}){return w.jsx("circle",{cx:e,cy:e,r:e,className:Bt(["react-flow__background-pattern","dots",t])})}var nr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(nr||(nr={}));const lB={[nr.Dots]:1,[nr.Lines]:1,[nr.Cross]:6},aB=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function qw({id:e,variant:t=nr.Dots,gap:i=20,size:r,lineWidth:o=1,offset:a=0,color:c,bgColor:h,style:d,className:f,patternClassName:m}){const g=q.useRef(null),{transform:v,patternId:y}=$e(aB,ft),S=r||lB[t],b=t===nr.Dots,k=t===nr.Cross,C=Array.isArray(i)?i:[i,i],z=[C[0]*v[2]||1,C[1]*v[2]||1],E=S*v[2],T=Array.isArray(a)?a:[a,a],P=k?[E,E]:z,R=[T[0]*v[2]||1+P[0]/2,T[1]*v[2]||1+P[1]/2],U=`${y}${e||""}`;return w.jsxs("svg",{className:Bt(["react-flow__background",f]),style:{...d,...yh,"--xy-background-color-props":h,"--xy-background-pattern-color-props":c},ref:g,"data-testid":"rf__background",children:[w.jsx("pattern",{id:U,x:v[0]%z[0],y:v[1]%z[1],width:z[0],height:z[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:b?w.jsx(oB,{radius:E/2,className:m}):w.jsx(sB,{dimensions:P,lineWidth:o,variant:t,className:m})}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}qw.displayName="Background";const cB=q.memo(qw);function uB(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:w.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function hB(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:w.jsx("path",{d:"M0 0h32v4.2H0z"})})}function fB(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:w.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 dB(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 pB(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 bu({children:e,className:t,...i}){return w.jsx("button",{type:"button",className:Bt(["react-flow__controls-button",t]),...i,children:e})}const gB=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Vw({style:e,showZoom:t=!0,showFitView:i=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:c,onFitView:h,onInteractiveChange:d,className:f,children:m,position:g="bottom-left",orientation:v="vertical","aria-label":y}){const S=dt(),{isInteractive:b,minZoomReached:k,maxZoomReached:C,ariaLabelConfig:z}=$e(gB,ft),{zoomIn:E,zoomOut:T,fitView:P}=vh(),R=()=>{E(),a==null||a()},U=()=>{T(),c==null||c()},X=()=>{P(o),h==null||h()},G=()=>{S.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),d==null||d(!b)},ne=v==="horizontal"?"horizontal":"vertical";return w.jsxs(_h,{className:Bt(["react-flow__controls",ne,f]),position:g,style:e,"data-testid":"rf__controls","aria-label":y??z["controls.ariaLabel"],children:[t&&w.jsxs(w.Fragment,{children:[w.jsx(bu,{onClick:R,className:"react-flow__controls-zoomin",title:z["controls.zoomIn.ariaLabel"],"aria-label":z["controls.zoomIn.ariaLabel"],disabled:C,children:w.jsx(uB,{})}),w.jsx(bu,{onClick:U,className:"react-flow__controls-zoomout",title:z["controls.zoomOut.ariaLabel"],"aria-label":z["controls.zoomOut.ariaLabel"],disabled:k,children:w.jsx(hB,{})})]}),i&&w.jsx(bu,{className:"react-flow__controls-fitview",onClick:X,title:z["controls.fitView.ariaLabel"],"aria-label":z["controls.fitView.ariaLabel"],children:w.jsx(fB,{})}),r&&w.jsx(bu,{className:"react-flow__controls-interactive",onClick:G,title:z["controls.interactive.ariaLabel"],"aria-label":z["controls.interactive.ariaLabel"],children:b?w.jsx(pB,{}):w.jsx(dB,{})}),m]})}Vw.displayName="Controls";const mB=q.memo(Vw);function _B({id:e,x:t,y:i,width:r,height:o,style:a,color:c,strokeColor:h,strokeWidth:d,className:f,borderRadius:m,shapeRendering:g,selected:v,onClick:y}){const{background:S,backgroundColor:b}=a||{},k=c||S||b;return w.jsx("rect",{className:Bt(["react-flow__minimap-node",{selected:v},f]),x:t,y:i,rx:m,ry:m,width:r,height:o,style:{fill:k,stroke:h,strokeWidth:d},shapeRendering:g,onClick:y?C=>y(C,e):void 0})}const vB=q.memo(_B),yB=e=>e.nodes.map(t=>t.id),gp=e=>e instanceof Function?e:()=>e;function SB({nodeStrokeColor:e,nodeColor:t,nodeClassName:i="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:a=vB,onClick:c}){const h=$e(yB,ft),d=gp(t),f=gp(e),m=gp(i),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return w.jsx(w.Fragment,{children:h.map(v=>w.jsx(xB,{id:v,nodeColorFunc:d,nodeStrokeColorFunc:f,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:a,onClick:c,shapeRendering:g},v))})}function bB({id:e,nodeColorFunc:t,nodeStrokeColorFunc:i,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:c,NodeComponent:h,onClick:d}){const{node:f,x:m,y:g,width:v,height:y}=$e(S=>{const{internals:b}=S.nodeLookup.get(e),k=b.userNode,{x:C,y:z}=b.positionAbsolute,{width:E,height:T}=lr(k);return{node:k,x:C,y:z,width:E,height:T}},ft);return!f||f.hidden||!Fx(f)?null:w.jsx(h,{x:m,y:g,width:v,height:y,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:o,strokeColor:i(f),strokeWidth:a,shapeRendering:c,onClick:d,id:f.id})}const xB=q.memo(bB);var wB=q.memo(SB);const CB=200,EB=150,kB=e=>!e.hidden,MB=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?Vx(Ba(e.nodeLookup,{filter:kB}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},TB="react-flow__minimap-desc";function Fw({style:e,className:t,nodeStrokeColor:i,nodeColor:r,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:c,nodeComponent:h,bgColor:d,maskColor:f,maskStrokeColor:m,maskStrokeWidth:g,position:v="bottom-right",onClick:y,onNodeClick:S,pannable:b=!1,zoomable:k=!1,ariaLabel:C,inversePan:z,zoomStep:E=1,offsetScale:T=5}){const P=dt(),R=q.useRef(null),{boundingRect:U,viewBB:X,rfId:G,panZoom:ne,translateExtent:V,flowWidth:I,flowHeight:F,ariaLabelConfig:B}=$e(MB,ft),O=(e==null?void 0:e.width)??CB,M=(e==null?void 0:e.height)??EB,j=U.width/O,H=U.height/M,$=Math.max(j,H),N=$*O,L=$*M,Y=T*$,A=U.x-(N-U.width)/2-Y,ee=U.y-(L-U.height)/2-Y,ce=N+Y*2,le=L+Y*2,fe=`${TB}-${G}`,he=q.useRef(0),pe=q.useRef();he.current=$,q.useEffect(()=>{if(R.current&&ne)return pe.current=FD({domNode:R.current,panZoom:ne,getTransform:()=>P.getState().transform,getViewScale:()=>he.current}),()=>{var me;(me=pe.current)==null||me.destroy()}},[ne]),q.useEffect(()=>{var me;(me=pe.current)==null||me.update({translateExtent:V,width:I,height:F,inversePan:z,pannable:b,zoomStep:E,zoomable:k})},[b,k,z,E,V,I,F]);const Ce=y?me=>{var ze;const[Ae,Ye]=((ze=pe.current)==null?void 0:ze.pointer(me))||[0,0];y(me,{x:Ae,y:Ye})}:void 0,xe=S?q.useCallback((me,Ae)=>{const Ye=P.getState().nodeLookup.get(Ae).internals.userNode;S(me,Ye)},[]):void 0,Se=C??B["minimap.ariaLabel"];return w.jsx(_h,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*$:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:Bt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:w.jsxs("svg",{width:O,height:M,viewBox:`${A} ${ee} ${ce} ${le}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":fe,ref:R,onClick:Ce,children:[Se&&w.jsx("title",{id:fe,children:Se}),w.jsx(wB,{onClick:xe,nodeColor:r,nodeStrokeColor:i,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:c,nodeComponent:h}),w.jsx("path",{className:"react-flow__minimap-mask",d:`M${A-Y},${ee-Y}h${ce+Y*2}v${le+Y*2}h${-ce-Y*2}z
|
|
165
|
+
M${X.x},${X.y}h${X.width}v${X.height}h${-X.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Fw.displayName="MiniMap";const NB=q.memo(Fw),AB=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,DB={[Po.Line]:"right",[Po.Handle]:"bottom-right"};function RB({nodeId:e,position:t,variant:i=Po.Handle,className:r,style:o=void 0,children:a,color:c,minWidth:h=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:v,autoScale:y=!0,shouldResize:S,onResizeStart:b,onResize:k,onResizeEnd:C}){const z=bw(),E=typeof e=="string"?e:z,T=dt(),P=q.useRef(null),R=i===Po.Handle,U=$e(q.useCallback(AB(R&&y),[R,y]),ft),X=q.useRef(null),G=t??DB[i];q.useEffect(()=>{if(!(!P.current||!E))return X.current||(X.current=rR({domNode:P.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:V,transform:I,snapGrid:F,snapToGrid:B,nodeOrigin:O,domNode:M}=T.getState();return{nodeLookup:V,transform:I,snapGrid:F,snapToGrid:B,nodeOrigin:O,paneDomNode:M}},onChange:(V,I)=>{const{triggerNodeChanges:F,nodeLookup:B,parentLookup:O,nodeOrigin:M}=T.getState(),j=[],H={x:V.x,y:V.y},$=B.get(E);if($&&$.expandParent&&$.parentId){const N=$.origin??M,L=V.width??$.measured.width??0,Y=V.height??$.measured.height??0,A={id:$.id,parentId:$.parentId,rect:{width:L,height:Y,...$x({x:V.x??$.position.x,y:V.y??$.position.y},{width:L,height:Y},$.parentId,B,N)}},ee=am([A],B,O,M);j.push(...ee),H.x=V.x?Math.max(N[0]*L,V.x):void 0,H.y=V.y?Math.max(N[1]*Y,V.y):void 0}if(H.x!==void 0&&H.y!==void 0){const N={id:E,type:"position",position:{...H}};j.push(N)}if(V.width!==void 0&&V.height!==void 0){const L={id:E,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};j.push(L)}for(const N of I){const L={...N,type:"position"};j.push(L)}F(j)},onEnd:({width:V,height:I})=>{const F={id:E,type:"dimensions",resizing:!1,dimensions:{width:V,height:I}};T.getState().triggerNodeChanges([F])}})),X.current.update({controlPosition:G,boundaries:{minWidth:h,minHeight:d,maxWidth:f,maxHeight:m},keepAspectRatio:g,resizeDirection:v,onResizeStart:b,onResize:k,onResizeEnd:C,shouldResize:S}),()=>{var V;(V=X.current)==null||V.destroy()}},[G,h,d,f,m,g,b,k,C,S]);const ne=G.split("-");return w.jsx("div",{className:Bt(["react-flow__resize-control","nodrag",...ne,i,r]),ref:P,style:{...o,scale:U,...c&&{[R?"backgroundColor":"borderColor"]:c}},children:a})}q.memo(RB);const BB={node:"<>",agent:"AI",workflow:"wf",input:"IN",output:"OUT",condition:"?"},LB={node:"CUSTOM CODE",agent:"AI AGENT",workflow:"WORKFLOW",input:"INPUT",output:"OUTPUT",condition:"CONDITION"},zB={node:"#d1fae5",agent:"#ede9fe",workflow:"#d1fae5",input:"#e5e7eb",output:"#e5e7eb",condition:"#fef3c7"},OB={node:"#ecfdf5",agent:"#f5f3ff",workflow:"#ecfdf5",input:"#f3f4f6",output:"#f3f4f6",condition:"#fffbeb"},HB={node:"#10b981",agent:"#8b5cf6",workflow:"#10b981",input:"#9ca3af",output:"#9ca3af",condition:"#f59e0b"},jB={node:"#10b981",agent:"#8b5cf6",workflow:"#10b981",input:"#9ca3af",output:"#9ca3af",condition:"#f59e0b"};function PB({data:e}){const t=e.type??"node",i=e.label??"",r=e.fields??void 0,o=BB[t]??"<>",a=t==="input"||t==="output";return w.jsxs("div",{className:"bg-white rounded-lg border",style:{borderColor:zB[t],minWidth:a?120:160,maxWidth:260,boxShadow:"0 1px 3px rgba(0,0,0,0.04)"},children:[w.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[w.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:OB[t]},children:w.jsx("span",{className:"text-[11px] font-bold",style:{color:HB[t]},children:o})}),w.jsxs("div",{className:"min-w-0",children:[w.jsx("div",{className:`font-medium truncate ${a?"text-[13px] text-gray-500":"text-sm text-gray-800"}`,children:i}),w.jsx("div",{className:"text-[10px] font-semibold tracking-wider",style:{color:jB[t]},children:LB[t]})]})]}),a&&r&&r.length>0&&w.jsx("div",{className:"border-t border-gray-100 px-3 py-1.5 flex flex-wrap gap-x-2 gap-y-0.5",children:r.map(c=>w.jsx("span",{className:"text-[11px] text-gray-400",children:c},c))}),t!=="input"&&w.jsx(Xr,{type:"target",position:we.Left,className:"!w-[6px] !h-[6px] !bg-gray-300 !border !border-gray-200 !opacity-60"}),t!=="output"&&w.jsx(Xr,{type:"source",position:we.Right,className:"!w-[6px] !h-[6px] !bg-gray-300 !border !border-gray-200 !opacity-60"})]})}function IB({data:e}){const t=e.label??"",i=e.width,r=e.height;return w.jsxs("div",{className:"relative rounded-xl",style:{width:i,height:r,border:"1.5px dashed #d1d5db",background:"rgba(249, 250, 251, 0.5)"},children:[w.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 border-b border-gray-200",children:[w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:"shrink-0 text-gray-400",children:[w.jsx("path",{d:"M3 4C2 4 1 5 1 6.5C1 8 2 9 3 9H11C12 9 13 8 13 6.5C13 5 12 4 11 4",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),w.jsx("path",{d:"M9.5 3L11 4L9.5 5",fill:"currentColor"})]}),w.jsx("span",{className:"text-[12px] font-semibold text-gray-500 truncate",children:t})]}),w.jsx(Xr,{type:"target",position:we.Left,className:"!bg-transparent !w-0 !h-0 !border-0"}),w.jsx(Xr,{type:"source",position:we.Right,className:"!bg-transparent !w-0 !h-0 !border-0"})]})}function UB(e){const{sourceX:t,sourceY:i,sourcePosition:r,targetX:o,targetY:a,targetPosition:c,markerEnd:h,label:d,style:f}=e,[m,g,v]=nm({sourceX:t,sourceY:i,sourcePosition:r,targetX:o,targetY:a,targetPosition:c});return w.jsxs("g",{children:[w.jsx("path",{d:m,fill:"none",strokeWidth:20,stroke:"transparent",className:"react-flow__edge-interaction"}),w.jsx("path",{d:m,fill:"none",stroke:(f==null?void 0:f.stroke)??"#d1d5db",strokeWidth:(f==null?void 0:f.strokeWidth)??1.5,markerEnd:h}),d&&w.jsx("text",{x:g,y:v,textAnchor:"middle",dominantBaseline:"central",className:"react-flow__edge-text",children:d})]})}function qB(e,t){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const VB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$B={};function _S(e,t){return($B.jsx?FB:VB).test(e)}const YB=/[ \t\n\f\r]/g;function WB(e){return typeof e=="object"?e.type==="text"?vS(e.value):!1:vS(e)}function vS(e){return e.replace(YB,"")===""}class Oa{constructor(t,i,r){this.normal=i,this.property=t,r&&(this.space=r)}}Oa.prototype.normal={};Oa.prototype.property={};Oa.prototype.space=void 0;function $w(e,t){const i={},r={};for(const o of e)Object.assign(i,o.property),Object.assign(r,o.normal);return new Oa(i,r,t)}function kg(e){return e.toLowerCase()}class wi{constructor(t,i){this.attribute=i,this.property=t}}wi.prototype.attribute="";wi.prototype.booleanish=!1;wi.prototype.boolean=!1;wi.prototype.commaOrSpaceSeparated=!1;wi.prototype.commaSeparated=!1;wi.prototype.defined=!1;wi.prototype.mustUseProperty=!1;wi.prototype.number=!1;wi.prototype.overloadedBoolean=!1;wi.prototype.property="";wi.prototype.spaceSeparated=!1;wi.prototype.space=void 0;let XB=0;const Le=Bs(),At=Bs(),Mg=Bs(),de=Bs(),st=Bs(),Ao=Bs(),zi=Bs();function Bs(){return 2**++XB}const Tg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:At,commaOrSpaceSeparated:zi,commaSeparated:Ao,number:de,overloadedBoolean:Mg,spaceSeparated:st},Symbol.toStringTag,{value:"Module"})),mp=Object.keys(Tg);class um extends wi{constructor(t,i,r,o){let a=-1;if(super(t,i),yS(this,"space",o),typeof r=="number")for(;++a<mp.length;){const c=mp[a];yS(this,mp[a],(r&Tg[c])===Tg[c])}}}um.prototype.defined=!0;function yS(e,t,i){i&&(e[t]=i)}function qo(e){const t={},i={};for(const[r,o]of Object.entries(e.properties)){const a=new um(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,i[kg(r)]=r,i[kg(a.attribute)]=r}return new Oa(t,i,e.space)}const Yw=qo({properties:{ariaActiveDescendant:null,ariaAtomic:At,ariaAutoComplete:null,ariaBusy:At,ariaChecked:At,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:st,ariaCurrent:null,ariaDescribedBy:st,ariaDetails:null,ariaDisabled:At,ariaDropEffect:st,ariaErrorMessage:null,ariaExpanded:At,ariaFlowTo:st,ariaGrabbed:At,ariaHasPopup:null,ariaHidden:At,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:st,ariaLevel:de,ariaLive:null,ariaModal:At,ariaMultiLine:At,ariaMultiSelectable:At,ariaOrientation:null,ariaOwns:st,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:At,ariaReadOnly:At,ariaRelevant:null,ariaRequired:At,ariaRoleDescription:st,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:At,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ww(e,t){return t in e?e[t]:t}function Xw(e,t){return Ww(e,t.toLowerCase())}const KB=qo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ao,acceptCharset:st,accessKey:st,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:st,autoFocus:Le,autoPlay:Le,blocking:st,capture:null,charSet:null,checked:Le,cite:null,className:st,cols:de,colSpan:null,content:null,contentEditable:At,controls:Le,controlsList:st,coords:de|Ao,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:Mg,draggable:At,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:st,height:de,hidden:Mg,high:de,href:null,hrefLang:null,htmlFor:st,httpEquiv:st,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:st,itemRef:st,itemScope:Le,itemType:st,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Le,optimum:de,pattern:null,ping:st,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:st,required:Le,reversed:Le,rows:de,rowSpan:de,sandbox:st,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:At,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:At,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:st,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:At,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Le,disableRemotePlayback:Le,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:Xw}),GB=qo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:zi,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:st,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ao,g2:Ao,glyphName:Ao,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:zi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:st,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zi,rev:zi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zi,requiredFeatures:zi,requiredFonts:zi,requiredFormats:zi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:zi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zi,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ww}),Kw=qo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Gw=qo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xw}),Zw=qo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ZB={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},QB=/[A-Z]/g,SS=/-[a-z]/g,JB=/^data[-\w.:]+$/i;function e6(e,t){const i=kg(t);let r=t,o=wi;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&JB.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(SS,i6);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!SS.test(a)){let c=a.replace(QB,t6);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}o=um}return new o(r,t)}function t6(e){return"-"+e.toLowerCase()}function i6(e){return e.charAt(1).toUpperCase()}const n6=$w([Yw,KB,Kw,Gw,Zw],"html"),hm=$w([Yw,GB,Kw,Gw,Zw],"svg");function r6(e){return e.join(" ").trim()}var wo={},_p,bS;function s6(){if(bS)return _p;bS=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,i=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,h=/^\s+|\s+$/g,d=`
|
|
166
|
+
`,f="/",m="*",g="",v="comment",y="declaration";function S(k,C){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];C=C||{};var z=1,E=1;function T(B){var O=B.match(t);O&&(z+=O.length);var M=B.lastIndexOf(d);E=~M?B.length-M:E+B.length}function P(){var B={line:z,column:E};return function(O){return O.position=new R(B),G(),O}}function R(B){this.start=B,this.end={line:z,column:E},this.source=C.source}R.prototype.content=k;function U(B){var O=new Error(C.source+":"+z+":"+E+": "+B);if(O.reason=B,O.filename=C.source,O.line=z,O.column=E,O.source=k,!C.silent)throw O}function X(B){var O=B.exec(k);if(O){var M=O[0];return T(M),k=k.slice(M.length),O}}function G(){X(i)}function ne(B){var O;for(B=B||[];O=V();)O!==!1&&B.push(O);return B}function V(){var B=P();if(!(f!=k.charAt(0)||m!=k.charAt(1))){for(var O=2;g!=k.charAt(O)&&(m!=k.charAt(O)||f!=k.charAt(O+1));)++O;if(O+=2,g===k.charAt(O-1))return U("End of comment missing");var M=k.slice(2,O-2);return E+=2,T(M),k=k.slice(O),E+=2,B({type:v,comment:M})}}function I(){var B=P(),O=X(r);if(O){if(V(),!X(o))return U("property missing ':'");var M=X(a),j=B({type:y,property:b(O[0].replace(e,g)),value:M?b(M[0].replace(e,g)):g});return X(c),j}}function F(){var B=[];ne(B);for(var O;O=I();)O!==!1&&(B.push(O),ne(B));return B}return G(),F()}function b(k){return k?k.replace(h,g):g}return _p=S,_p}var xS;function o6(){if(xS)return wo;xS=1;var e=wo&&wo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wo,"__esModule",{value:!0}),wo.default=i;const t=e(s6());function i(r,o){let a=null;if(!r||typeof r!="string")return a;const c=(0,t.default)(r),h=typeof o=="function";return c.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;h?o(f,m,d):m&&(a=a||{},a[f]=m)}),a}return wo}var Wl={},wS;function l6(){if(wS)return Wl;wS=1,Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,i=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(f){return!f||i.test(f)||e.test(f)},c=function(f,m){return m.toUpperCase()},h=function(f,m){return"".concat(m,"-")},d=function(f,m){return m===void 0&&(m={}),a(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(o,h):f=f.replace(r,h),f.replace(t,c))};return Wl.camelCase=d,Wl}var Xl,CS;function a6(){if(CS)return Xl;CS=1;var e=Xl&&Xl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(o6()),i=l6();function r(o,a){var c={};return!o||typeof o!="string"||(0,t.default)(o,function(h,d){h&&d&&(c[(0,i.camelCase)(h,a)]=d)}),c}return r.default=r,Xl=r,Xl}var c6=a6();const u6=nh(c6),Qw=Jw("end"),fm=Jw("start");function Jw(e){return t;function t(i){const r=i&&i.position&&i.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function h6(e){const t=fm(e),i=Qw(e);if(t&&i)return{start:t,end:i}}function la(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ES(e.position):"start"in e||"end"in e?ES(e):"line"in e||"column"in e?Ng(e):""}function Ng(e){return kS(e&&e.line)+":"+kS(e&&e.column)}function ES(e){return Ng(e&&e.start)+"-"+Ng(e&&e.end)}function kS(e){return e&&typeof e=="number"?e:1}class ri extends Error{constructor(t,i,r){super(),typeof i=="string"&&(r=i,i=void 0);let o="",a={},c=!1;if(i&&("line"in i&&"column"in i?a={place:i}:"start"in i&&"end"in i?a={place:i}:"type"in i?a={ancestors:[i],place:i.position}:a={...i}),typeof t=="string"?o=t:!a.cause&&t&&(c=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const h=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=h?h.line:void 0,this.name=la(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=c&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ri.prototype.file="";ri.prototype.name="";ri.prototype.reason="";ri.prototype.message="";ri.prototype.stack="";ri.prototype.column=void 0;ri.prototype.line=void 0;ri.prototype.ancestors=void 0;ri.prototype.cause=void 0;ri.prototype.fatal=void 0;ri.prototype.place=void 0;ri.prototype.ruleId=void 0;ri.prototype.source=void 0;const dm={}.hasOwnProperty,f6=new Map,d6=/[A-Z]/g,p6=new Set(["table","tbody","thead","tfoot","tr"]),g6=new Set(["td","th"]),eC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function m6(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=C6(i,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=w6(i,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?hm:n6,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=tC(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function tC(e,t,i){if(t.type==="element")return _6(e,t,i);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return v6(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return S6(e,t,i);if(t.type==="mdxjsEsm")return y6(e,t);if(t.type==="root")return b6(e,t,i);if(t.type==="text")return x6(e,t)}function _6(e,t,i){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=hm,e.schema=o),e.ancestors.push(t);const a=nC(e,t.tagName,!1),c=E6(e,t);let h=gm(e,t);return p6.has(t.tagName)&&(h=h.filter(function(d){return typeof d=="string"?!WB(d):!0})),iC(e,c,a,t),pm(c,h),e.ancestors.pop(),e.schema=r,e.create(t,a,c,i)}function v6(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}wa(e,t.position)}function y6(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wa(e,t.position)}function S6(e,t,i){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=hm,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:nC(e,t.name,!0),c=k6(e,t),h=gm(e,t);return iC(e,c,a,t),pm(c,h),e.ancestors.pop(),e.schema=r,e.create(t,a,c,i)}function b6(e,t,i){const r={};return pm(r,gm(e,t)),e.create(t,e.Fragment,r,i)}function x6(e,t){return t.value}function iC(e,t,i,r){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(t.node=r)}function pm(e,t){if(t.length>0){const i=t.length>1?t:t[0];i&&(e.children=i)}}function w6(e,t,i){return r;function r(o,a,c,h){const f=Array.isArray(c.children)?i:t;return h?f(a,c,h):f(a,c)}}function C6(e,t){return i;function i(r,o,a,c){const h=Array.isArray(a.children),d=fm(r);return t(o,a,c,h,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function E6(e,t){const i={};let r,o;for(o in t.properties)if(o!=="children"&&dm.call(t.properties,o)){const a=M6(e,o,t.properties[o]);if(a){const[c,h]=a;e.tableCellAlignToStyle&&c==="align"&&typeof h=="string"&&g6.has(t.tagName)?r=h:i[c]=h}}if(r){const a=i.style||(i.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return i}function k6(e,t){const i={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const c=a.expression;c.type;const h=c.properties[0];h.type,Object.assign(i,e.evaluater.evaluateExpression(h.argument))}else wa(e,t.position);else{const o=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const h=r.value.data.estree.body[0];h.type,a=e.evaluater.evaluateExpression(h.expression)}else wa(e,t.position);else a=r.value===null?!0:r.value;i[o]=a}return i}function gm(e,t){const i=[];let r=-1;const o=e.passKeys?new Map:f6;for(;++r<t.children.length;){const a=t.children[r];let c;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=o.get(d)||0;c=d+"-"+f,o.set(d,f+1)}}const h=tC(e,a,c);h!==void 0&&i.push(h)}return i}function M6(e,t,i){const r=e6(e.schema,t);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=r.commaSeparated?qB(i):r6(i)),r.property==="style"){let o=typeof i=="object"?i:T6(e,String(i));return e.stylePropertyNameCase==="css"&&(o=N6(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?ZB[r.property]||r.property:r.attribute,i]}}function T6(e,t){try{return u6(t,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const r=i,o=new ri("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=eC+"#cannot-parse-style-attribute",o}}function nC(e,t,i){let r;if(!i)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,c;for(;++a<o.length;){const h=_S(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};c=c?{type:"MemberExpression",object:c,property:h,computed:!!(a&&h.type==="Literal"),optional:!1}:h}r=c}else r=_S(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return dm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);wa(e)}function wa(e,t){const i=new ri("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=eC+"#cannot-handle-mdx-estrees-without-createevaluater",i}function N6(e){const t={};let i;for(i in e)dm.call(e,i)&&(t[A6(i)]=e[i]);return t}function A6(e){let t=e.replace(d6,D6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function D6(e){return"-"+e.toLowerCase()}const vp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},R6={};function B6(e,t){const i=R6,r=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,o=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return rC(e,r,o)}function rC(e,t,i){if(L6(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return MS(e.children,t,i)}return Array.isArray(e)?MS(e,t,i):""}function MS(e,t,i){const r=[];let o=-1;for(;++o<e.length;)r[o]=rC(e[o],t,i);return r.join("")}function L6(e){return!!(e&&typeof e=="object")}const TS=document.createElement("i");function mm(e){const t="&"+e+";";TS.innerHTML=t;const i=TS.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===t?!1:i}function Tn(e,t,i,r){const o=e.length;let a=0,c;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,i=i>0?i:0,r.length<1e4)c=Array.from(r),c.unshift(t,i),e.splice(...c);else for(i&&e.splice(t,i);a<r.length;)c=r.slice(a,a+1e4),c.unshift(t,0),e.splice(...c),a+=1e4,t+=1e4}function Gi(e,t){return e.length>0?(Tn(e,e.length,0,t),e):t}const NS={}.hasOwnProperty;function z6(e){const t={};let i=-1;for(;++i<e.length;)O6(t,e[i]);return t}function O6(e,t){let i;for(i in t){const o=(NS.call(e,i)?e[i]:void 0)||(e[i]={}),a=t[i];let c;if(a)for(c in a){NS.call(o,c)||(o[c]=[]);const h=a[c];H6(o[c],Array.isArray(h)?h:h?[h]:[])}}}function H6(e,t){let i=-1;const r=[];for(;++i<t.length;)(t[i].add==="after"?e:r).push(t[i]);Tn(e,0,0,r)}function sC(e,t){const i=Number.parseInt(e,t);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Do(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xn=Kr(/[A-Za-z]/),Hi=Kr(/[\dA-Za-z]/),j6=Kr(/[#-'*+\--9=?A-Z^-~]/);function Ag(e){return e!==null&&(e<32||e===127)}const Dg=Kr(/\d/),P6=Kr(/[\dA-Fa-f]/),I6=Kr(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function xi(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}const U6=Kr(new RegExp("\\p{P}|\\p{S}","u")),q6=Kr(/\s/);function Kr(e){return t;function t(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function Vo(e){const t=[];let i=-1,r=0,o=0;for(;++i<e.length;){const a=e.charCodeAt(i);let c="";if(a===37&&Hi(e.charCodeAt(i+1))&&Hi(e.charCodeAt(i+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(c=String.fromCharCode(a));else if(a>55295&&a<57344){const h=e.charCodeAt(i+1);a<56320&&h>56319&&h<57344?(c=String.fromCharCode(a,h),o=1):c="�"}else c=String.fromCharCode(a);c&&(t.push(e.slice(r,i),encodeURIComponent(c)),r=i+o+1,c=""),o&&(i+=o,o=0)}return t.join("")+e.slice(r)}function ot(e,t,i,r){const o=r?r-1:Number.POSITIVE_INFINITY;let a=0;return c;function c(d){return Ge(d)?(e.enter(i),h(d)):t(d)}function h(d){return Ge(d)&&a++<o?(e.consume(d),h):(e.exit(i),t(d))}}const V6={tokenize:F6};function F6(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let i;return t;function r(h){if(h===null){e.consume(h);return}return e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ot(e,t,"linePrefix")}function o(h){return e.enter("paragraph"),a(h)}function a(h){const d=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=d),i=d,c(h)}function c(h){if(h===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(h);return}return Ne(h)?(e.consume(h),e.exit("chunkText"),a):(e.consume(h),c)}}const $6={tokenize:Y6},AS={tokenize:W6};function Y6(e){const t=this,i=[];let r=0,o,a,c;return h;function h(E){if(r<i.length){const T=i[r];return t.containerState=T[1],e.attempt(T[0].continuation,d,f)(E)}return f(E)}function d(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&z();const T=t.events.length;let P=T,R;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){R=t.events[P][1].end;break}C(r);let U=T;for(;U<t.events.length;)t.events[U][1].end={...R},U++;return Tn(t.events,P+1,0,t.events.slice(T)),t.events.length=U,f(E)}return h(E)}function f(E){if(r===i.length){if(!o)return v(E);if(o.currentConstruct&&o.currentConstruct.concrete)return S(E);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(AS,m,g)(E)}function m(E){return o&&z(),C(r),v(E)}function g(E){return t.parser.lazy[t.now().line]=r!==i.length,c=t.now().offset,S(E)}function v(E){return t.containerState={},e.attempt(AS,y,S)(E)}function y(E){return r++,i.push([t.currentConstruct,t.containerState]),v(E)}function S(E){if(E===null){o&&z(),C(0),e.consume(E);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),b(E)}function b(E){if(E===null){k(e.exit("chunkFlow"),!0),C(0),e.consume(E);return}return Ne(E)?(e.consume(E),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,h):(e.consume(E),b)}function k(E,T){const P=t.sliceStream(E);if(T&&P.push(null),E.previous=a,a&&(a.next=E),a=E,o.defineSkip(E.start),o.write(P),t.parser.lazy[E.start.line]){let R=o.events.length;for(;R--;)if(o.events[R][1].start.offset<c&&(!o.events[R][1].end||o.events[R][1].end.offset>c))return;const U=t.events.length;let X=U,G,ne;for(;X--;)if(t.events[X][0]==="exit"&&t.events[X][1].type==="chunkFlow"){if(G){ne=t.events[X][1].end;break}G=!0}for(C(r),R=U;R<t.events.length;)t.events[R][1].end={...ne},R++;Tn(t.events,X+1,0,t.events.slice(U)),t.events.length=R}}function C(E){let T=i.length;for(;T-- >E;){const P=i[T];t.containerState=P[1],P[0].exit.call(t,e)}i.length=E}function z(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function W6(e,t,i){return ot(e,e.attempt(this.parser.constructs.document,t,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function DS(e){if(e===null||xi(e)||q6(e))return 1;if(U6(e))return 2}function _m(e,t,i){const r=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!r.includes(a)&&(t=a(t,i),r.push(a))}return t}const Rg={name:"attention",resolveAll:X6,tokenize:K6};function X6(e,t){let i=-1,r,o,a,c,h,d,f,m;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(r=i;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[r][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const g={...e[r][1].end},v={...e[i][1].start};RS(g,-d),RS(v,d),c={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},h={type:d>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:v},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[i][1].start}},o={type:d>1?"strong":"emphasis",start:{...c.start},end:{...h.end}},e[r][1].end={...c.start},e[i][1].start={...h.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Gi(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Gi(f,[["enter",o,t],["enter",c,t],["exit",c,t],["enter",a,t]]),f=Gi(f,_m(t.parser.constructs.insideSpan.null,e.slice(r+1,i),t)),f=Gi(f,[["exit",a,t],["enter",h,t],["exit",h,t],["exit",o,t]]),e[i][1].end.offset-e[i][1].start.offset?(m=2,f=Gi(f,[["enter",e[i][1],t],["exit",e[i][1],t]])):m=0,Tn(e,r-1,i-r+3,f),i=r+f.length-m-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function K6(e,t){const i=this.parser.constructs.attentionMarkers.null,r=this.previous,o=DS(r);let a;return c;function c(d){return a=d,e.enter("attentionSequence"),h(d)}function h(d){if(d===a)return e.consume(d),h;const f=e.exit("attentionSequence"),m=DS(d),g=!m||m===2&&o||i.includes(d),v=!o||o===2&&m||i.includes(r);return f._open=!!(a===42?g:g&&(o||!v)),f._close=!!(a===42?v:v&&(m||!g)),t(d)}}function RS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const G6={name:"autolink",tokenize:Z6};function Z6(e,t,i){let r=0;return o;function o(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(y){return xn(y)?(e.consume(y),c):y===64?i(y):f(y)}function c(y){return y===43||y===45||y===46||Hi(y)?(r=1,h(y)):f(y)}function h(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||Hi(y))&&r++<32?(e.consume(y),h):(r=0,f(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Ag(y)?i(y):(e.consume(y),d)}function f(y){return y===64?(e.consume(y),m):j6(y)?(e.consume(y),f):i(y)}function m(y){return Hi(y)?g(y):i(y)}function g(y){return y===46?(e.consume(y),r=0,m):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):v(y)}function v(y){if((y===45||Hi(y))&&r++<63){const S=y===45?v:g;return e.consume(y),S}return i(y)}}const bh={partial:!0,tokenize:Q6};function Q6(e,t,i){return r;function r(a){return Ge(a)?ot(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Ne(a)?t(a):i(a)}}const oC={continuation:{tokenize:eL},exit:tL,name:"blockQuote",tokenize:J6};function J6(e,t,i){const r=this;return o;function o(c){if(c===62){const h=r.containerState;return h.open||(e.enter("blockQuote",{_container:!0}),h.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),a}return i(c)}function a(c){return Ge(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function eL(e,t,i){const r=this;return o;function o(c){return Ge(c)?ot(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):a(c)}function a(c){return e.attempt(oC,t,i)(c)}}function tL(e){e.exit("blockQuote")}const lC={name:"characterEscape",tokenize:iL};function iL(e,t,i){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return I6(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):i(a)}}const aC={name:"characterReference",tokenize:nL};function nL(e,t,i){const r=this;let o=0,a,c;return h;function h(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,c=Hi,m(g))}function f(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,c=P6,m):(e.enter("characterReferenceValue"),a=7,c=Dg,m(g))}function m(g){if(g===59&&o){const v=e.exit("characterReferenceValue");return c===Hi&&!mm(r.sliceSerialize(v))?i(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&o++<a?(e.consume(g),m):i(g)}}const BS={partial:!0,tokenize:sL},LS={concrete:!0,name:"codeFenced",tokenize:rL};function rL(e,t,i){const r=this,o={partial:!0,tokenize:P};let a=0,c=0,h;return d;function d(R){return f(R)}function f(R){const U=r.events[r.events.length-1];return a=U&&U[1].type==="linePrefix"?U[2].sliceSerialize(U[1],!0).length:0,h=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(R)}function m(R){return R===h?(c++,e.consume(R),m):c<3?i(R):(e.exit("codeFencedFenceSequence"),Ge(R)?ot(e,g,"whitespace")(R):g(R))}function g(R){return R===null||Ne(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(BS,b,T)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(R)):Ge(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ot(e,y,"whitespace")(R)):R===96&&R===h?i(R):(e.consume(R),v)}function y(R){return R===null||Ne(R)?g(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(R)):R===96&&R===h?i(R):(e.consume(R),S)}function b(R){return e.attempt(o,T,k)(R)}function k(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),C}function C(R){return a>0&&Ge(R)?ot(e,z,"linePrefix",a+1)(R):z(R)}function z(R){return R===null||Ne(R)?e.check(BS,b,T)(R):(e.enter("codeFlowValue"),E(R))}function E(R){return R===null||Ne(R)?(e.exit("codeFlowValue"),z(R)):(e.consume(R),E)}function T(R){return e.exit("codeFenced"),t(R)}function P(R,U,X){let G=0;return ne;function ne(O){return R.enter("lineEnding"),R.consume(O),R.exit("lineEnding"),V}function V(O){return R.enter("codeFencedFence"),Ge(O)?ot(R,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):I(O)}function I(O){return O===h?(R.enter("codeFencedFenceSequence"),F(O)):X(O)}function F(O){return O===h?(G++,R.consume(O),F):G>=c?(R.exit("codeFencedFenceSequence"),Ge(O)?ot(R,B,"whitespace")(O):B(O)):X(O)}function B(O){return O===null||Ne(O)?(R.exit("codeFencedFence"),U(O)):X(O)}}}function sL(e,t,i){const r=this;return o;function o(c){return c===null?i(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a)}function a(c){return r.parser.lazy[r.now().line]?i(c):t(c)}}const yp={name:"codeIndented",tokenize:lL},oL={partial:!0,tokenize:aL};function lL(e,t,i){const r=this;return o;function o(f){return e.enter("codeIndented"),ot(e,a,"linePrefix",5)(f)}function a(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?c(f):i(f)}function c(f){return f===null?d(f):Ne(f)?e.attempt(oL,c,d)(f):(e.enter("codeFlowValue"),h(f))}function h(f){return f===null||Ne(f)?(e.exit("codeFlowValue"),c(f)):(e.consume(f),h)}function d(f){return e.exit("codeIndented"),t(f)}}function aL(e,t,i){const r=this;return o;function o(c){return r.parser.lazy[r.now().line]?i(c):Ne(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):ot(e,a,"linePrefix",5)(c)}function a(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?t(c):Ne(c)?o(c):i(c)}}const cL={name:"codeText",previous:hL,resolve:uL,tokenize:fL};function uL(e){let t=e.length-4,i=3,r,o;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=i;++r<t;)if(e[r][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[t][1].type="codeTextPadding",i+=2,t-=2;break}}for(r=i-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function hL(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fL(e,t,i){let r=0,o,a;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),h(g)}function h(g){return g===96?(e.consume(g),r++,h):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?i(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(a=e.enter("codeTextSequence"),o=0,m(g)):Ne(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(g))}function f(g){return g===null||g===32||g===96||Ne(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),f)}function m(g){return g===96?(e.consume(g),o++,m):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(a.type="codeTextData",f(g))}}class dL{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,i){const r=i??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,i,r){const o=i||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Kl(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Kl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Kl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const i=this.left.splice(t,Number.POSITIVE_INFINITY);Kl(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Kl(this.left,i.reverse())}}}function Kl(e,t){let i=0;if(t.length<1e4)e.push(...t);else for(;i<t.length;)e.push(...t.slice(i,i+1e4)),i+=1e4}function cC(e){const t={};let i=-1,r,o,a,c,h,d,f;const m=new dL(e);for(;++i<m.length;){for(;i in t;)i=t[i];if(r=m.get(i),i&&r[1].type==="chunkFlow"&&m.get(i-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,pL(m,i)),i=t[i],f=!0);else if(r[1]._container){for(a=i,o=void 0;a--;)if(c=m.get(a),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=a);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(r[1].end={...m.get(o)[1].start},h=m.slice(o,i),h.unshift(r),m.splice(o,i-o+1,h))}}return Tn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function pL(e,t){const i=e.get(t)[1],r=e.get(t)[2];let o=t-1;const a=[];let c=i._tokenizer;c||(c=r.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const h=c.events,d=[],f={};let m,g,v=-1,y=i,S=0,b=0;const k=[b];for(;y;){for(;e.get(++o)[1]!==y;);a.push(o),y._tokenizer||(m=r.sliceStream(y),y.next||m.push(null),g&&c.defineSkip(y.start),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(m),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=y,y=y.next}for(y=i;++v<h.length;)h[v][0]==="exit"&&h[v-1][0]==="enter"&&h[v][1].type===h[v-1][1].type&&h[v][1].start.line!==h[v][1].end.line&&(b=v+1,k.push(b),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(c.events=[],y?(y._tokenizer=void 0,y.previous=void 0):k.pop(),v=k.length;v--;){const C=h.slice(k[v],k[v+1]),z=a.pop();d.push([z,z+C.length-1]),e.splice(z,2,C)}for(d.reverse(),v=-1;++v<d.length;)f[S+d[v][0]]=S+d[v][1],S+=d[v][1]-d[v][0]-1;return f}const gL={resolve:_L,tokenize:vL},mL={partial:!0,tokenize:yL};function _L(e){return cC(e),e}function vL(e,t){let i;return r;function r(h){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),o(h)}function o(h){return h===null?a(h):Ne(h)?e.check(mL,c,a)(h):(e.consume(h),o)}function a(h){return e.exit("chunkContent"),e.exit("content"),t(h)}function c(h){return e.consume(h),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,o}}function yL(e,t,i){const r=this;return o;function o(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ot(e,a,"linePrefix")}function a(c){if(c===null||Ne(c))return i(c);const h=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?t(c):e.interrupt(r.parser.constructs.flow,i,t)(c)}}function uC(e,t,i,r,o,a,c,h,d){const f=d||Number.POSITIVE_INFINITY;let m=0;return g;function g(C){return C===60?(e.enter(r),e.enter(o),e.enter(a),e.consume(C),e.exit(a),v):C===null||C===32||C===41||Ag(C)?i(C):(e.enter(r),e.enter(c),e.enter(h),e.enter("chunkString",{contentType:"string"}),b(C))}function v(C){return C===62?(e.enter(a),e.consume(C),e.exit(a),e.exit(o),e.exit(r),t):(e.enter(h),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===62?(e.exit("chunkString"),e.exit(h),v(C)):C===null||C===60||Ne(C)?i(C):(e.consume(C),C===92?S:y)}function S(C){return C===60||C===62||C===92?(e.consume(C),y):y(C)}function b(C){return!m&&(C===null||C===41||xi(C))?(e.exit("chunkString"),e.exit(h),e.exit(c),e.exit(r),t(C)):m<f&&C===40?(e.consume(C),m++,b):C===41?(e.consume(C),m--,b):C===null||C===32||C===40||Ag(C)?i(C):(e.consume(C),C===92?k:b)}function k(C){return C===40||C===41||C===92?(e.consume(C),b):b(C)}}function hC(e,t,i,r,o,a){const c=this;let h=0,d;return f;function f(y){return e.enter(r),e.enter(o),e.consume(y),e.exit(o),e.enter(a),m}function m(y){return h>999||y===null||y===91||y===93&&!d||y===94&&!h&&"_hiddenFootnoteSupport"in c.parser.constructs?i(y):y===93?(e.exit(a),e.enter(o),e.consume(y),e.exit(o),e.exit(r),t):Ne(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===null||y===91||y===93||Ne(y)||h++>999?(e.exit("chunkString"),m(y)):(e.consume(y),d||(d=!Ge(y)),y===92?v:g)}function v(y){return y===91||y===92||y===93?(e.consume(y),h++,g):g(y)}}function fC(e,t,i,r,o,a){let c;return h;function h(v){return v===34||v===39||v===40?(e.enter(r),e.enter(o),e.consume(v),e.exit(o),c=v===40?41:v,d):i(v)}function d(v){return v===c?(e.enter(o),e.consume(v),e.exit(o),e.exit(r),t):(e.enter(a),f(v))}function f(v){return v===c?(e.exit(a),d(c)):v===null?i(v):Ne(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),ot(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===c||v===null||Ne(v)?(e.exit("chunkString"),f(v)):(e.consume(v),v===92?g:m)}function g(v){return v===c||v===92?(e.consume(v),m):m(v)}}function aa(e,t){let i;return r;function r(o){return Ne(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i=!0,r):Ge(o)?ot(e,r,i?"linePrefix":"lineSuffix")(o):t(o)}}const SL={name:"definition",tokenize:xL},bL={partial:!0,tokenize:wL};function xL(e,t,i){const r=this;let o;return a;function a(y){return e.enter("definition"),c(y)}function c(y){return hC.call(r,e,h,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function h(y){return o=Do(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),d):i(y)}function d(y){return xi(y)?aa(e,f)(y):f(y)}function f(y){return uC(e,m,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function m(y){return e.attempt(bL,g,g)(y)}function g(y){return Ge(y)?ot(e,v,"whitespace")(y):v(y)}function v(y){return y===null||Ne(y)?(e.exit("definition"),r.parser.defined.push(o),t(y)):i(y)}}function wL(e,t,i){return r;function r(h){return xi(h)?aa(e,o)(h):i(h)}function o(h){return fC(e,a,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function a(h){return Ge(h)?ot(e,c,"whitespace")(h):c(h)}function c(h){return h===null||Ne(h)?t(h):i(h)}}const CL={name:"hardBreakEscape",tokenize:EL};function EL(e,t,i){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Ne(a)?(e.exit("hardBreakEscape"),t(a)):i(a)}}const kL={name:"headingAtx",resolve:ML,tokenize:TL};function ML(e,t){let i=e.length-2,r=3,o,a;return e[r][1].type==="whitespace"&&(r+=2),i-2>r&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(r===i-1||i-4>r&&e[i-2][1].type==="whitespace")&&(i-=r+1===i?2:4),i>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[i][1].end},a={type:"chunkText",start:e[r][1].start,end:e[i][1].end,contentType:"text"},Tn(e,r,i-r+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function TL(e,t,i){let r=0;return o;function o(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),c(m)}function c(m){return m===35&&r++<6?(e.consume(m),c):m===null||xi(m)?(e.exit("atxHeadingSequence"),h(m)):i(m)}function h(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Ne(m)?(e.exit("atxHeading"),t(m)):Ge(m)?ot(e,h,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),h(m))}function f(m){return m===null||m===35||xi(m)?(e.exit("atxHeadingText"),h(m)):(e.consume(m),f)}}const NL=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zS=["pre","script","style","textarea"],AL={concrete:!0,name:"htmlFlow",resolveTo:BL,tokenize:LL},DL={partial:!0,tokenize:OL},RL={partial:!0,tokenize:zL};function BL(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function LL(e,t,i){const r=this;let o,a,c,h,d;return f;function f(A){return m(A)}function m(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),g}function g(A){return A===33?(e.consume(A),v):A===47?(e.consume(A),a=!0,b):A===63?(e.consume(A),o=3,r.interrupt?t:N):xn(A)?(e.consume(A),c=String.fromCharCode(A),k):i(A)}function v(A){return A===45?(e.consume(A),o=2,y):A===91?(e.consume(A),o=5,h=0,S):xn(A)?(e.consume(A),o=4,r.interrupt?t:N):i(A)}function y(A){return A===45?(e.consume(A),r.interrupt?t:N):i(A)}function S(A){const ee="CDATA[";return A===ee.charCodeAt(h++)?(e.consume(A),h===ee.length?r.interrupt?t:I:S):i(A)}function b(A){return xn(A)?(e.consume(A),c=String.fromCharCode(A),k):i(A)}function k(A){if(A===null||A===47||A===62||xi(A)){const ee=A===47,ce=c.toLowerCase();return!ee&&!a&&zS.includes(ce)?(o=1,r.interrupt?t(A):I(A)):NL.includes(c.toLowerCase())?(o=6,ee?(e.consume(A),C):r.interrupt?t(A):I(A)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?i(A):a?z(A):E(A))}return A===45||Hi(A)?(e.consume(A),c+=String.fromCharCode(A),k):i(A)}function C(A){return A===62?(e.consume(A),r.interrupt?t:I):i(A)}function z(A){return Ge(A)?(e.consume(A),z):ne(A)}function E(A){return A===47?(e.consume(A),ne):A===58||A===95||xn(A)?(e.consume(A),T):Ge(A)?(e.consume(A),E):ne(A)}function T(A){return A===45||A===46||A===58||A===95||Hi(A)?(e.consume(A),T):P(A)}function P(A){return A===61?(e.consume(A),R):Ge(A)?(e.consume(A),P):E(A)}function R(A){return A===null||A===60||A===61||A===62||A===96?i(A):A===34||A===39?(e.consume(A),d=A,U):Ge(A)?(e.consume(A),R):X(A)}function U(A){return A===d?(e.consume(A),d=null,G):A===null||Ne(A)?i(A):(e.consume(A),U)}function X(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||xi(A)?P(A):(e.consume(A),X)}function G(A){return A===47||A===62||Ge(A)?E(A):i(A)}function ne(A){return A===62?(e.consume(A),V):i(A)}function V(A){return A===null||Ne(A)?I(A):Ge(A)?(e.consume(A),V):i(A)}function I(A){return A===45&&o===2?(e.consume(A),M):A===60&&o===1?(e.consume(A),j):A===62&&o===4?(e.consume(A),L):A===63&&o===3?(e.consume(A),N):A===93&&o===5?(e.consume(A),$):Ne(A)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(DL,Y,F)(A)):A===null||Ne(A)?(e.exit("htmlFlowData"),F(A)):(e.consume(A),I)}function F(A){return e.check(RL,B,Y)(A)}function B(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return A===null||Ne(A)?F(A):(e.enter("htmlFlowData"),I(A))}function M(A){return A===45?(e.consume(A),N):I(A)}function j(A){return A===47?(e.consume(A),c="",H):I(A)}function H(A){if(A===62){const ee=c.toLowerCase();return zS.includes(ee)?(e.consume(A),L):I(A)}return xn(A)&&c.length<8?(e.consume(A),c+=String.fromCharCode(A),H):I(A)}function $(A){return A===93?(e.consume(A),N):I(A)}function N(A){return A===62?(e.consume(A),L):A===45&&o===2?(e.consume(A),N):I(A)}function L(A){return A===null||Ne(A)?(e.exit("htmlFlowData"),Y(A)):(e.consume(A),L)}function Y(A){return e.exit("htmlFlow"),t(A)}}function zL(e,t,i){const r=this;return o;function o(c){return Ne(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):i(c)}function a(c){return r.parser.lazy[r.now().line]?i(c):t(c)}}function OL(e,t,i){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(bh,t,i)}}const HL={name:"htmlText",tokenize:jL};function jL(e,t,i){const r=this;let o,a,c;return h;function h(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),f):N===47?(e.consume(N),P):N===63?(e.consume(N),E):xn(N)?(e.consume(N),X):i(N)}function f(N){return N===45?(e.consume(N),m):N===91?(e.consume(N),a=0,S):xn(N)?(e.consume(N),z):i(N)}function m(N){return N===45?(e.consume(N),y):i(N)}function g(N){return N===null?i(N):N===45?(e.consume(N),v):Ne(N)?(c=g,j(N)):(e.consume(N),g)}function v(N){return N===45?(e.consume(N),y):g(N)}function y(N){return N===62?M(N):N===45?v(N):g(N)}function S(N){const L="CDATA[";return N===L.charCodeAt(a++)?(e.consume(N),a===L.length?b:S):i(N)}function b(N){return N===null?i(N):N===93?(e.consume(N),k):Ne(N)?(c=b,j(N)):(e.consume(N),b)}function k(N){return N===93?(e.consume(N),C):b(N)}function C(N){return N===62?M(N):N===93?(e.consume(N),C):b(N)}function z(N){return N===null||N===62?M(N):Ne(N)?(c=z,j(N)):(e.consume(N),z)}function E(N){return N===null?i(N):N===63?(e.consume(N),T):Ne(N)?(c=E,j(N)):(e.consume(N),E)}function T(N){return N===62?M(N):E(N)}function P(N){return xn(N)?(e.consume(N),R):i(N)}function R(N){return N===45||Hi(N)?(e.consume(N),R):U(N)}function U(N){return Ne(N)?(c=U,j(N)):Ge(N)?(e.consume(N),U):M(N)}function X(N){return N===45||Hi(N)?(e.consume(N),X):N===47||N===62||xi(N)?G(N):i(N)}function G(N){return N===47?(e.consume(N),M):N===58||N===95||xn(N)?(e.consume(N),ne):Ne(N)?(c=G,j(N)):Ge(N)?(e.consume(N),G):M(N)}function ne(N){return N===45||N===46||N===58||N===95||Hi(N)?(e.consume(N),ne):V(N)}function V(N){return N===61?(e.consume(N),I):Ne(N)?(c=V,j(N)):Ge(N)?(e.consume(N),V):G(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?i(N):N===34||N===39?(e.consume(N),o=N,F):Ne(N)?(c=I,j(N)):Ge(N)?(e.consume(N),I):(e.consume(N),B)}function F(N){return N===o?(e.consume(N),o=void 0,O):N===null?i(N):Ne(N)?(c=F,j(N)):(e.consume(N),F)}function B(N){return N===null||N===34||N===39||N===60||N===61||N===96?i(N):N===47||N===62||xi(N)?G(N):(e.consume(N),B)}function O(N){return N===47||N===62||xi(N)?G(N):i(N)}function M(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):i(N)}function j(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),H}function H(N){return Ge(N)?ot(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):$(N)}function $(N){return e.enter("htmlTextData"),c(N)}}const vm={name:"labelEnd",resolveAll:qL,resolveTo:VL,tokenize:FL},PL={tokenize:$L},IL={tokenize:YL},UL={tokenize:WL};function qL(e){let t=-1;const i=[];for(;++t<e.length;){const r=e[t][1];if(i.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==i.length&&Tn(e,0,e.length,i),e}function VL(e,t){let i=e.length,r=0,o,a,c,h;for(;i--;)if(o=e[i][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[i][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(e[i][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=i,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(c=i);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[c][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[c-2][1].start}};return h=[["enter",d,t],["enter",f,t]],h=Gi(h,e.slice(a+1,a+r+3)),h=Gi(h,[["enter",m,t]]),h=Gi(h,_m(t.parser.constructs.insideSpan.null,e.slice(a+r+4,c-3),t)),h=Gi(h,[["exit",m,t],e[c-2],e[c-1],["exit",f,t]]),h=Gi(h,e.slice(c+1)),h=Gi(h,[["exit",d,t]]),Tn(e,a,e.length,h),e}function FL(e,t,i){const r=this;let o=r.events.length,a,c;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){a=r.events[o][1];break}return h;function h(v){return a?a._inactive?g(v):(c=r.parser.defined.includes(Do(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),d):i(v)}function d(v){return v===40?e.attempt(PL,m,c?m:g)(v):v===91?e.attempt(IL,m,c?f:g)(v):c?m(v):g(v)}function f(v){return e.attempt(UL,m,g)(v)}function m(v){return t(v)}function g(v){return a._balanced=!0,i(v)}}function $L(e,t,i){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return xi(g)?aa(e,a)(g):a(g)}function a(g){return g===41?m(g):uC(e,c,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return xi(g)?aa(e,d)(g):m(g)}function h(g){return i(g)}function d(g){return g===34||g===39||g===40?fC(e,f,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function f(g){return xi(g)?aa(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):i(g)}}function YL(e,t,i){const r=this;return o;function o(h){return hC.call(r,e,a,c,"reference","referenceMarker","referenceString")(h)}function a(h){return r.parser.defined.includes(Do(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(h):i(h)}function c(h){return i(h)}}function WL(e,t,i){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):i(a)}}const XL={name:"labelStartImage",resolveAll:vm.resolveAll,tokenize:KL};function KL(e,t,i){const r=this;return o;function o(h){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(h),e.exit("labelImageMarker"),a}function a(h){return h===91?(e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelImage"),c):i(h)}function c(h){return h===94&&"_hiddenFootnoteSupport"in r.parser.constructs?i(h):t(h)}}const GL={name:"labelStartLink",resolveAll:vm.resolveAll,tokenize:ZL};function ZL(e,t,i){const r=this;return o;function o(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),a}function a(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?i(c):t(c)}}const Sp={name:"lineEnding",tokenize:QL};function QL(e,t){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ot(e,t,"linePrefix")}}const Hu={name:"thematicBreak",tokenize:JL};function JL(e,t,i){let r=0,o;return a;function a(f){return e.enter("thematicBreak"),c(f)}function c(f){return o=f,h(f)}function h(f){return f===o?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ne(f))?(e.exit("thematicBreak"),t(f)):i(f)}function d(f){return f===o?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Ge(f)?ot(e,h,"whitespace")(f):h(f))}}const Si={continuation:{tokenize:nz},exit:sz,name:"list",tokenize:iz},ez={partial:!0,tokenize:oz},tz={partial:!0,tokenize:rz};function iz(e,t,i){const r=this,o=r.events[r.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return h;function h(y){const S=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Dg(y)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Hu,i,f)(y):f(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return i(y)}function d(y){return Dg(y)&&++c<10?(e.consume(y),d):(!r.interrupt||c<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),f(y)):i(y)}function f(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(bh,r.interrupt?i:m,e.attempt(ez,v,g))}function m(y){return r.containerState.initialBlankLine=!0,a++,v(y)}function g(y){return Ge(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):i(y)}function v(y){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function nz(e,t,i){const r=this;return r.containerState._closeFlow=void 0,e.check(bh,o,a);function o(h){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ot(e,t,"listItemIndent",r.containerState.size+1)(h)}function a(h){return r.containerState.furtherBlankLines||!Ge(h)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(h)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(tz,t,c)(h))}function c(h){return r.containerState._closeFlow=!0,r.interrupt=void 0,ot(e,e.attempt(Si,t,i),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function rz(e,t,i){const r=this;return ot(e,o,"listItemIndent",r.containerState.size+1);function o(a){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?t(a):i(a)}}function sz(e){e.exit(this.containerState.type)}function oz(e,t,i){const r=this;return ot(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const c=r.events[r.events.length-1];return!Ge(a)&&c&&c[1].type==="listItemPrefixWhitespace"?t(a):i(a)}}const OS={name:"setextUnderline",resolveTo:lz,tokenize:az};function lz(e,t){let i=e.length,r,o,a;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){r=i;break}e[i][1].type==="paragraph"&&(o=i)}else e[i][1].type==="content"&&e.splice(i,1),!a&&e[i][1].type==="definition"&&(a=i);const c={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",c,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=c,e.push(["exit",c,t]),e}function az(e,t,i){const r=this;let o;return a;function a(f){let m=r.events.length,g;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){g=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),o=f,c(f)):i(f)}function c(f){return e.enter("setextHeadingLineSequence"),h(f)}function h(f){return f===o?(e.consume(f),h):(e.exit("setextHeadingLineSequence"),Ge(f)?ot(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ne(f)?(e.exit("setextHeadingLine"),t(f)):i(f)}}const cz={tokenize:uz};function uz(e){const t=this,i=e.attempt(bh,r,e.attempt(this.parser.constructs.flowInitial,o,ot(e,e.attempt(this.parser.constructs.flow,o,e.attempt(gL,o)),"linePrefix")));return i;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,i}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,i}}const hz={resolveAll:pC()},fz=dC("string"),dz=dC("text");function dC(e){return{resolveAll:pC(e==="text"?pz:void 0),tokenize:t};function t(i){const r=this,o=this.parser.constructs[e],a=i.attempt(o,c,h);return c;function c(m){return f(m)?a(m):h(m)}function h(m){if(m===null){i.consume(m);return}return i.enter("data"),i.consume(m),d}function d(m){return f(m)?(i.exit("data"),a(m)):(i.consume(m),d)}function f(m){if(m===null)return!0;const g=o[m];let v=-1;if(g)for(;++v<g.length;){const y=g[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function pC(e){return t;function t(i,r){let o=-1,a;for(;++o<=i.length;)a===void 0?i[o]&&i[o][1].type==="data"&&(a=o,o++):(!i[o]||i[o][1].type!=="data")&&(o!==a+2&&(i[a][1].end=i[o-1][1].end,i.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(i,r):i}}function pz(e,t){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const r=e[i-1][1],o=t.sliceStream(r);let a=o.length,c=-1,h=0,d;for(;a--;){const f=o[a];if(typeof f=="string"){for(c=f.length;f.charCodeAt(c-1)===32;)h++,c--;if(c)break;c=-1}else if(f===-2)d=!0,h++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&i===e.length&&(h=0),h){const f={type:i===e.length||d||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?c:r.start._bufferIndex+c,_index:r.start._index+a,line:r.end.line,column:r.end.column-h,offset:r.end.offset-h},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(i,0,["enter",f,t],["exit",f,t]),i+=2)}i++}return e}const gz={42:Si,43:Si,45:Si,48:Si,49:Si,50:Si,51:Si,52:Si,53:Si,54:Si,55:Si,56:Si,57:Si,62:oC},mz={91:SL},_z={[-2]:yp,[-1]:yp,32:yp},vz={35:kL,42:Hu,45:[OS,Hu],60:AL,61:OS,95:Hu,96:LS,126:LS},yz={38:aC,92:lC},Sz={[-5]:Sp,[-4]:Sp,[-3]:Sp,33:XL,38:aC,42:Rg,60:[G6,HL],91:GL,92:[CL,lC],93:vm,95:Rg,96:cL},bz={null:[Rg,hz]},xz={null:[42,95]},wz={null:[]},Cz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:xz,contentInitial:mz,disable:wz,document:gz,flow:vz,flowInitial:_z,insideSpan:bz,string:yz,text:Sz},Symbol.toStringTag,{value:"Module"}));function Ez(e,t,i){let r={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const o={},a=[];let c=[],h=[];const d={attempt:U(P),check:U(R),consume:z,enter:E,exit:T,interrupt:U(R,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:g};let m=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function g(V){return c=Gi(c,V),k(),c[c.length-1]!==null?[]:(X(t,0),f.events=_m(a,f.events,f),f.events)}function v(V,I){return Mz(y(V),I)}function y(V){return kz(c,V)}function S(){const{_bufferIndex:V,_index:I,line:F,column:B,offset:O}=r;return{_bufferIndex:V,_index:I,line:F,column:B,offset:O}}function b(V){o[V.line]=V.column,ne()}function k(){let V;for(;r._index<c.length;){const I=c[r._index];if(typeof I=="string")for(V=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===V&&r._bufferIndex<I.length;)C(I.charCodeAt(r._bufferIndex));else C(I)}}function C(V){m=m(V)}function z(V){Ne(V)?(r.line++,r.column=1,r.offset+=V===-3?2:1,ne()):V!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=V}function E(V,I){const F=I||{};return F.type=V,F.start=S(),f.events.push(["enter",F,f]),h.push(F),F}function T(V){const I=h.pop();return I.end=S(),f.events.push(["exit",I,f]),I}function P(V,I){X(V,I.from)}function R(V,I){I.restore()}function U(V,I){return F;function F(B,O,M){let j,H,$,N;return Array.isArray(B)?Y(B):"tokenize"in B?Y([B]):L(B);function L(le){return fe;function fe(he){const pe=he!==null&&le[he],Ce=he!==null&&le.null,xe=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(Ce)?Ce:Ce?[Ce]:[]];return Y(xe)(he)}}function Y(le){return j=le,H=0,le.length===0?M:A(le[H])}function A(le){return fe;function fe(he){return N=G(),$=le,le.partial||(f.currentConstruct=le),le.name&&f.parser.constructs.disable.null.includes(le.name)?ce():le.tokenize.call(I?Object.assign(Object.create(f),I):f,d,ee,ce)(he)}}function ee(le){return V($,N),O}function ce(le){return N.restore(),++H<j.length?A(j[H]):M}}}function X(V,I){V.resolveAll&&!a.includes(V)&&a.push(V),V.resolve&&Tn(f.events,I,f.events.length-I,V.resolve(f.events.slice(I),f)),V.resolveTo&&(f.events=V.resolveTo(f.events,f))}function G(){const V=S(),I=f.previous,F=f.currentConstruct,B=f.events.length,O=Array.from(h);return{from:B,restore:M};function M(){r=V,f.previous=I,f.currentConstruct=F,f.events.length=B,h=O,ne()}}function ne(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function kz(e,t){const i=t.start._index,r=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let c;if(i===o)c=[e[i].slice(r,a)];else{if(c=e.slice(i,o),r>-1){const h=c[0];typeof h=="string"?c[0]=h.slice(r):c.shift()}a>0&&c.push(e[o].slice(0,a))}return c}function Mz(e,t){let i=-1;const r=[];let o;for(;++i<e.length;){const a=e[i];let c;if(typeof a=="string")c=a;else switch(a){case-5:{c="\r";break}case-4:{c=`
|
|
167
|
+
`;break}case-3:{c=`\r
|
|
168
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&o)continue;c=" ";break}default:c=String.fromCharCode(a)}o=a===-2,r.push(c)}return r.join("")}function Tz(e){const r={constructs:z6([Cz,...(e||{}).extensions||[]]),content:o(V6),defined:[],document:o($6),flow:o(cz),lazy:{},string:o(fz),text:o(dz)};return r;function o(a){return c;function c(h){return Ez(r,a,h)}}}function Nz(e){for(;!cC(e););return e}const HS=/[\0\t\n\r]/g;function Az(){let e=1,t="",i=!0,r;return o;function o(a,c,h){const d=[];let f,m,g,v,y;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(c||void 0).decode(a)),g=0,t="",i&&(a.charCodeAt(0)===65279&&g++,i=void 0);g<a.length;){if(HS.lastIndex=g,f=HS.exec(a),v=f&&f.index!==void 0?f.index:a.length,y=a.charCodeAt(v),!f){t=a.slice(g);break}if(y===10&&g===v&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),g<v&&(d.push(a.slice(g,v)),e+=v-g),y){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}g=v+1}return h&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const Dz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Rz(e){return e.replace(Dz,Bz)}function Bz(e,t,i){if(t)return t;if(i.charCodeAt(0)===35){const o=i.charCodeAt(1),a=o===120||o===88;return sC(i.slice(a?2:1),a?16:10)}return mm(i)||e}const gC={}.hasOwnProperty;function Lz(e,t,i){return t&&typeof t=="object"&&(i=t,t=void 0),zz(i)(Nz(Tz(i).document().write(Az()(e,t,!0))))}function zz(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Jt),autolinkProtocol:G,autolinkEmail:G,atxHeading:a(Ye),blockQuote:a(Ce),characterEscape:G,characterReference:G,codeFenced:a(xe),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:a(xe,c),codeText:a(Se,c),codeTextData:G,data:G,codeFlowValue:G,definition:a(me),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:a(Ae),hardBreakEscape:a(ze),hardBreakTrailing:a(ze),htmlFlow:a(St,c),htmlFlowData:G,htmlText:a(St,c),htmlTextData:G,image:a(Ci),label:c,link:a(Jt),listItem:a(Qi),listItemValue:v,listOrdered:a(ui,g),listUnordered:a(ui),paragraph:a(An),reference:A,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:a(Ye),strong:a(Dn),thematicBreak:a(ar)},exit:{atxHeading:d(),atxHeadingSequence:P,autolink:d(),autolinkEmail:pe,autolinkProtocol:he,blockQuote:d(),characterEscapeValue:ne,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:fe,codeFenced:d(k),codeFencedFence:b,codeFencedFenceInfo:y,codeFencedFenceMeta:S,codeFlowValue:ne,codeIndented:d(C),codeText:d(O),codeTextData:ne,data:ne,definition:d(),definitionDestinationString:T,definitionLabelString:z,definitionTitleString:E,emphasis:d(),hardBreakEscape:d(I),hardBreakTrailing:d(I),htmlFlow:d(F),htmlFlowData:ne,htmlText:d(B),htmlTextData:ne,image:d(j),label:$,labelText:H,lineEnding:V,link:d(M),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ee,resourceDestinationString:N,resourceTitleString:L,resource:Y,setextHeading:d(X),setextHeadingLineSequence:U,setextHeadingText:R,strong:d(),thematicBreak:d()}};mC(t,(e||{}).mdastExtensions||[]);const i={};return r;function r(re){let ge={type:"root",children:[]};const ke={stack:[ge],tokenStack:[],config:t,enter:h,exit:f,buffer:c,resume:m,data:i},Oe=[];let Fe=-1;for(;++Fe<re.length;)if(re[Fe][1].type==="listOrdered"||re[Fe][1].type==="listUnordered")if(re[Fe][0]==="enter")Oe.push(Fe);else{const si=Oe.pop();Fe=o(re,si,Fe)}for(Fe=-1;++Fe<re.length;){const si=t[re[Fe][0]];gC.call(si,re[Fe][1].type)&&si[re[Fe][1].type].call(Object.assign({sliceSerialize:re[Fe][2].sliceSerialize},ke),re[Fe][1])}if(ke.tokenStack.length>0){const si=ke.tokenStack[ke.tokenStack.length-1];(si[1]||jS).call(ke,void 0,si[0])}for(ge.position={start:Vr(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:Vr(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)ge=t.transforms[Fe](ge)||ge;return ge}function o(re,ge,ke){let Oe=ge-1,Fe=-1,si=!1,Ji,Yt,bt,ei;for(;++Oe<=ke;){const Ze=re[Oe];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?Fe++:Fe--,ei=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Ji&&!ei&&!Fe&&!bt&&(bt=Oe),ei=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ei=void 0}if(!Fe&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||Fe===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(Ji){let hn=Oe;for(Yt=void 0;hn--;){const Ei=re[hn];if(Ei[1].type==="lineEnding"||Ei[1].type==="lineEndingBlank"){if(Ei[0]==="exit")continue;Yt&&(re[Yt][1].type="lineEndingBlank",si=!0),Ei[1].type="lineEnding",Yt=hn}else if(!(Ei[1].type==="linePrefix"||Ei[1].type==="blockQuotePrefix"||Ei[1].type==="blockQuotePrefixWhitespace"||Ei[1].type==="blockQuoteMarker"||Ei[1].type==="listItemIndent"))break}bt&&(!Yt||bt<Yt)&&(Ji._spread=!0),Ji.end=Object.assign({},Yt?re[Yt][1].start:Ze[1].end),re.splice(Yt||Oe,0,["exit",Ji,Ze[2]]),Oe++,ke++}if(Ze[1].type==="listItemPrefix"){const hn={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Ji=hn,re.splice(Oe,0,["enter",hn,Ze[2]]),Oe++,ke++,bt=void 0,ei=!0}}}return re[ge][1]._spread=si,ke}function a(re,ge){return ke;function ke(Oe){h.call(this,re(Oe),Oe),ge&&ge.call(this,Oe)}}function c(){this.stack.push({type:"fragment",children:[]})}function h(re,ge,ke){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([ge,ke||void 0]),re.position={start:Vr(ge.start),end:void 0}}function d(re){return ge;function ge(ke){re&&re.call(this,ke),f.call(this,ke)}}function f(re,ge){const ke=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==re.type&&(ge?ge.call(this,re,Oe[0]):(Oe[1]||jS).call(this,re,Oe[0]));else throw new Error("Cannot close `"+re.type+"` ("+la({start:re.start,end:re.end})+"): it’s not open");ke.position.end=Vr(re.end)}function m(){return B6(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(re){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function y(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=re}function S(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=re}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re.replace(/(\r?\n|\r)$/g,"")}function z(re){const ge=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ge,ke.identifier=Do(this.sliceSerialize(re)).toLowerCase()}function E(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.title=re}function T(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.url=re}function P(re){const ge=this.stack[this.stack.length-1];if(!ge.depth){const ke=this.sliceSerialize(re).length;ge.depth=ke}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function U(re){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function X(){this.data.setextHeadingSlurpLineEnding=void 0}function G(re){const ke=this.stack[this.stack.length-1].children;let Oe=ke[ke.length-1];(!Oe||Oe.type!=="text")&&(Oe=Lt(),Oe.position={start:Vr(re.start),end:void 0},ke.push(Oe)),this.stack.push(Oe)}function ne(re){const ge=this.stack.pop();ge.value+=this.sliceSerialize(re),ge.position.end=Vr(re.end)}function V(re){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=ge.children[ge.children.length-1];ke.position.end=Vr(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(G.call(this,re),ne.call(this,re))}function I(){this.data.atHardBreak=!0}function F(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re}function B(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re}function O(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re}function M(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=ge,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function j(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=ge,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function H(re){const ge=this.sliceSerialize(re),ke=this.stack[this.stack.length-2];ke.label=Rz(ge),ke.identifier=Do(ge).toLowerCase()}function $(){const re=this.stack[this.stack.length-1],ge=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Oe=re.children;ke.children=Oe}else ke.alt=ge}function N(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.url=re}function L(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.title=re}function Y(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ee(re){const ge=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ge,ke.identifier=Do(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function ce(re){this.data.characterReferenceType=re.type}function le(re){const ge=this.sliceSerialize(re),ke=this.data.characterReferenceType;let Oe;ke?(Oe=sC(ge,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=mm(ge);const Fe=this.stack[this.stack.length-1];Fe.value+=Oe}function fe(re){const ge=this.stack.pop();ge.position.end=Vr(re.end)}function he(re){ne.call(this,re);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(re)}function pe(re){ne.call(this,re);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(re)}function Ce(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Se(){return{type:"inlineCode",value:""}}function me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function Ye(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function St(){return{type:"html",value:""}}function Ci(){return{type:"image",title:null,url:"",alt:null}}function Jt(){return{type:"link",title:null,url:"",children:[]}}function ui(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[]}}function Qi(re){return{type:"listItem",spread:re._spread,checked:null,children:[]}}function An(){return{type:"paragraph",children:[]}}function Dn(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function ar(){return{type:"thematicBreak"}}}function Vr(e){return{line:e.line,column:e.column,offset:e.offset}}function mC(e,t){let i=-1;for(;++i<t.length;){const r=t[i];Array.isArray(r)?mC(e,r):Oz(e,r)}}function Oz(e,t){let i;for(i in t)if(gC.call(t,i))switch(i){case"canContainEols":{const r=t[i];r&&e[i].push(...r);break}case"transforms":{const r=t[i];r&&e[i].push(...r);break}case"enter":case"exit":{const r=t[i];r&&Object.assign(e[i],r);break}}}function jS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+la({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+la({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+la({start:t.start,end:t.end})+") is still open")}function Hz(e){const t=this;t.parser=i;function i(r){return Lz(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function jz(e,t){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,i),e.applyData(t,i)}function Pz(e,t){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,i),[e.applyData(t,i),{type:"text",value:`
|
|
169
|
+
`}]}function Iz(e,t){const i=t.value?t.value+`
|
|
170
|
+
`:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:i}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Uz(e,t){const i={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function qz(e,t){const i={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Vz(e,t){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Vo(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let c,h=e.footnoteCounts.get(r);h===void 0?(h=0,e.footnoteOrder.push(r),c=e.footnoteOrder.length):c=a+1,h+=1,e.footnoteCounts.set(r,h);const d={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+o,id:i+"fnref-"+o+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function Fz(e,t){const i={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function $z(e,t){if(e.options.allowDangerousHtml){const i={type:"raw",value:t.value};return e.patch(t,i),e.applyData(t,i)}}function _C(e,t){const i=t.referenceType;let r="]";if(i==="collapsed"?r+="[]":i==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=r:o.push({type:"text",value:r}),o}function Yz(e,t){const i=String(t.identifier).toUpperCase(),r=e.definitionById.get(i);if(!r)return _C(e,t);const o={src:Vo(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function Wz(e,t){const i={src:Vo(t.url)};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),t.title!==null&&t.title!==void 0&&(i.title=t.title);const r={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,r),e.applyData(t,r)}function Xz(e,t){const i={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,i);const r={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(t,r),e.applyData(t,r)}function Kz(e,t){const i=String(t.identifier).toUpperCase(),r=e.definitionById.get(i);if(!r)return _C(e,t);const o={href:Vo(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Gz(e,t){const i={href:Vo(t.url)};t.title!==null&&t.title!==void 0&&(i.title=t.title);const r={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Zz(e,t,i){const r=e.all(t),o=i?Qz(i):vC(t),a={},c=[];if(typeof t.checked=="boolean"){const m=r[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let h=-1;for(;++h<r.length;){const m=r[h];(o||h!==0||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
171
|
+
`}),m.type==="element"&&m.tagName==="p"&&!o?c.push(...m.children):c.push(m)}const d=r[r.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&c.push({type:"text",value:`
|
|
172
|
+
`});const f={type:"element",tagName:"li",properties:a,children:c};return e.patch(t,f),e.applyData(t,f)}function Qz(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const i=e.children;let r=-1;for(;!t&&++r<i.length;)t=vC(i[r])}return t}function vC(e){const t=e.spread;return t??e.children.length>1}function Jz(e,t){const i={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(i.start=t.start);++o<r.length;){const c=r[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:i,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function eO(e,t){const i={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function tO(e,t){const i={type:"root",children:e.wrap(e.all(t))};return e.patch(t,i),e.applyData(t,i)}function iO(e,t){const i={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function nO(e,t){const i=e.all(t),r=i.shift(),o=[];if(r){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],c),o.push(c)}if(i.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},h=fm(t.children[1]),d=Qw(t.children[t.children.length-1]);h&&d&&(c.position={start:h,end:d}),o.push(c)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)}function rO(e,t,i){const r=i?i.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",c=i&&i.type==="table"?i.align:void 0,h=c?c.length:t.children.length;let d=-1;const f=[];for(;++d<h;){const g=t.children[d],v={},y=c?c[d]:void 0;y&&(v.align=y);let S={type:"element",tagName:a,properties:v,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),f.push(S)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function sO(e,t){const i={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}const PS=9,IS=32;function oO(e){const t=String(e),i=/\r?\n|\r/g;let r=i.exec(t),o=0;const a=[];for(;r;)a.push(US(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=i.exec(t);return a.push(US(t.slice(o),o>0,!1)),a.join("")}function US(e,t,i){let r=0,o=e.length;if(t){let a=e.codePointAt(r);for(;a===PS||a===IS;)r++,a=e.codePointAt(r)}if(i){let a=e.codePointAt(o-1);for(;a===PS||a===IS;)o--,a=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function lO(e,t){const i={type:"text",value:oO(String(t.value))};return e.patch(t,i),e.applyData(t,i)}function aO(e,t){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,i),e.applyData(t,i)}const cO={blockquote:jz,break:Pz,code:Iz,delete:Uz,emphasis:qz,footnoteReference:Vz,heading:Fz,html:$z,imageReference:Yz,image:Wz,inlineCode:Xz,linkReference:Kz,link:Gz,listItem:Zz,list:Jz,paragraph:eO,root:tO,strong:iO,table:nO,tableCell:sO,tableRow:rO,text:lO,thematicBreak:aO,toml:xu,yaml:xu,definition:xu,footnoteDefinition:xu};function xu(){}const yC=-1,xh=0,ca=1,eh=2,ym=3,Sm=4,bm=5,xm=6,SC=7,bC=8,qS=typeof self=="object"?self:globalThis,uO=(e,t)=>{const i=(o,a)=>(e.set(a,o),o),r=o=>{if(e.has(o))return e.get(o);const[a,c]=t[o];switch(a){case xh:case yC:return i(c,o);case ca:{const h=i([],o);for(const d of c)h.push(r(d));return h}case eh:{const h=i({},o);for(const[d,f]of c)h[r(d)]=r(f);return h}case ym:return i(new Date(c),o);case Sm:{const{source:h,flags:d}=c;return i(new RegExp(h,d),o)}case bm:{const h=i(new Map,o);for(const[d,f]of c)h.set(r(d),r(f));return h}case xm:{const h=i(new Set,o);for(const d of c)h.add(r(d));return h}case SC:{const{name:h,message:d}=c;return i(new qS[h](d),o)}case bC:return i(BigInt(c),o);case"BigInt":return i(Object(BigInt(c)),o);case"ArrayBuffer":return i(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:h}=new Uint8Array(c);return i(new DataView(h),c)}}return i(new qS[a](c),o)};return r},VS=e=>uO(new Map,e)(0),Co="",{toString:hO}={},{keys:fO}=Object,Gl=e=>{const t=typeof e;if(t!=="object"||!e)return[xh,t];const i=hO.call(e).slice(8,-1);switch(i){case"Array":return[ca,Co];case"Object":return[eh,Co];case"Date":return[ym,Co];case"RegExp":return[Sm,Co];case"Map":return[bm,Co];case"Set":return[xm,Co];case"DataView":return[ca,i]}return i.includes("Array")?[ca,i]:i.includes("Error")?[SC,i]:[eh,i]},wu=([e,t])=>e===xh&&(t==="function"||t==="symbol"),dO=(e,t,i,r)=>{const o=(c,h)=>{const d=r.push(c)-1;return i.set(h,d),d},a=c=>{if(i.has(c))return i.get(c);let[h,d]=Gl(c);switch(h){case xh:{let m=c;switch(d){case"bigint":h=bC,m=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return o([yC],c)}return o([h,m],c)}case ca:{if(d){let v=c;return d==="DataView"?v=new Uint8Array(c.buffer):d==="ArrayBuffer"&&(v=new Uint8Array(c)),o([d,[...v]],c)}const m=[],g=o([h,m],c);for(const v of c)m.push(a(v));return g}case eh:{if(d)switch(d){case"BigInt":return o([d,c.toString()],c);case"Boolean":case"Number":case"String":return o([d,c.valueOf()],c)}if(t&&"toJSON"in c)return a(c.toJSON());const m=[],g=o([h,m],c);for(const v of fO(c))(e||!wu(Gl(c[v])))&&m.push([a(v),a(c[v])]);return g}case ym:return o([h,c.toISOString()],c);case Sm:{const{source:m,flags:g}=c;return o([h,{source:m,flags:g}],c)}case bm:{const m=[],g=o([h,m],c);for(const[v,y]of c)(e||!(wu(Gl(v))||wu(Gl(y))))&&m.push([a(v),a(y)]);return g}case xm:{const m=[],g=o([h,m],c);for(const v of c)(e||!wu(Gl(v)))&&m.push(a(v));return g}}const{message:f}=c;return o([h,{name:d,message:f}],c)};return a},FS=(e,{json:t,lossy:i}={})=>{const r=[];return dO(!(t||i),!!t,new Map,r)(e),r},th=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?VS(FS(e,t)):structuredClone(e):(e,t)=>VS(FS(e,t));function pO(e,t){const i=[{type:"text",value:"↩"}];return t>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),i}function gO(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function mO(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||pO,r=e.options.footnoteBackLabel||gO,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const m=e.all(f),g=String(f.identifier).toUpperCase(),v=Vo(g.toLowerCase());let y=0;const S=[],b=e.footnoteCounts.get(g);for(;b!==void 0&&++y<=b;){S.length>0&&S.push({type:"text",value:" "});let z=typeof i=="string"?i:i(d,y);typeof z=="string"&&(z={type:"text",value:z}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,y),className:["data-footnote-backref"]},children:Array.isArray(z)?z:[z]})}const k=m[m.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const z=k.children[k.children.length-1];z&&z.type==="text"?z.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...S)}else m.push(...S);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(m,!0)};e.patch(f,C),h.push(C)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...th(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
173
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(h,!0)},{type:"text",value:`
|
|
174
|
+
`}]}}const xC=(function(e){if(e==null)return SO;if(typeof e=="function")return wh(e);if(typeof e=="object")return Array.isArray(e)?_O(e):vO(e);if(typeof e=="string")return yO(e);throw new Error("Expected function, string, or object as test")});function _O(e){const t=[];let i=-1;for(;++i<e.length;)t[i]=xC(e[i]);return wh(r);function r(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function vO(e){const t=e;return wh(i);function i(r){const o=r;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function yO(e){return wh(t);function t(i){return i&&i.type===e}}function wh(e){return t;function t(i,r,o){return!!(bO(i)&&e.call(this,i,typeof r=="number"?r:void 0,o||void 0))}}function SO(){return!0}function bO(e){return e!==null&&typeof e=="object"&&"type"in e}const wC=[],xO=!0,$S=!1,wO="skip";function CO(e,t,i,r){let o;typeof t=="function"&&typeof i!="function"?(r=i,i=t):o=t;const a=xC(o),c=r?-1:1;h(e,void 0,[])();function h(d,f,m){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const y=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(d.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=wC,S,b,k;if((!t||a(d,f,m[m.length-1]||void 0))&&(y=EO(i(d,m)),y[0]===$S))return y;if("children"in d&&d.children){const C=d;if(C.children&&y[0]!==wO)for(b=(r?C.children.length:-1)+c,k=m.concat(C);b>-1&&b<C.children.length;){const z=C.children[b];if(S=h(z,b,k)(),S[0]===$S)return S;b=typeof S[1]=="number"?S[1]:b+c}}return y}}}function EO(e){return Array.isArray(e)?e:typeof e=="number"?[xO,e]:e==null?wC:[e]}function CC(e,t,i,r){let o,a,c;typeof t=="function"&&typeof i!="function"?(a=void 0,c=t,o=i):(a=t,c=i,o=r),CO(e,a,h,o);function h(d,f){const m=f[f.length-1],g=m?m.children.indexOf(d):void 0;return c(d,g,m)}}const Bg={}.hasOwnProperty,kO={};function MO(e,t){const i=t||kO,r=new Map,o=new Map,a=new Map,c={...cO,...i.handlers},h={all:f,applyData:NO,definitionById:r,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:c,one:d,options:i,patch:TO,wrap:DO};return CC(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?r:o,v=String(m.identifier).toUpperCase();g.has(v)||g.set(v,m)}}),h;function d(m,g){const v=m.type,y=h.handlers[v];if(Bg.call(h.handlers,v)&&y)return y(h,m,g);if(h.options.passThrough&&h.options.passThrough.includes(v)){if("children"in m){const{children:b,...k}=m,C=th(k);return C.children=h.all(m),C}return th(m)}return(h.options.unknownHandler||AO)(h,m,g)}function f(m){const g=[];if("children"in m){const v=m.children;let y=-1;for(;++y<v.length;){const S=h.one(v[y],m);if(S){if(y&&v[y-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=YS(S.value)),!Array.isArray(S)&&S.type==="element")){const b=S.children[0];b&&b.type==="text"&&(b.value=YS(b.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function TO(e,t){e.position&&(t.position=h6(e))}function NO(e,t){let i=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(i.type==="element")i.tagName=r;else{const c="children"in i?i.children:[i];i={type:"element",tagName:r,properties:{},children:c}}i.type==="element"&&a&&Object.assign(i.properties,th(a)),"children"in i&&i.children&&o!==null&&o!==void 0&&(i.children=o)}return i}function AO(e,t){const i=t.data||{},r="value"in t&&!(Bg.call(i,"hProperties")||Bg.call(i,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function DO(e,t){const i=[];let r=-1;for(t&&i.push({type:"text",value:`
|
|
175
|
+
`});++r<e.length;)r&&i.push({type:"text",value:`
|
|
176
|
+
`}),i.push(e[r]);return t&&e.length>0&&i.push({type:"text",value:`
|
|
177
|
+
`}),i}function YS(e){let t=0,i=e.charCodeAt(t);for(;i===9||i===32;)t++,i=e.charCodeAt(t);return e.slice(t)}function WS(e,t){const i=MO(e,t),r=i.one(e,void 0),o=mO(i),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
|
|
178
|
+
`},o),a}function RO(e,t){return e&&"run"in e?async function(i,r){const o=WS(i,{file:r,...t});await e.run(o,r)}:function(i,r){return WS(i,{file:r,...e||t})}}function XS(e){if(e)throw e}var bp,KS;function BO(){if(KS)return bp;KS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),g=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!g)return!1;var v;for(v in f);return typeof v>"u"||e.call(f,v)},c=function(f,m){i&&m.name==="__proto__"?i(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},h=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return bp=function d(){var f,m,g,v,y,S,b=arguments[0],k=1,C=arguments.length,z=!1;for(typeof b=="boolean"&&(z=b,b=arguments[1]||{},k=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});k<C;++k)if(f=arguments[k],f!=null)for(m in f)g=h(b,m),v=h(f,m),b!==v&&(z&&v&&(a(v)||(y=o(v)))?(y?(y=!1,S=g&&o(g)?g:[]):S=g&&a(g)?g:{},c(b,{name:m,newValue:d(z,S,v)})):typeof v<"u"&&c(b,{name:m,newValue:v}));return b},bp}var LO=BO();const xp=nh(LO);function Lg(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zO(){const e=[],t={run:i,use:r};return t;function i(...o){let a=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);h(null,...o);function h(d,...f){const m=e[++a];let g=-1;if(d){c(d);return}for(;++g<o.length;)(f[g]===null||f[g]===void 0)&&(f[g]=o[g]);o=f,m?OO(m,h)(...f):c(null,...f)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function OO(e,t){let i;return r;function r(...c){const h=e.length>c.length;let d;h&&c.push(o);try{d=e.apply(this,c)}catch(f){const m=f;if(h&&i)throw m;return o(m)}h||(d&&d.then&&typeof d.then=="function"?d.then(a,o):d instanceof Error?o(d):a(d))}function o(c,...h){i||(i=!0,t(c,...h))}function a(c){o(null,c)}}const Sn={basename:HO,dirname:jO,extname:PO,join:IO,sep:"/"};function HO(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ha(e);let i=0,r=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){i=o+1;break}}else r<0&&(a=!0,r=o+1);return r<0?"":e.slice(i,r)}if(t===e)return"";let c=-1,h=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){i=o+1;break}}else c<0&&(a=!0,c=o+1),h>-1&&(e.codePointAt(o)===t.codePointAt(h--)?h<0&&(r=o):(h=-1,r=c));return i===r?r=c:r<0&&(r=e.length),e.slice(i,r)}function jO(e){if(Ha(e),e.length===0)return".";let t=-1,i=e.length,r;for(;--i;)if(e.codePointAt(i)===47){if(r){t=i;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function PO(e){Ha(e);let t=e.length,i=-1,r=0,o=-1,a=0,c;for(;t--;){const h=e.codePointAt(t);if(h===47){if(c){r=t+1;break}continue}i<0&&(c=!0,i=t+1),h===46?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||i<0||a===0||a===1&&o===i-1&&o===r+1?"":e.slice(o,i)}function IO(...e){let t=-1,i;for(;++t<e.length;)Ha(e[t]),e[t]&&(i=i===void 0?e[t]:i+"/"+e[t]);return i===void 0?".":UO(i)}function UO(e){Ha(e);const t=e.codePointAt(0)===47;let i=qO(e,!t);return i.length===0&&!t&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),t?"/"+i:i}function qO(e,t){let i="",r=0,o=-1,a=0,c=-1,h,d;for(;++c<=e.length;){if(c<e.length)h=e.codePointAt(c);else{if(h===47)break;h=47}if(h===47){if(!(o===c-1||a===1))if(o!==c-1&&a===2){if(i.length<2||r!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(d=i.lastIndexOf("/"),d!==i.length-1){d<0?(i="",r=0):(i=i.slice(0,d),r=i.length-1-i.lastIndexOf("/")),o=c,a=0;continue}}else if(i.length>0){i="",r=0,o=c,a=0;continue}}t&&(i=i.length>0?i+"/..":"..",r=2)}else i.length>0?i+="/"+e.slice(o+1,c):i=e.slice(o+1,c),r=c-o-1;o=c,a=0}else h===46&&a>-1?a++:a=-1}return i}function Ha(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VO={cwd:FO};function FO(){return"/"}function zg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $O(e){if(typeof e=="string")e=new URL(e);else if(!zg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return YO(e)}function YO(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let i=-1;for(;++i<t.length;)if(t.codePointAt(i)===37&&t.codePointAt(i+1)===50){const r=t.codePointAt(i+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const wp=["history","path","basename","stem","extname","dirname"];class EC{constructor(t){let i;t?zg(t)?i={path:t}:typeof t=="string"||WO(t)?i={value:t}:i=t:i={},this.cwd="cwd"in i?"":VO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<wp.length;){const a=wp[r];a in i&&i[a]!==void 0&&i[a]!==null&&(this[a]=a==="history"?[...i[a]]:i[a])}let o;for(o in i)wp.includes(o)||(this[o]=i[o])}get basename(){return typeof this.path=="string"?Sn.basename(this.path):void 0}set basename(t){Ep(t,"basename"),Cp(t,"basename"),this.path=Sn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Sn.dirname(this.path):void 0}set dirname(t){GS(this.basename,"dirname"),this.path=Sn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Sn.extname(this.path):void 0}set extname(t){if(Cp(t,"extname"),GS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Sn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){zg(t)&&(t=$O(t)),Ep(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Sn.basename(this.path,this.extname):void 0}set stem(t){Ep(t,"stem"),Cp(t,"stem"),this.path=Sn.join(this.dirname||"",t+(this.extname||""))}fail(t,i,r){const o=this.message(t,i,r);throw o.fatal=!0,o}info(t,i,r){const o=this.message(t,i,r);return o.fatal=void 0,o}message(t,i,r){const o=new ri(t,i,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Cp(e,t){if(e&&e.includes(Sn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Sn.sep+"`")}function Ep(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function GS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function WO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const XO=(function(e){const r=this.constructor.prototype,o=r[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),KO={}.hasOwnProperty;class wm extends XO{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zO()}copy(){const t=new wm;let i=-1;for(;++i<this.attachers.length;){const r=this.attachers[i];t.use(...r)}return t.data(xp(!0,{},this.namespace)),t}data(t,i){return typeof t=="string"?arguments.length===2?(Tp("data",this.frozen),this.namespace[t]=i,this):KO.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Tp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=i.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const i=Cu(t),r=this.parser||this.Parser;return kp("parse",r),r(String(i),i)}process(t,i){const r=this;return this.freeze(),kp("process",this.parser||this.Parser),Mp("process",this.compiler||this.Compiler),i?o(void 0,i):new Promise(o);function o(a,c){const h=Cu(t),d=r.parse(h);r.run(d,h,function(m,g,v){if(m||!g||!v)return f(m);const y=g,S=r.stringify(y,v);QO(S)?v.value=S:v.result=S,f(m,v)});function f(m,g){m||!g?c(m):a?a(g):i(void 0,g)}}}processSync(t){let i=!1,r;return this.freeze(),kp("processSync",this.parser||this.Parser),Mp("processSync",this.compiler||this.Compiler),this.process(t,o),QS("processSync","process",i),r;function o(a,c){i=!0,XS(a),r=c}}run(t,i,r){ZS(t),this.freeze();const o=this.transformers;return!r&&typeof i=="function"&&(r=i,i=void 0),r?a(void 0,r):new Promise(a);function a(c,h){const d=Cu(i);o.run(t,d,f);function f(m,g,v){const y=g||t;m?h(m):c?c(y):r(void 0,y,v)}}}runSync(t,i){let r=!1,o;return this.run(t,i,a),QS("runSync","run",r),o;function a(c,h){XS(c),o=h,r=!0}}stringify(t,i){this.freeze();const r=Cu(i),o=this.compiler||this.Compiler;return Mp("stringify",o),ZS(t),o(t,r)}use(t,...i){const r=this.attachers,o=this.namespace;if(Tp("use",this.frozen),t!=null)if(typeof t=="function")d(t,i);else if(typeof t=="object")Array.isArray(t)?h(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...g]=f;d(m,g)}else c(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function c(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");h(f.plugins),f.settings&&(o.settings=xp(!0,o.settings,f.settings))}function h(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const g=f[m];a(g)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,m){let g=-1,v=-1;for(;++g<r.length;)if(r[g][0]===f){v=g;break}if(v===-1)r.push([f,...m]);else if(m.length>0){let[y,...S]=m;const b=r[v][1];Lg(b)&&Lg(y)&&(y=xp(!0,b,y)),r[v]=[f,y,...S]}}}}const GO=new wm().freeze();function kp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Mp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ZS(e){if(!Lg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function QS(e,t,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Cu(e){return ZO(e)?e:new EC(e)}function ZO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function QO(e){return typeof e=="string"||JO(e)}function JO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const e8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",JS=[],eb={allowDangerousHtml:!0},t8=/^(https?|ircs?|mailto|xmpp)$/i,i8=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function n8(e){const t=r8(e),i=s8(e);return o8(t.runSync(t.parse(i),i),e)}function r8(e){const t=e.rehypePlugins||JS,i=e.remarkPlugins||JS,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...eb}:eb;return GO().use(Hz).use(i).use(RO,r).use(t)}function s8(e){const t=e.children||"",i=new EC;return typeof t=="string"&&(i.value=t),i}function o8(e,t){const i=t.allowedElements,r=t.allowElement,o=t.components,a=t.disallowedElements,c=t.skipHtml,h=t.unwrapDisallowed,d=t.urlTransform||l8;for(const m of i8)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+e8+m.id,void 0);return CC(e,f),m6(e,{Fragment:w.Fragment,components:o,ignoreInvalidStyle:!0,jsx:w.jsx,jsxs:w.jsxs,passKeys:!0,passNode:!0});function f(m,g,v){if(m.type==="raw"&&v&&typeof g=="number")return c?v.children.splice(g,1):v.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let y;for(y in vp)if(Object.hasOwn(vp,y)&&Object.hasOwn(m.properties,y)){const S=m.properties[y],b=vp[y];(b===null||b.includes(m.tagName))&&(m.properties[y]=d(String(S||""),y,m))}}if(m.type==="element"){let y=i?!i.includes(m.tagName):a?a.includes(m.tagName):!1;if(!y&&r&&typeof g=="number"&&(y=!r(m,g,v)),y&&v&&typeof g=="number")return h&&m.children?v.children.splice(g,1,...m.children):v.children.splice(g,1),g}}}function l8(e){const t=e.indexOf(":"),i=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||i!==-1&&t>i||r!==-1&&t>r||t8.test(e.slice(0,t))?e:""}const a8="modulepreload",c8=function(e){return"/"+e},tb={},kC=function(t,i,r){let o=Promise.resolve();if(i&&i.length>0){let c=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),d=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));o=c(i.map(f=>{if(f=c8(f),f in tb)return;tb[f]=!0;const m=f.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":a8,m||(v.as="script"),v.crossOrigin="",v.href=f,d&&v.setAttribute("nonce",d),document.head.appendChild(v),m)return new Promise((y,S)=>{v.addEventListener("load",y),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(c){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=c,window.dispatchEvent(h),!h.defaultPrevented)throw c}return o.then(c=>{for(const h of c||[])h.status==="rejected"&&a(h.reason);return t().catch(a)})};function u8({integrationId:e,workflowName:t,nodeName:i,connectionsApi:r}){const{nangoConnections:o,loading:a,refetch:c}=db(e,r.mutationVersion),[h,d]=q.useState(!1),f=r.getForNode(t,i,e),m=q.useCallback(async v=>{await r.upsert({workflow_name:t,node_name:i,integration_id:e,connection_id:v})},[r,t,i,e]),g=q.useCallback(async()=>{d(!0);try{const v=await fetch("/api/nango/connect-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({integration_id:e})});if(!v.ok)return;const{token:y}=await v.json(),b=(await kC(()=>import("./index-DAKTQEvj.js"),[])).default;new b().openConnectUI({sessionToken:y,onEvent:async C=>{if(C.type==="connect"){c();const z=C.payload.connectionId;z&&(await m(z),t!=="*"&&await r.upsert({workflow_name:"*",node_name:"*",integration_id:e,connection_id:z}))}else C.type==="close"&&c()}})}catch{}finally{d(!1)}},[e,c,m,t,r]);return w.jsxs("div",{className:"flex flex-col gap-1.5",children:[w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx("span",{className:"text-[12px] font-medium text-popover-foreground capitalize",children:e}),w.jsx("button",{onClick:g,disabled:h,className:"text-[10px] px-2.5 py-0.5 rounded-full bg-[#e0d9cf] text-[#6b6358] hover:bg-[#d5cdc0] transition-colors cursor-pointer disabled:opacity-50",children:h?"...":"Connect"})]}),a?w.jsx("p",{className:"text-[11px] text-[#a8a099] italic",children:"Loading connections..."}):o.length===0?w.jsx("p",{className:"text-[11px] text-[#a8a099] italic",children:"No connections. Click Connect to add one."}):w.jsxs("select",{value:(f==null?void 0:f.connection_id)??"",onChange:v=>m(v.target.value),className:"text-[12px] px-2 py-1 rounded-md border border-border bg-background text-foreground",children:[w.jsx("option",{value:"",children:"Select a connection..."}),o.map(v=>w.jsx("option",{value:v.connection_id,children:v.display_name},v.connection_id))]})]})}const h8={node:"fn",agent:"AI",workflow:"wf",input:"IN",output:"OUT",condition:"?"},ib={node:{iconBg:"bg-emerald-50 text-emerald-600"},agent:{iconBg:"bg-purple-50 text-purple-600"},workflow:{iconBg:"bg-emerald-50 text-emerald-600"},input:{iconBg:"bg-[#f5f3f0] text-[#a8a099]"},output:{iconBg:"bg-[#f5f3f0] text-[#a8a099]"},condition:{iconBg:"bg-amber-50 text-amber-600"}},f8={node:"Node",agent:"Agent",workflow:"Workflow",input:"Input",output:"Output",condition:"Condition"};function d8({node:e,position:t,onClose:i,workflowName:r,connectionsApi:o}){const a=q.useRef(null),c=h8[e.type]??"fn",h=ib[e.type]??ib.node,d=f8[e.type]??e.type;q.useEffect(()=>{const b=k=>{k.key==="Escape"&&i()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[i]),q.useEffect(()=>{const b=C=>{a.current&&!a.current.contains(C.target)&&i()},k=setTimeout(()=>{document.addEventListener("mousedown",b)},0);return()=>{clearTimeout(k),document.removeEventListener("mousedown",b)}},[i]);const f=300,m=400,g=12,[v,y]=q.useState({left:t.x+12,top:t.y-20});q.useLayoutEffect(()=>{const b=a.current;if(!b)return;const k=b.offsetParent,C=(k==null?void 0:k.clientWidth)??window.innerWidth,z=(k==null?void 0:k.clientHeight)??window.innerHeight;y({left:Math.max(g,Math.min(t.x+12,C-f-g)),top:Math.max(g,Math.min(t.y-20,z-m-g))})},[t.x,t.y]);const S=e.integrations&&e.integrations.length>0&&e.nodeName&&r&&o;return w.jsxs("div",{ref:a,style:{left:v.left,top:v.top},className:"absolute z-50 w-[300px] bg-popover rounded-xl border border-border shadow-lg",children:[w.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-accent",children:[w.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[w.jsx("div",{className:`w-7 h-7 rounded-md flex items-center justify-center shrink-0 ${h.iconBg}`,children:w.jsx("span",{className:"text-[10px] font-bold",children:c})}),w.jsxs("div",{className:"min-w-0",children:[w.jsx("p",{className:"text-[13px] font-medium text-popover-foreground truncate",children:e.label}),w.jsx("p",{className:"text-[10px] text-[#a8a099] uppercase tracking-wide",children:d})]})]}),w.jsx("button",{onClick:i,"aria-label":"Close node details",className:"p-1 rounded-md text-[#a8a099] hover:text-popover-foreground hover:bg-accent transition-colors cursor-pointer",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),w.jsxs("div",{className:"px-4 py-3",children:[w.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[#a8a099] mb-1.5",children:"Description"}),e.description?w.jsx("div",{className:"text-[13px] text-muted-foreground leading-relaxed prose-sm",children:w.jsx(n8,{components:{p:({children:b})=>w.jsx("p",{className:"mb-2 last:mb-0",children:b}),strong:({children:b})=>w.jsx("strong",{className:"font-semibold text-popover-foreground",children:b}),blockquote:({children:b})=>w.jsx("blockquote",{className:"border-l-2 border-border pl-2.5 my-2 text-muted-foreground italic",children:b}),ul:({children:b})=>w.jsx("ul",{className:"list-disc pl-4 mb-2",children:b}),ol:({children:b})=>w.jsx("ol",{className:"list-decimal pl-4 mb-2",children:b}),li:({children:b})=>w.jsx("li",{className:"mb-0.5",children:b}),code:({children:b})=>w.jsx("code",{className:"text-[12px] bg-muted px-1 py-0.5 rounded",children:b})},children:e.description})}):w.jsx("p",{className:"text-[13px] text-[#a8a099] italic",children:"No description available"})]}),S&&w.jsxs("div",{className:"px-4 py-3 border-t border-accent",children:[w.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[#a8a099] mb-2",children:"Integrations"}),w.jsx("div",{className:"flex flex-col gap-3",children:e.integrations.map(b=>w.jsx(u8,{integrationId:b,workflowName:r,nodeName:e.nodeName,connectionsApi:o},b))})]})]})}const ih=220,Ca=50,p8=80,nb=40,rb=20,sb=16,ob=28;function g8(e,t){if(e.length===0)return new Map;const i=new Map,r=new Map,o=new Set(e);for(const f of e)i.set(f,[]),r.set(f,[]);for(const f of t)o.has(f.source)&&o.has(f.target)&&(i.get(f.source).push(f.target),r.get(f.target).push(f.source));const a=m8(e,i,r),c=new Map;for(const[f,m]of a)c.has(m)||c.set(m,[]),c.get(m).push(f);_8(c,a,i);const h=Math.max(...c.keys()),d=new Map;for(let f=0;f<=h;f++){const m=c.get(f)||[],v=-(m.length*Ca+(m.length-1)*nb)/2;for(let y=0;y<m.length;y++)d.set(m[y],{x:Math.round(f*(ih+p8)),y:Math.round(v+y*(Ca+nb))})}return d}function m8(e,t,i){const r=new Map,o=e.filter(h=>i.get(h).length===0),a=o.length>0?o:[e[0]],c=[...a];for(const h of a)r.set(h,0);for(const h of e)r.has(h)||(r.set(h,0),c.push(h));for(;c.length>0;){const h=c.shift(),d=r.get(h);for(const f of t.get(h)||[]){const m=r.get(f),g=d+1;(m===void 0||g>m)&&(r.set(f,g),c.push(f))}}return r}function _8(e,t,i){const r=Math.max(...e.keys()),o=new Map;for(const[a,c]of i)for(const h of c)o.has(h)||o.set(h,[]),o.get(h).push(a);for(let a=1;a<=r;a++){const c=e.get(a);if(!c||c.length<=1)continue;const h=e.get(a-1)||[],d=new Map;h.forEach((f,m)=>d.set(f,m)),c.sort((f,m)=>{const g=(o.get(f)||[]).filter(b=>t.get(b)===a-1),v=(o.get(m)||[]).filter(b=>t.get(b)===a-1),y=g.length>0?g.reduce((b,k)=>b+(d.get(k)||0),0)/g.length:0,S=v.length>0?v.reduce((b,k)=>b+(d.get(k)||0),0)/v.length:0;return y-S}),e.set(a,c)}}function v8(e,t){const i=[];for(const r of t){const o=new Map;let a=1/0,c=1/0,h=-1/0,d=-1/0;for(const y of r.nodeIds){const S=e.get(y);S&&(a=Math.min(a,S.x),c=Math.min(c,S.y),h=Math.max(h,S.x+ih),d=Math.max(d,S.y+Ca))}if(a===1/0)continue;const f=a-rb,m=c-ob-sb,g=h-a+2*rb,v=d-c+ob+2*sb;for(const y of r.nodeIds){const S=e.get(y);S&&o.set(y,{x:S.x-f,y:S.y-m})}i.push({id:r.id,position:{x:f,y:m},width:g,height:v,childPositions:o})}return i}const y8={workflowNode:PB,loopGroup:IB},S8={clean:UB};function b8({dag:e,connectionsApi:t}){const{fitView:i}=vh(),[r,o]=q.useState(null),[a,c]=q.useState(null),{flowNodes:h,flowEdges:d}=q.useMemo(()=>{const z=g8(e.nodes.map(X=>X.id),e.edges.map(X=>({source:X.source,target:X.target}))),E=e.loopGroups??[],T=v8(z,E),P=new Map;for(const X of T){const G=E.find(ne=>ne.id===X.id);if(G)for(const ne of G.nodeIds)P.set(ne,X)}const R=[];for(const X of T){const G=E.find(ne=>ne.id===X.id);R.push({id:X.id,type:"loopGroup",position:X.position,data:{label:(G==null?void 0:G.label)??"",width:X.width,height:X.height},draggable:!0,style:{width:X.width,height:X.height}})}for(const X of e.nodes){const G=P.get(X.id);if(G){const ne=G.childPositions.get(X.id)??{x:0,y:0};R.push({id:X.id,type:"workflowNode",position:ne,parentId:G.id,extent:"parent",data:{...X},draggable:!0,width:ih,height:Ca})}else{const ne=z.get(X.id)??{x:0,y:0};R.push({id:X.id,type:"workflowNode",position:ne,data:{...X},draggable:!0,width:ih,height:Ca})}}const U=e.edges.map(X=>({id:X.id,source:X.source,target:X.target,label:X.label,type:"clean",animated:!1,style:{stroke:"#c4b5a0",strokeWidth:1.5},labelStyle:{fontSize:12,fill:"#6b7280"},markerEnd:{type:ya.ArrowClosed,width:12,height:12,color:"#c4b5a0"}}));return{flowNodes:R,flowEdges:U}},[e]),[f,m,g]=nB(h),[v,y,S]=rB(d);q.useEffect(()=>{m(h),y(d),setTimeout(()=>i({padding:.2,duration:300}),50)},[h,d,m,y,i]);const b=q.useCallback((z,E)=>{const T=E.data;if(T.type==="input"||T.type==="output"||T.type==="condition")return;const R=z.currentTarget.closest(".react-flow"),U=(R==null?void 0:R.getBoundingClientRect())??{left:0,top:0};o(T),c({x:z.clientX-U.left,y:z.clientY-U.top})},[]),k=q.useCallback(()=>{o(null),c(null)},[]),C=q.useCallback(()=>{setTimeout(()=>i({padding:.2,duration:200}),50)},[i]);return w.jsxs("div",{className:"relative w-full h-full",children:[w.jsxs(iB,{nodes:f,edges:v,onNodesChange:g,onEdgesChange:S,nodeTypes:y8,edgeTypes:S8,onInit:C,onNodeClick:b,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[w.jsx(cB,{variant:nr.Cross,color:"#d5cdc0",gap:24,size:1.5}),w.jsx(mB,{showInteractive:!1}),w.jsx(NB,{nodeStrokeWidth:3,pannable:!0,zoomable:!0,style:{width:120,height:80},maskColor:"rgba(240, 235, 227, 0.7)"})]}),r&&a&&w.jsx(d8,{node:r,position:a,onClose:k,workflowName:e.workflowName,connectionsApi:t})]})}const x8={SUCCESS:{bg:"bg-emerald-50",text:"text-emerald-700",label:"Success"},ERROR:{bg:"bg-red-50",text:"text-red-700",label:"Failed"},PENDING:{bg:"bg-amber-50",text:"text-amber-700",label:"Pending"},RETRIES_EXCEEDED:{bg:"bg-red-50",text:"text-red-700",label:"Retries Exceeded"}};function w8({runs:e,loading:t,selectedRunId:i,trace:r,traceLoading:o,selectRun:a,refresh:c}){return t&&e.length===0?w.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Loading runs..."}):e.length===0?w.jsx("div",{className:"flex items-center justify-center h-full",children:w.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center",children:[w.jsx("p",{className:"text-[13px] text-foreground/60",children:"No runs yet"}),w.jsx("p",{className:"text-[11px] text-muted-foreground mt-1 leading-relaxed max-w-[240px]",children:"Workflow runs will appear here with their status, duration, and step-by-step trace."})]})}):w.jsxs("div",{className:"h-full flex flex-col",children:[w.jsxs("div",{className:"shrink-0 px-3 py-1.5 flex items-center justify-between border-b border-border",children:[w.jsxs("span",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-medium",children:[e.length," run",e.length!==1?"s":""]}),w.jsx("button",{onClick:c,className:"text-[11px] text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:"Refresh"})]}),w.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-3 py-2 space-y-1",children:e.map(h=>w.jsx(C8,{run:h,isExpanded:i===h.workflow_uuid,trace:i===h.workflow_uuid?r:null,traceLoading:i===h.workflow_uuid&&o,onToggle:()=>a(i===h.workflow_uuid?null:h.workflow_uuid)},h.workflow_uuid))})]})}function C8({run:e,isExpanded:t,trace:i,traceLoading:r,onToggle:o}){var d;const a=x8[e.status]??{bg:"bg-gray-50",text:"text-gray-700",label:e.status},c=(d=i==null?void 0:i.workflow)==null?void 0:d.duration_ms,h=M8(e.created_at);return w.jsxs("div",{className:`rounded-lg border transition-colors ${e.status==="PENDING"?"border-amber-200":"border-border"} bg-muted`,children:[w.jsxs("button",{onClick:o,className:"w-full flex items-center gap-2 px-3 py-2 text-left cursor-pointer",children:[w.jsx("span",{className:"text-muted-foreground text-[10px] shrink-0",children:t?"▾":"▸"}),w.jsx("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] font-medium ${a.bg} ${a.text}`,children:a.label}),w.jsx("span",{className:"text-[12px] font-medium text-foreground truncate",children:e.name}),w.jsx("div",{className:"flex-1"}),c!=null&&w.jsx("span",{className:"text-[11px] font-mono text-muted-foreground shrink-0",children:Cm(c)}),w.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:T8(h)})]}),t&&w.jsxs("div",{className:"border-t border-border px-3 py-2",children:[r?w.jsx("p",{className:"text-[11px] text-muted-foreground text-center py-3",children:"Loading trace..."}):i&&i.operations.length>0?w.jsx(E8,{operations:i.operations,rootWorkflowId:e.workflow_uuid}):w.jsx("p",{className:"text-[11px] text-muted-foreground text-center py-3 italic",children:"No operations recorded."}),e.error&&w.jsx("div",{className:"mt-2",children:w.jsx("pre",{className:"text-[10px] font-mono text-red-600 bg-red-50 rounded p-1.5 whitespace-pre-wrap break-all",children:e.error})})]})]})}function E8({operations:e,rootWorkflowId:t}){const[i,r]=q.useState(new Set),o=q.useCallback(f=>{r(m=>{const g=new Set(m);return g.has(f)?g.delete(f):g.add(f),g})},[]),a=new Map;for(const f of e){const m=a.get(f.workflow_uuid)??[];m.push(f),a.set(f.workflow_uuid,m)}const c=a.get(t)??[],h=new Set;for(const f of c)f.function_name==="DBOS.getResult"&&f.child_workflow_id&&h.add(f.child_workflow_id);const d=c.filter(f=>!f.child_workflow_id||f.function_name==="DBOS.getResult"?!0:!h.has(f.child_workflow_id));return w.jsx("div",{className:"space-y-0.5",children:d.map(f=>{let m=f.function_name;if(f.function_name==="DBOS.getResult"&&f.child_workflow_id){const b=c.find(k=>k.child_workflow_id===f.child_workflow_id&&k.function_name!=="DBOS.getResult");b&&(m=b.function_name)}const g=!!(f.output_preview||f.error||f.child_workflow_id),v=`${f.workflow_uuid}-${f.function_id}`,y=i.has(v),S=f.child_workflow_id?a.get(f.child_workflow_id)??[]:[];return w.jsxs("div",{children:[w.jsxs("button",{onClick:()=>g&&o(v),className:`w-full flex items-center gap-2 px-2 py-1 rounded text-left transition-colors ${g?"cursor-pointer hover:bg-accent":"cursor-default"} ${f.error?"bg-red-50/30":""}`,children:[g?w.jsx("span",{className:"text-muted-foreground text-[9px] w-3 shrink-0",children:y?"▾":"▸"}):w.jsx("span",{className:"w-3 shrink-0"}),w.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${f.error?"bg-red-500":f.duration_ms!=null?"bg-emerald-500":"bg-amber-400"}`}),w.jsx("span",{className:`text-[12px] font-medium truncate flex-1 ${f.error?"text-red-700":"text-foreground"}`,children:m}),f.duration_ms!=null&&w.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:Cm(f.duration_ms)})]}),y&&w.jsxs("div",{className:"ml-7 mt-0.5 mb-1 space-y-1",children:[f.error&&w.jsx("pre",{className:"text-[10px] font-mono text-red-600 bg-red-50 rounded p-1.5 whitespace-pre-wrap break-all",children:f.error}),S.length>0&&w.jsx("div",{className:"space-y-0.5 border-l-2 border-border pl-2",children:S.map(b=>w.jsx(k8,{op:b},`${b.workflow_uuid}-${b.function_id}`))}),f.output_preview&&!f.error&&w.jsx("pre",{className:"text-[10px] font-mono text-muted-foreground bg-background rounded p-1.5 whitespace-pre-wrap break-all max-h-[100px] overflow-auto",children:N8(f.output_preview)})]})]},v)})})}function k8({op:e}){return w.jsxs("div",{className:`flex items-center gap-2 px-2 py-0.5 rounded text-[11px] ${e.error?"bg-red-50/30":""}`,children:[w.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${e.error?"bg-red-500":e.duration_ms!=null?"bg-emerald-500":"bg-amber-400"}`}),w.jsx("span",{className:`truncate flex-1 ${e.error?"text-red-700":"text-foreground/80"}`,children:e.function_name}),e.duration_ms!=null&&w.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:Cm(e.duration_ms)})]})}function M8(e){if(typeof e=="number")return e;if(typeof e=="string"){if(/^\d+$/.test(e))return parseInt(e,10);const t=new Date(e).getTime();if(!isNaN(t))return t}return Date.now()}function Cm(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),i=Math.floor(e%6e4/1e3);return`${t}m ${i}s`}function T8(e){const t=Date.now()-e;return t<0?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:t<6048e5?`${Math.floor(t/864e5)}d ago`:new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function N8(e){if(!e)return"";try{const t=JSON.parse(e),i=JSON.stringify(t,null,2);return i.length>200?i.slice(0,197)+"...":i}catch{return e.length>200?e.slice(0,197)+"...":e}}function A8({dag:e,onClose:t,onSuccess:i}){const r=e.nodes.find(E=>E.type==="input"),o=(r==null?void 0:r.fields)??[],[a,c]=q.useState(()=>Object.fromEntries(o.map(E=>[E,""]))),[h,d]=q.useState("{}"),[f,m]=q.useState(o.length===0),[g,v]=q.useState(!1),[y,S]=q.useState(null),b=q.useRef(null);q.useEffect(()=>{const E=T=>{T.key==="Escape"&&!g&&t()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[t,g]);const k=q.useCallback(E=>{E.target===b.current&&!g&&t()},[t,g]),C=q.useCallback(()=>{if(f)return JSON.parse(h);const E={};for(const[T,P]of Object.entries(a))if(P!=="")try{E[T]=JSON.parse(P)}catch{E[T]=P}return E},[f,h,a]),z=q.useCallback(async()=>{S(null);let E;try{E=C()}catch(T){S(`Invalid JSON: ${T instanceof Error?T.message:String(T)}`);return}v(!0);try{const P=await(await fetch(`/api/workflows/${encodeURIComponent(e.workflowName)}/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:E})})).json();if(P.status==="ERROR"){S(P.error??"Workflow failed"),v(!1);return}i()}catch(T){S(T instanceof Error?T.message:"Request failed"),v(!1)}},[e.workflowName,C,i]);return w.jsx("div",{ref:b,onClick:k,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-[2px]",children:w.jsxs("div",{className:"bg-card rounded-xl shadow-xl border border-border w-full max-w-md mx-4",children:[w.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[w.jsxs("div",{children:[w.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Run workflow"}),w.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.workflowName})]}),w.jsx("button",{onClick:t,disabled:g,className:"text-muted-foreground hover:text-foreground text-lg px-1 cursor-pointer disabled:opacity-50",children:"×"})]}),w.jsxs("div",{className:"px-5 py-4 space-y-3 max-h-[60vh] overflow-auto",children:[o.length>0&&w.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground cursor-pointer select-none",children:[w.jsx("input",{type:"checkbox",checked:f,onChange:E=>m(E.target.checked),className:"accent-foreground"}),"Raw JSON"]}),f?w.jsx("textarea",{value:h,onChange:E=>d(E.target.value),spellCheck:!1,className:"w-full h-40 font-mono text-xs bg-background border border-border rounded-lg p-3 resize-y focus:outline-none focus:ring-1 focus:ring-foreground/20",placeholder:"{}"}):o.length>0?o.map(E=>w.jsxs("div",{children:[w.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:E}),w.jsx("input",{type:"text",value:a[E]??"",onChange:T=>c(P=>({...P,[E]:T.target.value})),onKeyDown:T=>{T.key==="Enter"&&!g&&z()},className:"w-full text-sm bg-background border border-border rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-foreground/20",placeholder:`Enter ${E}`})]},E)):w.jsx("p",{className:"text-xs text-muted-foreground italic",children:"This workflow has no input fields."}),y&&w.jsx("pre",{className:"text-xs font-mono text-red-600 bg-red-50 rounded-lg p-3 whitespace-pre-wrap break-all max-h-32 overflow-auto",children:y})]}),w.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border",children:[w.jsx("button",{onClick:t,disabled:g,className:"px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground rounded-md transition-colors cursor-pointer disabled:opacity-50",children:"Cancel"}),w.jsx("button",{onClick:z,disabled:g,className:"px-4 py-1.5 text-xs bg-foreground text-background rounded-md hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-60 flex items-center gap-2",children:g?w.jsxs(w.Fragment,{children:[w.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",fill:"none",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Running..."]}):"Run"})]})]})})}function D8({defaultWidth:e,minWidth:t,maxWidth:i,side:r}){const[o,a]=q.useState(e),c=q.useRef(!1),h=q.useRef(0),d=q.useRef(0),f=q.useCallback(m=>{m.preventDefault(),c.current=!0,h.current=m.clientX,d.current=o},[o]);return q.useEffect(()=>{const m=v=>{if(!c.current)return;const y=v.clientX-h.current,S=d.current-y;a(Math.max(t,Math.min(i,S)))},g=()=>{c.current=!1};return window.addEventListener("mousemove",m),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",g)}},[t,i,r]),{width:o,onDragStart:f}}function R8({workflowName:e,workflows:t,connectionsApi:i,navigate:r,bottomPanelOpen:o,onToggleBottomPanel:a}){const[c,h]=q.useState(!1),[d,f]=q.useState(!1),m=D8({defaultWidth:288,minWidth:200,maxWidth:500,side:"left"}),g=pb(e),v=t.find(y=>y.workflowName===e);return v?w.jsxs("div",{className:"h-full flex",children:[w.jsxs("div",{className:"flex-1 relative min-h-0 min-w-0",children:[w.jsxs(Uw,{children:[w.jsx("div",{className:"absolute inset-0 shadow-[inset_0_0_20px_rgba(0,0,0,0.03)]",children:w.jsx(b8,{dag:v,connectionsApi:i})}),w.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-2",children:[w.jsx("button",{onClick:()=>r("/"),className:"bg-card/80 backdrop-blur-sm px-2 py-1.5 rounded-md shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-border text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Back to dashboard",children:w.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("path",{d:"M8.5 3L4.5 7L8.5 11"})})}),w.jsxs("div",{className:"bg-card/80 backdrop-blur-sm px-3 py-1.5 rounded-lg shadow-[0_1px_4px_rgba(0,0,0,0.04)] border border-border",children:[w.jsx("span",{className:"text-[15px] font-semibold text-foreground",children:v.workflowName}),w.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["v",v.version]})]}),w.jsxs("button",{onClick:()=>f(!0),className:"bg-card/80 backdrop-blur-sm px-3 py-1.5 rounded-md shadow-sm border border-border text-[12px] text-muted-foreground hover:text-foreground transition-colors cursor-pointer flex items-center gap-1.5",title:"Run workflow",children:[w.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"currentColor",children:w.jsx("path",{d:"M2.5 1.5L10 6L2.5 10.5V1.5Z"})}),"Run"]})]})]},v.workflowName),w.jsxs("div",{className:"absolute top-3 right-3 flex gap-1.5",children:[g.available&&w.jsx("button",{onClick:()=>h(!c),className:`bg-card/80 backdrop-blur-sm px-3 py-1.5 rounded-md shadow-sm border border-border text-[12px] cursor-pointer transition-colors ${c?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"History"}),w.jsx("button",{onClick:a,className:`bg-card/80 backdrop-blur-sm px-3 py-1.5 rounded-md shadow-sm border border-border text-[12px] cursor-pointer transition-colors ${o?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Terminal"})]})]}),d&&w.jsx(A8,{dag:v,onClose:()=>f(!1),onSuccess:()=>{f(!1),h(!0),g.refresh()}}),c&&g.available&&w.jsxs("div",{className:"flex flex-col bg-[#f3ede5] shrink-0 relative border-l border-border",style:{width:m.width},children:[w.jsx("div",{onMouseDown:m.onDragStart,className:"absolute top-0 left-0 w-1 h-full cursor-ew-resize hover:bg-accent z-20"}),w.jsxs("div",{className:"shrink-0 px-4 py-3 border-b border-border flex items-center justify-between",children:[w.jsx("span",{className:"text-[12px] font-medium text-foreground tracking-wide",children:"History"}),w.jsx("button",{onClick:()=>h(!1),className:"text-muted-foreground hover:text-foreground text-sm px-1 cursor-pointer",title:"Close",children:"×"})]}),w.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:w.jsx(w8,{runs:g.runs,loading:g.loading,selectedRunId:g.selectedRunId,trace:g.trace,traceLoading:g.traceLoading,selectRun:g.selectRun,refresh:g.refresh})})]})]}):w.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:w.jsxs("div",{className:"text-center",children:[w.jsxs("p",{children:['Workflow "',e,'" not found.']}),w.jsx("button",{onClick:()=>r("/"),className:"mt-2 text-xs underline hover:text-foreground cursor-pointer",children:"Back to dashboard"})]})})}function lb({integrationId:e}){const t=e.slice(0,2).toUpperCase();return w.jsx("div",{className:"w-8 h-8 rounded-full bg-[#f0ebe3] flex items-center justify-center text-[11px] font-semibold text-muted-foreground shrink-0",children:t})}function B8({integrationId:e,connectionsApi:t,mutationVersion:i,onRows:r}){const{nangoConnections:o}=db(e,i),a=q.useMemo(()=>o.map(c=>{const h=t.connections.find(d=>d.integration_id===e&&d.connection_id===c.connection_id);return{integrationId:e,connection:c,isActive:!!h}}),[o,t.connections,e]);return q.useEffect(()=>{r(a)},[a,r]),null}function L8({connectionsApi:e,workflows:t}){const{integrations:i,loading:r}=YE(),[o,a]=q.useState(!1),[c,h]=q.useState(!1),d=q.useRef(null),[f,m]=q.useState(new Map);q.useEffect(()=>{if(!c)return;const b=C=>{d.current&&!d.current.contains(C.target)&&h(!1)},k=C=>{C.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",k)}},[c]);const g=q.useMemo(()=>{const b=new Set;for(const k of i)b.add(k.id);for(const k of t)for(const C of k.nodes)if(C.integrations)for(const z of C.integrations)b.add(z);return Array.from(b).sort()},[i,t]),v=q.useCallback((b,k)=>{m(C=>{const z=new Map(C);return z.set(b,k),z})},[]),y=q.useMemo(()=>{const b=[];for(const k of g){const C=f.get(k)??[];b.push(...C)}return b},[g,f]),S=q.useCallback(async b=>{const k=b||g[0];if(k){a(!0);try{const C=await fetch("/api/nango/connect-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({integration_id:k})});if(!C.ok)return;const{token:z}=await C.json(),T=(await kC(()=>import("./index-DAKTQEvj.js"),[])).default;new T().openConnectUI({sessionToken:z,onEvent:async R=>{if(R.type==="connect"){const U=R.payload.connectionId;U&&await e.upsert({workflow_name:"*",node_name:"*",integration_id:k,connection_id:U}),e.refetch()}else R.type==="close"&&e.refetch()}})}catch{}finally{a(!1)}}},[g,e]);return r?w.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Loading..."}):w.jsx("div",{className:"h-full overflow-y-auto",children:w.jsxs("div",{className:"max-w-[1200px] mx-auto px-8 py-8",children:[g.map(b=>w.jsx(B8,{integrationId:b,connectionsApi:e,mutationVersion:e.mutationVersion,onRows:k=>v(b,k)},b)),w.jsxs("div",{className:"flex items-start justify-between mb-6",children:[w.jsxs("div",{children:[w.jsx("h1",{className:"text-3xl font-bold text-foreground font-serif",children:"Credentials"}),w.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage OAuth connections and API keys for your integrations"})]}),g.length>0&&w.jsxs("div",{className:"relative",ref:d,children:[w.jsxs("button",{onClick:()=>h(!c),disabled:o,className:"flex items-center gap-2 px-4 py-2 bg-foreground text-background text-sm rounded-lg hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-60 shrink-0",children:[w.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2",children:w.jsx("path",{d:"M7 2v10M2 7h10"})}),"Add Credential"]}),c&&w.jsxs("div",{className:"absolute right-0 top-full mt-1 w-56 bg-card rounded-xl border border-border shadow-lg z-30 py-1 overflow-hidden",children:[w.jsx("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-medium px-4 py-2",children:"Select integration"}),g.map(b=>w.jsxs("button",{onClick:()=>{h(!1),S(b)},className:"w-full flex items-center gap-3 px-4 py-2.5 text-left hover:bg-background/60 transition-colors cursor-pointer",children:[w.jsx(lb,{integrationId:b}),w.jsx("span",{className:"text-sm text-foreground capitalize",children:b})]},b))]})]})]}),y.length===0?w.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[w.jsx("p",{className:"text-sm",children:"No credentials configured."}),w.jsx("p",{className:"text-xs mt-1",children:"Connect an integration to get started."})]}):w.jsx("div",{className:"bg-card rounded-xl border border-border overflow-hidden",children:w.jsxs("table",{className:"w-full",children:[w.jsx("thead",{children:w.jsxs("tr",{className:"border-b border-border",children:[w.jsx("th",{className:"text-left text-[11px] uppercase tracking-wider text-muted-foreground font-medium px-5 py-3",children:"Name"}),w.jsx("th",{className:"text-left text-[11px] uppercase tracking-wider text-muted-foreground font-medium px-5 py-3",children:"Type"}),w.jsx("th",{className:"text-left text-[11px] uppercase tracking-wider text-muted-foreground font-medium px-5 py-3",children:"Status"})]})}),w.jsx("tbody",{children:y.map(b=>w.jsxs("tr",{className:"border-b border-border last:border-b-0 hover:bg-background/50 transition-colors",children:[w.jsx("td",{className:"px-5 py-3",children:w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx(lb,{integrationId:b.integrationId}),w.jsxs("div",{children:[w.jsx("div",{className:"text-sm font-medium text-foreground",children:b.connection.display_name||b.connection.connection_id}),w.jsx("div",{className:"text-xs text-muted-foreground capitalize",children:b.integrationId})]})]})}),w.jsx("td",{className:"px-5 py-3",children:w.jsx("span",{className:"text-xs px-2.5 py-1 rounded-full bg-[#f0ebe3] text-muted-foreground",children:"OAuth"})}),w.jsx("td",{className:"px-5 py-3",children:w.jsx("span",{className:"text-xs px-2.5 py-1 rounded-full bg-accent text-green-700",children:"Active"})})]},`${b.integrationId}:${b.connection.connection_id}`))})]})})]})})}function z8(){const[e,t]=q.useState({status:"idle"}),[i,r]=q.useState(null),[o,a]=q.useState("unknown");q.useEffect(()=>{const d=()=>{fetch("/api/deploy").then(m=>m.json()).then(m=>{m.deployed&&m.url&&(r(m.url),a(m.freshness??"unknown"))}).catch(()=>{})};d();const f=setInterval(d,3e4);return()=>clearInterval(f)},[]);const c=q.useCallback(async()=>{var d;t({status:"deploying",message:"Starting deploy..."});try{const f=await fetch("/api/deploy",{method:"POST"});if(!f.ok){t({status:"error",error:`Deploy request failed (HTTP ${f.status})`});return}const m=(d=f.body)==null?void 0:d.getReader();if(!m){t({status:"error",error:"No response body"});return}const g=new TextDecoder;let v="";for(;;){const{done:y,value:S}=await m.read();if(y)break;v+=g.decode(S,{stream:!0});const b=v.split(`
|
|
179
|
+
`);v=b.pop()??"";for(const k of b)if(k.startsWith("data: "))try{const C=JSON.parse(k.slice(6));C.type==="progress"?t({status:"deploying",step:C.step,message:C.message}):C.type==="done"?(C.url&&r(C.url),a("current"),t({status:"success",url:C.url})):C.type==="error"&&t({status:"error",error:C.message})}catch{}}}catch(f){t({status:"error",error:f instanceof Error?f.message:String(f)})}},[]),h=q.useCallback(()=>{t({status:"idle"})},[]);return{...e,deployedUrl:i,freshness:o,startDeploy:c,reset:h}}function ab(e){return e.replace(/^https?:\/\//,"")}function O8(){const e=z8();return w.jsxs("div",{className:"border-t border-border pt-3",children:[w.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[#a8a099] mb-2 px-1",children:"Deploy"}),e.deployedUrl&&e.status!=="deploying"&&e.status!=="success"&&w.jsxs("a",{href:e.deployedUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground px-1 mb-2 group transition-colors",title:e.freshness==="outdated"?"Local changes not yet deployed":e.freshness==="current"?"Up to date":void 0,children:[w.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${e.freshness==="outdated"?"bg-yellow-400":e.freshness==="current"?"bg-green-400":"bg-zinc-400"}`}),w.jsx("span",{className:"truncate group-hover:underline",children:ab(e.deployedUrl)}),w.jsx("svg",{className:"w-2.5 h-2.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:w.jsx("path",{d:"M3.5 1.5h7v7M10.5 1.5L1.5 10.5"})})]}),e.status==="idle"&&w.jsx("button",{onClick:e.startDeploy,className:"w-full px-3 py-1.5 text-xs bg-foreground text-background rounded hover:opacity-90 transition-opacity cursor-pointer",children:e.deployedUrl?"Re-deploy":"Deploy to Cloud"}),e.status==="deploying"&&w.jsxs("div",{className:"text-xs text-muted-foreground px-1 flex items-center gap-2",children:[w.jsxs("svg",{className:"animate-spin h-3 w-3",viewBox:"0 0 24 24",fill:"none",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),w.jsx("span",{children:e.message??"Deploying..."})]}),e.status==="success"&&w.jsxs("div",{className:"text-xs px-1",children:[w.jsx("p",{className:"text-green-400 mb-1",children:"Deployed successfully!"}),e.url&&w.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 underline break-all",children:ab(e.url)}),w.jsx("button",{onClick:e.reset,className:"mt-1 block text-muted-foreground hover:text-foreground underline cursor-pointer",children:"Done"})]}),e.status==="error"&&w.jsxs("div",{className:"text-xs px-1",children:[w.jsx("p",{className:"text-red-400 mb-1",children:e.error}),w.jsx("button",{onClick:e.reset,className:"text-muted-foreground hover:text-foreground underline cursor-pointer",children:"Try again"})]})]})}function H8(){return w.jsx("div",{className:"h-full overflow-y-auto",children:w.jsxs("div",{className:"max-w-[1200px] mx-auto px-8 py-8",children:[w.jsx("h1",{className:"text-3xl font-bold text-foreground font-serif",children:"Settings"}),w.jsx("p",{className:"text-muted-foreground mt-1 mb-6",children:"Configure your project settings"}),w.jsx("div",{className:"bg-card rounded-xl border border-border p-5 max-w-md",children:w.jsx(O8,{})})]})})}function j8(){const{state:e,connected:t,sendMessage:i,ptyEvents:r}=FE(),o=d3({sendMessage:i,ptyEvents:r}),a=$E(),{path:c,navigate:h}=p3(),[d,f]=q.useState(!1),[m,g]=q.useState(!1),v=pb(null),y=g3(c,"/workflows/:name"),S=q.useMemo(()=>[{id:"terminal",label:"Terminal",content:w.jsx(w3,{attachTo:o.attachTo,fit:o.fit,ptyAlive:o.ptyAlive,hasData:o.hasData,restart:o.restart})}],[o]),b=()=>y?w.jsx(R8,{workflowName:y.name,workflows:e.workflows,connectionsApi:a,navigate:h,bottomPanelOpen:d,onToggleBottomPanel:()=>f(!d)}):c==="/credentials"?w.jsx(L8,{connectionsApi:a,workflows:e.workflows}):c==="/settings"?w.jsx(H8,{}):w.jsx(k3,{workflows:e.workflows,runs:v.runs,runsAvailable:v.available,navigate:h});return w.jsxs("div",{className:"h-screen w-screen flex bg-background",children:[w.jsx(v3,{currentPath:c,navigate:h,connected:t,collapsed:m,onToggleCollapse:()=>g(!m)}),w.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[w.jsx("div",{className:"flex-1 min-h-0",children:b()}),d&&w.jsx(x3,{tabs:S,defaultTab:"terminal",onClose:()=>f(!1)})]})]})}UE.createRoot(document.getElementById("root")).render(w.jsx(q.StrictMode,{children:w.jsx(j8,{})}));
|