panopticon-cli 0.3.7 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1162 -6
- package/dist/agents-RCAPFJG7.js +41 -0
- package/dist/chunk-4BIZ4OVN.js +827 -0
- package/dist/chunk-4BIZ4OVN.js.map +1 -0
- package/dist/{chunk-C6A7S65K.js → chunk-7BGFIAWQ.js} +188 -43
- package/dist/chunk-7BGFIAWQ.js.map +1 -0
- package/dist/chunk-DGUM43GV.js +11 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/{chunk-P5TQ5C3J.js → chunk-U4LCHEVU.js} +14 -1
- package/dist/chunk-U4LCHEVU.js.map +1 -0
- package/dist/cli/index.js +6546 -2413
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/public/assets/index-BZXQno9X.js +540 -0
- package/dist/dashboard/public/assets/{index-CUoYoWX_.css → index-BtAxF_yl.css} +1 -1
- package/dist/dashboard/public/index.html +2 -2
- package/dist/dashboard/server.js +9890 -47449
- package/dist/index.d.ts +12 -1
- package/dist/index.js +10 -3
- package/dist/js-yaml-DLUPUHNL.js +2648 -0
- package/dist/js-yaml-DLUPUHNL.js.map +1 -0
- package/package.json +2 -2
- package/scripts/git-hooks/post-checkout +109 -0
- package/templates/claude-md/sections/beads.md +1 -2
- package/templates/claude-md/sections/warnings.md +19 -0
- package/templates/docker/dotnet/docker-compose.yml +2 -0
- package/templates/docker/monorepo/docker-compose.yml +4 -0
- package/templates/docker/nextjs/docker-compose.yml +1 -0
- package/templates/docker/python-fastapi/docker-compose.yml +3 -0
- package/templates/docker/react-vite/docker-compose.yml +1 -0
- package/templates/docker/spring-boot/docker-compose.yml +3 -0
- package/dist/chunk-BH6BR26M.js +0 -173
- package/dist/chunk-BH6BR26M.js.map +0 -1
- package/dist/chunk-C6A7S65K.js.map +0 -1
- package/dist/chunk-P5TQ5C3J.js.map +0 -1
- package/dist/dashboard/public/assets/index-CY0Ew5B9.js +0 -423
- package/dist/projects-54CV437J.js +0 -34
- /package/dist/{projects-54CV437J.js.map → agents-RCAPFJG7.js.map} +0 -0
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
var Ym=e=>{throw TypeError(e)};var Hu=(e,t,r)=>t.has(e)||Ym("Cannot "+r);var P=(e,t,r)=>(Hu(e,t,"read from private field"),r?r.call(e):t.get(e)),ne=(e,t,r)=>t.has(e)?Ym("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),G=(e,t,r,n)=>(Hu(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ce=(e,t,r)=>(Hu(e,t,"access private method"),r);var gl=(e,t,r,n)=>({set _(i){G(e,t,i,r)},get _(){return P(e,t,n)}});function lb(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Cc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cb(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Yy={exports:{}},lu={},Xy={exports:{}},pe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var el=Symbol.for("react.element"),ub=Symbol.for("react.portal"),hb=Symbol.for("react.fragment"),db=Symbol.for("react.strict_mode"),fb=Symbol.for("react.profiler"),pb=Symbol.for("react.provider"),mb=Symbol.for("react.context"),gb=Symbol.for("react.forward_ref"),vb=Symbol.for("react.suspense"),yb=Symbol.for("react.memo"),_b=Symbol.for("react.lazy"),Xm=Symbol.iterator;function xb(e){return e===null||typeof e!="object"?null:(e=Xm&&e[Xm]||e["@@iterator"],typeof e=="function"?e:null)}var Gy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jy=Object.assign,Zy={};function So(e,t,r){this.props=e,this.context=t,this.refs=Zy,this.updater=r||Gy}So.prototype.isReactComponent={};So.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};So.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function e_(){}e_.prototype=So.prototype;function hp(e,t,r){this.props=e,this.context=t,this.refs=Zy,this.updater=r||Gy}var dp=hp.prototype=new e_;dp.constructor=hp;Jy(dp,So.prototype);dp.isPureReactComponent=!0;var Gm=Array.isArray,t_=Object.prototype.hasOwnProperty,fp={current:null},r_={key:!0,ref:!0,__self:!0,__source:!0};function n_(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)t_.call(t,n)&&!r_.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)i[n]===void 0&&(i[n]=a[n]);return{$$typeof:el,type:e,key:s,ref:o,props:i,_owner:fp.current}}function wb(e,t){return{$$typeof:el,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function pp(e){return typeof e=="object"&&e!==null&&e.$$typeof===el}function Sb(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Jm=/\/+/g;function Wu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Sb(""+e.key):t.toString(36)}function ec(e,t,r,n,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case el:case ub:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+Wu(o,0):n,Gm(i)?(r="",e!=null&&(r=e.replace(Jm,"$&/")+"/"),ec(i,t,r,"",function(c){return c})):i!=null&&(pp(i)&&(i=wb(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Jm,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",Gm(e))for(var a=0;a<e.length;a++){s=e[a];var u=n+Wu(s,a);o+=ec(s,t,r,u,i)}else if(u=xb(e),typeof u=="function")for(e=u.call(e),a=0;!(s=e.next()).done;)s=s.value,u=n+Wu(s,a++),o+=ec(s,t,r,u,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function vl(e,t,r){if(e==null)return e;var n=[],i=0;return ec(e,n,"","",function(s){return t.call(r,s,i++)}),n}function bb(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var At={current:null},tc={transition:null},Cb={ReactCurrentDispatcher:At,ReactCurrentBatchConfig:tc,ReactCurrentOwner:fp};function i_(){throw Error("act(...) is not supported in production builds of React.")}pe.Children={map:vl,forEach:function(e,t,r){vl(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return vl(e,function(){t++}),t},toArray:function(e){return vl(e,function(t){return t})||[]},only:function(e){if(!pp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pe.Component=So;pe.Fragment=hb;pe.Profiler=fb;pe.PureComponent=hp;pe.StrictMode=db;pe.Suspense=vb;pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cb;pe.act=i_;pe.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Jy({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=fp.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)t_.call(t,u)&&!r_.hasOwnProperty(u)&&(n[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)n.children=r;else if(1<u){a=Array(u);for(var c=0;c<u;c++)a[c]=arguments[c+2];n.children=a}return{$$typeof:el,type:e.type,key:i,ref:s,props:n,_owner:o}};pe.createContext=function(e){return e={$$typeof:mb,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:pb,_context:e},e.Consumer=e};pe.createElement=n_;pe.createFactory=function(e){var t=n_.bind(null,e);return t.type=e,t};pe.createRef=function(){return{current:null}};pe.forwardRef=function(e){return{$$typeof:gb,render:e}};pe.isValidElement=pp;pe.lazy=function(e){return{$$typeof:_b,_payload:{_status:-1,_result:e},_init:bb}};pe.memo=function(e,t){return{$$typeof:yb,type:e,compare:t===void 0?null:t}};pe.startTransition=function(e){var t=tc.transition;tc.transition={};try{e()}finally{tc.transition=t}};pe.unstable_act=i_;pe.useCallback=function(e,t){return At.current.useCallback(e,t)};pe.useContext=function(e){return At.current.useContext(e)};pe.useDebugValue=function(){};pe.useDeferredValue=function(e){return At.current.useDeferredValue(e)};pe.useEffect=function(e,t){return At.current.useEffect(e,t)};pe.useId=function(){return At.current.useId()};pe.useImperativeHandle=function(e,t,r){return At.current.useImperativeHandle(e,t,r)};pe.useInsertionEffect=function(e,t){return At.current.useInsertionEffect(e,t)};pe.useLayoutEffect=function(e,t){return At.current.useLayoutEffect(e,t)};pe.useMemo=function(e,t){return At.current.useMemo(e,t)};pe.useReducer=function(e,t,r){return At.current.useReducer(e,t,r)};pe.useRef=function(e){return At.current.useRef(e)};pe.useState=function(e){return At.current.useState(e)};pe.useSyncExternalStore=function(e,t,r){return At.current.useSyncExternalStore(e,t,r)};pe.useTransition=function(){return At.current.useTransition()};pe.version="18.3.1";Xy.exports=pe;var S=Xy.exports;const s_=Za(S),mp=lb({__proto__:null,default:s_},[S]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var kb=S,Nb=Symbol.for("react.element"),Eb=Symbol.for("react.fragment"),jb=Object.prototype.hasOwnProperty,Pb=kb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Rb={key:!0,ref:!0,__self:!0,__source:!0};function o_(e,t,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)jb.call(t,n)&&!Rb.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:Nb,type:e,key:s,ref:o,props:i,_owner:Pb.current}}lu.Fragment=Eb;lu.jsx=o_;lu.jsxs=o_;Yy.exports=lu;var l=Yy.exports,ed={},a_={exports:{}},fr={},l_={exports:{}},c_={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(R,W){var N=R.length;R.push(W);e:for(;0<N;){var $=N-1>>>1,I=R[$];if(0<i(I,W))R[$]=W,R[N]=I,N=$;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var W=R[0],N=R.pop();if(N!==W){R[0]=N;e:for(var $=0,I=R.length,C=I>>>1;$<C;){var q=2*($+1)-1,Y=R[q],Z=q+1,oe=R[Z];if(0>i(Y,N))Z<I&&0>i(oe,Y)?(R[$]=oe,R[Z]=N,$=Z):(R[$]=Y,R[q]=N,$=q);else if(Z<I&&0>i(oe,N))R[$]=oe,R[Z]=N,$=Z;else break e}}return W}function i(R,W){var N=R.sortIndex-W.sortIndex;return N!==0?N:R.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(R){for(var W=r(c);W!==null;){if(W.callback===null)n(c);else if(W.startTime<=R)n(c),W.sortIndex=W.expirationTime,t(u,W);else break;W=r(c)}}function x(R){if(y=!1,v(R),!m)if(r(u)!==null)m=!0,B(k);else{var W=r(c);W!==null&&U(x,W.startTime-R)}}function k(R,W){m=!1,y&&(y=!1,g(L),L=-1),p=!0;var N=f;try{for(v(W),d=r(u);d!==null&&(!(d.expirationTime>W)||R&&!A());){var $=d.callback;if(typeof $=="function"){d.callback=null,f=d.priorityLevel;var I=$(d.expirationTime<=W);W=e.unstable_now(),typeof I=="function"?d.callback=I:d===r(u)&&n(u),v(W)}else n(u);d=r(u)}if(d!==null)var C=!0;else{var q=r(c);q!==null&&U(x,q.startTime-W),C=!1}return C}finally{d=null,f=N,p=!1}}var b=!1,E=null,L=-1,F=5,D=-1;function A(){return!(e.unstable_now()-D<F)}function j(){if(E!==null){var R=e.unstable_now();D=R;var W=!0;try{W=E(!0,R)}finally{W?M():(b=!1,E=null)}}else b=!1}var M;if(typeof _=="function")M=function(){_(j)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,T=O.port2;O.port1.onmessage=j,M=function(){T.postMessage(null)}}else M=function(){w(j,0)};function B(R){E=R,b||(b=!0,M())}function U(R,W){L=w(function(){R(e.unstable_now())},W)}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(R){R.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,B(k))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(R){switch(f){case 1:case 2:case 3:var W=3;break;default:W=f}var N=f;f=W;try{return R()}finally{f=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,W){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var N=f;f=R;try{return W()}finally{f=N}},e.unstable_scheduleCallback=function(R,W,N){var $=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?$+N:$):N=$,R){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=N+I,R={id:h++,callback:W,priorityLevel:R,startTime:N,expirationTime:I,sortIndex:-1},N>$?(R.sortIndex=N,t(c,R),r(u)===null&&R===r(c)&&(y?(g(L),L=-1):y=!0,U(x,N-$))):(R.sortIndex=I,t(u,R),m||p||(m=!0,B(k))),R},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(R){var W=f;return function(){var N=f;f=W;try{return R.apply(this,arguments)}finally{f=N}}}})(c_);l_.exports=c_;var Db=l_.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Mb=S,dr=Db;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u_=new Set,wa={};function us(e,t){ho(e,t),ho(e+"Capture",t)}function ho(e,t){for(wa[e]=t,e=0;e<t.length;e++)u_.add(t[e])}var jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),td=Object.prototype.hasOwnProperty,Tb=/^[: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]*$/,Zm={},eg={};function Lb(e){return td.call(eg,e)?!0:td.call(Zm,e)?!1:Tb.test(e)?eg[e]=!0:(Zm[e]=!0,!1)}function Ab(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ob(e,t,r,n){if(t===null||typeof t>"u"||Ab(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ot(e,t,r,n,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var _t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_t[e]=new Ot(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_t[t]=new Ot(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_t[e]=new Ot(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_t[e]=new Ot(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){_t[e]=new Ot(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_t[e]=new Ot(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_t[e]=new Ot(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_t[e]=new Ot(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_t[e]=new Ot(e,5,!1,e.toLowerCase(),null,!1,!1)});var gp=/[\-:]([a-z])/g;function vp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(gp,vp);_t[t]=new Ot(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(gp,vp);_t[t]=new Ot(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(gp,vp);_t[t]=new Ot(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_t[e]=new Ot(e,1,!1,e.toLowerCase(),null,!1,!1)});_t.xlinkHref=new Ot("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_t[e]=new Ot(e,1,!1,e.toLowerCase(),null,!0,!0)});function yp(e,t,r,n){var i=_t.hasOwnProperty(t)?_t[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ob(t,r,i,n)&&(r=null),n||i===null?Lb(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Tn=Mb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yl=Symbol.for("react.element"),Ps=Symbol.for("react.portal"),Rs=Symbol.for("react.fragment"),_p=Symbol.for("react.strict_mode"),rd=Symbol.for("react.profiler"),h_=Symbol.for("react.provider"),d_=Symbol.for("react.context"),xp=Symbol.for("react.forward_ref"),nd=Symbol.for("react.suspense"),id=Symbol.for("react.suspense_list"),wp=Symbol.for("react.memo"),qn=Symbol.for("react.lazy"),f_=Symbol.for("react.offscreen"),tg=Symbol.iterator;function Mo(e){return e===null||typeof e!="object"?null:(e=tg&&e[tg]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Object.assign,Uu;function Xo(e){if(Uu===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Uu=t&&t[1]||""}return`
|
|
34
|
+
`+Uu+e}var qu=!1;function Ku(e,t){if(!e||qu)return"";qu=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
35
|
+
`),s=n.stack.split(`
|
|
36
|
+
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var u=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{qu=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Xo(e):""}function Ib(e){switch(e.tag){case 5:return Xo(e.type);case 16:return Xo("Lazy");case 13:return Xo("Suspense");case 19:return Xo("SuspenseList");case 0:case 2:case 15:return e=Ku(e.type,!1),e;case 11:return e=Ku(e.type.render,!1),e;case 1:return e=Ku(e.type,!0),e;default:return""}}function sd(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Rs:return"Fragment";case Ps:return"Portal";case rd:return"Profiler";case _p:return"StrictMode";case nd:return"Suspense";case id:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d_:return(e.displayName||"Context")+".Consumer";case h_:return(e._context.displayName||"Context")+".Provider";case xp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wp:return t=e.displayName||null,t!==null?t:sd(e.type)||"Memo";case qn:t=e._payload,e=e._init;try{return sd(e(t))}catch{}}return null}function Bb(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sd(t);case 8:return t===_p?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function _i(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function p_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fb(e){var t=p_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _l(e){e._valueTracker||(e._valueTracker=Fb(e))}function m_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=p_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function kc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function od(e,t){var r=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function rg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=_i(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function g_(e,t){t=t.checked,t!=null&&yp(e,"checked",t,!1)}function ad(e,t){g_(e,t);var r=_i(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ld(e,t.type,r):t.hasOwnProperty("defaultValue")&&ld(e,t.type,_i(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ng(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function ld(e,t,r){(t!=="number"||kc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Go=Array.isArray;function Us(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+_i(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function cd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return ze({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ig(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(K(92));if(Go(r)){if(1<r.length)throw Error(K(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:_i(r)}}function v_(e,t){var r=_i(t.value),n=_i(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function sg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function y_(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ud(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?y_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var xl,__=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(xl=xl||document.createElement("div"),xl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=xl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Sa(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var oa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zb=["Webkit","ms","Moz","O"];Object.keys(oa).forEach(function(e){zb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),oa[t]=oa[e]})});function x_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||oa.hasOwnProperty(e)&&oa[e]?(""+t).trim():t+"px"}function w_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=x_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var $b=ze({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function hd(e,t){if(t){if($b[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function dd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fd=null;function Sp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pd=null,qs=null,Ks=null;function og(e){if(e=nl(e)){if(typeof pd!="function")throw Error(K(280));var t=e.stateNode;t&&(t=fu(t),pd(e.stateNode,e.type,t))}}function S_(e){qs?Ks?Ks.push(e):Ks=[e]:qs=e}function b_(){if(qs){var e=qs,t=Ks;if(Ks=qs=null,og(e),t)for(e=0;e<t.length;e++)og(t[e])}}function C_(e,t){return e(t)}function k_(){}var Vu=!1;function N_(e,t,r){if(Vu)return e(t,r);Vu=!0;try{return C_(e,t,r)}finally{Vu=!1,(qs!==null||Ks!==null)&&(k_(),b_())}}function ba(e,t){var r=e.stateNode;if(r===null)return null;var n=fu(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(K(231,t,typeof r));return r}var md=!1;if(jn)try{var To={};Object.defineProperty(To,"passive",{get:function(){md=!0}}),window.addEventListener("test",To,To),window.removeEventListener("test",To,To)}catch{md=!1}function Hb(e,t,r,n,i,s,o,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(h){this.onError(h)}}var aa=!1,Nc=null,Ec=!1,gd=null,Wb={onError:function(e){aa=!0,Nc=e}};function Ub(e,t,r,n,i,s,o,a,u){aa=!1,Nc=null,Hb.apply(Wb,arguments)}function qb(e,t,r,n,i,s,o,a,u){if(Ub.apply(this,arguments),aa){if(aa){var c=Nc;aa=!1,Nc=null}else throw Error(K(198));Ec||(Ec=!0,gd=c)}}function hs(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function E_(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ag(e){if(hs(e)!==e)throw Error(K(188))}function Kb(e){var t=e.alternate;if(!t){if(t=hs(e),t===null)throw Error(K(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return ag(i),e;if(s===n)return ag(i),t;s=s.sibling}throw Error(K(188))}if(r.return!==n.return)r=i,n=s;else{for(var o=!1,a=i.child;a;){if(a===r){o=!0,r=i,n=s;break}if(a===n){o=!0,n=i,r=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===r){o=!0,r=s,n=i;break}if(a===n){o=!0,n=s,r=i;break}a=a.sibling}if(!o)throw Error(K(189))}}if(r.alternate!==n)throw Error(K(190))}if(r.tag!==3)throw Error(K(188));return r.stateNode.current===r?e:t}function j_(e){return e=Kb(e),e!==null?P_(e):null}function P_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=P_(e);if(t!==null)return t;e=e.sibling}return null}var R_=dr.unstable_scheduleCallback,lg=dr.unstable_cancelCallback,Vb=dr.unstable_shouldYield,Qb=dr.unstable_requestPaint,Ve=dr.unstable_now,Yb=dr.unstable_getCurrentPriorityLevel,bp=dr.unstable_ImmediatePriority,D_=dr.unstable_UserBlockingPriority,jc=dr.unstable_NormalPriority,Xb=dr.unstable_LowPriority,M_=dr.unstable_IdlePriority,cu=null,rn=null;function Gb(e){if(rn&&typeof rn.onCommitFiberRoot=="function")try{rn.onCommitFiberRoot(cu,e,void 0,(e.current.flags&128)===128)}catch{}}var Ir=Math.clz32?Math.clz32:eC,Jb=Math.log,Zb=Math.LN2;function eC(e){return e>>>=0,e===0?32:31-(Jb(e)/Zb|0)|0}var wl=64,Sl=4194304;function Jo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pc(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Jo(a):(s&=o,s!==0&&(n=Jo(s)))}else o=r&~i,o!==0?n=Jo(o):s!==0&&(n=Jo(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Ir(t),i=1<<r,n|=e[r],t&=~i;return n}function tC(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rC(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Ir(s),a=1<<o,u=i[o];u===-1?(!(a&r)||a&n)&&(i[o]=tC(a,t)):u<=t&&(e.expiredLanes|=a),s&=~a}}function vd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function T_(){var e=wl;return wl<<=1,!(wl&4194240)&&(wl=64),e}function Qu(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function tl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ir(t),e[t]=r}function nC(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Ir(r),s=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~s}}function Cp(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Ir(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Ce=0;function L_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var A_,kp,O_,I_,B_,yd=!1,bl=[],li=null,ci=null,ui=null,Ca=new Map,ka=new Map,Qn=[],iC="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function cg(e,t){switch(e){case"focusin":case"focusout":li=null;break;case"dragenter":case"dragleave":ci=null;break;case"mouseover":case"mouseout":ui=null;break;case"pointerover":case"pointerout":Ca.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ka.delete(t.pointerId)}}function Lo(e,t,r,n,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},t!==null&&(t=nl(t),t!==null&&kp(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function sC(e,t,r,n,i){switch(t){case"focusin":return li=Lo(li,e,t,r,n,i),!0;case"dragenter":return ci=Lo(ci,e,t,r,n,i),!0;case"mouseover":return ui=Lo(ui,e,t,r,n,i),!0;case"pointerover":var s=i.pointerId;return Ca.set(s,Lo(Ca.get(s)||null,e,t,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,ka.set(s,Lo(ka.get(s)||null,e,t,r,n,i)),!0}return!1}function F_(e){var t=Oi(e.target);if(t!==null){var r=hs(t);if(r!==null){if(t=r.tag,t===13){if(t=E_(r),t!==null){e.blockedOn=t,B_(e.priority,function(){O_(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function rc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=_d(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);fd=n,r.target.dispatchEvent(n),fd=null}else return t=nl(r),t!==null&&kp(t),e.blockedOn=r,!1;t.shift()}return!0}function ug(e,t,r){rc(e)&&r.delete(t)}function oC(){yd=!1,li!==null&&rc(li)&&(li=null),ci!==null&&rc(ci)&&(ci=null),ui!==null&&rc(ui)&&(ui=null),Ca.forEach(ug),ka.forEach(ug)}function Ao(e,t){e.blockedOn===t&&(e.blockedOn=null,yd||(yd=!0,dr.unstable_scheduleCallback(dr.unstable_NormalPriority,oC)))}function Na(e){function t(i){return Ao(i,e)}if(0<bl.length){Ao(bl[0],e);for(var r=1;r<bl.length;r++){var n=bl[r];n.blockedOn===e&&(n.blockedOn=null)}}for(li!==null&&Ao(li,e),ci!==null&&Ao(ci,e),ui!==null&&Ao(ui,e),Ca.forEach(t),ka.forEach(t),r=0;r<Qn.length;r++)n=Qn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Qn.length&&(r=Qn[0],r.blockedOn===null);)F_(r),r.blockedOn===null&&Qn.shift()}var Vs=Tn.ReactCurrentBatchConfig,Rc=!0;function aC(e,t,r,n){var i=Ce,s=Vs.transition;Vs.transition=null;try{Ce=1,Np(e,t,r,n)}finally{Ce=i,Vs.transition=s}}function lC(e,t,r,n){var i=Ce,s=Vs.transition;Vs.transition=null;try{Ce=4,Np(e,t,r,n)}finally{Ce=i,Vs.transition=s}}function Np(e,t,r,n){if(Rc){var i=_d(e,t,r,n);if(i===null)ih(e,t,n,Dc,r),cg(e,n);else if(sC(i,e,t,r,n))n.stopPropagation();else if(cg(e,n),t&4&&-1<iC.indexOf(e)){for(;i!==null;){var s=nl(i);if(s!==null&&A_(s),s=_d(e,t,r,n),s===null&&ih(e,t,n,Dc,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else ih(e,t,n,null,r)}}var Dc=null;function _d(e,t,r,n){if(Dc=null,e=Sp(n),e=Oi(e),e!==null)if(t=hs(e),t===null)e=null;else if(r=t.tag,r===13){if(e=E_(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Dc=e,null}function z_(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Yb()){case bp:return 1;case D_:return 4;case jc:case Xb:return 16;case M_:return 536870912;default:return 16}default:return 16}}var si=null,Ep=null,nc=null;function $_(){if(nc)return nc;var e,t=Ep,r=t.length,n,i="value"in si?si.value:si.textContent,s=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[s-n];n++);return nc=i.slice(e,1<n?1-n:void 0)}function ic(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Cl(){return!0}function hg(){return!1}function pr(e){function t(r,n,i,s,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Cl:hg,this.isPropagationStopped=hg,this}return ze(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Cl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Cl)},persist:function(){},isPersistent:Cl}),t}var bo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jp=pr(bo),rl=ze({},bo,{view:0,detail:0}),cC=pr(rl),Yu,Xu,Oo,uu=ze({},rl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Oo&&(Oo&&e.type==="mousemove"?(Yu=e.screenX-Oo.screenX,Xu=e.screenY-Oo.screenY):Xu=Yu=0,Oo=e),Yu)},movementY:function(e){return"movementY"in e?e.movementY:Xu}}),dg=pr(uu),uC=ze({},uu,{dataTransfer:0}),hC=pr(uC),dC=ze({},rl,{relatedTarget:0}),Gu=pr(dC),fC=ze({},bo,{animationName:0,elapsedTime:0,pseudoElement:0}),pC=pr(fC),mC=ze({},bo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),gC=pr(mC),vC=ze({},bo,{data:0}),fg=pr(vC),yC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_C={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"},xC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wC(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xC[e])?!!t[e]:!1}function Pp(){return wC}var SC=ze({},rl,{key:function(e){if(e.key){var t=yC[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ic(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?_C[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pp,charCode:function(e){return e.type==="keypress"?ic(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ic(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bC=pr(SC),CC=ze({},uu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pg=pr(CC),kC=ze({},rl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pp}),NC=pr(kC),EC=ze({},bo,{propertyName:0,elapsedTime:0,pseudoElement:0}),jC=pr(EC),PC=ze({},uu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),RC=pr(PC),DC=[9,13,27,32],Rp=jn&&"CompositionEvent"in window,la=null;jn&&"documentMode"in document&&(la=document.documentMode);var MC=jn&&"TextEvent"in window&&!la,H_=jn&&(!Rp||la&&8<la&&11>=la),mg=" ",gg=!1;function W_(e,t){switch(e){case"keyup":return DC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ds=!1;function TC(e,t){switch(e){case"compositionend":return U_(t);case"keypress":return t.which!==32?null:(gg=!0,mg);case"textInput":return e=t.data,e===mg&&gg?null:e;default:return null}}function LC(e,t){if(Ds)return e==="compositionend"||!Rp&&W_(e,t)?(e=$_(),nc=Ep=si=null,Ds=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return H_&&t.locale!=="ko"?null:t.data;default:return null}}var AC={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 vg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!AC[e.type]:t==="textarea"}function q_(e,t,r,n){S_(n),t=Mc(t,"onChange"),0<t.length&&(r=new jp("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ca=null,Ea=null;function OC(e){rx(e,0)}function hu(e){var t=Ls(e);if(m_(t))return e}function IC(e,t){if(e==="change")return t}var K_=!1;if(jn){var Ju;if(jn){var Zu="oninput"in document;if(!Zu){var yg=document.createElement("div");yg.setAttribute("oninput","return;"),Zu=typeof yg.oninput=="function"}Ju=Zu}else Ju=!1;K_=Ju&&(!document.documentMode||9<document.documentMode)}function _g(){ca&&(ca.detachEvent("onpropertychange",V_),Ea=ca=null)}function V_(e){if(e.propertyName==="value"&&hu(Ea)){var t=[];q_(t,Ea,e,Sp(e)),N_(OC,t)}}function BC(e,t,r){e==="focusin"?(_g(),ca=t,Ea=r,ca.attachEvent("onpropertychange",V_)):e==="focusout"&&_g()}function FC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hu(Ea)}function zC(e,t){if(e==="click")return hu(t)}function $C(e,t){if(e==="input"||e==="change")return hu(t)}function HC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fr=typeof Object.is=="function"?Object.is:HC;function ja(e,t){if(Fr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!td.call(t,i)||!Fr(e[i],t[i]))return!1}return!0}function xg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wg(e,t){var r=xg(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=xg(r)}}function Q_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Q_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Y_(){for(var e=window,t=kc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=kc(e.document)}return t}function Dp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function WC(e){var t=Y_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Q_(r.ownerDocument.documentElement,r)){if(n!==null&&Dp(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=wg(r,s);var o=wg(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var UC=jn&&"documentMode"in document&&11>=document.documentMode,Ms=null,xd=null,ua=null,wd=!1;function Sg(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wd||Ms==null||Ms!==kc(n)||(n=Ms,"selectionStart"in n&&Dp(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),ua&&ja(ua,n)||(ua=n,n=Mc(xd,"onSelect"),0<n.length&&(t=new jp("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ms)))}function kl(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ts={animationend:kl("Animation","AnimationEnd"),animationiteration:kl("Animation","AnimationIteration"),animationstart:kl("Animation","AnimationStart"),transitionend:kl("Transition","TransitionEnd")},eh={},X_={};jn&&(X_=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function du(e){if(eh[e])return eh[e];if(!Ts[e])return e;var t=Ts[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in X_)return eh[e]=t[r];return e}var G_=du("animationend"),J_=du("animationiteration"),Z_=du("animationstart"),ex=du("transitionend"),tx=new Map,bg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ci(e,t){tx.set(e,t),us(t,[e])}for(var th=0;th<bg.length;th++){var rh=bg[th],qC=rh.toLowerCase(),KC=rh[0].toUpperCase()+rh.slice(1);Ci(qC,"on"+KC)}Ci(G_,"onAnimationEnd");Ci(J_,"onAnimationIteration");Ci(Z_,"onAnimationStart");Ci("dblclick","onDoubleClick");Ci("focusin","onFocus");Ci("focusout","onBlur");Ci(ex,"onTransitionEnd");ho("onMouseEnter",["mouseout","mouseover"]);ho("onMouseLeave",["mouseout","mouseover"]);ho("onPointerEnter",["pointerout","pointerover"]);ho("onPointerLeave",["pointerout","pointerover"]);us("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));us("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));us("onBeforeInput",["compositionend","keypress","textInput","paste"]);us("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));us("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));us("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zo="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(" "),VC=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zo));function Cg(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,qb(n,t,void 0,e),e.currentTarget=null}function rx(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var o=n.length-1;0<=o;o--){var a=n[o],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==s&&i.isPropagationStopped())break e;Cg(i,a,c),s=u}else for(o=0;o<n.length;o++){if(a=n[o],u=a.instance,c=a.currentTarget,a=a.listener,u!==s&&i.isPropagationStopped())break e;Cg(i,a,c),s=u}}}if(Ec)throw e=gd,Ec=!1,gd=null,e}function De(e,t){var r=t[Nd];r===void 0&&(r=t[Nd]=new Set);var n=e+"__bubble";r.has(n)||(nx(t,e,2,!1),r.add(n))}function nh(e,t,r){var n=0;t&&(n|=4),nx(r,e,n,t)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function Pa(e){if(!e[Nl]){e[Nl]=!0,u_.forEach(function(r){r!=="selectionchange"&&(VC.has(r)||nh(r,!1,e),nh(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nl]||(t[Nl]=!0,nh("selectionchange",!1,t))}}function nx(e,t,r,n){switch(z_(t)){case 1:var i=aC;break;case 4:i=lC;break;default:i=Np}r=i.bind(null,t,r,e),i=void 0,!md||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function ih(e,t,r,n,i){var s=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var a=n.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Oi(a),o===null)return;if(u=o.tag,u===5||u===6){n=s=o;continue e}a=a.parentNode}}n=n.return}N_(function(){var c=s,h=Sp(r),d=[];e:{var f=tx.get(e);if(f!==void 0){var p=jp,m=e;switch(e){case"keypress":if(ic(r)===0)break e;case"keydown":case"keyup":p=bC;break;case"focusin":m="focus",p=Gu;break;case"focusout":m="blur",p=Gu;break;case"beforeblur":case"afterblur":p=Gu;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=dg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=hC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=NC;break;case G_:case J_:case Z_:p=pC;break;case ex:p=jC;break;case"scroll":p=cC;break;case"wheel":p=RC;break;case"copy":case"cut":case"paste":p=gC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=pg}var y=(t&4)!==0,w=!y&&e==="scroll",g=y?f!==null?f+"Capture":null:f;y=[];for(var _=c,v;_!==null;){v=_;var x=v.stateNode;if(v.tag===5&&x!==null&&(v=x,g!==null&&(x=ba(_,g),x!=null&&y.push(Ra(_,x,v)))),w)break;_=_.return}0<y.length&&(f=new p(f,m,null,r,h),d.push({event:f,listeners:y}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&r!==fd&&(m=r.relatedTarget||r.fromElement)&&(Oi(m)||m[Pn]))break e;if((p||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=r.relatedTarget||r.toElement,p=c,m=m?Oi(m):null,m!==null&&(w=hs(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(y=dg,x="onMouseLeave",g="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(y=pg,x="onPointerLeave",g="onPointerEnter",_="pointer"),w=p==null?f:Ls(p),v=m==null?f:Ls(m),f=new y(x,_+"leave",p,r,h),f.target=w,f.relatedTarget=v,x=null,Oi(h)===c&&(y=new y(g,_+"enter",m,r,h),y.target=v,y.relatedTarget=w,x=y),w=x,p&&m)t:{for(y=p,g=m,_=0,v=y;v;v=ys(v))_++;for(v=0,x=g;x;x=ys(x))v++;for(;0<_-v;)y=ys(y),_--;for(;0<v-_;)g=ys(g),v--;for(;_--;){if(y===g||g!==null&&y===g.alternate)break t;y=ys(y),g=ys(g)}y=null}else y=null;p!==null&&kg(d,f,p,y,!1),m!==null&&w!==null&&kg(d,w,m,y,!0)}}e:{if(f=c?Ls(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var k=IC;else if(vg(f))if(K_)k=$C;else{k=FC;var b=BC}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=zC);if(k&&(k=k(e,c))){q_(d,k,r,h);break e}b&&b(e,f,c),e==="focusout"&&(b=f._wrapperState)&&b.controlled&&f.type==="number"&&ld(f,"number",f.value)}switch(b=c?Ls(c):window,e){case"focusin":(vg(b)||b.contentEditable==="true")&&(Ms=b,xd=c,ua=null);break;case"focusout":ua=xd=Ms=null;break;case"mousedown":wd=!0;break;case"contextmenu":case"mouseup":case"dragend":wd=!1,Sg(d,r,h);break;case"selectionchange":if(UC)break;case"keydown":case"keyup":Sg(d,r,h)}var E;if(Rp)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else Ds?W_(e,r)&&(L="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(L="onCompositionStart");L&&(H_&&r.locale!=="ko"&&(Ds||L!=="onCompositionStart"?L==="onCompositionEnd"&&Ds&&(E=$_()):(si=h,Ep="value"in si?si.value:si.textContent,Ds=!0)),b=Mc(c,L),0<b.length&&(L=new fg(L,e,null,r,h),d.push({event:L,listeners:b}),E?L.data=E:(E=U_(r),E!==null&&(L.data=E)))),(E=MC?TC(e,r):LC(e,r))&&(c=Mc(c,"onBeforeInput"),0<c.length&&(h=new fg("onBeforeInput","beforeinput",null,r,h),d.push({event:h,listeners:c}),h.data=E))}rx(d,t)})}function Ra(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Mc(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=ba(e,r),s!=null&&n.unshift(Ra(e,s,i)),s=ba(e,t),s!=null&&n.push(Ra(e,s,i))),e=e.return}return n}function ys(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function kg(e,t,r,n,i){for(var s=t._reactName,o=[];r!==null&&r!==n;){var a=r,u=a.alternate,c=a.stateNode;if(u!==null&&u===n)break;a.tag===5&&c!==null&&(a=c,i?(u=ba(r,s),u!=null&&o.unshift(Ra(r,u,a))):i||(u=ba(r,s),u!=null&&o.push(Ra(r,u,a)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var QC=/\r\n?/g,YC=/\u0000|\uFFFD/g;function Ng(e){return(typeof e=="string"?e:""+e).replace(QC,`
|
|
38
|
+
`).replace(YC,"")}function El(e,t,r){if(t=Ng(t),Ng(e)!==t&&r)throw Error(K(425))}function Tc(){}var Sd=null,bd=null;function Cd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var kd=typeof setTimeout=="function"?setTimeout:void 0,XC=typeof clearTimeout=="function"?clearTimeout:void 0,Eg=typeof Promise=="function"?Promise:void 0,GC=typeof queueMicrotask=="function"?queueMicrotask:typeof Eg<"u"?function(e){return Eg.resolve(null).then(e).catch(JC)}:kd;function JC(e){setTimeout(function(){throw e})}function sh(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),Na(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Na(t)}function hi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function jg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Co=Math.random().toString(36).slice(2),Jr="__reactFiber$"+Co,Da="__reactProps$"+Co,Pn="__reactContainer$"+Co,Nd="__reactEvents$"+Co,ZC="__reactListeners$"+Co,ek="__reactHandles$"+Co;function Oi(e){var t=e[Jr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Pn]||r[Jr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=jg(e);e!==null;){if(r=e[Jr])return r;e=jg(e)}return t}e=r,r=e.parentNode}return null}function nl(e){return e=e[Jr]||e[Pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ls(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function fu(e){return e[Da]||null}var Ed=[],As=-1;function ki(e){return{current:e}}function Te(e){0>As||(e.current=Ed[As],Ed[As]=null,As--)}function Pe(e,t){As++,Ed[As]=e.current,e.current=t}var xi={},kt=ki(xi),Qt=ki(!1),Zi=xi;function fo(e,t){var r=e.type.contextTypes;if(!r)return xi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yt(e){return e=e.childContextTypes,e!=null}function Lc(){Te(Qt),Te(kt)}function Pg(e,t,r){if(kt.current!==xi)throw Error(K(168));Pe(kt,t),Pe(Qt,r)}function ix(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(K(108,Bb(e)||"Unknown",i));return ze({},r,n)}function Ac(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xi,Zi=kt.current,Pe(kt,e),Pe(Qt,Qt.current),!0}function Rg(e,t,r){var n=e.stateNode;if(!n)throw Error(K(169));r?(e=ix(e,t,Zi),n.__reactInternalMemoizedMergedChildContext=e,Te(Qt),Te(kt),Pe(kt,e)):Te(Qt),Pe(Qt,r)}var gn=null,pu=!1,oh=!1;function sx(e){gn===null?gn=[e]:gn.push(e)}function tk(e){pu=!0,sx(e)}function Ni(){if(!oh&&gn!==null){oh=!0;var e=0,t=Ce;try{var r=gn;for(Ce=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}gn=null,pu=!1}catch(i){throw gn!==null&&(gn=gn.slice(e+1)),R_(bp,Ni),i}finally{Ce=t,oh=!1}}return null}var Os=[],Is=0,Oc=null,Ic=0,xr=[],wr=0,es=null,wn=1,Sn="";function Di(e,t){Os[Is++]=Ic,Os[Is++]=Oc,Oc=e,Ic=t}function ox(e,t,r){xr[wr++]=wn,xr[wr++]=Sn,xr[wr++]=es,es=e;var n=wn;e=Sn;var i=32-Ir(n)-1;n&=~(1<<i),r+=1;var s=32-Ir(t)+i;if(30<s){var o=i-i%5;s=(n&(1<<o)-1).toString(32),n>>=o,i-=o,wn=1<<32-Ir(t)+i|r<<i|n,Sn=s+e}else wn=1<<s|r<<i|n,Sn=e}function Mp(e){e.return!==null&&(Di(e,1),ox(e,1,0))}function Tp(e){for(;e===Oc;)Oc=Os[--Is],Os[Is]=null,Ic=Os[--Is],Os[Is]=null;for(;e===es;)es=xr[--wr],xr[wr]=null,Sn=xr[--wr],xr[wr]=null,wn=xr[--wr],xr[wr]=null}var ur=null,lr=null,Le=!1,Or=null;function ax(e,t){var r=br(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Dg(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ur=e,lr=hi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ur=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=es!==null?{id:wn,overflow:Sn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=br(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ur=e,lr=null,!0):!1;default:return!1}}function jd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pd(e){if(Le){var t=lr;if(t){var r=t;if(!Dg(e,t)){if(jd(e))throw Error(K(418));t=hi(r.nextSibling);var n=ur;t&&Dg(e,t)?ax(n,r):(e.flags=e.flags&-4097|2,Le=!1,ur=e)}}else{if(jd(e))throw Error(K(418));e.flags=e.flags&-4097|2,Le=!1,ur=e}}}function Mg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ur=e}function jl(e){if(e!==ur)return!1;if(!Le)return Mg(e),Le=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Cd(e.type,e.memoizedProps)),t&&(t=lr)){if(jd(e))throw lx(),Error(K(418));for(;t;)ax(e,t),t=hi(t.nextSibling)}if(Mg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){lr=hi(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}lr=null}}else lr=ur?hi(e.stateNode.nextSibling):null;return!0}function lx(){for(var e=lr;e;)e=hi(e.nextSibling)}function po(){lr=ur=null,Le=!1}function Lp(e){Or===null?Or=[e]:Or.push(e)}var rk=Tn.ReactCurrentBatchConfig;function Io(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(K(309));var n=r.stateNode}if(!n)throw Error(K(147,e));var i=n,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(K(284));if(!r._owner)throw Error(K(290,e))}return e}function Pl(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Tg(e){var t=e._init;return t(e._payload)}function cx(e){function t(g,_){if(e){var v=g.deletions;v===null?(g.deletions=[_],g.flags|=16):v.push(_)}}function r(g,_){if(!e)return null;for(;_!==null;)t(g,_),_=_.sibling;return null}function n(g,_){for(g=new Map;_!==null;)_.key!==null?g.set(_.key,_):g.set(_.index,_),_=_.sibling;return g}function i(g,_){return g=mi(g,_),g.index=0,g.sibling=null,g}function s(g,_,v){return g.index=v,e?(v=g.alternate,v!==null?(v=v.index,v<_?(g.flags|=2,_):v):(g.flags|=2,_)):(g.flags|=1048576,_)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,_,v,x){return _===null||_.tag!==6?(_=fh(v,g.mode,x),_.return=g,_):(_=i(_,v),_.return=g,_)}function u(g,_,v,x){var k=v.type;return k===Rs?h(g,_,v.props.children,x,v.key):_!==null&&(_.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===qn&&Tg(k)===_.type)?(x=i(_,v.props),x.ref=Io(g,_,v),x.return=g,x):(x=hc(v.type,v.key,v.props,null,g.mode,x),x.ref=Io(g,_,v),x.return=g,x)}function c(g,_,v,x){return _===null||_.tag!==4||_.stateNode.containerInfo!==v.containerInfo||_.stateNode.implementation!==v.implementation?(_=ph(v,g.mode,x),_.return=g,_):(_=i(_,v.children||[]),_.return=g,_)}function h(g,_,v,x,k){return _===null||_.tag!==7?(_=Gi(v,g.mode,x,k),_.return=g,_):(_=i(_,v),_.return=g,_)}function d(g,_,v){if(typeof _=="string"&&_!==""||typeof _=="number")return _=fh(""+_,g.mode,v),_.return=g,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case yl:return v=hc(_.type,_.key,_.props,null,g.mode,v),v.ref=Io(g,null,_),v.return=g,v;case Ps:return _=ph(_,g.mode,v),_.return=g,_;case qn:var x=_._init;return d(g,x(_._payload),v)}if(Go(_)||Mo(_))return _=Gi(_,g.mode,v,null),_.return=g,_;Pl(g,_)}return null}function f(g,_,v,x){var k=_!==null?_.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return k!==null?null:a(g,_,""+v,x);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case yl:return v.key===k?u(g,_,v,x):null;case Ps:return v.key===k?c(g,_,v,x):null;case qn:return k=v._init,f(g,_,k(v._payload),x)}if(Go(v)||Mo(v))return k!==null?null:h(g,_,v,x,null);Pl(g,v)}return null}function p(g,_,v,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return g=g.get(v)||null,a(_,g,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case yl:return g=g.get(x.key===null?v:x.key)||null,u(_,g,x,k);case Ps:return g=g.get(x.key===null?v:x.key)||null,c(_,g,x,k);case qn:var b=x._init;return p(g,_,v,b(x._payload),k)}if(Go(x)||Mo(x))return g=g.get(v)||null,h(_,g,x,k,null);Pl(_,x)}return null}function m(g,_,v,x){for(var k=null,b=null,E=_,L=_=0,F=null;E!==null&&L<v.length;L++){E.index>L?(F=E,E=null):F=E.sibling;var D=f(g,E,v[L],x);if(D===null){E===null&&(E=F);break}e&&E&&D.alternate===null&&t(g,E),_=s(D,_,L),b===null?k=D:b.sibling=D,b=D,E=F}if(L===v.length)return r(g,E),Le&&Di(g,L),k;if(E===null){for(;L<v.length;L++)E=d(g,v[L],x),E!==null&&(_=s(E,_,L),b===null?k=E:b.sibling=E,b=E);return Le&&Di(g,L),k}for(E=n(g,E);L<v.length;L++)F=p(E,g,L,v[L],x),F!==null&&(e&&F.alternate!==null&&E.delete(F.key===null?L:F.key),_=s(F,_,L),b===null?k=F:b.sibling=F,b=F);return e&&E.forEach(function(A){return t(g,A)}),Le&&Di(g,L),k}function y(g,_,v,x){var k=Mo(v);if(typeof k!="function")throw Error(K(150));if(v=k.call(v),v==null)throw Error(K(151));for(var b=k=null,E=_,L=_=0,F=null,D=v.next();E!==null&&!D.done;L++,D=v.next()){E.index>L?(F=E,E=null):F=E.sibling;var A=f(g,E,D.value,x);if(A===null){E===null&&(E=F);break}e&&E&&A.alternate===null&&t(g,E),_=s(A,_,L),b===null?k=A:b.sibling=A,b=A,E=F}if(D.done)return r(g,E),Le&&Di(g,L),k;if(E===null){for(;!D.done;L++,D=v.next())D=d(g,D.value,x),D!==null&&(_=s(D,_,L),b===null?k=D:b.sibling=D,b=D);return Le&&Di(g,L),k}for(E=n(g,E);!D.done;L++,D=v.next())D=p(E,g,L,D.value,x),D!==null&&(e&&D.alternate!==null&&E.delete(D.key===null?L:D.key),_=s(D,_,L),b===null?k=D:b.sibling=D,b=D);return e&&E.forEach(function(j){return t(g,j)}),Le&&Di(g,L),k}function w(g,_,v,x){if(typeof v=="object"&&v!==null&&v.type===Rs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case yl:e:{for(var k=v.key,b=_;b!==null;){if(b.key===k){if(k=v.type,k===Rs){if(b.tag===7){r(g,b.sibling),_=i(b,v.props.children),_.return=g,g=_;break e}}else if(b.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===qn&&Tg(k)===b.type){r(g,b.sibling),_=i(b,v.props),_.ref=Io(g,b,v),_.return=g,g=_;break e}r(g,b);break}else t(g,b);b=b.sibling}v.type===Rs?(_=Gi(v.props.children,g.mode,x,v.key),_.return=g,g=_):(x=hc(v.type,v.key,v.props,null,g.mode,x),x.ref=Io(g,_,v),x.return=g,g=x)}return o(g);case Ps:e:{for(b=v.key;_!==null;){if(_.key===b)if(_.tag===4&&_.stateNode.containerInfo===v.containerInfo&&_.stateNode.implementation===v.implementation){r(g,_.sibling),_=i(_,v.children||[]),_.return=g,g=_;break e}else{r(g,_);break}else t(g,_);_=_.sibling}_=ph(v,g.mode,x),_.return=g,g=_}return o(g);case qn:return b=v._init,w(g,_,b(v._payload),x)}if(Go(v))return m(g,_,v,x);if(Mo(v))return y(g,_,v,x);Pl(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,_!==null&&_.tag===6?(r(g,_.sibling),_=i(_,v),_.return=g,g=_):(r(g,_),_=fh(v,g.mode,x),_.return=g,g=_),o(g)):r(g,_)}return w}var mo=cx(!0),ux=cx(!1),Bc=ki(null),Fc=null,Bs=null,Ap=null;function Op(){Ap=Bs=Fc=null}function Ip(e){var t=Bc.current;Te(Bc),e._currentValue=t}function Rd(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Qs(e,t){Fc=e,Ap=Bs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Kt=!0),e.firstContext=null)}function Nr(e){var t=e._currentValue;if(Ap!==e)if(e={context:e,memoizedValue:t,next:null},Bs===null){if(Fc===null)throw Error(K(308));Bs=e,Fc.dependencies={lanes:0,firstContext:e}}else Bs=Bs.next=e;return t}var Ii=null;function Bp(e){Ii===null?Ii=[e]:Ii.push(e)}function hx(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Bp(t)):(r.next=i.next,i.next=r),t.interleaved=r,Rn(e,n)}function Rn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Kn=!1;function Fp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function di(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,_e&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Rn(e,r)}return i=n.interleaved,i===null?(t.next=t,Bp(n)):(t.next=i.next,i.next=t),n.interleaved=t,Rn(e,r)}function sc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Cp(e,r)}}function Lg(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function zc(e,t,r,n){var i=e.updateQueue;Kn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,c=u.next;u.next=null,o===null?s=c:o.next=c,o=u;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=u))}if(s!==null){var d=i.baseState;o=0,h=c=u=null,a=s;do{var f=a.lane,p=a.eventTime;if((n&f)===f){h!==null&&(h=h.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(f=t,p=r,y.tag){case 1:if(m=y.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=ze({},d,f);break e;case 2:Kn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(c=h=p,u=d):h=h.next=p,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);rs|=o,e.lanes=o,e.memoizedState=d}}function Ag(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(K(191,i));i.call(n)}}}var il={},nn=ki(il),Ma=ki(il),Ta=ki(il);function Bi(e){if(e===il)throw Error(K(174));return e}function zp(e,t){switch(Pe(Ta,t),Pe(Ma,e),Pe(nn,il),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ud(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ud(t,e)}Te(nn),Pe(nn,t)}function go(){Te(nn),Te(Ma),Te(Ta)}function fx(e){Bi(Ta.current);var t=Bi(nn.current),r=ud(t,e.type);t!==r&&(Pe(Ma,e),Pe(nn,r))}function $p(e){Ma.current===e&&(Te(nn),Te(Ma))}var Be=ki(0);function $c(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ah=[];function Hp(){for(var e=0;e<ah.length;e++)ah[e]._workInProgressVersionPrimary=null;ah.length=0}var oc=Tn.ReactCurrentDispatcher,lh=Tn.ReactCurrentBatchConfig,ts=0,Fe=null,nt=null,ct=null,Hc=!1,ha=!1,La=0,nk=0;function xt(){throw Error(K(321))}function Wp(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Fr(e[r],t[r]))return!1;return!0}function Up(e,t,r,n,i,s){if(ts=s,Fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oc.current=e===null||e.memoizedState===null?ak:lk,e=r(n,i),ha){s=0;do{if(ha=!1,La=0,25<=s)throw Error(K(301));s+=1,ct=nt=null,t.updateQueue=null,oc.current=ck,e=r(n,i)}while(ha)}if(oc.current=Wc,t=nt!==null&&nt.next!==null,ts=0,ct=nt=Fe=null,Hc=!1,t)throw Error(K(300));return e}function qp(){var e=La!==0;return La=0,e}function Kr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?Fe.memoizedState=ct=e:ct=ct.next=e,ct}function Er(){if(nt===null){var e=Fe.alternate;e=e!==null?e.memoizedState:null}else e=nt.next;var t=ct===null?Fe.memoizedState:ct.next;if(t!==null)ct=t,nt=e;else{if(e===null)throw Error(K(310));nt=e,e={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},ct===null?Fe.memoizedState=ct=e:ct=ct.next=e}return ct}function Aa(e,t){return typeof t=="function"?t(e):t}function ch(e){var t=Er(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var n=nt,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}n.baseQueue=i=s,r.pending=null}if(i!==null){s=i.next,n=n.baseState;var a=o=null,u=null,c=s;do{var h=c.lane;if((ts&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(a=u=d,o=n):u=u.next=d,Fe.lanes|=h,rs|=h}c=c.next}while(c!==null&&c!==s);u===null?o=n:u.next=a,Fr(n,t.memoizedState)||(Kt=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=u,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do s=i.lane,Fe.lanes|=s,rs|=s,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function uh(e){var t=Er(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,s=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Fr(s,t.memoizedState)||(Kt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),r.lastRenderedState=s}return[s,n]}function px(){}function mx(e,t){var r=Fe,n=Er(),i=t(),s=!Fr(n.memoizedState,i);if(s&&(n.memoizedState=i,Kt=!0),n=n.queue,Kp(yx.bind(null,r,n,e),[e]),n.getSnapshot!==t||s||ct!==null&&ct.memoizedState.tag&1){if(r.flags|=2048,Oa(9,vx.bind(null,r,n,i,t),void 0,null),ft===null)throw Error(K(349));ts&30||gx(r,t,i)}return i}function gx(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Fe.updateQueue,t===null?(t={lastEffect:null,stores:null},Fe.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function vx(e,t,r,n){t.value=r,t.getSnapshot=n,_x(t)&&xx(e)}function yx(e,t,r){return r(function(){_x(t)&&xx(e)})}function _x(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Fr(e,r)}catch{return!0}}function xx(e){var t=Rn(e,1);t!==null&&Br(t,e,1,-1)}function Og(e){var t=Kr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:e},t.queue=e,e=e.dispatch=ok.bind(null,Fe,e),[t.memoizedState,e]}function Oa(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Fe.updateQueue,t===null?(t={lastEffect:null,stores:null},Fe.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function wx(){return Er().memoizedState}function ac(e,t,r,n){var i=Kr();Fe.flags|=e,i.memoizedState=Oa(1|t,r,void 0,n===void 0?null:n)}function mu(e,t,r,n){var i=Er();n=n===void 0?null:n;var s=void 0;if(nt!==null){var o=nt.memoizedState;if(s=o.destroy,n!==null&&Wp(n,o.deps)){i.memoizedState=Oa(t,r,s,n);return}}Fe.flags|=e,i.memoizedState=Oa(1|t,r,s,n)}function Ig(e,t){return ac(8390656,8,e,t)}function Kp(e,t){return mu(2048,8,e,t)}function Sx(e,t){return mu(4,2,e,t)}function bx(e,t){return mu(4,4,e,t)}function Cx(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kx(e,t,r){return r=r!=null?r.concat([e]):null,mu(4,4,Cx.bind(null,t,e),r)}function Vp(){}function Nx(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Wp(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Ex(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Wp(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function jx(e,t,r){return ts&21?(Fr(r,t)||(r=T_(),Fe.lanes|=r,rs|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Kt=!0),e.memoizedState=r)}function ik(e,t){var r=Ce;Ce=r!==0&&4>r?r:4,e(!0);var n=lh.transition;lh.transition={};try{e(!1),t()}finally{Ce=r,lh.transition=n}}function Px(){return Er().memoizedState}function sk(e,t,r){var n=pi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Rx(e))Dx(t,r);else if(r=hx(e,t,r,n),r!==null){var i=Lt();Br(r,e,n,i),Mx(r,t,n)}}function ok(e,t,r){var n=pi(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Rx(e))Dx(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Fr(a,o)){var u=t.interleaved;u===null?(i.next=i,Bp(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=hx(e,t,i,n),r!==null&&(i=Lt(),Br(r,e,n,i),Mx(r,t,n))}}function Rx(e){var t=e.alternate;return e===Fe||t!==null&&t===Fe}function Dx(e,t){ha=Hc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Mx(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Cp(e,r)}}var Wc={readContext:Nr,useCallback:xt,useContext:xt,useEffect:xt,useImperativeHandle:xt,useInsertionEffect:xt,useLayoutEffect:xt,useMemo:xt,useReducer:xt,useRef:xt,useState:xt,useDebugValue:xt,useDeferredValue:xt,useTransition:xt,useMutableSource:xt,useSyncExternalStore:xt,useId:xt,unstable_isNewReconciler:!1},ak={readContext:Nr,useCallback:function(e,t){return Kr().memoizedState=[e,t===void 0?null:t],e},useContext:Nr,useEffect:Ig,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ac(4194308,4,Cx.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ac(4194308,4,e,t)},useInsertionEffect:function(e,t){return ac(4,2,e,t)},useMemo:function(e,t){var r=Kr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Kr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=sk.bind(null,Fe,e),[n.memoizedState,e]},useRef:function(e){var t=Kr();return e={current:e},t.memoizedState=e},useState:Og,useDebugValue:Vp,useDeferredValue:function(e){return Kr().memoizedState=e},useTransition:function(){var e=Og(!1),t=e[0];return e=ik.bind(null,e[1]),Kr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Fe,i=Kr();if(Le){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),ft===null)throw Error(K(349));ts&30||gx(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,Ig(yx.bind(null,n,s,e),[e]),n.flags|=2048,Oa(9,vx.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=Kr(),t=ft.identifierPrefix;if(Le){var r=Sn,n=wn;r=(n&~(1<<32-Ir(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=La++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=nk++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},lk={readContext:Nr,useCallback:Nx,useContext:Nr,useEffect:Kp,useImperativeHandle:kx,useInsertionEffect:Sx,useLayoutEffect:bx,useMemo:Ex,useReducer:ch,useRef:wx,useState:function(){return ch(Aa)},useDebugValue:Vp,useDeferredValue:function(e){var t=Er();return jx(t,nt.memoizedState,e)},useTransition:function(){var e=ch(Aa)[0],t=Er().memoizedState;return[e,t]},useMutableSource:px,useSyncExternalStore:mx,useId:Px,unstable_isNewReconciler:!1},ck={readContext:Nr,useCallback:Nx,useContext:Nr,useEffect:Kp,useImperativeHandle:kx,useInsertionEffect:Sx,useLayoutEffect:bx,useMemo:Ex,useReducer:uh,useRef:wx,useState:function(){return uh(Aa)},useDebugValue:Vp,useDeferredValue:function(e){var t=Er();return nt===null?t.memoizedState=e:jx(t,nt.memoizedState,e)},useTransition:function(){var e=uh(Aa)[0],t=Er().memoizedState;return[e,t]},useMutableSource:px,useSyncExternalStore:mx,useId:Px,unstable_isNewReconciler:!1};function Mr(e,t){if(e&&e.defaultProps){t=ze({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Dd(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ze({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var gu={isMounted:function(e){return(e=e._reactInternals)?hs(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Lt(),i=pi(e),s=kn(n,i);s.payload=t,r!=null&&(s.callback=r),t=di(e,s,i),t!==null&&(Br(t,e,i,n),sc(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Lt(),i=pi(e),s=kn(n,i);s.tag=1,s.payload=t,r!=null&&(s.callback=r),t=di(e,s,i),t!==null&&(Br(t,e,i,n),sc(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Lt(),n=pi(e),i=kn(r,n);i.tag=2,t!=null&&(i.callback=t),t=di(e,i,n),t!==null&&(Br(t,e,n,r),sc(t,e,n))}};function Bg(e,t,r,n,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,o):t.prototype&&t.prototype.isPureReactComponent?!ja(r,n)||!ja(i,s):!0}function Tx(e,t,r){var n=!1,i=xi,s=t.contextType;return typeof s=="object"&&s!==null?s=Nr(s):(i=Yt(t)?Zi:kt.current,n=t.contextTypes,s=(n=n!=null)?fo(e,i):xi),t=new t(r,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=gu,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Fg(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&gu.enqueueReplaceState(t,t.state,null)}function Md(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},Fp(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Nr(s):(s=Yt(t)?Zi:kt.current,i.context=fo(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Dd(e,t,s,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&gu.enqueueReplaceState(i,i.state,null),zc(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function vo(e,t){try{var r="",n=t;do r+=Ib(n),n=n.return;while(n);var i=r}catch(s){i=`
|
|
39
|
+
Error generating stack: `+s.message+`
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function hh(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Td(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var uk=typeof WeakMap=="function"?WeakMap:Map;function Lx(e,t,r){r=kn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){qc||(qc=!0,Wd=n),Td(e,t)},r}function Ax(e,t,r){r=kn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Td(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){Td(e,t),typeof n!="function"&&(fi===null?fi=new Set([this]):fi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function zg(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new uk;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Ck.bind(null,e,t,r),t.then(e,e))}function $g(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Hg(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=kn(-1,1),t.tag=2,di(r,t,1))),r.lanes|=1),e)}var hk=Tn.ReactCurrentOwner,Kt=!1;function Dt(e,t,r,n){t.child=e===null?ux(t,null,r,n):mo(t,e.child,r,n)}function Wg(e,t,r,n,i){r=r.render;var s=t.ref;return Qs(t,i),n=Up(e,t,r,n,s,i),r=qp(),e!==null&&!Kt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Dn(e,t,i)):(Le&&r&&Mp(t),t.flags|=1,Dt(e,t,n,i),t.child)}function Ug(e,t,r,n,i){if(e===null){var s=r.type;return typeof s=="function"&&!tm(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=s,Ox(e,t,s,n,i)):(e=hc(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:ja,r(o,n)&&e.ref===t.ref)return Dn(e,t,i)}return t.flags|=1,e=mi(s,n),e.ref=t.ref,e.return=t,t.child=e}function Ox(e,t,r,n,i){if(e!==null){var s=e.memoizedProps;if(ja(s,n)&&e.ref===t.ref)if(Kt=!1,t.pendingProps=n=s,(e.lanes&i)!==0)e.flags&131072&&(Kt=!0);else return t.lanes=e.lanes,Dn(e,t,i)}return Ld(e,t,r,n,i)}function Ix(e,t,r){var n=t.pendingProps,i=n.children,s=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(zs,ar),ar|=r;else{if(!(r&1073741824))return e=s!==null?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pe(zs,ar),ar|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,Pe(zs,ar),ar|=n}else s!==null?(n=s.baseLanes|r,t.memoizedState=null):n=r,Pe(zs,ar),ar|=n;return Dt(e,t,i,r),t.child}function Bx(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ld(e,t,r,n,i){var s=Yt(r)?Zi:kt.current;return s=fo(t,s),Qs(t,i),r=Up(e,t,r,n,s,i),n=qp(),e!==null&&!Kt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Dn(e,t,i)):(Le&&n&&Mp(t),t.flags|=1,Dt(e,t,r,i),t.child)}function qg(e,t,r,n,i){if(Yt(r)){var s=!0;Ac(t)}else s=!1;if(Qs(t,i),t.stateNode===null)lc(e,t),Tx(t,r,n),Md(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var u=o.context,c=r.contextType;typeof c=="object"&&c!==null?c=Nr(c):(c=Yt(r)?Zi:kt.current,c=fo(t,c));var h=r.getDerivedStateFromProps,d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||u!==c)&&Fg(t,o,n,c),Kn=!1;var f=t.memoizedState;o.state=f,zc(t,n,o,i),u=t.memoizedState,a!==n||f!==u||Qt.current||Kn?(typeof h=="function"&&(Dd(t,r,h,n),u=t.memoizedState),(a=Kn||Bg(t,r,a,n,f,u,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=c,n=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,dx(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Mr(t.type,a),o.props=c,d=t.pendingProps,f=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Nr(u):(u=Yt(r)?Zi:kt.current,u=fo(t,u));var p=r.getDerivedStateFromProps;(h=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==u)&&Fg(t,o,n,u),Kn=!1,f=t.memoizedState,o.state=f,zc(t,n,o,i);var m=t.memoizedState;a!==d||f!==m||Qt.current||Kn?(typeof p=="function"&&(Dd(t,r,p,n),m=t.memoizedState),(c=Kn||Bg(t,r,c,n,f,m,u)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,m,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,m,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=m),o.props=n,o.state=m,o.context=u,n=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return Ad(e,t,r,n,s,i)}function Ad(e,t,r,n,i,s){Bx(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&Rg(t,r,!1),Dn(e,t,s);n=t.stateNode,hk.current=t;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=mo(t,e.child,null,s),t.child=mo(t,null,a,s)):Dt(e,t,a,s),t.memoizedState=n.state,i&&Rg(t,r,!0),t.child}function Fx(e){var t=e.stateNode;t.pendingContext?Pg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Pg(e,t.context,!1),zp(e,t.containerInfo)}function Kg(e,t,r,n,i){return po(),Lp(i),t.flags|=256,Dt(e,t,r,n),t.child}var Od={dehydrated:null,treeContext:null,retryLane:0};function Id(e){return{baseLanes:e,cachePool:null,transitions:null}}function zx(e,t,r){var n=t.pendingProps,i=Be.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Pe(Be,i&1),e===null)return Pd(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,s?(n=t.mode,s=t.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=_u(o,n,0,null),e=Gi(e,n,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Id(r),t.memoizedState=Od,e):Qp(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return dk(e,t,o,n,a,i,r);if(s){s=n.fallback,o=t.mode,i=e.child,a=i.sibling;var u={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=u,t.deletions=null):(n=mi(i,u),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=mi(a,s):(s=Gi(s,o,r,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,n=s,s=t.child,o=e.child.memoizedState,o=o===null?Id(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~r,t.memoizedState=Od,n}return s=e.child,e=s.sibling,n=mi(s,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Qp(e,t){return t=_u({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Rl(e,t,r,n){return n!==null&&Lp(n),mo(t,e.child,null,r),e=Qp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dk(e,t,r,n,i,s,o){if(r)return t.flags&256?(t.flags&=-257,n=hh(Error(K(422))),Rl(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=n.fallback,i=t.mode,n=_u({mode:"visible",children:n.children},i,0,null),s=Gi(s,i,o,null),s.flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,t.mode&1&&mo(t,e.child,null,o),t.child.memoizedState=Id(o),t.memoizedState=Od,s);if(!(t.mode&1))return Rl(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(K(419)),n=hh(s,n,void 0),Rl(e,t,o,n)}if(a=(o&e.childLanes)!==0,Kt||a){if(n=ft,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Rn(e,i),Br(n,e,i,-1))}return em(),n=hh(Error(K(421))),Rl(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=kk.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,lr=hi(i.nextSibling),ur=t,Le=!0,Or=null,e!==null&&(xr[wr++]=wn,xr[wr++]=Sn,xr[wr++]=es,wn=e.id,Sn=e.overflow,es=t),t=Qp(t,n.children),t.flags|=4096,t)}function Vg(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Rd(e.return,t,r)}function dh(e,t,r,n,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function $x(e,t,r){var n=t.pendingProps,i=n.revealOrder,s=n.tail;if(Dt(e,t,n.children,r),n=Be.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Vg(e,r,t);else if(e.tag===19)Vg(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Pe(Be,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&$c(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),dh(t,!1,i,r,s);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&$c(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}dh(t,!0,r,null,s);break;case"together":dh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function lc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Dn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),rs|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,r=mi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=mi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function fk(e,t,r){switch(t.tag){case 3:Fx(t),po();break;case 5:fx(t);break;case 1:Yt(t.type)&&Ac(t);break;case 4:zp(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Pe(Bc,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Pe(Be,Be.current&1),t.flags|=128,null):r&t.child.childLanes?zx(e,t,r):(Pe(Be,Be.current&1),e=Dn(e,t,r),e!==null?e.sibling:null);Pe(Be,Be.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return $x(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Pe(Be,Be.current),n)break;return null;case 22:case 23:return t.lanes=0,Ix(e,t,r)}return Dn(e,t,r)}var Hx,Bd,Wx,Ux;Hx=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Bd=function(){};Wx=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Bi(nn.current);var s=null;switch(r){case"input":i=od(e,i),n=od(e,n),s=[];break;case"select":i=ze({},i,{value:void 0}),n=ze({},n,{value:void 0}),s=[];break;case"textarea":i=cd(e,i),n=cd(e,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Tc)}hd(r,n);var o;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(wa.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in n){var u=n[c];if(a=i!=null?i[c]:void 0,n.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in u)u.hasOwnProperty(o)&&a[o]!==u[o]&&(r||(r={}),r[o]=u[o])}else r||(s||(s=[]),s.push(c,r)),r=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(s=s||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(wa.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&De("scroll",e),s||a===u||(s=[])):(s=s||[]).push(c,u))}r&&(s=s||[]).push("style",r);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Ux=function(e,t,r,n){r!==n&&(t.flags|=4)};function Bo(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function pk(e,t,r){var n=t.pendingProps;switch(Tp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(t),null;case 1:return Yt(t.type)&&Lc(),wt(t),null;case 3:return n=t.stateNode,go(),Te(Qt),Te(kt),Hp(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(jl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Or!==null&&(Kd(Or),Or=null))),Bd(e,t),wt(t),null;case 5:$p(t);var i=Bi(Ta.current);if(r=t.type,e!==null&&t.stateNode!=null)Wx(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(K(166));return wt(t),null}if(e=Bi(nn.current),jl(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[Jr]=t,n[Da]=s,e=(t.mode&1)!==0,r){case"dialog":De("cancel",n),De("close",n);break;case"iframe":case"object":case"embed":De("load",n);break;case"video":case"audio":for(i=0;i<Zo.length;i++)De(Zo[i],n);break;case"source":De("error",n);break;case"img":case"image":case"link":De("error",n),De("load",n);break;case"details":De("toggle",n);break;case"input":rg(n,s),De("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},De("invalid",n);break;case"textarea":ig(n,s),De("invalid",n)}hd(r,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?n.textContent!==a&&(s.suppressHydrationWarning!==!0&&El(n.textContent,a,e),i=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&El(n.textContent,a,e),i=["children",""+a]):wa.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&De("scroll",n)}switch(r){case"input":_l(n),ng(n,s,!0);break;case"textarea":_l(n),sg(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=Tc)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=y_(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Jr]=t,e[Da]=n,Hx(e,t,!1,!1),t.stateNode=e;e:{switch(o=dd(r,n),r){case"dialog":De("cancel",e),De("close",e),i=n;break;case"iframe":case"object":case"embed":De("load",e),i=n;break;case"video":case"audio":for(i=0;i<Zo.length;i++)De(Zo[i],e);i=n;break;case"source":De("error",e),i=n;break;case"img":case"image":case"link":De("error",e),De("load",e),i=n;break;case"details":De("toggle",e),i=n;break;case"input":rg(e,n),i=od(e,n),De("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=ze({},n,{value:void 0}),De("invalid",e);break;case"textarea":ig(e,n),i=cd(e,n),De("invalid",e);break;default:i=n}hd(r,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var u=a[s];s==="style"?w_(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&__(e,u)):s==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Sa(e,u):typeof u=="number"&&Sa(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(wa.hasOwnProperty(s)?u!=null&&s==="onScroll"&&De("scroll",e):u!=null&&yp(e,s,u,o))}switch(r){case"input":_l(e),ng(e,n,!1);break;case"textarea":_l(e),sg(e);break;case"option":n.value!=null&&e.setAttribute("value",""+_i(n.value));break;case"select":e.multiple=!!n.multiple,s=n.value,s!=null?Us(e,!!n.multiple,s,!1):n.defaultValue!=null&&Us(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Tc)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return wt(t),null;case 6:if(e&&t.stateNode!=null)Ux(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(K(166));if(r=Bi(Ta.current),Bi(nn.current),jl(t)){if(n=t.stateNode,r=t.memoizedProps,n[Jr]=t,(s=n.nodeValue!==r)&&(e=ur,e!==null))switch(e.tag){case 3:El(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&El(n.nodeValue,r,(e.mode&1)!==0)}s&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Jr]=t,t.stateNode=n}return wt(t),null;case 13:if(Te(Be),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Le&&lr!==null&&t.mode&1&&!(t.flags&128))lx(),po(),t.flags|=98560,s=!1;else if(s=jl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(K(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(K(317));s[Jr]=t}else po(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wt(t),s=!1}else Or!==null&&(Kd(Or),Or=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Be.current&1?st===0&&(st=3):em())),t.updateQueue!==null&&(t.flags|=4),wt(t),null);case 4:return go(),Bd(e,t),e===null&&Pa(t.stateNode.containerInfo),wt(t),null;case 10:return Ip(t.type._context),wt(t),null;case 17:return Yt(t.type)&&Lc(),wt(t),null;case 19:if(Te(Be),s=t.memoizedState,s===null)return wt(t),null;if(n=(t.flags&128)!==0,o=s.rendering,o===null)if(n)Bo(s,!1);else{if(st!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=$c(e),o!==null){for(t.flags|=128,Bo(s,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)s=r,e=n,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Pe(Be,Be.current&1|2),t.child}e=e.sibling}s.tail!==null&&Ve()>yo&&(t.flags|=128,n=!0,Bo(s,!1),t.lanes=4194304)}else{if(!n)if(e=$c(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Bo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Le)return wt(t),null}else 2*Ve()-s.renderingStartTime>yo&&r!==1073741824&&(t.flags|=128,n=!0,Bo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ve(),t.sibling=null,r=Be.current,Pe(Be,n?r&1|2:r&1),t):(wt(t),null);case 22:case 23:return Zp(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?ar&1073741824&&(wt(t),t.subtreeFlags&6&&(t.flags|=8192)):wt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function mk(e,t){switch(Tp(t),t.tag){case 1:return Yt(t.type)&&Lc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return go(),Te(Qt),Te(kt),Hp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $p(t),null;case 13:if(Te(Be),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te(Be),null;case 4:return go(),null;case 10:return Ip(t.type._context),null;case 22:case 23:return Zp(),null;case 24:return null;default:return null}}var Dl=!1,Ct=!1,gk=typeof WeakSet=="function"?WeakSet:Set,te=null;function Fs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){We(e,t,n)}else r.current=null}function Fd(e,t,r){try{r()}catch(n){We(e,t,n)}}var Qg=!1;function vk(e,t){if(Sd=Rc,e=Y_(),Dp(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(a=o+i),d!==s||n!==0&&d.nodeType!==3||(u=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++c===i&&(a=o),f===s&&++h===n&&(u=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=a===-1||u===-1?null:{start:a,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(bd={focusedElem:e,selectionRange:r},Rc=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,w=m.memoizedState,g=t.stateNode,_=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Mr(t.type,y),w);g.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(x){We(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return m=Qg,Qg=!1,m}function da(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Fd(t,r,s)}i=i.next}while(i!==n)}}function vu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function zd(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function qx(e){var t=e.alternate;t!==null&&(e.alternate=null,qx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jr],delete t[Da],delete t[Nd],delete t[ZC],delete t[ek])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Kx(e){return e.tag===5||e.tag===3||e.tag===4}function Yg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $d(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Tc));else if(n!==4&&(e=e.child,e!==null))for($d(e,t,r),e=e.sibling;e!==null;)$d(e,t,r),e=e.sibling}function Hd(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Hd(e,t,r),e=e.sibling;e!==null;)Hd(e,t,r),e=e.sibling}var mt=null,Ar=!1;function On(e,t,r){for(r=r.child;r!==null;)Vx(e,t,r),r=r.sibling}function Vx(e,t,r){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(cu,r)}catch{}switch(r.tag){case 5:Ct||Fs(r,t);case 6:var n=mt,i=Ar;mt=null,On(e,t,r),mt=n,Ar=i,mt!==null&&(Ar?(e=mt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):mt.removeChild(r.stateNode));break;case 18:mt!==null&&(Ar?(e=mt,r=r.stateNode,e.nodeType===8?sh(e.parentNode,r):e.nodeType===1&&sh(e,r),Na(e)):sh(mt,r.stateNode));break;case 4:n=mt,i=Ar,mt=r.stateNode.containerInfo,Ar=!0,On(e,t,r),mt=n,Ar=i;break;case 0:case 11:case 14:case 15:if(!Ct&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Fd(r,t,o),i=i.next}while(i!==n)}On(e,t,r);break;case 1:if(!Ct&&(Fs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){We(r,t,a)}On(e,t,r);break;case 21:On(e,t,r);break;case 22:r.mode&1?(Ct=(n=Ct)||r.memoizedState!==null,On(e,t,r),Ct=n):On(e,t,r);break;default:On(e,t,r)}}function Xg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new gk),t.forEach(function(n){var i=Nk.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Pr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:mt=a.stateNode,Ar=!1;break e;case 3:mt=a.stateNode.containerInfo,Ar=!0;break e;case 4:mt=a.stateNode.containerInfo,Ar=!0;break e}a=a.return}if(mt===null)throw Error(K(160));Vx(s,o,i),mt=null,Ar=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){We(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qx(t,e),t=t.sibling}function Qx(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pr(t,e),Hr(e),n&4){try{da(3,e,e.return),vu(3,e)}catch(y){We(e,e.return,y)}try{da(5,e,e.return)}catch(y){We(e,e.return,y)}}break;case 1:Pr(t,e),Hr(e),n&512&&r!==null&&Fs(r,r.return);break;case 5:if(Pr(t,e),Hr(e),n&512&&r!==null&&Fs(r,r.return),e.flags&32){var i=e.stateNode;try{Sa(i,"")}catch(y){We(e,e.return,y)}}if(n&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=r!==null?r.memoizedProps:s,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&g_(i,s),dd(a,o);var c=dd(a,s);for(o=0;o<u.length;o+=2){var h=u[o],d=u[o+1];h==="style"?w_(i,d):h==="dangerouslySetInnerHTML"?__(i,d):h==="children"?Sa(i,d):yp(i,h,d,c)}switch(a){case"input":ad(i,s);break;case"textarea":v_(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Us(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Us(i,!!s.multiple,s.defaultValue,!0):Us(i,!!s.multiple,s.multiple?[]:"",!1))}i[Da]=s}catch(y){We(e,e.return,y)}}break;case 6:if(Pr(t,e),Hr(e),n&4){if(e.stateNode===null)throw Error(K(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(y){We(e,e.return,y)}}break;case 3:if(Pr(t,e),Hr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Na(t.containerInfo)}catch(y){We(e,e.return,y)}break;case 4:Pr(t,e),Hr(e);break;case 13:Pr(t,e),Hr(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Gp=Ve())),n&4&&Xg(e);break;case 22:if(h=r!==null&&r.memoizedState!==null,e.mode&1?(Ct=(c=Ct)||h,Pr(t,e),Ct=c):Pr(t,e),Hr(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(te=e,h=e.child;h!==null;){for(d=te=h;te!==null;){switch(f=te,p=f.child,f.tag){case 0:case 11:case 14:case 15:da(4,f,f.return);break;case 1:Fs(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){n=f,r=f.return;try{t=n,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(y){We(n,r,y)}}break;case 5:Fs(f,f.return);break;case 22:if(f.memoizedState!==null){Jg(d);continue}}p!==null?(p.return=f,te=p):Jg(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{i=d.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,u=d.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=x_("display",o))}catch(y){We(e,e.return,y)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(y){We(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Pr(t,e),Hr(e),n&4&&Xg(e);break;case 21:break;default:Pr(t,e),Hr(e)}}function Hr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Kx(r)){var n=r;break e}r=r.return}throw Error(K(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Sa(i,""),n.flags&=-33);var s=Yg(e);Hd(e,s,i);break;case 3:case 4:var o=n.stateNode.containerInfo,a=Yg(e);$d(e,a,o);break;default:throw Error(K(161))}}catch(u){We(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yk(e,t,r){te=e,Yx(e)}function Yx(e,t,r){for(var n=(e.mode&1)!==0;te!==null;){var i=te,s=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||Dl;if(!o){var a=i.alternate,u=a!==null&&a.memoizedState!==null||Ct;a=Dl;var c=Ct;if(Dl=o,(Ct=u)&&!c)for(te=i;te!==null;)o=te,u=o.child,o.tag===22&&o.memoizedState!==null?Zg(i):u!==null?(u.return=o,te=u):Zg(i);for(;s!==null;)te=s,Yx(s),s=s.sibling;te=i,Dl=a,Ct=c}Gg(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,te=s):Gg(e)}}function Gg(e){for(;te!==null;){var t=te;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ct||vu(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Ct)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Mr(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Ag(t,s,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ag(t,o,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&Na(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Ct||t.flags&512&&zd(t)}catch(f){We(t,t.return,f)}}if(t===e){te=null;break}if(r=t.sibling,r!==null){r.return=t.return,te=r;break}te=t.return}}function Jg(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var r=t.sibling;if(r!==null){r.return=t.return,te=r;break}te=t.return}}function Zg(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{vu(4,t)}catch(u){We(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){We(t,i,u)}}var s=t.return;try{zd(t)}catch(u){We(t,s,u)}break;case 5:var o=t.return;try{zd(t)}catch(u){We(t,o,u)}}}catch(u){We(t,t.return,u)}if(t===e){te=null;break}var a=t.sibling;if(a!==null){a.return=t.return,te=a;break}te=t.return}}var _k=Math.ceil,Uc=Tn.ReactCurrentDispatcher,Yp=Tn.ReactCurrentOwner,Cr=Tn.ReactCurrentBatchConfig,_e=0,ft=null,Je=null,yt=0,ar=0,zs=ki(0),st=0,Ia=null,rs=0,yu=0,Xp=0,fa=null,qt=null,Gp=0,yo=1/0,pn=null,qc=!1,Wd=null,fi=null,Ml=!1,oi=null,Kc=0,pa=0,Ud=null,cc=-1,uc=0;function Lt(){return _e&6?Ve():cc!==-1?cc:cc=Ve()}function pi(e){return e.mode&1?_e&2&&yt!==0?yt&-yt:rk.transition!==null?(uc===0&&(uc=T_()),uc):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:z_(e.type)),e):1}function Br(e,t,r,n){if(50<pa)throw pa=0,Ud=null,Error(K(185));tl(e,r,n),(!(_e&2)||e!==ft)&&(e===ft&&(!(_e&2)&&(yu|=r),st===4&&Yn(e,yt)),Xt(e,n),r===1&&_e===0&&!(t.mode&1)&&(yo=Ve()+500,pu&&Ni()))}function Xt(e,t){var r=e.callbackNode;rC(e,t);var n=Pc(e,e===ft?yt:0);if(n===0)r!==null&&lg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&lg(r),t===1)e.tag===0?tk(e0.bind(null,e)):sx(e0.bind(null,e)),GC(function(){!(_e&6)&&Ni()}),r=null;else{switch(L_(n)){case 1:r=bp;break;case 4:r=D_;break;case 16:r=jc;break;case 536870912:r=M_;break;default:r=jc}r=nw(r,Xx.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Xx(e,t){if(cc=-1,uc=0,_e&6)throw Error(K(327));var r=e.callbackNode;if(Ys()&&e.callbackNode!==r)return null;var n=Pc(e,e===ft?yt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Vc(e,n);else{t=n;var i=_e;_e|=2;var s=Jx();(ft!==e||yt!==t)&&(pn=null,yo=Ve()+500,Xi(e,t));do try{Sk();break}catch(a){Gx(e,a)}while(!0);Op(),Uc.current=s,_e=i,Je!==null?t=0:(ft=null,yt=0,t=st)}if(t!==0){if(t===2&&(i=vd(e),i!==0&&(n=i,t=qd(e,i))),t===1)throw r=Ia,Xi(e,0),Yn(e,n),Xt(e,Ve()),r;if(t===6)Yn(e,n);else{if(i=e.current.alternate,!(n&30)&&!xk(i)&&(t=Vc(e,n),t===2&&(s=vd(e),s!==0&&(n=s,t=qd(e,s))),t===1))throw r=Ia,Xi(e,0),Yn(e,n),Xt(e,Ve()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(K(345));case 2:Mi(e,qt,pn);break;case 3:if(Yn(e,n),(n&130023424)===n&&(t=Gp+500-Ve(),10<t)){if(Pc(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){Lt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=kd(Mi.bind(null,e,qt,pn),t);break}Mi(e,qt,pn);break;case 4:if(Yn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-Ir(n);s=1<<o,o=t[o],o>i&&(i=o),n&=~s}if(n=i,n=Ve()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*_k(n/1960))-n,10<n){e.timeoutHandle=kd(Mi.bind(null,e,qt,pn),n);break}Mi(e,qt,pn);break;case 5:Mi(e,qt,pn);break;default:throw Error(K(329))}}}return Xt(e,Ve()),e.callbackNode===r?Xx.bind(null,e):null}function qd(e,t){var r=fa;return e.current.memoizedState.isDehydrated&&(Xi(e,t).flags|=256),e=Vc(e,t),e!==2&&(t=qt,qt=r,t!==null&&Kd(t)),e}function Kd(e){qt===null?qt=e:qt.push.apply(qt,e)}function xk(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!Fr(s(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Yn(e,t){for(t&=~Xp,t&=~yu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Ir(t),n=1<<r;e[r]=-1,t&=~n}}function e0(e){if(_e&6)throw Error(K(327));Ys();var t=Pc(e,0);if(!(t&1))return Xt(e,Ve()),null;var r=Vc(e,t);if(e.tag!==0&&r===2){var n=vd(e);n!==0&&(t=n,r=qd(e,n))}if(r===1)throw r=Ia,Xi(e,0),Yn(e,t),Xt(e,Ve()),r;if(r===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Mi(e,qt,pn),Xt(e,Ve()),null}function Jp(e,t){var r=_e;_e|=1;try{return e(t)}finally{_e=r,_e===0&&(yo=Ve()+500,pu&&Ni())}}function ns(e){oi!==null&&oi.tag===0&&!(_e&6)&&Ys();var t=_e;_e|=1;var r=Cr.transition,n=Ce;try{if(Cr.transition=null,Ce=1,e)return e()}finally{Ce=n,Cr.transition=r,_e=t,!(_e&6)&&Ni()}}function Zp(){ar=zs.current,Te(zs)}function Xi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,XC(r)),Je!==null)for(r=Je.return;r!==null;){var n=r;switch(Tp(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Lc();break;case 3:go(),Te(Qt),Te(kt),Hp();break;case 5:$p(n);break;case 4:go();break;case 13:Te(Be);break;case 19:Te(Be);break;case 10:Ip(n.type._context);break;case 22:case 23:Zp()}r=r.return}if(ft=e,Je=e=mi(e.current,null),yt=ar=t,st=0,Ia=null,Xp=yu=rs=0,qt=fa=null,Ii!==null){for(t=0;t<Ii.length;t++)if(r=Ii[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,s=r.pending;if(s!==null){var o=s.next;s.next=i,n.next=o}r.pending=n}Ii=null}return e}function Gx(e,t){do{var r=Je;try{if(Op(),oc.current=Wc,Hc){for(var n=Fe.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Hc=!1}if(ts=0,ct=nt=Fe=null,ha=!1,La=0,Yp.current=null,r===null||r.return===null){st=1,Ia=t,Je=null;break}e:{var s=e,o=r.return,a=r,u=t;if(t=yt,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=a,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=$g(o);if(p!==null){p.flags&=-257,Hg(p,o,a,s,t),p.mode&1&&zg(s,c,t),t=p,u=c;var m=t.updateQueue;if(m===null){var y=new Set;y.add(u),t.updateQueue=y}else m.add(u);break e}else{if(!(t&1)){zg(s,c,t),em();break e}u=Error(K(426))}}else if(Le&&a.mode&1){var w=$g(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Hg(w,o,a,s,t),Lp(vo(u,a));break e}}s=u=vo(u,a),st!==4&&(st=2),fa===null?fa=[s]:fa.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=Lx(s,u,t);Lg(s,g);break e;case 1:a=u;var _=s.type,v=s.stateNode;if(!(s.flags&128)&&(typeof _.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(fi===null||!fi.has(v)))){s.flags|=65536,t&=-t,s.lanes|=t;var x=Ax(s,a,t);Lg(s,x);break e}}s=s.return}while(s!==null)}ew(r)}catch(k){t=k,Je===r&&r!==null&&(Je=r=r.return);continue}break}while(!0)}function Jx(){var e=Uc.current;return Uc.current=Wc,e===null?Wc:e}function em(){(st===0||st===3||st===2)&&(st=4),ft===null||!(rs&268435455)&&!(yu&268435455)||Yn(ft,yt)}function Vc(e,t){var r=_e;_e|=2;var n=Jx();(ft!==e||yt!==t)&&(pn=null,Xi(e,t));do try{wk();break}catch(i){Gx(e,i)}while(!0);if(Op(),_e=r,Uc.current=n,Je!==null)throw Error(K(261));return ft=null,yt=0,st}function wk(){for(;Je!==null;)Zx(Je)}function Sk(){for(;Je!==null&&!Vb();)Zx(Je)}function Zx(e){var t=rw(e.alternate,e,ar);e.memoizedProps=e.pendingProps,t===null?ew(e):Je=t,Yp.current=null}function ew(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=mk(r,t),r!==null){r.flags&=32767,Je=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{st=6,Je=null;return}}else if(r=pk(r,t,ar),r!==null){Je=r;return}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);st===0&&(st=5)}function Mi(e,t,r){var n=Ce,i=Cr.transition;try{Cr.transition=null,Ce=1,bk(e,t,r,n)}finally{Cr.transition=i,Ce=n}return null}function bk(e,t,r,n){do Ys();while(oi!==null);if(_e&6)throw Error(K(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var s=r.lanes|r.childLanes;if(nC(e,s),e===ft&&(Je=ft=null,yt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ml||(Ml=!0,nw(jc,function(){return Ys(),null})),s=(r.flags&15990)!==0,r.subtreeFlags&15990||s){s=Cr.transition,Cr.transition=null;var o=Ce;Ce=1;var a=_e;_e|=4,Yp.current=null,vk(e,r),Qx(r,e),WC(bd),Rc=!!Sd,bd=Sd=null,e.current=r,yk(r),Qb(),_e=a,Ce=o,Cr.transition=s}else e.current=r;if(Ml&&(Ml=!1,oi=e,Kc=i),s=e.pendingLanes,s===0&&(fi=null),Gb(r.stateNode),Xt(e,Ve()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(qc)throw qc=!1,e=Wd,Wd=null,e;return Kc&1&&e.tag!==0&&Ys(),s=e.pendingLanes,s&1?e===Ud?pa++:(pa=0,Ud=e):pa=0,Ni(),null}function Ys(){if(oi!==null){var e=L_(Kc),t=Cr.transition,r=Ce;try{if(Cr.transition=null,Ce=16>e?16:e,oi===null)var n=!1;else{if(e=oi,oi=null,Kc=0,_e&6)throw Error(K(331));var i=_e;for(_e|=4,te=e.current;te!==null;){var s=te,o=s.child;if(te.flags&16){var a=s.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[u];for(te=c;te!==null;){var h=te;switch(h.tag){case 0:case 11:case 15:da(8,h,s)}var d=h.child;if(d!==null)d.return=h,te=d;else for(;te!==null;){h=te;var f=h.sibling,p=h.return;if(qx(h),h===c){te=null;break}if(f!==null){f.return=p,te=f;break}te=p}}}var m=s.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var w=y.sibling;y.sibling=null,y=w}while(y!==null)}}te=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,te=o;else e:for(;te!==null;){if(s=te,s.flags&2048)switch(s.tag){case 0:case 11:case 15:da(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,te=g;break e}te=s.return}}var _=e.current;for(te=_;te!==null;){o=te;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,te=v;else e:for(o=_;te!==null;){if(a=te,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:vu(9,a)}}catch(k){We(a,a.return,k)}if(a===o){te=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,te=x;break e}te=a.return}}if(_e=i,Ni(),rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(cu,e)}catch{}n=!0}return n}finally{Ce=r,Cr.transition=t}}return!1}function t0(e,t,r){t=vo(r,t),t=Lx(e,t,1),e=di(e,t,1),t=Lt(),e!==null&&(tl(e,1,t),Xt(e,t))}function We(e,t,r){if(e.tag===3)t0(e,e,r);else for(;t!==null;){if(t.tag===3){t0(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(fi===null||!fi.has(n))){e=vo(r,e),e=Ax(t,e,1),t=di(t,e,1),e=Lt(),t!==null&&(tl(t,1,e),Xt(t,e));break}}t=t.return}}function Ck(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Lt(),e.pingedLanes|=e.suspendedLanes&r,ft===e&&(yt&r)===r&&(st===4||st===3&&(yt&130023424)===yt&&500>Ve()-Gp?Xi(e,0):Xp|=r),Xt(e,t)}function tw(e,t){t===0&&(e.mode&1?(t=Sl,Sl<<=1,!(Sl&130023424)&&(Sl=4194304)):t=1);var r=Lt();e=Rn(e,t),e!==null&&(tl(e,t,r),Xt(e,r))}function kk(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),tw(e,r)}function Nk(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(K(314))}n!==null&&n.delete(t),tw(e,r)}var rw;rw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qt.current)Kt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Kt=!1,fk(e,t,r);Kt=!!(e.flags&131072)}else Kt=!1,Le&&t.flags&1048576&&ox(t,Ic,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;lc(e,t),e=t.pendingProps;var i=fo(t,kt.current);Qs(t,r),i=Up(null,t,n,e,i,r);var s=qp();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yt(n)?(s=!0,Ac(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Fp(t),i.updater=gu,t.stateNode=i,i._reactInternals=t,Md(t,n,e,r),t=Ad(null,t,n,!0,s,r)):(t.tag=0,Le&&s&&Mp(t),Dt(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(lc(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=jk(n),e=Mr(n,e),i){case 0:t=Ld(null,t,n,e,r);break e;case 1:t=qg(null,t,n,e,r);break e;case 11:t=Wg(null,t,n,e,r);break e;case 14:t=Ug(null,t,n,Mr(n.type,e),r);break e}throw Error(K(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Mr(n,i),Ld(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Mr(n,i),qg(e,t,n,i,r);case 3:e:{if(Fx(t),e===null)throw Error(K(387));n=t.pendingProps,s=t.memoizedState,i=s.element,dx(e,t),zc(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=vo(Error(K(423)),t),t=Kg(e,t,n,r,i);break e}else if(n!==i){i=vo(Error(K(424)),t),t=Kg(e,t,n,r,i);break e}else for(lr=hi(t.stateNode.containerInfo.firstChild),ur=t,Le=!0,Or=null,r=ux(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(po(),n===i){t=Dn(e,t,r);break e}Dt(e,t,n,r)}t=t.child}return t;case 5:return fx(t),e===null&&Pd(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Cd(n,i)?o=null:s!==null&&Cd(n,s)&&(t.flags|=32),Bx(e,t),Dt(e,t,o,r),t.child;case 6:return e===null&&Pd(t),null;case 13:return zx(e,t,r);case 4:return zp(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=mo(t,null,n,r):Dt(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Mr(n,i),Wg(e,t,n,i,r);case 7:return Dt(e,t,t.pendingProps,r),t.child;case 8:return Dt(e,t,t.pendingProps.children,r),t.child;case 12:return Dt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Pe(Bc,n._currentValue),n._currentValue=o,s!==null)if(Fr(s.value,o)){if(s.children===i.children&&!Qt.current){t=Dn(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===n){if(s.tag===1){u=kn(-1,r&-r),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}s.lanes|=r,u=s.alternate,u!==null&&(u.lanes|=r),Rd(s.return,r,t),a.lanes|=r;break}u=u.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(K(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Rd(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Dt(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Qs(t,r),i=Nr(i),n=n(i),t.flags|=1,Dt(e,t,n,r),t.child;case 14:return n=t.type,i=Mr(n,t.pendingProps),i=Mr(n.type,i),Ug(e,t,n,i,r);case 15:return Ox(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Mr(n,i),lc(e,t),t.tag=1,Yt(n)?(e=!0,Ac(t)):e=!1,Qs(t,r),Tx(t,n,i),Md(t,n,i,r),Ad(null,t,n,!0,e,r);case 19:return $x(e,t,r);case 22:return Ix(e,t,r)}throw Error(K(156,t.tag))};function nw(e,t){return R_(e,t)}function Ek(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function br(e,t,r,n){return new Ek(e,t,r,n)}function tm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jk(e){if(typeof e=="function")return tm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xp)return 11;if(e===wp)return 14}return 2}function mi(e,t){var r=e.alternate;return r===null?(r=br(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function hc(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")tm(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Rs:return Gi(r.children,i,s,t);case _p:o=8,i|=8;break;case rd:return e=br(12,r,t,i|2),e.elementType=rd,e.lanes=s,e;case nd:return e=br(13,r,t,i),e.elementType=nd,e.lanes=s,e;case id:return e=br(19,r,t,i),e.elementType=id,e.lanes=s,e;case f_:return _u(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h_:o=10;break e;case d_:o=9;break e;case xp:o=11;break e;case wp:o=14;break e;case qn:o=16,n=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=br(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function Gi(e,t,r,n){return e=br(7,e,n,t),e.lanes=r,e}function _u(e,t,r,n){return e=br(22,e,n,t),e.elementType=f_,e.lanes=r,e.stateNode={isHidden:!1},e}function fh(e,t,r){return e=br(6,e,null,t),e.lanes=r,e}function ph(e,t,r){return t=br(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Pk(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qu(0),this.expirationTimes=Qu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qu(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function rm(e,t,r,n,i,s,o,a,u){return e=new Pk(e,t,r,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=br(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fp(s),e}function Rk(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ps,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function iw(e){if(!e)return xi;e=e._reactInternals;e:{if(hs(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var r=e.type;if(Yt(r))return ix(e,r,t)}return t}function sw(e,t,r,n,i,s,o,a,u){return e=rm(r,n,!0,e,i,s,o,a,u),e.context=iw(null),r=e.current,n=Lt(),i=pi(r),s=kn(n,i),s.callback=t??null,di(r,s,i),e.current.lanes=i,tl(e,i,n),Xt(e,n),e}function xu(e,t,r,n){var i=t.current,s=Lt(),o=pi(i);return r=iw(r),t.context===null?t.context=r:t.pendingContext=r,t=kn(s,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=di(i,t,o),e!==null&&(Br(e,i,o,s),sc(e,i,o)),o}function Qc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function r0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function nm(e,t){r0(e,t),(e=e.alternate)&&r0(e,t)}function Dk(){return null}var ow=typeof reportError=="function"?reportError:function(e){console.error(e)};function im(e){this._internalRoot=e}wu.prototype.render=im.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));xu(e,t,null,null)};wu.prototype.unmount=im.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ns(function(){xu(null,e,null,null)}),t[Pn]=null}};function wu(e){this._internalRoot=e}wu.prototype.unstable_scheduleHydration=function(e){if(e){var t=I_();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Qn.length&&t!==0&&t<Qn[r].priority;r++);Qn.splice(r,0,e),r===0&&F_(e)}};function sm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Su(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function n0(){}function Mk(e,t,r,n,i){if(i){if(typeof n=="function"){var s=n;n=function(){var c=Qc(o);s.call(c)}}var o=sw(t,n,e,0,null,!1,!1,"",n0);return e._reactRootContainer=o,e[Pn]=o.current,Pa(e.nodeType===8?e.parentNode:e),ns(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var a=n;n=function(){var c=Qc(u);a.call(c)}}var u=rm(e,0,!1,null,null,!1,!1,"",n0);return e._reactRootContainer=u,e[Pn]=u.current,Pa(e.nodeType===8?e.parentNode:e),ns(function(){xu(t,u,r,n)}),u}function bu(e,t,r,n,i){var s=r._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var u=Qc(o);a.call(u)}}xu(t,o,e,i)}else o=Mk(r,t,e,i,n);return Qc(o)}A_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Jo(t.pendingLanes);r!==0&&(Cp(t,r|1),Xt(t,Ve()),!(_e&6)&&(yo=Ve()+500,Ni()))}break;case 13:ns(function(){var n=Rn(e,1);if(n!==null){var i=Lt();Br(n,e,1,i)}}),nm(e,1)}};kp=function(e){if(e.tag===13){var t=Rn(e,134217728);if(t!==null){var r=Lt();Br(t,e,134217728,r)}nm(e,134217728)}};O_=function(e){if(e.tag===13){var t=pi(e),r=Rn(e,t);if(r!==null){var n=Lt();Br(r,e,t,n)}nm(e,t)}};I_=function(){return Ce};B_=function(e,t){var r=Ce;try{return Ce=e,t()}finally{Ce=r}};pd=function(e,t,r){switch(t){case"input":if(ad(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=fu(n);if(!i)throw Error(K(90));m_(n),ad(n,i)}}}break;case"textarea":v_(e,r);break;case"select":t=r.value,t!=null&&Us(e,!!r.multiple,t,!1)}};C_=Jp;k_=ns;var Tk={usingClientEntryPoint:!1,Events:[nl,Ls,fu,S_,b_,Jp]},Fo={findFiberByHostInstance:Oi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Lk={bundleType:Fo.bundleType,version:Fo.version,rendererPackageName:Fo.rendererPackageName,rendererConfig:Fo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Tn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=j_(e),e===null?null:e.stateNode},findFiberByHostInstance:Fo.findFiberByHostInstance||Dk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tl.isDisabled&&Tl.supportsFiber)try{cu=Tl.inject(Lk),rn=Tl}catch{}}fr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tk;fr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!sm(t))throw Error(K(200));return Rk(e,t,null,r)};fr.createRoot=function(e,t){if(!sm(e))throw Error(K(299));var r=!1,n="",i=ow;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=rm(e,1,!1,null,null,r,!1,n,i),e[Pn]=t.current,Pa(e.nodeType===8?e.parentNode:e),new im(t)};fr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=j_(t),e=e===null?null:e.stateNode,e};fr.flushSync=function(e){return ns(e)};fr.hydrate=function(e,t,r){if(!Su(t))throw Error(K(200));return bu(null,e,t,!0,r)};fr.hydrateRoot=function(e,t,r){if(!sm(e))throw Error(K(405));var n=r!=null&&r.hydratedSources||null,i=!1,s="",o=ow;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=sw(t,null,e,1,r??null,i,!1,s,o),e[Pn]=t.current,Pa(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new wu(t)};fr.render=function(e,t,r){if(!Su(t))throw Error(K(200));return bu(null,e,t,!1,r)};fr.unmountComponentAtNode=function(e){if(!Su(e))throw Error(K(40));return e._reactRootContainer?(ns(function(){bu(null,null,e,!1,function(){e._reactRootContainer=null,e[Pn]=null})}),!0):!1};fr.unstable_batchedUpdates=Jp;fr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Su(r))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return bu(e,t,r,!1,n)};fr.version="18.3.1-next-f1338f8080-20240426";function aw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aw)}catch(e){console.error(e)}}aw(),a_.exports=fr;var ds=a_.exports;const Ak=Za(ds);var i0=ds;ed.createRoot=i0.createRoot,ed.hydrateRoot=i0.hydrateRoot;var ko=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ok={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Xn,up,Ay,Ik=(Ay=class{constructor(){ne(this,Xn,Ok);ne(this,up,!1)}setTimeoutProvider(e){G(this,Xn,e)}setTimeout(e,t){return P(this,Xn).setTimeout(e,t)}clearTimeout(e){P(this,Xn).clearTimeout(e)}setInterval(e,t){return P(this,Xn).setInterval(e,t)}clearInterval(e){P(this,Xn).clearInterval(e)}},Xn=new WeakMap,up=new WeakMap,Ay),Fi=new Ik;function Bk(e){setTimeout(e,0)}var is=typeof window>"u"||"Deno"in globalThis;function Mt(){}function Fk(e,t){return typeof e=="function"?e(t):e}function Vd(e){return typeof e=="number"&&e>=0&&e!==1/0}function lw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gi(e,t){return typeof e=="function"?e(t):e}function yr(e,t){return typeof e=="function"?e(t):e}function s0(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==om(o,t.options))return!1}else if(!Ba(t.queryKey,o))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function o0(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(ss(t.options.mutationKey)!==ss(s))return!1}else if(!Ba(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function om(e,t){return((t==null?void 0:t.queryKeyHashFn)||ss)(e)}function ss(e){return JSON.stringify(e,(t,r)=>Qd(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Ba(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ba(e[r],t[r])):!1}var zk=Object.prototype.hasOwnProperty;function cw(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=a0(e)&&a0(t);if(!n&&!(Qd(e)&&Qd(t)))return t;const s=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,u=n?new Array(a):{};let c=0;for(let h=0;h<a;h++){const d=n?h:o[h],f=e[d],p=t[d];if(f===p){u[d]=f,(n?h<s:zk.call(e,d))&&c++;continue}if(f===null||p===null||typeof f!="object"||typeof p!="object"){u[d]=p;continue}const m=cw(f,p,r+1);u[d]=m,m===f&&c++}return s===a&&c===s?e:u}function Yc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function a0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qd(e){if(!l0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!l0(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function l0(e){return Object.prototype.toString.call(e)==="[object Object]"}function $k(e){return new Promise(t=>{Fi.setTimeout(t,e)})}function Yd(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?cw(e,t):t}function Hk(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Wk(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var am=Symbol();function uw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===am?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function lm(e,t){return typeof e=="function"?e(...t):!!e}function Uk(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var $i,Gn,Zs,Oy,qk=(Oy=class extends ko{constructor(){super();ne(this,$i);ne(this,Gn);ne(this,Zs);G(this,Zs,t=>{if(!is&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){P(this,Gn)||this.setEventListener(P(this,Zs))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Gn))==null||t.call(this),G(this,Gn,void 0))}setEventListener(t){var r;G(this,Zs,t),(r=P(this,Gn))==null||r.call(this),G(this,Gn,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){P(this,$i)!==t&&(G(this,$i,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof P(this,$i)=="boolean"?P(this,$i):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$i=new WeakMap,Gn=new WeakMap,Zs=new WeakMap,Oy),cm=new qk;function Xd(){let e,t;const r=new Promise((i,s)=>{e=i,t=s});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var Kk=Bk;function Vk(){let e=[],t=0,r=a=>{a()},n=a=>{a()},i=Kk;const s=a=>{t?e.push(a):i(()=>{r(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{n(()=>{a.forEach(u=>{r(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||o()}return u},batchCalls:a=>(...u)=>{s(()=>{a(...u)})},schedule:s,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{i=a}}}var it=Vk(),eo,Jn,to,Iy,Qk=(Iy=class extends ko{constructor(){super();ne(this,eo,!0);ne(this,Jn);ne(this,to);G(this,to,t=>{if(!is&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){P(this,Jn)||this.setEventListener(P(this,to))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Jn))==null||t.call(this),G(this,Jn,void 0))}setEventListener(t){var r;G(this,to,t),(r=P(this,Jn))==null||r.call(this),G(this,Jn,t(this.setOnline.bind(this)))}setOnline(t){P(this,eo)!==t&&(G(this,eo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return P(this,eo)}},eo=new WeakMap,Jn=new WeakMap,to=new WeakMap,Iy),Xc=new Qk;function Yk(e){return Math.min(1e3*2**e,3e4)}function hw(e){return(e??"online")==="online"?Xc.isOnline():!0}var Gd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dw(e){let t=!1,r=0,n;const i=Xd(),s=()=>i.status!=="pending",o=y=>{var w;if(!s()){const g=new Gd(y);f(g),(w=e.onCancel)==null||w.call(e,g)}},a=()=>{t=!0},u=()=>{t=!1},c=()=>cm.isFocused()&&(e.networkMode==="always"||Xc.isOnline())&&e.canRun(),h=()=>hw(e.networkMode)&&e.canRun(),d=y=>{s()||(n==null||n(),i.resolve(y))},f=y=>{s()||(n==null||n(),i.reject(y))},p=()=>new Promise(y=>{var w;n=g=>{(s()||c())&&y(g)},(w=e.onPause)==null||w.call(e)}).then(()=>{var y;n=void 0,s()||(y=e.onContinue)==null||y.call(e)}),m=()=>{if(s())return;let y;const w=r===0?e.initialPromise:void 0;try{y=w??e.fn()}catch(g){y=Promise.reject(g)}Promise.resolve(y).then(d).catch(g=>{var b;if(s())return;const _=e.retry??(is?0:3),v=e.retryDelay??Yk,x=typeof v=="function"?v(r,g):v,k=_===!0||typeof _=="number"&&r<_||typeof _=="function"&&_(r,g);if(t||!k){f(g);return}r++,(b=e.onFail)==null||b.call(e,r,g),$k(x).then(()=>c()?void 0:p()).then(()=>{t?f(g):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n==null||n(),i),cancelRetry:a,continueRetry:u,canStart:h,start:()=>(h()?m():p().then(m),i)}}var Hi,By,fw=(By=class{constructor(){ne(this,Hi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vd(this.gcTime)&&G(this,Hi,Fi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(is?1/0:5*60*1e3))}clearGcTimeout(){P(this,Hi)&&(Fi.clearTimeout(P(this,Hi)),G(this,Hi,void 0))}},Hi=new WeakMap,By),Wi,ro,vr,Ui,at,Qa,qi,Tr,fn,Fy,Xk=(Fy=class extends fw{constructor(t){super();ne(this,Tr);ne(this,Wi);ne(this,ro);ne(this,vr);ne(this,Ui);ne(this,at);ne(this,Qa);ne(this,qi);G(this,qi,!1),G(this,Qa,t.defaultOptions),this.setOptions(t.options),this.observers=[],G(this,Ui,t.client),G(this,vr,P(this,Ui).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,G(this,Wi,u0(this.options)),this.state=t.state??P(this,Wi),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,at))==null?void 0:t.promise}setOptions(t){if(this.options={...P(this,Qa),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=u0(this.options);r.data!==void 0&&(this.setState(c0(r.data,r.dataUpdatedAt)),G(this,Wi,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,vr).remove(this)}setData(t,r){const n=Yd(this.state.data,t,this.options);return ce(this,Tr,fn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ce(this,Tr,fn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=P(this,at))==null?void 0:n.promise;return(i=P(this,at))==null||i.cancel(t),r?r.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,Wi))}isActive(){return this.observers.some(t=>yr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===am||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>gi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!lw(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,at))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,at))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,vr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(P(this,at)&&(P(this,qi)?P(this,at).cancel({revert:!0}):P(this,at).cancelRetry()),this.scheduleGc()),P(this,vr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,Tr,fn).call(this,{type:"invalidate"})}async fetch(t,r){var u,c,h,d,f,p,m,y,w,g,_,v;if(this.state.fetchStatus!=="idle"&&((u=P(this,at))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(P(this,at))return P(this,at).continueRetry(),P(this,at).promise}if(t&&this.setOptions(t),!this.options.queryFn){const x=this.observers.find(k=>k.options.queryFn);x&&this.setOptions(x.options)}const n=new AbortController,i=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(G(this,qi,!0),n.signal)})},s=()=>{const x=uw(this.options,r),b=(()=>{const E={client:P(this,Ui),queryKey:this.queryKey,meta:this.meta};return i(E),E})();return G(this,qi,!1),this.options.persister?this.options.persister(x,b,this):x(b)},a=(()=>{const x={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:P(this,Ui),state:this.state,fetchFn:s};return i(x),x})();(c=this.options.behavior)==null||c.onFetch(a,this),G(this,ro,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&ce(this,Tr,fn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),G(this,at,dw({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:x=>{x instanceof Gd&&x.revert&&this.setState({...P(this,ro),fetchStatus:"idle"}),n.abort()},onFail:(x,k)=>{ce(this,Tr,fn).call(this,{type:"failed",failureCount:x,error:k})},onPause:()=>{ce(this,Tr,fn).call(this,{type:"pause"})},onContinue:()=>{ce(this,Tr,fn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const x=await P(this,at).start();if(x===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(x),(p=(f=P(this,vr).config).onSuccess)==null||p.call(f,x,this),(y=(m=P(this,vr).config).onSettled)==null||y.call(m,x,this.state.error,this),x}catch(x){if(x instanceof Gd){if(x.silent)return P(this,at).promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw ce(this,Tr,fn).call(this,{type:"error",error:x}),(g=(w=P(this,vr).config).onError)==null||g.call(w,x,this),(v=(_=P(this,vr).config).onSettled)==null||v.call(_,this.state.data,x,this),x}finally{this.scheduleGc()}}},Wi=new WeakMap,ro=new WeakMap,vr=new WeakMap,Ui=new WeakMap,at=new WeakMap,Qa=new WeakMap,qi=new WeakMap,Tr=new WeakSet,fn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...pw(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...c0(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return G(this,ro,t.manual?i:void 0),i;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),it.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),P(this,vr).notify({query:this,type:"updated",action:t})})},Fy);function pw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function c0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function u0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Wt,ve,Ya,Pt,Ki,no,vn,Zn,Xa,io,so,Vi,Qi,ei,oo,be,ea,Jd,Zd,ef,tf,rf,nf,sf,mw,zy,Gk=(zy=class extends ko{constructor(t,r){super();ne(this,be);ne(this,Wt);ne(this,ve);ne(this,Ya);ne(this,Pt);ne(this,Ki);ne(this,no);ne(this,vn);ne(this,Zn);ne(this,Xa);ne(this,io);ne(this,so);ne(this,Vi);ne(this,Qi);ne(this,ei);ne(this,oo,new Set);this.options=r,G(this,Wt,t),G(this,Zn,null),G(this,vn,Xd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,ve).addObserver(this),h0(P(this,ve),this.options)?ce(this,be,ea).call(this):this.updateResult(),ce(this,be,tf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return of(P(this,ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return of(P(this,ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,be,rf).call(this),ce(this,be,nf).call(this),P(this,ve).removeObserver(this)}setOptions(t){const r=this.options,n=P(this,ve);if(this.options=P(this,Wt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yr(this.options.enabled,P(this,ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,be,sf).call(this),P(this,ve).setOptions(this.options),r._defaulted&&!Yc(this.options,r)&&P(this,Wt).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,ve),observer:this});const i=this.hasListeners();i&&d0(P(this,ve),n,this.options,r)&&ce(this,be,ea).call(this),this.updateResult(),i&&(P(this,ve)!==n||yr(this.options.enabled,P(this,ve))!==yr(r.enabled,P(this,ve))||gi(this.options.staleTime,P(this,ve))!==gi(r.staleTime,P(this,ve)))&&ce(this,be,Jd).call(this);const s=ce(this,be,Zd).call(this);i&&(P(this,ve)!==n||yr(this.options.enabled,P(this,ve))!==yr(r.enabled,P(this,ve))||s!==P(this,ei))&&ce(this,be,ef).call(this,s)}getOptimisticResult(t){const r=P(this,Wt).getQueryCache().build(P(this,Wt),t),n=this.createResult(r,t);return Zk(this,n)&&(G(this,Pt,n),G(this,no,this.options),G(this,Ki,P(this,ve).state)),n}getCurrentResult(){return P(this,Pt)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&P(this,vn).status==="pending"&&P(this,vn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){P(this,oo).add(t)}getCurrentQuery(){return P(this,ve)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=P(this,Wt).defaultQueryOptions(t),n=P(this,Wt).getQueryCache().build(P(this,Wt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ce(this,be,ea).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Pt)))}createResult(t,r){var F;const n=P(this,ve),i=this.options,s=P(this,Pt),o=P(this,Ki),a=P(this,no),c=t!==n?t.state:P(this,Ya),{state:h}=t;let d={...h},f=!1,p;if(r._optimisticResults){const D=this.hasListeners(),A=!D&&h0(t,r),j=D&&d0(t,n,r,i);(A||j)&&(d={...d,...pw(h.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:w}=d;p=d.data;let g=!1;if(r.placeholderData!==void 0&&p===void 0&&w==="pending"){let D;s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(D=s.data,g=!0):D=typeof r.placeholderData=="function"?r.placeholderData((F=P(this,so))==null?void 0:F.state.data,P(this,so)):r.placeholderData,D!==void 0&&(w="success",p=Yd(s==null?void 0:s.data,D,r),f=!0)}if(r.select&&p!==void 0&&!g)if(s&&p===(o==null?void 0:o.data)&&r.select===P(this,Xa))p=P(this,io);else try{G(this,Xa,r.select),p=r.select(p),p=Yd(s==null?void 0:s.data,p,r),G(this,io,p),G(this,Zn,null)}catch(D){G(this,Zn,D)}P(this,Zn)&&(m=P(this,Zn),p=P(this,io),y=Date.now(),w="error");const _=d.fetchStatus==="fetching",v=w==="pending",x=w==="error",k=v&&_,b=p!==void 0,L={status:w,fetchStatus:d.fetchStatus,isPending:v,isSuccess:w==="success",isError:x,isInitialLoading:k,isLoading:k,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:x&&!b,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&b,isStale:um(t,r),refetch:this.refetch,promise:P(this,vn),isEnabled:yr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=L.data!==void 0,A=L.status==="error"&&!D,j=T=>{A?T.reject(L.error):D&&T.resolve(L.data)},M=()=>{const T=G(this,vn,L.promise=Xd());j(T)},O=P(this,vn);switch(O.status){case"pending":t.queryHash===n.queryHash&&j(O);break;case"fulfilled":(A||L.data!==O.value)&&M();break;case"rejected":(!A||L.error!==O.reason)&&M();break}}return L}updateResult(){const t=P(this,Pt),r=this.createResult(P(this,ve),this.options);if(G(this,Ki,P(this,ve).state),G(this,no,this.options),P(this,Ki).data!==void 0&&G(this,so,P(this,ve)),Yc(r,t))return;G(this,Pt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!P(this,oo).size)return!0;const o=new Set(s??P(this,oo));return this.options.throwOnError&&o.add("error"),Object.keys(P(this,Pt)).some(a=>{const u=a;return P(this,Pt)[u]!==t[u]&&o.has(u)})};ce(this,be,mw).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,be,tf).call(this)}},Wt=new WeakMap,ve=new WeakMap,Ya=new WeakMap,Pt=new WeakMap,Ki=new WeakMap,no=new WeakMap,vn=new WeakMap,Zn=new WeakMap,Xa=new WeakMap,io=new WeakMap,so=new WeakMap,Vi=new WeakMap,Qi=new WeakMap,ei=new WeakMap,oo=new WeakMap,be=new WeakSet,ea=function(t){ce(this,be,sf).call(this);let r=P(this,ve).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Mt)),r},Jd=function(){ce(this,be,rf).call(this);const t=gi(this.options.staleTime,P(this,ve));if(is||P(this,Pt).isStale||!Vd(t))return;const n=lw(P(this,Pt).dataUpdatedAt,t)+1;G(this,Vi,Fi.setTimeout(()=>{P(this,Pt).isStale||this.updateResult()},n))},Zd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,ve)):this.options.refetchInterval)??!1},ef=function(t){ce(this,be,nf).call(this),G(this,ei,t),!(is||yr(this.options.enabled,P(this,ve))===!1||!Vd(P(this,ei))||P(this,ei)===0)&&G(this,Qi,Fi.setInterval(()=>{(this.options.refetchIntervalInBackground||cm.isFocused())&&ce(this,be,ea).call(this)},P(this,ei)))},tf=function(){ce(this,be,Jd).call(this),ce(this,be,ef).call(this,ce(this,be,Zd).call(this))},rf=function(){P(this,Vi)&&(Fi.clearTimeout(P(this,Vi)),G(this,Vi,void 0))},nf=function(){P(this,Qi)&&(Fi.clearInterval(P(this,Qi)),G(this,Qi,void 0))},sf=function(){const t=P(this,Wt).getQueryCache().build(P(this,Wt),this.options);if(t===P(this,ve))return;const r=P(this,ve);G(this,ve,t),G(this,Ya,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},mw=function(t){it.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(P(this,Pt))}),P(this,Wt).getQueryCache().notify({query:P(this,ve),type:"observerResultsUpdated"})})},zy);function Jk(e,t){return yr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function h0(e,t){return Jk(e,t)||e.state.data!==void 0&&of(e,t,t.refetchOnMount)}function of(e,t,r){if(yr(t.enabled,e)!==!1&&gi(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&um(e,t)}return!1}function d0(e,t,r,n){return(e!==t||yr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&um(e,r)}function um(e,t){return yr(t.enabled,e)!==!1&&e.isStaleByTime(gi(t.staleTime,e))}function Zk(e,t){return!Yc(e.getCurrentResult(),t)}function f0(e){return{onFetch:(t,r)=>{var h,d,f,p,m;const n=t.options,i=(f=(d=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],o=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const c=async()=>{let y=!1;const w=v=>{Uk(v,()=>t.signal,()=>y=!0)},g=uw(t.options,t.fetchOptions),_=async(v,x,k)=>{if(y)return Promise.reject();if(x==null&&v.pages.length)return Promise.resolve(v);const E=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:x,direction:k?"backward":"forward",meta:t.options.meta};return w(A),A})(),L=await g(E),{maxPages:F}=t.options,D=k?Wk:Hk;return{pages:D(v.pages,L,F),pageParams:D(v.pageParams,x,F)}};if(i&&s.length){const v=i==="backward",x=v?e2:p0,k={pages:s,pageParams:o},b=x(n,k);a=await _(k,b,v)}else{const v=e??s.length;do{const x=u===0?o[0]??n.initialPageParam:p0(n,a);if(u>0&&x==null)break;a=await _(a,x),u++}while(u<v)}return a};t.options.persister?t.fetchFn=()=>{var y,w;return(w=(y=t.options).persister)==null?void 0:w.call(y,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=c}}}function p0(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function e2(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ga,Yr,Rt,Yi,Xr,Wn,$y,t2=($y=class extends fw{constructor(t){super();ne(this,Xr);ne(this,Ga);ne(this,Yr);ne(this,Rt);ne(this,Yi);G(this,Ga,t.client),this.mutationId=t.mutationId,G(this,Rt,t.mutationCache),G(this,Yr,[]),this.state=t.state||gw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,Yr).includes(t)||(P(this,Yr).push(t),this.clearGcTimeout(),P(this,Rt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){G(this,Yr,P(this,Yr).filter(r=>r!==t)),this.scheduleGc(),P(this,Rt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,Yr).length||(this.state.status==="pending"?this.scheduleGc():P(this,Rt).remove(this))}continue(){var t;return((t=P(this,Yi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,u,c,h,d,f,p,m,y,w,g,_,v,x,k,b,E,L,F;const r=()=>{ce(this,Xr,Wn).call(this,{type:"continue"})},n={client:P(this,Ga),meta:this.options.meta,mutationKey:this.options.mutationKey};G(this,Yi,dw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(D,A)=>{ce(this,Xr,Wn).call(this,{type:"failed",failureCount:D,error:A})},onPause:()=>{ce(this,Xr,Wn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,Rt).canRun(this)}));const i=this.state.status==="pending",s=!P(this,Yi).canStart();try{if(i)r();else{ce(this,Xr,Wn).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=P(this,Rt).config).onMutate)==null?void 0:a.call(o,t,this,n));const A=await((c=(u=this.options).onMutate)==null?void 0:c.call(u,t,n));A!==this.state.context&&ce(this,Xr,Wn).call(this,{type:"pending",context:A,variables:t,isPaused:s})}const D=await P(this,Yi).start();return await((d=(h=P(this,Rt).config).onSuccess)==null?void 0:d.call(h,D,t,this.state.context,this,n)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,D,t,this.state.context,n)),await((y=(m=P(this,Rt).config).onSettled)==null?void 0:y.call(m,D,null,this.state.variables,this.state.context,this,n)),await((g=(w=this.options).onSettled)==null?void 0:g.call(w,D,null,t,this.state.context,n)),ce(this,Xr,Wn).call(this,{type:"success",data:D}),D}catch(D){try{await((v=(_=P(this,Rt).config).onError)==null?void 0:v.call(_,D,t,this.state.context,this,n))}catch(A){Promise.reject(A)}try{await((k=(x=this.options).onError)==null?void 0:k.call(x,D,t,this.state.context,n))}catch(A){Promise.reject(A)}try{await((E=(b=P(this,Rt).config).onSettled)==null?void 0:E.call(b,void 0,D,this.state.variables,this.state.context,this,n))}catch(A){Promise.reject(A)}try{await((F=(L=this.options).onSettled)==null?void 0:F.call(L,void 0,D,t,this.state.context,n))}catch(A){Promise.reject(A)}throw ce(this,Xr,Wn).call(this,{type:"error",error:D}),D}finally{P(this,Rt).runNext(this)}}},Ga=new WeakMap,Yr=new WeakMap,Rt=new WeakMap,Yi=new WeakMap,Xr=new WeakSet,Wn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),it.batch(()=>{P(this,Yr).forEach(n=>{n.onMutationUpdate(t)}),P(this,Rt).notify({mutation:this,type:"updated",action:t})})},$y);function gw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yn,Lr,Ja,Hy,r2=(Hy=class extends ko{constructor(t={}){super();ne(this,yn);ne(this,Lr);ne(this,Ja);this.config=t,G(this,yn,new Set),G(this,Lr,new Map),G(this,Ja,0)}build(t,r,n){const i=new t2({client:t,mutationCache:this,mutationId:++gl(this,Ja)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){P(this,yn).add(t);const r=Ll(t);if(typeof r=="string"){const n=P(this,Lr).get(r);n?n.push(t):P(this,Lr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,yn).delete(t)){const r=Ll(t);if(typeof r=="string"){const n=P(this,Lr).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&P(this,Lr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Ll(t);if(typeof r=="string"){const n=P(this,Lr).get(r),i=n==null?void 0:n.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=Ll(t);if(typeof r=="string"){const i=(n=P(this,Lr).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){it.batch(()=>{P(this,yn).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,yn).clear(),P(this,Lr).clear()})}getAll(){return Array.from(P(this,yn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>o0(r,n))}findAll(t={}){return this.getAll().filter(r=>o0(t,r))}notify(t){it.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return it.batch(()=>Promise.all(t.map(r=>r.continue().catch(Mt))))}},yn=new WeakMap,Lr=new WeakMap,Ja=new WeakMap,Hy);function Ll(e){var t;return(t=e.options.scope)==null?void 0:t.id}var _n,ti,Ut,xn,En,dc,af,Wy,n2=(Wy=class extends ko{constructor(r,n){super();ne(this,En);ne(this,_n);ne(this,ti);ne(this,Ut);ne(this,xn);G(this,_n,r),this.setOptions(n),this.bindMethods(),ce(this,En,dc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=P(this,_n).defaultMutationOptions(r),Yc(this.options,n)||P(this,_n).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,Ut),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&ss(n.mutationKey)!==ss(this.options.mutationKey)?this.reset():((i=P(this,Ut))==null?void 0:i.state.status)==="pending"&&P(this,Ut).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=P(this,Ut))==null||r.removeObserver(this)}onMutationUpdate(r){ce(this,En,dc).call(this),ce(this,En,af).call(this,r)}getCurrentResult(){return P(this,ti)}reset(){var r;(r=P(this,Ut))==null||r.removeObserver(this),G(this,Ut,void 0),ce(this,En,dc).call(this),ce(this,En,af).call(this)}mutate(r,n){var i;return G(this,xn,n),(i=P(this,Ut))==null||i.removeObserver(this),G(this,Ut,P(this,_n).getMutationCache().build(P(this,_n),this.options)),P(this,Ut).addObserver(this),P(this,Ut).execute(r)}},_n=new WeakMap,ti=new WeakMap,Ut=new WeakMap,xn=new WeakMap,En=new WeakSet,dc=function(){var n;const r=((n=P(this,Ut))==null?void 0:n.state)??gw();G(this,ti,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},af=function(r){it.batch(()=>{var n,i,s,o,a,u,c,h;if(P(this,xn)&&this.hasListeners()){const d=P(this,ti).variables,f=P(this,ti).context,p={client:P(this,_n),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(i=(n=P(this,xn)).onSuccess)==null||i.call(n,r.data,d,f,p)}catch(m){Promise.reject(m)}try{(o=(s=P(this,xn)).onSettled)==null||o.call(s,r.data,null,d,f,p)}catch(m){Promise.reject(m)}}else if((r==null?void 0:r.type)==="error"){try{(u=(a=P(this,xn)).onError)==null||u.call(a,r.error,d,f,p)}catch(m){Promise.reject(m)}try{(h=(c=P(this,xn)).onSettled)==null||h.call(c,void 0,r.error,d,f,p)}catch(m){Promise.reject(m)}}}this.listeners.forEach(d=>{d(P(this,ti))})})},Wy),Gr,Uy,i2=(Uy=class extends ko{constructor(t={}){super();ne(this,Gr);this.config=t,G(this,Gr,new Map)}build(t,r,n){const i=r.queryKey,s=r.queryHash??om(i,r);let o=this.get(s);return o||(o=new Xk({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){P(this,Gr).has(t.queryHash)||(P(this,Gr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=P(this,Gr).get(t.queryHash);r&&(t.destroy(),r===t&&P(this,Gr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){it.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,Gr).get(t)}getAll(){return[...P(this,Gr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>s0(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>s0(t,n)):r}notify(t){it.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){it.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){it.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Gr=new WeakMap,Uy),$e,ri,ni,ao,lo,ii,co,uo,qy,s2=(qy=class{constructor(e={}){ne(this,$e);ne(this,ri);ne(this,ni);ne(this,ao);ne(this,lo);ne(this,ii);ne(this,co);ne(this,uo);G(this,$e,e.queryCache||new i2),G(this,ri,e.mutationCache||new r2),G(this,ni,e.defaultOptions||{}),G(this,ao,new Map),G(this,lo,new Map),G(this,ii,0)}mount(){gl(this,ii)._++,P(this,ii)===1&&(G(this,co,cm.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,$e).onFocus())})),G(this,uo,Xc.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,$e).onOnline())})))}unmount(){var e,t;gl(this,ii)._--,P(this,ii)===0&&((e=P(this,co))==null||e.call(this),G(this,co,void 0),(t=P(this,uo))==null||t.call(this),G(this,uo,void 0))}isFetching(e){return P(this,$e).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,ri).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=P(this,$e).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=P(this,$e).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(gi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return P(this,$e).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=P(this,$e).get(n.queryHash),s=i==null?void 0:i.state.data,o=Fk(t,s);if(o!==void 0)return P(this,$e).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return it.batch(()=>P(this,$e).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=P(this,$e).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=P(this,$e);it.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=P(this,$e);return it.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=it.batch(()=>P(this,$e).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Mt).catch(Mt)}invalidateQueries(e,t={}){return it.batch(()=>(P(this,$e).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=it.batch(()=>P(this,$e).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Mt)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Mt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=P(this,$e).build(this,t);return r.isStaleByTime(gi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mt).catch(Mt)}fetchInfiniteQuery(e){return e.behavior=f0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mt).catch(Mt)}ensureInfiniteQueryData(e){return e.behavior=f0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Xc.isOnline()?P(this,ri).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,$e)}getMutationCache(){return P(this,ri)}getDefaultOptions(){return P(this,ni)}setDefaultOptions(e){G(this,ni,e)}setQueryDefaults(e,t){P(this,ao).set(ss(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,ao).values()],r={};return t.forEach(n=>{Ba(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){P(this,lo).set(ss(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,lo).values()],r={};return t.forEach(n=>{Ba(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,ni).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=om(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===am&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,ni).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,$e).clear(),P(this,ri).clear()}},$e=new WeakMap,ri=new WeakMap,ni=new WeakMap,ao=new WeakMap,lo=new WeakMap,ii=new WeakMap,co=new WeakMap,uo=new WeakMap,qy),vw=S.createContext(void 0),Jt=e=>{const t=S.useContext(vw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},o2=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(vw.Provider,{value:e,children:t})),yw=S.createContext(!1),a2=()=>S.useContext(yw);yw.Provider;function l2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var c2=S.createContext(l2()),u2=()=>S.useContext(c2),h2=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?lm(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},d2=e=>{S.useEffect(()=>{e.clearReset()},[e])},f2=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||lm(r,[e.error,n])),p2=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},m2=(e,t)=>e.isLoading&&e.isFetching&&!t,g2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,m0=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function v2(e,t,r){var f,p,m,y;const n=a2(),i=u2(),s=Jt(),o=s.defaultQueryOptions(e);(p=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,o);const a=s.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",p2(o),h2(o,i,a),d2(i);const u=!s.getQueryCache().get(o.queryHash),[c]=S.useState(()=>new t(s,o)),h=c.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(w=>{const g=d?c.subscribe(it.batchCalls(w)):Mt;return c.updateResult(),g},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),S.useEffect(()=>{c.setOptions(o)},[o,c]),g2(o,h))throw m0(o,c,i);if(f2({result:h,errorResetBoundary:i,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw h.error;if((y=(m=s.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,h),o.experimental_prefetchInRender&&!is&&m2(h,n)){const w=u?m0(o,c,i):a==null?void 0:a.promise;w==null||w.catch(Mt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?h:c.trackResult(h)}function he(e,t){return v2(e,Gk)}function ue(e,t){const r=Jt(),[n]=S.useState(()=>new n2(r,e));S.useEffect(()=>{n.setOptions(e)},[n,e]);const i=S.useSyncExternalStore(S.useCallback(o=>n.subscribe(it.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=S.useCallback((o,a)=>{n.mutate(o,a).catch(Mt)},[n]);if(i.error&&lm(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const g0=["backlog","todo","planning","in_progress","in_review","done"],mn={Backlog:"backlog",Triage:"backlog",Unknown:"backlog",Todo:"todo","To Do":"todo",Ready:"todo",Unstarted:"todo","In Planning":"planning",Planning:"planning",Planned:"planning",Discovery:"planning","In Progress":"in_progress",Started:"in_progress",Active:"in_progress","In Review":"in_review",Review:"in_review",QA:"in_review",Testing:"in_review",Done:"done",Completed:"done",Closed:"done",Canceled:"canceled",Cancelled:"canceled",Duplicate:"canceled","Won't Do":"canceled",Wontfix:"canceled"};/**
|
|
41
|
+
* @license lucide-react v0.400.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const y2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_w=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
|
|
46
|
+
* @license lucide-react v0.400.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/var _2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
51
|
+
* @license lucide-react v0.400.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const x2=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:o,...a},u)=>S.createElement("svg",{ref:u,..._2,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:_w("lucide",i),...a},[...o.map(([c,h])=>S.createElement(c,h)),...Array.isArray(s)?s:[s]]));/**
|
|
56
|
+
* @license lucide-react v0.400.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const re=(e,t)=>{const r=S.forwardRef(({className:n,...i},s)=>S.createElement(x2,{ref:s,iconNode:t,className:_w(`lucide-${y2(e)}`,n),...i}));return r.displayName=`${e}`,r};/**
|
|
61
|
+
* @license lucide-react v0.400.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const _o=re("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
66
|
+
* @license lucide-react v0.400.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const hm=re("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
|
|
71
|
+
* @license lucide-react v0.400.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const lf=re("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
76
|
+
* @license lucide-react v0.400.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const w2=re("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
81
|
+
* @license lucide-react v0.400.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const S2=re("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
86
|
+
* @license lucide-react v0.400.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const xw=re("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
|
|
91
|
+
* @license lucide-react v0.400.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const ww=re("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
|
|
96
|
+
* @license lucide-react v0.400.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const b2=re("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
101
|
+
* @license lucide-react v0.400.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const Gc=re("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
106
|
+
* @license lucide-react v0.400.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const Sw=re("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
111
|
+
* @license lucide-react v0.400.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const C2=re("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
116
|
+
* @license lucide-react v0.400.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const k2=re("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
|
|
121
|
+
* @license lucide-react v0.400.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const $s=re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
126
|
+
* @license lucide-react v0.400.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const N2=re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
131
|
+
* @license lucide-react v0.400.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const E2=re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
136
|
+
* @license lucide-react v0.400.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const xo=re("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
141
|
+
* @license lucide-react v0.400.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const Fa=re("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
146
|
+
* @license lucide-react v0.400.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const Ns=re("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
151
|
+
* @license lucide-react v0.400.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const j2=re("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
156
|
+
* @license lucide-react v0.400.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const P2=re("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]);/**
|
|
161
|
+
* @license lucide-react v0.400.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const Cu=re("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
166
|
+
* @license lucide-react v0.400.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const R2=re("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
171
|
+
* @license lucide-react v0.400.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const za=re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
176
|
+
* @license lucide-react v0.400.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const bw=re("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
181
|
+
* @license lucide-react v0.400.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const Cw=re("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
186
|
+
* @license lucide-react v0.400.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const kw=re("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
191
|
+
* @license lucide-react v0.400.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const sl=re("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
196
|
+
* @license lucide-react v0.400.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const ol=re("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
201
|
+
* @license lucide-react v0.400.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const Nw=re("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
206
|
+
* @license lucide-react v0.400.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const fc=re("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
211
|
+
* @license lucide-react v0.400.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const D2=re("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
216
|
+
* @license lucide-react v0.400.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const M2=re("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
221
|
+
* @license lucide-react v0.400.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const dm=re("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
226
|
+
* @license lucide-react v0.400.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const ma=re("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
231
|
+
* @license lucide-react v0.400.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const T2=re("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);/**
|
|
236
|
+
* @license lucide-react v0.400.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const fm=re("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
|
|
241
|
+
* @license lucide-react v0.400.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const cf=re("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
246
|
+
* @license lucide-react v0.400.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const L2=re("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
251
|
+
* @license lucide-react v0.400.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const A2=re("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
256
|
+
* @license lucide-react v0.400.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const Ew=re("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
|
|
261
|
+
* @license lucide-react v0.400.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const Se=re("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
266
|
+
* @license lucide-react v0.400.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const O2=re("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
271
|
+
* @license lucide-react v0.400.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const I2=re("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
276
|
+
* @license lucide-react v0.400.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const B2=re("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
281
|
+
* @license lucide-react v0.400.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const F2=re("MoveDown",[["path",{d:"M8 18L12 22L16 18",key:"cskvfv"}],["path",{d:"M12 2V22",key:"r89rzk"}]]);/**
|
|
286
|
+
* @license lucide-react v0.400.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const z2=re("MoveUp",[["path",{d:"M8 6L12 2L16 6",key:"1yvkyx"}],["path",{d:"M12 2V22",key:"r89rzk"}]]);/**
|
|
291
|
+
* @license lucide-react v0.400.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const Tt=re("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
296
|
+
* @license lucide-react v0.400.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const $2=re("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
|
|
301
|
+
* @license lucide-react v0.400.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const bn=re("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
306
|
+
* @license lucide-react v0.400.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const pm=re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
311
|
+
* @license lucide-react v0.400.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const H2=re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
316
|
+
* @license lucide-react v0.400.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const jw=re("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
321
|
+
* @license lucide-react v0.400.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const W2=re("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
326
|
+
* @license lucide-react v0.400.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const U2=re("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
331
|
+
* @license lucide-react v0.400.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const uf=re("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
336
|
+
* @license lucide-react v0.400.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const $a=re("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
341
|
+
* @license lucide-react v0.400.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const Pw=re("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
346
|
+
* @license lucide-react v0.400.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const wi=re("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
351
|
+
* @license lucide-react v0.400.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const Rw=re("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
356
|
+
* @license lucide-react v0.400.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const Dw=re("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
361
|
+
* @license lucide-react v0.400.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const Mn=re("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
366
|
+
* @license lucide-react v0.400.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const Mw=re("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
371
|
+
* @license lucide-react v0.400.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const Tw=re("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
376
|
+
* @license lucide-react v0.400.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const Vt=re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var ku={exports:{}},Lw={},Aw={exports:{}},q2="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",K2=q2,V2=K2;function Ow(){}function Iw(){}Iw.resetWarningCache=Ow;var Q2=function(){function e(n,i,s,o,a,u){if(u!==V2){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Iw,resetWarningCache:Ow};return r.PropTypes=r,r};Aw.exports=Q2();var Bw=Aw.exports;function Fw(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Fw(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function v0(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Fw(e))&&(n&&(n+=" "),n+=t);return n}const Y2=Object.freeze(Object.defineProperty({__proto__:null,clsx:v0,default:v0},Symbol.toStringTag,{value:"Module"})),X2=cb(Y2);var Ue={},ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.dontSetMe=tN;ln.findInArray=G2;ln.int=eN;ln.isFunction=J2;ln.isNum=Z2;function G2(e,t){for(let r=0,n=e.length;r<n;r++)if(t.apply(t,[e[r],r,e]))return e[r]}function J2(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Z2(e){return typeof e=="number"&&!isNaN(e)}function eN(e){return parseInt(e,10)}function tN(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))}var fs={};Object.defineProperty(fs,"__esModule",{value:!0});fs.browserPrefixToKey=$w;fs.browserPrefixToStyle=rN;fs.default=void 0;fs.getPrefix=zw;const mh=["Moz","Webkit","O","ms"];function zw(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const r=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!r||t in r)return"";for(let n=0;n<mh.length;n++)if($w(t,mh[n])in r)return mh[n];return""}function $w(e,t){return t?"".concat(t).concat(nN(e)):e}function rN(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function nN(e){let t="",r=!0;for(let n=0;n<e.length;n++)r?(t+=e[n].toUpperCase(),r=!1):e[n]==="-"?r=!0:t+=e[n];return t}fs.default=zw();Object.defineProperty(Ue,"__esModule",{value:!0});Ue.addClassName=Uw;Ue.addEvent=oN;Ue.addUserSelectStyles=vN;Ue.createCSSTransform=fN;Ue.createSVGTransform=pN;Ue.getTouch=mN;Ue.getTouchIdentifier=gN;Ue.getTranslation=mm;Ue.innerHeight=uN;Ue.innerWidth=hN;Ue.matchesSelector=Ww;Ue.matchesSelectorAndParentsTo=sN;Ue.offsetXYFromParent=dN;Ue.outerHeight=lN;Ue.outerWidth=cN;Ue.removeClassName=qw;Ue.removeEvent=aN;Ue.removeUserSelectStyles=yN;var hr=ln,y0=iN(fs);function Hw(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Hw=function(n){return n?r:t})(e)}function iN(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Hw(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(s!=="default"&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}let Al="";function Ww(e,t){return Al||(Al=(0,hr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(r){return(0,hr.isFunction)(e[r])})),(0,hr.isFunction)(e[Al])?e[Al](t):!1}function sN(e,t,r){let n=e;do{if(Ww(n,t))return!0;if(n===r)return!1;n=n.parentNode}while(n);return!1}function oN(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.addEventListener?e.addEventListener(t,r,i):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r}function aN(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null}function lN(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,hr.int)(r.borderTopWidth),t+=(0,hr.int)(r.borderBottomWidth),t}function cN(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,hr.int)(r.borderLeftWidth),t+=(0,hr.int)(r.borderRightWidth),t}function uN(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,hr.int)(r.paddingTop),t-=(0,hr.int)(r.paddingBottom),t}function hN(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,hr.int)(r.paddingLeft),t-=(0,hr.int)(r.paddingRight),t}function dN(e,t,r){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),s=(e.clientX+t.scrollLeft-i.left)/r,o=(e.clientY+t.scrollTop-i.top)/r;return{x:s,y:o}}function fN(e,t){const r=mm(e,t,"px");return{[(0,y0.browserPrefixToKey)("transform",y0.default)]:r}}function pN(e,t){return mm(e,t,"")}function mm(e,t,r){let{x:n,y:i}=e,s="translate(".concat(n).concat(r,",").concat(i).concat(r,")");if(t){const o="".concat(typeof t.x=="string"?t.x:t.x+r),a="".concat(typeof t.y=="string"?t.y:t.y+r);s="translate(".concat(o,", ").concat(a,")")+s}return s}function mN(e,t){return e.targetTouches&&(0,hr.findInArray)(e.targetTouches,r=>t===r.identifier)||e.changedTouches&&(0,hr.findInArray)(e.changedTouches,r=>t===r.identifier)}function gN(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function vN(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
381
|
+
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
382
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&Uw(e.body,"react-draggable-transparent-selection")}function yN(e){if(e)try{if(e.body&&qw(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function Uw(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function qw(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.canDragX=wN;cn.canDragY=SN;cn.createCoreData=CN;cn.createDraggableData=kN;cn.getBoundPosition=_N;cn.getControlPosition=bN;cn.snapToGrid=xN;var sr=ln,Hs=Ue;function _N(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:n}=e.props;n=typeof n=="string"?n:NN(n);const i=gm(e);if(typeof n=="string"){const{ownerDocument:s}=i,o=s.defaultView;let a;if(n==="parent"?a=i.parentNode:a=s.querySelector(n),!(a instanceof o.HTMLElement))throw new Error('Bounds selector "'+n+'" could not find an element.');const u=a,c=o.getComputedStyle(i),h=o.getComputedStyle(u);n={left:-i.offsetLeft+(0,sr.int)(h.paddingLeft)+(0,sr.int)(c.marginLeft),top:-i.offsetTop+(0,sr.int)(h.paddingTop)+(0,sr.int)(c.marginTop),right:(0,Hs.innerWidth)(u)-(0,Hs.outerWidth)(i)-i.offsetLeft+(0,sr.int)(h.paddingRight)-(0,sr.int)(c.marginRight),bottom:(0,Hs.innerHeight)(u)-(0,Hs.outerHeight)(i)-i.offsetTop+(0,sr.int)(h.paddingBottom)-(0,sr.int)(c.marginBottom)}}return(0,sr.isNum)(n.right)&&(t=Math.min(t,n.right)),(0,sr.isNum)(n.bottom)&&(r=Math.min(r,n.bottom)),(0,sr.isNum)(n.left)&&(t=Math.max(t,n.left)),(0,sr.isNum)(n.top)&&(r=Math.max(r,n.top)),[t,r]}function xN(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]}function wN(e){return e.props.axis==="both"||e.props.axis==="x"}function SN(e){return e.props.axis==="both"||e.props.axis==="y"}function bN(e,t,r){const n=typeof t=="number"?(0,Hs.getTouch)(e,t):null;if(typeof t=="number"&&!n)return null;const i=gm(r),s=r.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,Hs.offsetXYFromParent)(n||e,s,r.props.scale)}function CN(e,t,r){const n=!(0,sr.isNum)(e.lastX),i=gm(e);return n?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:i,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}}function kN(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}}function NN(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function gm(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Nu={},Eu={};Object.defineProperty(Eu,"__esModule",{value:!0});Eu.default=EN;function EN(){}Object.defineProperty(Nu,"__esModule",{value:!0});Nu.default=void 0;var gh=PN(S),zt=vm(Bw),jN=vm(ds),St=Ue,In=cn,vh=ln,zo=vm(Eu);function vm(e){return e&&e.__esModule?e:{default:e}}function Kw(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Kw=function(n){return n?r:t})(e)}function PN(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Kw(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(s!=="default"&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}function jt(e,t,r){return t=RN(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RN(e){var t=DN(e,"string");return typeof t=="symbol"?t:String(t)}function DN(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Rr={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Bn=Rr.mouse,ju=class extends gh.Component{constructor(){super(...arguments),jt(this,"dragging",!1),jt(this,"lastX",NaN),jt(this,"lastY",NaN),jt(this,"touchIdentifier",null),jt(this,"mounted",!1),jt(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const r=this.findDOMNode();if(!r||!r.ownerDocument||!r.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=r;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!(0,St.matchesSelectorAndParentsTo)(t.target,this.props.handle,r)||this.props.cancel&&(0,St.matchesSelectorAndParentsTo)(t.target,this.props.cancel,r))return;t.type==="touchstart"&&t.preventDefault();const i=(0,St.getTouchIdentifier)(t);this.touchIdentifier=i;const s=(0,In.getControlPosition)(t,i,this);if(s==null)return;const{x:o,y:a}=s,u=(0,In.createCoreData)(this,o,a);(0,zo.default)("DraggableCore: handleDragStart: %j",u),(0,zo.default)("calling",this.props.onStart),!(this.props.onStart(t,u)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,St.addUserSelectStyles)(n),this.dragging=!0,this.lastX=o,this.lastY=a,(0,St.addEvent)(n,Bn.move,this.handleDrag),(0,St.addEvent)(n,Bn.stop,this.handleDragStop))}),jt(this,"handleDrag",t=>{const r=(0,In.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let a=n-this.lastX,u=i-this.lastY;if([a,u]=(0,In.snapToGrid)(this.props.grid,a,u),!a&&!u)return;n=this.lastX+a,i=this.lastY+u}const s=(0,In.createCoreData)(this,n,i);if((0,zo.default)("DraggableCore: handleDrag: %j",s),this.props.onDrag(t,s)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const u=document.createEvent("MouseEvents");u.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(u)}return}this.lastX=n,this.lastY=i}),jt(this,"handleDragStop",t=>{if(!this.dragging)return;const r=(0,In.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let u=n-this.lastX||0,c=i-this.lastY||0;[u,c]=(0,In.snapToGrid)(this.props.grid,u,c),n=this.lastX+u,i=this.lastY+c}const s=(0,In.createCoreData)(this,n,i);if(this.props.onStop(t,s)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,St.removeUserSelectStyles)(a.ownerDocument),(0,zo.default)("DraggableCore: handleDragStop: %j",s),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,zo.default)("DraggableCore: Removing handlers"),(0,St.removeEvent)(a.ownerDocument,Bn.move,this.handleDrag),(0,St.removeEvent)(a.ownerDocument,Bn.stop,this.handleDragStop))}),jt(this,"onMouseDown",t=>(Bn=Rr.mouse,this.handleDragStart(t))),jt(this,"onMouseUp",t=>(Bn=Rr.mouse,this.handleDragStop(t))),jt(this,"onTouchStart",t=>(Bn=Rr.touch,this.handleDragStart(t))),jt(this,"onTouchEnd",t=>(Bn=Rr.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,St.addEvent)(t,Rr.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:r}=t;(0,St.removeEvent)(r,Rr.mouse.move,this.handleDrag),(0,St.removeEvent)(r,Rr.touch.move,this.handleDrag),(0,St.removeEvent)(r,Rr.mouse.stop,this.handleDragStop),(0,St.removeEvent)(r,Rr.touch.stop,this.handleDragStop),(0,St.removeEvent)(t,Rr.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,St.removeUserSelectStyles)(r)}}findDOMNode(){var t,r;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(r=this.props)===null||r===void 0||(r=r.nodeRef)===null||r===void 0?void 0:r.current:jN.default.findDOMNode(this)}render(){return gh.cloneElement(gh.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Nu.default=ju;jt(ju,"displayName","DraggableCore");jt(ju,"propTypes",{allowAnyClick:zt.default.bool,children:zt.default.node.isRequired,disabled:zt.default.bool,enableUserSelectHack:zt.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:zt.default.arrayOf(zt.default.number),handle:zt.default.string,cancel:zt.default.string,nodeRef:zt.default.object,onStart:zt.default.func,onDrag:zt.default.func,onStop:zt.default.func,onMouseDown:zt.default.func,scale:zt.default.number,className:vh.dontSetMe,style:vh.dontSetMe,transform:vh.dontSetMe});jt(ju,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),e.default=void 0;var t=f(S),r=h(Bw),n=h(ds),i=h(X2),s=Ue,o=cn,a=ln,u=h(Nu),c=h(Eu);function h(_){return _&&_.__esModule?_:{default:_}}function d(_){if(typeof WeakMap!="function")return null;var v=new WeakMap,x=new WeakMap;return(d=function(k){return k?x:v})(_)}function f(_,v){if(_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var x=d(v);if(x&&x.has(_))return x.get(_);var k={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in _)if(E!=="default"&&Object.prototype.hasOwnProperty.call(_,E)){var L=b?Object.getOwnPropertyDescriptor(_,E):null;L&&(L.get||L.set)?Object.defineProperty(k,E,L):k[E]=_[E]}return k.default=_,x&&x.set(_,k),k}function p(){return p=Object.assign?Object.assign.bind():function(_){for(var v=1;v<arguments.length;v++){var x=arguments[v];for(var k in x)Object.prototype.hasOwnProperty.call(x,k)&&(_[k]=x[k])}return _},p.apply(this,arguments)}function m(_,v,x){return v=y(v),v in _?Object.defineProperty(_,v,{value:x,enumerable:!0,configurable:!0,writable:!0}):_[v]=x,_}function y(_){var v=w(_,"string");return typeof v=="symbol"?v:String(v)}function w(_,v){if(typeof _!="object"||_===null)return _;var x=_[Symbol.toPrimitive];if(x!==void 0){var k=x.call(_,v);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(_)}class g extends t.Component{static getDerivedStateFromProps(v,x){let{position:k}=v,{prevPropsPosition:b}=x;return k&&(!b||k.x!==b.x||k.y!==b.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:k,prevPropsPosition:b}),{x:k.x,y:k.y,prevPropsPosition:{...k}}):null}constructor(v){super(v),m(this,"onDragStart",(x,k)=>{if((0,c.default)("Draggable: onDragStart: %j",k),this.props.onStart(x,(0,o.createDraggableData)(this,k))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(x,k)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",k);const b=(0,o.createDraggableData)(this,k),E={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:D}=E;E.x+=this.state.slackX,E.y+=this.state.slackY;const[A,j]=(0,o.getBoundPosition)(this,E.x,E.y);E.x=A,E.y=j,E.slackX=this.state.slackX+(F-E.x),E.slackY=this.state.slackY+(D-E.y),b.x=E.x,b.y=E.y,b.deltaX=E.x-this.state.x,b.deltaY=E.y-this.state.y}if(this.props.onDrag(x,b)===!1)return!1;this.setState(E)}),m(this,"onDragStop",(x,k)=>{if(!this.state.dragging||this.props.onStop(x,(0,o.createDraggableData)(this,k))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",k);const E={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:D}=this.props.position;E.x=F,E.y=D}this.setState(E)}),this.state={dragging:!1,dragged:!1,x:v.position?v.position.x:v.defaultPosition.x,y:v.position?v.position.y:v.defaultPosition.y,prevPropsPosition:{...v.position},slackX:0,slackY:0,isElementSVG:!1},v.position&&!(v.onDrag||v.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var v,x;return(v=(x=this.props)===null||x===void 0||(x=x.nodeRef)===null||x===void 0?void 0:x.current)!==null&&v!==void 0?v:n.default.findDOMNode(this)}render(){const{axis:v,bounds:x,children:k,defaultPosition:b,defaultClassName:E,defaultClassNameDragging:L,defaultClassNameDragged:F,position:D,positionOffset:A,scale:j,...M}=this.props;let O={},T=null;const U=!!!D||this.state.dragging,R=D||b,W={x:(0,o.canDragX)(this)&&U?this.state.x:R.x,y:(0,o.canDragY)(this)&&U?this.state.y:R.y};this.state.isElementSVG?T=(0,s.createSVGTransform)(W,A):O=(0,s.createCSSTransform)(W,A);const N=(0,i.default)(k.props.className||"",E,{[L]:this.state.dragging,[F]:this.state.dragged});return t.createElement(u.default,p({},M,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(k),{className:N,style:{...k.props.style,...O},transform:T}))}}e.default=g,m(g,"displayName","Draggable"),m(g,"propTypes",{...u.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(g,"defaultProps",{...u.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Lw);const{default:Vw,DraggableCore:MN}=Lw;ku.exports=Vw;ku.exports.default=Vw;ku.exports.DraggableCore=MN;var TN=ku.exports;const LN=Za(TN);var Qe=function(){return Qe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Qe.apply(this,arguments)},_0={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},x0={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Ol={width:"20px",height:"20px",position:"absolute",zIndex:1},AN={top:Qe(Qe({},_0),{top:"-5px"}),right:Qe(Qe({},x0),{left:void 0,right:"-5px"}),bottom:Qe(Qe({},_0),{top:void 0,bottom:"-5px"}),left:Qe(Qe({},x0),{left:"-5px"}),topRight:Qe(Qe({},Ol),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Qe(Qe({},Ol),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Qe(Qe({},Ol),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Qe(Qe({},Ol),{left:"-10px",top:"-10px",cursor:"nw-resize"})},ON=S.memo(function(e){var t=e.onResizeStart,r=e.direction,n=e.children,i=e.replaceStyles,s=e.className,o=S.useCallback(function(c){t(c,r)},[t,r]),a=S.useCallback(function(c){t(c,r)},[t,r]),u=S.useMemo(function(){return Qe(Qe({position:"absolute",userSelect:"none"},AN[r]),i??{})},[i,r]);return l.jsx("div",{className:s||void 0,style:u,onMouseDown:o,onTouchStart:a,children:n})}),IN=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vr=function(){return Vr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Vr.apply(this,arguments)},BN={width:"auto",height:"auto"},Il=function(e,t,r){return Math.max(Math.min(e,r),t)},w0=function(e,t,r){var n=Math.round(e/t);return n*t+r*(n-1)},_s=function(e,t){return new RegExp(e,"i").test(t)},Bl=function(e){return!!(e.touches&&e.touches.length)},FN=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},S0=function(e,t,r){r===void 0&&(r=0);var n=t.reduce(function(s,o,a){return Math.abs(o-e)<Math.abs(t[s]-e)?a:s},0),i=Math.abs(t[n]-e);return r===0||i<r?t[n]:e},yh=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Fl=function(e,t,r,n){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var i=Number(e.replace("%",""))/100;return t*i}if(e.endsWith("vw")){var i=Number(e.replace("vw",""))/100;return r*i}if(e.endsWith("vh")){var i=Number(e.replace("vh",""))/100;return n*i}}return e},zN=function(e,t,r,n,i,s,o){return n=Fl(n,e.width,t,r),i=Fl(i,e.height,t,r),s=Fl(s,e.width,t,r),o=Fl(o,e.height,t,r),{maxWidth:typeof n>"u"?void 0:Number(n),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof s>"u"?void 0:Number(s),minHeight:typeof o>"u"?void 0:Number(o)}},$N=function(e){return Array.isArray(e)?e:[e,e]},HN=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],b0="__resizable_base__",WN=function(e){IN(t,e);function t(r){var n,i,s,o,a=e.call(this,r)||this;return a.ratio=1,a.resizable=null,a.parentLeft=0,a.parentTop=0,a.resizableLeft=0,a.resizableRight=0,a.resizableTop=0,a.resizableBottom=0,a.targetLeft=0,a.targetTop=0,a.delta={width:0,height:0},a.appendBase=function(){if(!a.resizable||!a.window)return null;var u=a.parentNode;if(!u)return null;var c=a.window.document.createElement("div");return c.style.width="100%",c.style.height="100%",c.style.position="absolute",c.style.transform="scale(0, 0)",c.style.left="0",c.style.flex="0 0 100%",c.classList?c.classList.add(b0):c.className+=b0,u.appendChild(c),c},a.removeBase=function(u){var c=a.parentNode;c&&c.removeChild(u)},a.state={isResizing:!1,width:(i=(n=a.propsSize)===null||n===void 0?void 0:n.width)!==null&&i!==void 0?i:"auto",height:(o=(s=a.propsSize)===null||s===void 0?void 0:s.height)!==null&&o!==void 0?o:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},a.onResizeStart=a.onResizeStart.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||BN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var r=0,n=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,s=this.resizable.offsetHeight,o=this.resizable.style.position;o!=="relative"&&(this.resizable.style.position="relative"),r=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,n=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:s,this.resizable.style.position=o}return{width:r,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var r=this,n=this.props.size,i=function(a){var u;if(typeof r.state[a]>"u"||r.state[a]==="auto")return"auto";if(r.propsSize&&r.propsSize[a]&&(!((u=r.propsSize[a])===null||u===void 0)&&u.toString().endsWith("%"))){if(r.state[a].toString().endsWith("%"))return r.state[a].toString();var c=r.getParentSize(),h=Number(r.state[a].toString().replace("px","")),d=h/c[a]*100;return"".concat(d,"%")}return yh(r.state[a])},s=n&&typeof n.width<"u"&&!this.state.isResizing?yh(n.width):i("width"),o=n&&typeof n.height<"u"&&!this.state.isResizing?yh(n.height):i("height");return{width:s,height:o}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var r=this.appendBase();if(!r)return{width:0,height:0};var n=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(n=!0,this.parentNode.style.flexWrap="wrap"),r.style.position="relative",r.style.minWidth="100%",r.style.minHeight="100%";var s={width:r.offsetWidth,height:r.offsetHeight};return n&&(this.parentNode.style.flexWrap=i),this.removeBase(r),s},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var r=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:r.flexBasis!=="auto"?r.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(r,n){var i=this.propsSize&&this.propsSize[n];return this.state[n]==="auto"&&this.state.original[n]===r&&(typeof i>"u"||i==="auto")?"auto":r},t.prototype.calculateNewMaxFromBoundary=function(r,n){var i=this.props.boundsByDirection,s=this.state.direction,o=i&&_s("left",s),a=i&&_s("top",s),u,c;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(u=o?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),c=a?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(u=o?this.resizableRight:this.window.innerWidth-this.resizableLeft,c=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(u=o?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),c=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return u&&Number.isFinite(u)&&(r=r&&r<u?r:u),c&&Number.isFinite(c)&&(n=n&&n<c?n:c),{maxWidth:r,maxHeight:n}},t.prototype.calculateNewSizeFromDirection=function(r,n){var i=this.props.scale||1,s=$N(this.props.resizeRatio||1),o=s[0],a=s[1],u=this.state,c=u.direction,h=u.original,d=this.props,f=d.lockAspectRatio,p=d.lockAspectRatioExtraHeight,m=d.lockAspectRatioExtraWidth,y=h.width,w=h.height,g=p||0,_=m||0;return _s("right",c)&&(y=h.width+(r-h.x)*o/i,f&&(w=(y-_)/this.ratio+g)),_s("left",c)&&(y=h.width-(r-h.x)*o/i,f&&(w=(y-_)/this.ratio+g)),_s("bottom",c)&&(w=h.height+(n-h.y)*a/i,f&&(y=(w-g)*this.ratio+_)),_s("top",c)&&(w=h.height-(n-h.y)*a/i,f&&(y=(w-g)*this.ratio+_)),{newWidth:y,newHeight:w}},t.prototype.calculateNewSizeFromAspectRatio=function(r,n,i,s){var o=this.props,a=o.lockAspectRatio,u=o.lockAspectRatioExtraHeight,c=o.lockAspectRatioExtraWidth,h=typeof s.width>"u"?10:s.width,d=typeof i.width>"u"||i.width<0?r:i.width,f=typeof s.height>"u"?10:s.height,p=typeof i.height>"u"||i.height<0?n:i.height,m=u||0,y=c||0;if(a){var w=(f-m)*this.ratio+y,g=(p-m)*this.ratio+y,_=(h-y)/this.ratio+m,v=(d-y)/this.ratio+m,x=Math.max(h,w),k=Math.min(d,g),b=Math.max(f,_),E=Math.min(p,v);r=Il(r,x,k),n=Il(n,b,E)}else r=Il(r,h,d),n=Il(n,f,p);return{newWidth:r,newHeight:n}},t.prototype.setBoundingClientRect=function(){var r=1/(this.props.scale||1);if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var i=n.getBoundingClientRect();this.parentLeft=i.left*r,this.parentTop=i.top*r}}if(this.props.bounds&&typeof this.props.bounds!="string"){var s=this.props.bounds.getBoundingClientRect();this.targetLeft=s.left*r,this.targetTop=s.top*r}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,u=o.top,c=o.right,h=o.bottom;this.resizableLeft=a*r,this.resizableRight=c*r,this.resizableTop=u*r,this.resizableBottom=h*r}},t.prototype.onResizeStart=function(r,n){if(!(!this.resizable||!this.window)){var i=0,s=0;if(r.nativeEvent&&FN(r.nativeEvent)?(i=r.nativeEvent.clientX,s=r.nativeEvent.clientY):r.nativeEvent&&Bl(r.nativeEvent)&&(i=r.nativeEvent.touches[0].clientX,s=r.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var o=this.props.onResizeStart(r,n,this.resizable);if(o===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var a,u=this.window.getComputedStyle(this.resizable);if(u.flexBasis!=="auto"){var c=this.parentNode;if(c){var h=this.window.getComputedStyle(c).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",a=u.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var d={original:{x:i,y:s,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Vr(Vr({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(r.target).cursor||"auto"}),direction:n,flexBasis:a};this.setState(d)}},t.prototype.onMouseMove=function(r){var n=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Bl(r))try{r.preventDefault(),r.stopPropagation()}catch{}var i=this.props,s=i.maxWidth,o=i.maxHeight,a=i.minWidth,u=i.minHeight,c=Bl(r)?r.touches[0].clientX:r.clientX,h=Bl(r)?r.touches[0].clientY:r.clientY,d=this.state,f=d.direction,p=d.original,m=d.width,y=d.height,w=this.getParentSize(),g=zN(w,this.window.innerWidth,this.window.innerHeight,s,o,a,u);s=g.maxWidth,o=g.maxHeight,a=g.minWidth,u=g.minHeight;var _=this.calculateNewSizeFromDirection(c,h),v=_.newHeight,x=_.newWidth,k=this.calculateNewMaxFromBoundary(s,o);this.props.snap&&this.props.snap.x&&(x=S0(x,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(v=S0(v,this.props.snap.y,this.props.snapGap));var b=this.calculateNewSizeFromAspectRatio(x,v,{width:k.maxWidth,height:k.maxHeight},{width:a,height:u});if(x=b.newWidth,v=b.newHeight,this.props.grid){var E=w0(x,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),L=w0(v,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),F=this.props.snapGap||0,D=F===0||Math.abs(E-x)<=F?E:x,A=F===0||Math.abs(L-v)<=F?L:v;x=D,v=A}var j={width:x-p.width,height:v-p.height};if(this.delta=j,m&&typeof m=="string"){if(m.endsWith("%")){var M=x/w.width*100;x="".concat(M,"%")}else if(m.endsWith("vw")){var O=x/this.window.innerWidth*100;x="".concat(O,"vw")}else if(m.endsWith("vh")){var T=x/this.window.innerHeight*100;x="".concat(T,"vh")}}if(y&&typeof y=="string"){if(y.endsWith("%")){var M=v/w.height*100;v="".concat(M,"%")}else if(y.endsWith("vw")){var O=v/this.window.innerWidth*100;v="".concat(O,"vw")}else if(y.endsWith("vh")){var T=v/this.window.innerHeight*100;v="".concat(T,"vh")}}var B={width:this.createSizeForCssProperty(x,"width"),height:this.createSizeForCssProperty(v,"height")};this.flexDir==="row"?B.flexBasis=B.width:this.flexDir==="column"&&(B.flexBasis=B.height);var U=this.state.width!==B.width,R=this.state.height!==B.height,W=this.state.flexBasis!==B.flexBasis,N=U||R||W;N&&ds.flushSync(function(){n.setState(B)}),this.props.onResize&&N&&this.props.onResize(r,f,this.resizable,j)}},t.prototype.onMouseUp=function(r){var n,i,s=this.state,o=s.isResizing,a=s.direction;s.original,!(!o||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(r,a,this.resizable,this.delta),this.props.size&&this.setState({width:(n=this.props.size.width)!==null&&n!==void 0?n:"auto",height:(i=this.props.size.height)!==null&&i!==void 0?i:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Vr(Vr({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(r){var n,i;this.setState({width:(n=r.width)!==null&&n!==void 0?n:"auto",height:(i=r.height)!==null&&i!==void 0?i:"auto"})},t.prototype.renderResizer=function(){var r=this,n=this.props,i=n.enable,s=n.handleStyles,o=n.handleClasses,a=n.handleWrapperStyle,u=n.handleWrapperClass,c=n.handleComponent;if(!i)return null;var h=Object.keys(i).map(function(d){return i[d]!==!1?l.jsx(ON,{direction:d,onResizeStart:r.onResizeStart,replaceStyles:s&&s[d],className:o&&o[d],children:c&&c[d]?c[d]:null},d):null});return l.jsx("div",{className:u,style:a,children:h})},t.prototype.render=function(){var r=this,n=Object.keys(this.props).reduce(function(o,a){return HN.indexOf(a)!==-1||(o[a]=r.props[a]),o},{}),i=Vr(Vr(Vr({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var s=this.props.as||"div";return l.jsxs(s,Vr({style:i,className:this.props.className},n,{ref:function(o){o&&(r.resizable=o)},children:[this.state.isResizing&&l.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(S.PureComponent);/*! *****************************************************************************
|
|
383
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
384
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
385
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
386
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
387
|
+
|
|
388
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
389
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
390
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
391
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
392
|
+
|
|
393
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
394
|
+
and limitations under the License.
|
|
395
|
+
***************************************************************************** */var hf=function(e,t){return hf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},hf(e,t)};function UN(e,t){hf(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var rt=function(){return rt=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},rt.apply(this,arguments)};function qN(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}var KN={width:"auto",height:"auto",display:"inline-block",position:"absolute",top:0,left:0},VN=function(e){return{bottom:e,bottomLeft:e,bottomRight:e,left:e,right:e,top:e,topLeft:e,topRight:e}},QN=function(e){UN(t,e);function t(r){var n=e.call(this,r)||this;return n.resizingPosition={x:0,y:0},n.offsetFromParent={left:0,top:0},n.resizableElement={current:null},n.originalPosition={x:0,y:0},n.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:r.maxWidth,maxHeight:r.maxHeight},n.onResizeStart=n.onResizeStart.bind(n),n.onResize=n.onResize.bind(n),n.onResizeStop=n.onResizeStop.bind(n),n.onDragStart=n.onDragStart.bind(n),n.onDrag=n.onDrag.bind(n),n.onDragStop=n.onDragStop.bind(n),n.getMaxSizesFromProps=n.getMaxSizesFromProps.bind(n),n}return t.prototype.componentDidMount=function(){this.updateOffsetFromParent();var r=this.offsetFromParent,n=r.left,i=r.top,s=this.getDraggablePosition(),o=s.x,a=s.y;this.draggable.setState({x:o-n,y:a-i}),this.forceUpdate()},t.prototype.getDraggablePosition=function(){var r=this.draggable.state,n=r.x,i=r.y;return{x:n,y:i}},t.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},t.prototype.getParentSize=function(){return this.resizable.getParentSize()},t.prototype.getMaxSizesFromProps=function(){var r=typeof this.props.maxWidth>"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,n=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:r,maxHeight:n}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(r){var n=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/n;case"body":return document.body.offsetHeight/n;default:return r.offsetHeight}},t.prototype.getOffsetWidth=function(r){var n=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/n;case"body":return document.body.offsetWidth/n;default:return r.offsetWidth}},t.prototype.onDragStart=function(r,n){this.props.onDragStart&&this.props.onDragStart(r,n);var i=this.getDraggablePosition();if(this.originalPosition=i,!!this.props.bounds){var s=this.getParent(),o=this.props.scale,a;if(this.props.bounds==="parent")a=s;else if(this.props.bounds==="body"){var u=s.getBoundingClientRect(),c=u.left,h=u.top,d=document.body.getBoundingClientRect(),f=-(c-s.offsetLeft*o-d.left)/o,p=-(h-s.offsetTop*o-d.top)/o,m=(document.body.offsetWidth-this.resizable.size.width*o)/o+f,y=(document.body.offsetHeight-this.resizable.size.height*o)/o+p;return this.setState({bounds:{top:p,right:m,bottom:y,left:f}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var w=s.getBoundingClientRect(),g=w.left,_=w.top,v=-(g-s.offsetLeft*o)/o,x=-(_-s.offsetTop*o)/o,m=(window.innerWidth-this.resizable.size.width*o)/o+v,y=(window.innerHeight-this.resizable.size.height*o)/o+x;return this.setState({bounds:{top:x,right:m,bottom:y,left:v}})}else typeof this.props.bounds=="string"?a=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(a=this.props.bounds);if(!(!(a instanceof HTMLElement)||!(s instanceof HTMLElement))){var k=a.getBoundingClientRect(),b=k.left,E=k.top,L=s.getBoundingClientRect(),F=L.left,D=L.top,A=(b-F)/o,j=E-D;if(this.resizable){this.updateOffsetFromParent();var M=this.offsetFromParent;this.setState({bounds:{top:j-M.top,right:A+(a.offsetWidth-this.resizable.size.width)-M.left/o,bottom:j+(a.offsetHeight-this.resizable.size.height)-M.top,left:A-M.left/o}})}}}},t.prototype.onDrag=function(r,n){if(this.props.onDrag){var i=this.offsetFromParent,s=i.left,o=i.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(r,rt(rt({},n),{x:n.x+s,y:n.y+o}));if(this.props.dragAxis==="x")return this.props.onDrag(r,rt(rt({},n),{x:n.x+s,y:this.originalPosition.y+o,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(r,rt(rt({},n),{x:this.originalPosition.x+s,y:n.y+o,deltaX:0}))}},t.prototype.onDragStop=function(r,n){if(this.props.onDragStop){var i=this.offsetFromParent,s=i.left,o=i.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(r,rt(rt({},n),{x:n.x+s,y:n.y+o}));if(this.props.dragAxis==="x")return this.props.onDragStop(r,rt(rt({},n),{x:n.x+s,y:this.originalPosition.y+o,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(r,rt(rt({},n),{x:this.originalPosition.x+s,y:n.y+o,deltaX:0}))}},t.prototype.onResizeStart=function(r,n,i){r.stopPropagation(),this.setState({resizing:!0});var s=this.props.scale,o=this.offsetFromParent,a=this.getDraggablePosition();if(this.resizingPosition={x:a.x+o.left,y:a.y+o.top},this.originalPosition=a,this.props.bounds){var u=this.getParent(),c=void 0;this.props.bounds==="parent"?c=u:this.props.bounds==="body"?c=document.body:this.props.bounds==="window"?c=window:typeof this.props.bounds=="string"?c=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(c=this.props.bounds);var h=this.getSelfElement();if(h instanceof Element&&(c instanceof HTMLElement||c===window)&&u instanceof HTMLElement){var d=this.getMaxSizesFromProps(),f=d.maxWidth,p=d.maxHeight,m=this.getParentSize();if(f&&typeof f=="string")if(f.endsWith("%")){var y=Number(f.replace("%",""))/100;f=m.width*y}else f.endsWith("px")&&(f=Number(f.replace("px","")));if(p&&typeof p=="string")if(p.endsWith("%")){var y=Number(p.replace("%",""))/100;p=m.height*y}else p.endsWith("px")&&(p=Number(p.replace("px","")));var w=h.getBoundingClientRect(),g=w.left,_=w.top,v=this.props.bounds==="window"?{left:0,top:0}:c.getBoundingClientRect(),x=v.left,k=v.top,b=this.getOffsetWidth(c),E=this.getOffsetHeight(c),L=n.toLowerCase().endsWith("left"),F=n.toLowerCase().endsWith("right"),D=n.startsWith("top"),A=n.startsWith("bottom");if((L||D)&&this.resizable){var j=(g-x)/s+this.resizable.size.width;this.setState({maxWidth:j>Number(f)?f:j})}if(F||this.props.lockAspectRatio&&!L&&!D){var j=b+(x-g)/s;this.setState({maxWidth:j>Number(f)?f:j})}if((D||L)&&this.resizable){var j=(_-k)/s+this.resizable.size.height;this.setState({maxHeight:j>Number(p)?p:j})}if(A||this.props.lockAspectRatio&&!D&&!L){var j=E+(k-_)/s;this.setState({maxHeight:j>Number(p)?p:j})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(r,n,i)},t.prototype.onResize=function(r,n,i,s){var o=this,a={x:this.originalPosition.x,y:this.originalPosition.y},u=-s.width,c=-s.height,h=["top","left","topLeft","bottomLeft","topRight"];h.includes(n)&&(n==="bottomLeft"?a.x+=u:(n==="topRight"||(a.x+=u),a.y+=c));var d=this.draggable.state;(a.x!==d.x||a.y!==d.y)&&ds.flushSync(function(){o.draggable.setState(a)}),this.updateOffsetFromParent();var f=this.offsetFromParent,p=this.getDraggablePosition().x+f.left,m=this.getDraggablePosition().y+f.top;this.resizingPosition={x:p,y:m},this.props.onResize&&this.props.onResize(r,n,i,s,{x:p,y:m})},t.prototype.onResizeStop=function(r,n,i,s){this.setState({resizing:!1});var o=this.getMaxSizesFromProps(),a=o.maxWidth,u=o.maxHeight;this.setState({maxWidth:a,maxHeight:u}),this.props.onResizeStop&&this.props.onResizeStop(r,n,i,s,this.resizingPosition)},t.prototype.updateSize=function(r){this.resizable&&this.resizable.updateSize({width:r.width,height:r.height})},t.prototype.updatePosition=function(r){this.draggable.setState(r)},t.prototype.updateOffsetFromParent=function(){var r=this.props.scale,n=this.getParent(),i=this.getSelfElement();if(!n||i===null)return{top:0,left:0};var s=n.getBoundingClientRect(),o=s.left,a=s.top,u=i.getBoundingClientRect(),c=this.getDraggablePosition(),h=n.scrollLeft,d=n.scrollTop;this.offsetFromParent={left:u.left-o+h-c.x*r,top:u.top-a+d-c.y*r}},t.prototype.render=function(){var r=this,n=this.props,i=n.disableDragging,s=n.style,o=n.dragHandleClassName,a=n.position,u=n.onMouseDown,c=n.onMouseUp,h=n.dragAxis,d=n.dragGrid,f=n.bounds,p=n.enableUserSelectHack,m=n.cancel,y=n.children;n.onResizeStart,n.onResize,n.onResizeStop,n.onDragStart,n.onDrag,n.onDragStop;var w=n.resizeHandleStyles,g=n.resizeHandleClasses,_=n.resizeHandleComponent,v=n.enableResizing,x=n.resizeGrid,k=n.resizeHandleWrapperClass,b=n.resizeHandleWrapperStyle,E=n.scale,L=n.allowAnyClick,F=n.dragPositionOffset,D=qN(n,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),A=this.props.default?rt({},this.props.default):void 0;delete D.default;var j=i||o?{cursor:"auto"}:{cursor:"move"},M=rt(rt(rt({},KN),j),s),O=this.offsetFromParent,T=O.left,B=O.top,U;a&&(U={x:a.x-T,y:a.y-B});var R=this.state.resizing?void 0:U,W=this.state.resizing?"both":h;return S.createElement(LN,{ref:function(N){N&&(r.draggable=N)},handle:o?".".concat(o):void 0,defaultPosition:A,onMouseDown:u,onMouseUp:c,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:W,disabled:i,grid:d,bounds:f?this.state.bounds:void 0,position:R,enableUserSelectHack:p,cancel:m,scale:E,allowAnyClick:L,nodeRef:this.resizableElement,positionOffset:F},S.createElement(WN,rt({},D,{ref:function(N){N&&(r.resizable=N,r.resizableElement.current=N.resizable)},defaultSize:A,size:this.props.size,enable:typeof v=="boolean"?VN(v):v,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:M,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:x,handleWrapperClass:k,handleWrapperStyle:b,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:w,handleClasses:g,handleComponent:_,scale:this.props.scale}),y))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(S.PureComponent);/**
|
|
396
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
397
|
+
* @license MIT
|
|
398
|
+
*
|
|
399
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
400
|
+
* @license MIT
|
|
401
|
+
*
|
|
402
|
+
* Originally forked from (with the author's permission):
|
|
403
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
404
|
+
* http://bellard.org/jslinux/
|
|
405
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
406
|
+
*/var Qw=Object.defineProperty,YN=Object.getOwnPropertyDescriptor,XN=(e,t)=>{for(var r in t)Qw(e,r,{get:t[r],enumerable:!0})},qe=(e,t,r,n)=>{for(var i=n>1?void 0:n?YN(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&Qw(t,r,i),i},J=(e,t)=>(r,n)=>t(r,n,e),C0="Terminal input",df={get:()=>C0,set:e=>C0=e},k0="Too much output to announce, navigate to rows manually to read",ff={get:()=>k0,set:e=>k0=e};function GN(e){return e.replace(/\r?\n/g,"\r")}function JN(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function ZN(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function eE(e,t,r,n){if(e.stopPropagation(),e.clipboardData){let i=e.clipboardData.getData("text/plain");Yw(i,t,r,n)}}function Yw(e,t,r,n){e=GN(e),e=JN(e,r.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function Xw(e,t,r){let n=r.getBoundingClientRect(),i=e.clientX-n.left-10,s=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${i}px`,t.style.top=`${s}px`,t.style.zIndex="1000",t.focus()}function N0(e,t,r,n,i){Xw(e,t,r),i&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function Vn(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Pu(e,t=0,r=e.length){let n="";for(let i=t;i<r;++i){let s=e[i];s>65535?(s-=65536,n+=String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):n+=String.fromCharCode(s)}return n}var tE=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let n=0,i=0;if(this._interim){let s=e.charCodeAt(i++);56320<=s&&s<=57343?t[n++]=(this._interim-55296)*1024+s-56320+65536:(t[n++]=this._interim,t[n++]=s),this._interim=0}for(let s=i;s<r;++s){let o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=r)return this._interim=o,n;let a=e.charCodeAt(s);56320<=a&&a<=57343?t[n++]=(o-55296)*1024+a-56320+65536:(t[n++]=o,t[n++]=a);continue}o!==65279&&(t[n++]=o)}return n}},rE=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let n=0,i,s,o,a,u=0,c=0;if(this.interim[0]){let f=!1,p=this.interim[0];p&=(p&224)===192?31:(p&240)===224?15:7;let m=0,y;for(;(y=this.interim[++m]&63)&&m<4;)p<<=6,p|=y;let w=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,g=w-m;for(;c<g;){if(c>=r)return 0;if(y=e[c++],(y&192)!==128){c--,f=!0;break}else this.interim[m++]=y,p<<=6,p|=y&63}f||(w===2?p<128?c--:t[n++]=p:w===3?p<2048||p>=55296&&p<=57343||p===65279||(t[n++]=p):p<65536||p>1114111||(t[n++]=p)),this.interim.fill(0)}let h=r-4,d=c;for(;d<r;){for(;d<h&&!((i=e[d])&128)&&!((s=e[d+1])&128)&&!((o=e[d+2])&128)&&!((a=e[d+3])&128);)t[n++]=i,t[n++]=s,t[n++]=o,t[n++]=a,d+=4;if(i=e[d++],i<128)t[n++]=i;else if((i&224)===192){if(d>=r)return this.interim[0]=i,n;if(s=e[d++],(s&192)!==128){d--;continue}if(u=(i&31)<<6|s&63,u<128){d--;continue}t[n++]=u}else if((i&240)===224){if(d>=r)return this.interim[0]=i,n;if(s=e[d++],(s&192)!==128){d--;continue}if(d>=r)return this.interim[0]=i,this.interim[1]=s,n;if(o=e[d++],(o&192)!==128){d--;continue}if(u=(i&15)<<12|(s&63)<<6|o&63,u<2048||u>=55296&&u<=57343||u===65279)continue;t[n++]=u}else if((i&248)===240){if(d>=r)return this.interim[0]=i,n;if(s=e[d++],(s&192)!==128){d--;continue}if(d>=r)return this.interim[0]=i,this.interim[1]=s,n;if(o=e[d++],(o&192)!==128){d--;continue}if(d>=r)return this.interim[0]=i,this.interim[1]=s,this.interim[2]=o,n;if(a=e[d++],(a&192)!==128){d--;continue}if(u=(i&7)<<18|(s&63)<<12|(o&63)<<6|a&63,u<65536||u>1114111)continue;t[n++]=u}}return n}},Gw="",ai=" ",al=class Jw{constructor(){this.fg=0,this.bg=0,this.extended=new Jc}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 Jw;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}},Jc=class Zw{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}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 Zw(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},kr=class eS extends al{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Jc,this.combinedData=""}static fromCharData(t){let r=new eS;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Vn(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 r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let i=t[1].charCodeAt(1);56320<=i&&i<=57343?this.content=(n-55296)*1024+i-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},E0="di$target",pf="di$dependencies",_h=new Map;function nE(e){return e[pf]||[]}function pt(e){if(_h.has(e))return _h.get(e);let t=function(r,n,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");iE(t,r,i)};return t._id=e,_h.set(e,t),t}function iE(e,t,r){t[E0]===t?t[pf].push({id:e,index:r}):(t[pf]=[{id:e,index:r}],t[E0]=t)}var It=pt("BufferService"),tS=pt("CoreMouseService"),ps=pt("CoreService"),sE=pt("CharsetService"),ym=pt("InstantiationService"),rS=pt("LogService"),Bt=pt("OptionsService"),nS=pt("OscLinkService"),oE=pt("UnicodeService"),ll=pt("DecorationService"),mf=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){var h;let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let n=[],i=this._optionsService.rawOptions.linkHandler,s=new kr,o=r.getTrimmedLength(),a=-1,u=-1,c=!1;for(let d=0;d<o;d++)if(!(u===-1&&!r.hasContent(d))){if(r.loadCell(d,s),s.hasExtendedAttrs()&&s.extended.urlId)if(u===-1){u=d,a=s.extended.urlId;continue}else c=s.extended.urlId!==a;else u!==-1&&(c=!0);if(c||u!==-1&&d===o-1){let f=(h=this._oscLinkService.getLinkData(a))==null?void 0:h.uri;if(f){let p={start:{x:u+1,y:e},end:{x:d+(!c&&d===o-1?1:0),y:e}},m=!1;if(!(i!=null&&i.allowNonHttpProtocols))try{let y=new URL(f);["http:","https:"].includes(y.protocol)||(m=!0)}catch{m=!0}m||n.push({text:f,range:p,activate:(y,w)=>i?i.activate(y,w,p):aE(y,w),hover:(y,w)=>{var g;return(g=i==null?void 0:i.hover)==null?void 0:g.call(i,y,w,p)},leave:(y,w)=>{var g;return(g=i==null?void 0:i.leave)==null?void 0:g.call(i,y,w,p)}})}c=!1,s.hasExtendedAttrs()&&s.extended.urlId?(u=d,a=s.extended.urlId):(u=-1,a=-1)}}t(n)}};mf=qe([J(0,It),J(1,Bt),J(2,nS)],mf);function aE(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
407
|
+
|
|
408
|
+
WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Ru=pt("CharSizeService"),Ln=pt("CoreBrowserService"),_m=pt("MouseService"),An=pt("RenderService"),lE=pt("SelectionService"),iS=pt("CharacterJoinerService"),No=pt("ThemeService"),sS=pt("LinkProviderService"),cE=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?j0.isErrorNoTelemetry(e)?new j0(e.message+`
|
|
409
|
+
|
|
410
|
+
`+e.stack):new Error(e.message+`
|
|
411
|
+
|
|
412
|
+
`+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)}},uE=new cE;function pc(e){hE(e)||uE.onUnexpectedError(e)}var gf="Canceled";function hE(e){return e instanceof dE?!0:e instanceof Error&&e.name===gf&&e.message===gf}var dE=class extends Error{constructor(){super(gf),this.name=this.message}};function fE(e){return new Error(`Illegal argument: ${e}`)}var j0=class vf extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof vf)return t;let r=new vf;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},yf=class oS extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,oS.prototype)}};function nr(e,t=0){return e[e.length-(1+t)]}var pE;(e=>{function t(s){return s<0}e.isLessThan=t;function r(s){return s<=0}e.isLessThanOrEqual=r;function n(s){return s>0}e.isGreaterThan=n;function i(s){return s===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(pE||(pE={}));function mE(e,t){let r=this,n=!1,i;return function(){return n||(n=!0,t||(i=e.apply(r,arguments))),i}}var aS;(e=>{function t(x){return x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function n(){return r}e.empty=n;function*i(x){yield x}e.single=i;function s(x){return t(x)?x:i(x)}e.wrap=s;function o(x){return x||r}e.from=o;function*a(x){for(let k=x.length-1;k>=0;k--)yield x[k]}e.reverse=a;function u(x){return!x||x[Symbol.iterator]().next().done===!0}e.isEmpty=u;function c(x){return x[Symbol.iterator]().next().value}e.first=c;function h(x,k){let b=0;for(let E of x)if(k(E,b++))return!0;return!1}e.some=h;function d(x,k){for(let b of x)if(k(b))return b}e.find=d;function*f(x,k){for(let b of x)k(b)&&(yield b)}e.filter=f;function*p(x,k){let b=0;for(let E of x)yield k(E,b++)}e.map=p;function*m(x,k){let b=0;for(let E of x)yield*k(E,b++)}e.flatMap=m;function*y(...x){for(let k of x)yield*k}e.concat=y;function w(x,k,b){let E=b;for(let L of x)E=k(E,L);return E}e.reduce=w;function*g(x,k,b=x.length){for(k<0&&(k+=x.length),b<0?b+=x.length:b>x.length&&(b=x.length);k<b;k++)yield x[k]}e.slice=g;function _(x,k=Number.POSITIVE_INFINITY){let b=[];if(k===0)return[b,x];let E=x[Symbol.iterator]();for(let L=0;L<k;L++){let F=E.next();if(F.done)return[b,e.empty()];b.push(F.value)}return[b,{[Symbol.iterator](){return E}}]}e.consume=_;async function v(x){let k=[];for await(let b of x)k.push(b);return Promise.resolve(k)}e.asyncToArray=v})(aS||(aS={}));function os(e){if(aS.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(n){t.push(n)}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 gE(...e){return Ae(()=>os(e))}function Ae(e){return{dispose:mE(()=>{e()})}}var lS=class cS{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{os(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?cS.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)}};lS.DISABLE_DISPOSED_WARNING=!1;var vi=lS,fe=class{constructor(){this._store=new vi,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};fe.None=Object.freeze({dispose(){}});var wo=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){var r;this._isDisposed||t===this._value||((r=this._value)==null||r.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,(t=this._value)==null||t.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},Cn=typeof window=="object"?window:globalThis,_f=class xf{constructor(t){this.element=t,this.next=xf.Undefined,this.prev=xf.Undefined}};_f.Undefined=new _f(void 0);var Oe=_f,P0=class{constructor(){this._first=Oe.Undefined,this._last=Oe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Oe.Undefined}clear(){let e=this._first;for(;e!==Oe.Undefined;){let t=e.next;e.prev=Oe.Undefined,e.next=Oe.Undefined,e=t}this._first=Oe.Undefined,this._last=Oe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new Oe(e);if(this._first===Oe.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==Oe.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Oe.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Oe.Undefined&&e.next!==Oe.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Oe.Undefined&&e.next===Oe.Undefined?(this._first=Oe.Undefined,this._last=Oe.Undefined):e.next===Oe.Undefined?(this._last=this._last.prev,this._last.next=Oe.Undefined):e.prev===Oe.Undefined&&(this._first=this._first.next,this._first.prev=Oe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Oe.Undefined;)yield e.element,e=e.next}},vE=globalThis.performance&&typeof globalThis.performance.now=="function",yE=class uS{static create(t){return new uS(t)}constructor(t){this._now=vE&&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}},vt;(e=>{e.None=()=>fe.None;function t(j,M){return d(j,()=>{},0,void 0,!0,void 0,M)}e.defer=t;function r(j){return(M,O=null,T)=>{let B=!1,U;return U=j(R=>{if(!B)return U?U.dispose():B=!0,M.call(O,R)},null,T),B&&U.dispose(),U}}e.once=r;function n(j,M,O){return c((T,B=null,U)=>j(R=>T.call(B,M(R)),null,U),O)}e.map=n;function i(j,M,O){return c((T,B=null,U)=>j(R=>{M(R),T.call(B,R)},null,U),O)}e.forEach=i;function s(j,M,O){return c((T,B=null,U)=>j(R=>M(R)&&T.call(B,R),null,U),O)}e.filter=s;function o(j){return j}e.signal=o;function a(...j){return(M,O=null,T)=>{let B=gE(...j.map(U=>U(R=>M.call(O,R))));return h(B,T)}}e.any=a;function u(j,M,O,T){let B=O;return n(j,U=>(B=M(B,U),B),T)}e.reduce=u;function c(j,M){let O,T={onWillAddFirstListener(){O=j(B.fire,B)},onDidRemoveLastListener(){O==null||O.dispose()}},B=new Q(T);return M==null||M.add(B),B.event}function h(j,M){return M instanceof Array?M.push(j):M&&M.add(j),j}function d(j,M,O=100,T=!1,B=!1,U,R){let W,N,$,I=0,C,q={leakWarningThreshold:U,onWillAddFirstListener(){W=j(Z=>{I++,N=M(N,Z),T&&!$&&(Y.fire(N),N=void 0),C=()=>{let oe=N;N=void 0,$=void 0,(!T||I>1)&&Y.fire(oe),I=0},typeof O=="number"?(clearTimeout($),$=setTimeout(C,O)):$===void 0&&($=0,queueMicrotask(C))})},onWillRemoveListener(){B&&I>0&&(C==null||C())},onDidRemoveLastListener(){C=void 0,W.dispose()}},Y=new Q(q);return R==null||R.add(Y),Y.event}e.debounce=d;function f(j,M=0,O){return e.debounce(j,(T,B)=>T?(T.push(B),T):[B],M,void 0,!0,void 0,O)}e.accumulate=f;function p(j,M=(T,B)=>T===B,O){let T=!0,B;return s(j,U=>{let R=T||!M(U,B);return T=!1,B=U,R},O)}e.latch=p;function m(j,M,O){return[e.filter(j,M,O),e.filter(j,T=>!M(T),O)]}e.split=m;function y(j,M=!1,O=[],T){let B=O.slice(),U=j(N=>{B?B.push(N):W.fire(N)});T&&T.add(U);let R=()=>{B==null||B.forEach(N=>W.fire(N)),B=null},W=new Q({onWillAddFirstListener(){U||(U=j(N=>W.fire(N)),T&&T.add(U))},onDidAddFirstListener(){B&&(M?setTimeout(R):R())},onDidRemoveLastListener(){U&&U.dispose(),U=null}});return T&&T.add(W),W.event}e.buffer=y;function w(j,M){return(O,T,B)=>{let U=M(new _);return j(function(R){let W=U.evaluate(R);W!==g&&O.call(T,W)},void 0,B)}}e.chain=w;let g=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(M){return this.steps.push(M),this}forEach(M){return this.steps.push(O=>(M(O),O)),this}filter(M){return this.steps.push(O=>M(O)?O:g),this}reduce(M,O){let T=O;return this.steps.push(B=>(T=M(T,B),T)),this}latch(M=(O,T)=>O===T){let O=!0,T;return this.steps.push(B=>{let U=O||!M(B,T);return O=!1,T=B,U?B:g}),this}evaluate(M){for(let O of this.steps)if(M=O(M),M===g)break;return M}}function v(j,M,O=T=>T){let T=(...W)=>R.fire(O(...W)),B=()=>j.on(M,T),U=()=>j.removeListener(M,T),R=new Q({onWillAddFirstListener:B,onDidRemoveLastListener:U});return R.event}e.fromNodeEventEmitter=v;function x(j,M,O=T=>T){let T=(...W)=>R.fire(O(...W)),B=()=>j.addEventListener(M,T),U=()=>j.removeEventListener(M,T),R=new Q({onWillAddFirstListener:B,onDidRemoveLastListener:U});return R.event}e.fromDOMEventEmitter=x;function k(j){return new Promise(M=>r(j)(M))}e.toPromise=k;function b(j){let M=new Q;return j.then(O=>{M.fire(O)},()=>{M.fire(void 0)}).finally(()=>{M.dispose()}),M.event}e.fromPromise=b;function E(j,M){return j(O=>M.fire(O))}e.forward=E;function L(j,M,O){return M(O),j(T=>M(T))}e.runAndSubscribe=L;class F{constructor(M,O){this._observable=M,this._counter=0,this._hasChanged=!1;let T={onWillAddFirstListener:()=>{M.addObserver(this)},onDidRemoveLastListener:()=>{M.removeObserver(this)}};this.emitter=new Q(T),O&&O.add(this.emitter)}beginUpdate(M){this._counter++}handlePossibleChange(M){}handleChange(M,O){this._hasChanged=!0}endUpdate(M){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function D(j,M){return new F(j,M).emitter.event}e.fromObservable=D;function A(j){return(M,O,T)=>{let B=0,U=!1,R={beginUpdate(){B++},endUpdate(){B--,B===0&&(j.reportChanges(),U&&(U=!1,M.call(O)))},handlePossibleChange(){},handleChange(){U=!0}};j.addObserver(R),j.reportChanges();let W={dispose(){j.removeObserver(R)}};return T instanceof vi?T.add(W):Array.isArray(T)&&T.push(W),W}}e.fromObservableLight=A})(vt||(vt={}));var wf=class Sf{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Sf._idPool++}`,Sf.all.add(this)}start(t){this._stopWatch=new yE,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}}};wf.all=new Set,wf._idPool=0;var _E=wf,xE=-1,hS=class dS{constructor(t,r,n=(dS._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let i=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[s,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(s);let u=new bE(a,s);this._errorHandler(u)}return()=>{let s=this._stacks.get(t.value)||0;this._stacks.set(t.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[n,i]of this._stacks)(!t||r<i)&&(t=[n,i],r=i);return t}};hS._idPool=1;var wE=hS,SE=class fS{constructor(t){this.value=t}static create(){let t=new Error;return new fS(t.stack??"")}print(){console.warn(this.value.split(`
|
|
413
|
+
`).slice(2).join(`
|
|
414
|
+
`))}},bE=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},CE=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},kE=0,xh=class{constructor(e){this.value=e,this.id=kE++}},NE=2,EE,Q=class{constructor(e){var t,r,n,i;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new wE((e==null?void 0:e.onListenerError)??pc,((r=this._options)==null?void 0:r.leakWarningThreshold)??xE):void 0,this._perfMon=(n=this._options)!=null&&n._profName?new _E(this._options._profName):void 0,this._deliveryQueue=(i=this._options)==null?void 0:i.deliveryQueue}dispose(){var e,t,r,n;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t),(n=this._leakageMon)==null||n.dispose())}get event(){return this._event??(this._event=(e,t,r)=>{var o,a,u,c,h;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let d=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(d);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],p=new CE(`${d}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(((o=this._options)==null?void 0:o.onListenerError)||pc)(p),fe.None}if(this._disposed)return fe.None;t&&(e=e.bind(t));let n=new xh(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=SE.create(),i=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof xh?(this._deliveryQueue??(this._deliveryQueue=new jE),this._listeners=[this._listeners,n]):this._listeners.push(n):((u=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||u.call(a,this),this._listeners=n,(h=(c=this._options)==null?void 0:c.onDidAddFirstListener)==null||h.call(c,this)),this._size++;let s=Ae(()=>{i==null||i(),this._removeListener(n)});return r instanceof vi?r.add(s):Array.isArray(r)&&r.push(s),s}),this._event}_removeListener(e){var i,s,o,a;if((s=(i=this._options)==null?void 0:i.onWillRemoveListener)==null||s.call(i,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(a=(o=this._options)==null?void 0:o.onDidRemoveLastListener)==null||a.call(o,this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);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--,t[r]=void 0;let n=this._deliveryQueue.current===this;if(this._size*NE<=t.length){let u=0;for(let c=0;c<t.length;c++)t[c]?t[u++]=t[c]:n&&(this._deliveryQueue.end--,u<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=u}}_deliver(e,t){var n;if(!e)return;let r=((n=this._options)==null?void 0:n.onListenerError)||pc;if(!r){e.value(t);return}try{e.value(t)}catch(i){r(i)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,r,n,i;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(n=this._perfMon)==null||n.start(this._size),this._listeners)if(this._listeners instanceof xh)this._deliver(this._listeners,e);else{let s=this._deliveryQueue;s.enqueue(this,e,this._listeners.length),this._deliverQueue(s)}(i=this._perfMon)==null||i.stop()}hasListeners(){return this._size>0}},jE=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},bf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Q,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};bf.INSTANCE=new bf;var xm=bf;function PE(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}xm.INSTANCE.onDidChangeZoomLevel;function RE(e){return xm.INSTANCE.getZoomFactor(e)}xm.INSTANCE.onDidChangeFullscreen;var Eo=typeof navigator=="object"?navigator.userAgent:"",Cf=Eo.indexOf("Firefox")>=0,DE=Eo.indexOf("AppleWebKit")>=0,wm=Eo.indexOf("Chrome")>=0,ME=!wm&&Eo.indexOf("Safari")>=0;Eo.indexOf("Electron/")>=0;Eo.indexOf("Android")>=0;var wh=!1;if(typeof Cn.matchMedia=="function"){let e=Cn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Cn.matchMedia("(display-mode: fullscreen)");wh=e.matches,PE(Cn,e,({matches:r})=>{wh&&t.matches||(wh=r)})}var Ws="en",kf=!1,Nf=!1,mc=!1,pS=!1,zl,gc=Ws,R0=Ws,TE,Dr,Ji=globalThis,gt,Ky;typeof Ji.vscode<"u"&&typeof Ji.vscode.process<"u"?gt=Ji.vscode.process:typeof process<"u"&&typeof((Ky=process==null?void 0:process.versions)==null?void 0:Ky.node)=="string"&&(gt=process);var Vy,LE=typeof((Vy=gt==null?void 0:gt.versions)==null?void 0:Vy.electron)=="string",AE=LE&&(gt==null?void 0:gt.type)==="renderer",Qy;if(typeof gt=="object"){kf=gt.platform==="win32",Nf=gt.platform==="darwin",mc=gt.platform==="linux",mc&>.env.SNAP&>.env.SNAP_REVISION,gt.env.CI||gt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,zl=Ws,gc=Ws;let e=gt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);zl=t.userLocale,R0=t.osLocale,gc=t.resolvedLanguage||Ws,TE=(Qy=t.languagePack)==null?void 0:Qy.translationsConfigFile}catch{}pS=!0}else typeof navigator=="object"&&!AE?(Dr=navigator.userAgent,kf=Dr.indexOf("Windows")>=0,Nf=Dr.indexOf("Macintosh")>=0,(Dr.indexOf("Macintosh")>=0||Dr.indexOf("iPad")>=0||Dr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,mc=Dr.indexOf("Linux")>=0,(Dr==null?void 0:Dr.indexOf("Mobi"))>=0,gc=globalThis._VSCODE_NLS_LANGUAGE||Ws,zl=navigator.language.toLowerCase(),R0=zl):console.error("Unable to resolve platform.");var mS=kf,sn=Nf,OE=mc,D0=pS,on=Dr,Fn=gc,IE;(e=>{function t(){return Fn}e.value=t;function r(){return Fn.length===2?Fn==="en":Fn.length>=3?Fn[0]==="e"&&Fn[1]==="n"&&Fn[2]==="-":!1}e.isDefaultVariant=r;function n(){return Fn==="en"}e.isDefault=n})(IE||(IE={}));var BE=typeof Ji.postMessage=="function"&&!Ji.importScripts;(()=>{if(BE){let e=[];Ji.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,i=e.length;n<i;n++){let s=e[n];if(s.id===r.data.vscodeScheduleAsyncWork){e.splice(n,1),s.callback();return}}});let t=0;return r=>{let n=++t;e.push({id:n,callback:r}),Ji.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var FE=!!(on&&on.indexOf("Chrome")>=0);on&&on.indexOf("Firefox")>=0;!FE&&on&&on.indexOf("Safari")>=0;on&&on.indexOf("Edg/")>=0;on&&on.indexOf("Android")>=0;var xs=typeof navigator=="object"?navigator:{};D0||document.queryCommandSupported&&document.queryCommandSupported("copy")||xs&&xs.clipboard&&xs.clipboard.writeText,D0||xs&&xs.clipboard&&xs.clipboard.readText;var Sm=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}},Sh=new Sm,M0=new Sm,T0=new Sm,zE=new Array(230),gS;(e=>{function t(a){return Sh.keyCodeToStr(a)}e.toString=t;function r(a){return Sh.strToKeyCode(a)}e.fromString=r;function n(a){return M0.keyCodeToStr(a)}e.toUserSettingsUS=n;function i(a){return T0.keyCodeToStr(a)}e.toUserSettingsGeneral=i;function s(a){return M0.strToKeyCode(a)||T0.strToKeyCode(a)}e.fromUserSettings=s;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Sh.keyCodeToStr(a)}e.toElectronAccelerator=o})(gS||(gS={}));var $E=class vS{constructor(t,r,n,i,s){this.ctrlKey=t,this.shiftKey=r,this.altKey=n,this.metaKey=i,this.keyCode=s}equals(t){return t instanceof vS&&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",r=this.shiftKey?"1":"0",n=this.altKey?"1":"0",i=this.metaKey?"1":"0";return`K${t}${r}${n}${i}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new HE([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},HE=class{constructor(e){if(e.length===0)throw fE("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t<r;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 WE(e){if(e.charCode){let r=String.fromCharCode(e.charCode).toUpperCase();return gS.fromString(r)}let t=e.keyCode;if(t===3)return 7;if(Cf)switch(t){case 59:return 85;case 60:if(OE)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(sn)return 57;break}else if(DE&&(sn&&t===93||!sn&&t===92))return 57;return zE[t]||0}var UE=sn?256:2048,qE=512,KE=1024,VE=sn?2048:256,L0=class{constructor(e){var r;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=(r=t.getModifierState)==null?void 0:r.call(t,"AltGraph"),this.keyCode=WE(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|=UE),this.altKey&&(t|=qE),this.shiftKey&&(t|=KE),this.metaKey&&(t|=VE),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new $E(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},A0=new WeakMap;function QE(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,r=e.parent.location;if(t.origin!=="null"&&r.origin!=="null"&&t.origin!==r.origin)return null}catch{return null}return e.parent}var YE=class{static getSameOriginWindowChain(e){let t=A0.get(e);if(!t){t=[],A0.set(e,t);let r=e,n;do n=QE(r),n?t.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):t.push({window:new WeakRef(r),iframeElement:null}),r=n;while(r)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let r=0,n=0,i=this.getSameOriginWindowChain(e);for(let s of i){let o=s.window.deref();if(r+=(o==null?void 0:o.scrollY)??0,n+=(o==null?void 0:o.scrollX)??0,o===t||!s.iframeElement)break;let a=s.iframeElement.getBoundingClientRect();r+=a.top,n+=a.left}return{top:r,left:n}}},$l=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 r=YE.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},O0=class{constructor(e,t=0,r=0){var i;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=t;let n=!1;if(wm){let s=navigator.userAgent.match(/Chrome\/(\d+)/);n=(s?parseInt(s[1]):123)<=122}if(e){let s=e,o=e,a=((i=e.view)==null?void 0:i.devicePixelRatio)||1;if(typeof s.wheelDeltaY<"u")n?this.deltaY=s.wheelDeltaY/(120*a):this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?Cf&&!sn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")ME&&mS?this.deltaX=-(s.wheelDeltaX/120):n?this.deltaX=s.wheelDeltaX/(120*a):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?Cf&&!sn?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*a):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},yS=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),XE;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof GE?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:vt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:yS})})(XE||(XE={}));var GE=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?yS:(this._emitter||(this._emitter=new Q),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},bm=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 yf("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new yf("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},JE=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,r=globalThis){if(this.isDisposed)throw new yf("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=r.setInterval(()=>{e()},t);this.disposable=Ae(()=>{r.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},ZE;(e=>{async function t(n){let i,s=await Promise.all(n.map(o=>o.then(a=>a,a=>{i||(i=a)})));if(typeof i<"u")throw i;return s}e.settled=t;function r(n){return new Promise(async(i,s)=>{try{await n(i,s)}catch(o){s(o)}})}e.withAsyncBody=r})(ZE||(ZE={}));var I0=class gr{static fromArray(t){return new gr(r=>{r.emitMany(t)})}static fromPromise(t){return new gr(async r=>{r.emitMany(await t)})}static fromPromises(t){return new gr(async r=>{await Promise.all(t.map(async n=>r.emitOne(await n)))})}static merge(t){return new gr(async r=>{await Promise.all(t.map(async n=>{for await(let i of n)r.emitOne(i)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Q,queueMicrotask(async()=>{let n={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{await Promise.resolve(t(n)),this.resolve()}catch(i){this.reject(i)}finally{n.emitOne=void 0,n.emitMany=void 0,n.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 vt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new gr(async n=>{for await(let i of t)n.emitOne(r(i))})}map(t){return gr.map(this,t)}static filter(t,r){return new gr(async n=>{for await(let i of t)r(i)&&n.emitOne(i)})}filter(t){return gr.filter(this,t)}static coalesce(t){return gr.filter(t,r=>!!r)}coalesce(){return gr.coalesce(this)}static async toPromise(t){let r=[];for await(let n of t)r.push(n);return r}toPromise(){return gr.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())}};I0.EMPTY=I0.fromArray([]);var{getWindow:tn,getWindowId:ej,onDidRegisterWindow:tj}=function(){let e=new Map,t={window:Cn,disposables:new vi};e.set(Cn.vscodeWindowId,t);let r=new Q,n=new Q,i=new Q;function s(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:n.event,registerWindow(o){if(e.has(o.vscodeWindowId))return fe.None;let a=new vi,u={window:o,disposables:a.add(new vi)};return e.set(o.vscodeWindowId,u),a.add(Ae(()=>{e.delete(o.vscodeWindowId),n.fire(o)})),a.add(ie(o,lt.BEFORE_UNLOAD,()=>{i.fire(o)})),r.fire(u),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:s,getWindow(o){var c;let a=o;if((c=a==null?void 0:a.ownerDocument)!=null&&c.defaultView)return a.ownerDocument.defaultView.window;let u=o;return u!=null&&u.view?u.view.window:Cn},getDocument(o){return tn(o).document}}}(),rj=class{constructor(e,t,r,n){this._node=e,this._type=t,this._handler=r,this._options=n||!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 ie(e,t,r,n){return new rj(e,t,r,n)}var B0=function(e,t,r,n){return ie(e,t,r,n)},Cm,nj=class extends JE{constructor(e){super(),this.defaultTarget=e&&tn(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},F0=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){pc(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,n=new Map,i=s=>{r.set(s,!1);let o=e.get(s)??[];for(t.set(s,o),e.set(s,[]),n.set(s,!0);o.length>0;)o.sort(F0.sort),o.shift().execute();n.set(s,!1)};Cm=(s,o,a=0)=>{let u=ej(s),c=new F0(o,a),h=e.get(u);return h||(h=[],e.set(u,h)),h.push(c),r.get(u)||(r.set(u,!0),s.requestAnimationFrame(()=>i(u))),c}})();function ij(e){let t=e.getBoundingClientRect(),r=tn(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var lt={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"},sj=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=$t(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=$t(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=$t(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=$t(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=$t(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=$t(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=$t(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=$t(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=$t(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=$t(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=$t(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=$t(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=$t(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=$t(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 $t(e){return typeof e=="number"?`${e}px`:e}function ga(e){return new sj(e)}var _S=class{constructor(){this._hooks=new vi,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 r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,n,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=i;let s=e;try{e.setPointerCapture(t),this._hooks.add(Ae(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=tn(e)}this._hooks.add(ie(s,lt.POINTER_MOVE,o=>{if(o.buttons!==r){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(ie(s,lt.POINTER_UP,o=>this.stopMonitoring(!0)))}};function oj(e,t,r){let n=null,i=null;if(typeof r.value=="function"?(n="value",i=r.value,i.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(n="get",i=r.get),!i)throw new Error("not supported");let s=`$memoize$${t}`;r[n]=function(...o){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,o)}),this[s]}}var qr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(qr||(qr={}));var ta=class bt extends fe{constructor(){super(),this.dispatched=!1,this.targets=new P0,this.ignoreTargets=new P0,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(vt.runAndSubscribe(tj,({window:t,disposables:r})=>{r.add(ie(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),r.add(ie(t.document,"touchend",n=>this.onTouchEnd(t,n))),r.add(ie(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:Cn,disposables:this._store}))}static addTarget(t){if(!bt.isTouchDevice())return fe.None;bt.INSTANCE||(bt.INSTANCE=new bt);let r=bt.INSTANCE.targets.push(t);return Ae(r)}static ignoreTarget(t){if(!bt.isTouchDevice())return fe.None;bt.INSTANCE||(bt.INSTANCE=new bt);let r=bt.INSTANCE.ignoreTargets.push(t);return Ae(r)}static isTouchDevice(){return"ontouchstart"in Cn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,i=t.targetTouches.length;n<i;n++){let s=t.targetTouches.item(n);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:r,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[r],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};let o=this.newGestureEvent(qr.Start,s.target);o.pageX=s.pageX,o.pageY=s.pageY,this.dispatchEvent(o)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,r){let n=Date.now(),i=Object.keys(this.activeTouches).length;for(let s=0,o=r.changedTouches.length;s<o;s++){let a=r.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}let u=this.activeTouches[a.identifier],c=Date.now()-u.initialTimeStamp;if(c<bt.HOLD_DELAY&&Math.abs(u.initialPageX-nr(u.rollingPageX))<30&&Math.abs(u.initialPageY-nr(u.rollingPageY))<30){let h=this.newGestureEvent(qr.Tap,u.initialTarget);h.pageX=nr(u.rollingPageX),h.pageY=nr(u.rollingPageY),this.dispatchEvent(h)}else if(c>=bt.HOLD_DELAY&&Math.abs(u.initialPageX-nr(u.rollingPageX))<30&&Math.abs(u.initialPageY-nr(u.rollingPageY))<30){let h=this.newGestureEvent(qr.Contextmenu,u.initialTarget);h.pageX=nr(u.rollingPageX),h.pageY=nr(u.rollingPageY),this.dispatchEvent(h)}else if(i===1){let h=nr(u.rollingPageX),d=nr(u.rollingPageY),f=nr(u.rollingTimestamps)-u.rollingTimestamps[0],p=h-u.rollingPageX[0],m=d-u.rollingPageY[0],y=[...this.targets].filter(w=>u.initialTarget instanceof Node&&w.contains(u.initialTarget));this.inertia(t,y,n,Math.abs(p)/f,p>0?1:-1,h,Math.abs(m)/f,m>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(qr.End,u.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=r,n.tapCount=0,n}dispatchEvent(t){if(t.type===qr.Tap){let r=new Date().getTime(),n=0;r-this._lastSetTapCountTime>bt.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=r,t.tapCount=n}else(t.type===qr.Change||t.type===qr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let r=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let i=0,s=t.initialTarget;for(;s&&s!==n;)i++,s=s.parentElement;r.push([i,n])}r.sort((n,i)=>n[0]-i[0]);for(let[n,i]of r)i.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,n,i,s,o,a,u,c){this.handle=Cm(t,()=>{let h=Date.now(),d=h-n,f=0,p=0,m=!0;i+=bt.SCROLL_FRICTION*d,a+=bt.SCROLL_FRICTION*d,i>0&&(m=!1,f=s*i*d),a>0&&(m=!1,p=u*a*d);let y=this.newGestureEvent(qr.Change);y.translationX=f,y.translationY=p,r.forEach(w=>w.dispatchEvent(y)),m||this.inertia(t,r,h,i,s,o+f,a,u,c+p)})}onTouchMove(t){let r=Date.now();for(let n=0,i=t.changedTouches.length;n<i;n++){let s=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}let o=this.activeTouches[s.identifier],a=this.newGestureEvent(qr.Change,o.initialTarget);a.translationX=s.pageX-nr(o.rollingPageX),a.translationY=s.pageY-nr(o.rollingPageY),a.pageX=s.pageX,a.pageY=s.pageY,this.dispatchEvent(a),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(s.pageX),o.rollingPageY.push(s.pageY),o.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};ta.SCROLL_FRICTION=-.005,ta.HOLD_DELAY=700,ta.CLEAR_TAP_COUNT_TIME=400,qe([oj],ta,"isTouchDevice",1);var aj=ta,km=class extends fe{onclick(e,t){this._register(ie(e,lt.CLICK,r=>t(new $l(tn(e),r))))}onmousedown(e,t){this._register(ie(e,lt.MOUSE_DOWN,r=>t(new $l(tn(e),r))))}onmouseover(e,t){this._register(ie(e,lt.MOUSE_OVER,r=>t(new $l(tn(e),r))))}onmouseleave(e,t){this._register(ie(e,lt.MOUSE_LEAVE,r=>t(new $l(tn(e),r))))}onkeydown(e,t){this._register(ie(e,lt.KEY_DOWN,r=>t(new L0(r))))}onkeyup(e,t){this._register(ie(e,lt.KEY_UP,r=>t(new L0(r))))}oninput(e,t){this._register(ie(e,lt.INPUT,t))}onblur(e,t){this._register(ie(e,lt.BLUR,t))}onfocus(e,t){this._register(ie(e,lt.FOCUS,t))}onchange(e,t){this._register(ie(e,lt.CHANGE,t))}ignoreGesture(e){return aj.ignoreTarget(e)}},z0=11,lj=class extends km{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=z0+"px",this.domNode.style.height=z0+"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 _S),this._register(B0(this.bgDomNode,lt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(B0(this.domNode,lt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new nj),this._pointerdownScheduleRepeatTimer=this._register(new bm)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,tn(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},cj=class Ef{constructor(t,r,n,i,s,o,a){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,n=n|0,i=i|0,s=s|0,o=o|0,a=a|0),this.rawScrollLeft=i,this.rawScrollTop=a,r<0&&(r=0),i+r>n&&(i=n-r),i<0&&(i=0),s<0&&(s=0),a+s>o&&(a=o-s),a<0&&(a=0),this.width=r,this.scrollWidth=n,this.scrollLeft=i,this.height=s,this.scrollHeight=o,this.scrollTop=a}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,r){return new Ef(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Ef(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,r){let n=this.width!==t.width,i=this.scrollWidth!==t.scrollWidth,s=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,a=this.scrollHeight!==t.scrollHeight,u=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,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:n,scrollWidthChanged:i,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:u}}},uj=class extends fe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new cj(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 n;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.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 r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let n;t?n=new H0(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=H0.start(this._state,r,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 r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},$0=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function bh(e,t){let r=t-e;return function(n){return e+r*fj(n)}}function hj(e,t,r){return function(n){return n<r?e(n/r):t((n-r)/(1-r))}}var H0=class jf{constructor(t,r,n,i){this.from=t,this.to=r,this.duration=i,this.startTime=n,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,r,n){if(Math.abs(t-r)>2.5*n){let i,s;return t<r?(i=t+.75*n,s=r-.75*n):(i=t-.75*n,s=r+.75*n),hj(bh(t,i),bh(s,r),.33)}return bh(t,r)}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 r=(t-this.startTime)/this.duration;if(r<1){let n=this.scrollLeft(r),i=this.scrollTop(r);return new $0(n,i,!1)}return new $0(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,r,n){return jf.start(t,r,n)}static start(t,r,n){n=n+10;let i=Date.now()-10;return new jf(t,r,i,n)}};function dj(e){return Math.pow(e,3)}function fj(e){return 1-dj(1-e)}var pj=class extends fe{constructor(e,t,r){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new bm)}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":"")))}},mj=140,xS=class extends km{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 pj(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new _S),this._shouldRender=!0,this.domNode=ga(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(ie(this.domNode.domNode,lt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new lj(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,n){this.slider=ga(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ie(this.slider.domNode,lt.POINTER_DOWN,i=>{i.button===0&&(i.preventDefault(),this._sliderPointerDown(i))})),this.onclick(this.slider.domNode,i=>{i.leftButton&&i.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,r=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);r<=i&&i<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let i=ij(this.domNode.domNode);t=e.pageX-i.left,r=e.pageY-i.top}let n=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{let s=this._sliderOrthogonalPointerPosition(i),o=Math.abs(s-r);if(mS&&o>mj){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let a=this._sliderPointerPosition(i)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(a))},()=>{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()}},wS=class Pf{constructor(t,r,n,i,s,o){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=i,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Pf(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,n,i,s){let o=Math.max(0,n-t),a=Math.max(0,o-2*r),u=i>0&&i>n;if(!u)return{computedAvailableSize:Math.round(o),computedIsNeeded:u,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*a/i))),h=(a-c)/(i-n),d=s*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:u,computedSliderSize:Math.round(c),computedSliderRatio:h,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){let t=Pf._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 r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,n=this._scrollPosition;return r<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let r=this._computedSliderPosition+t;return Math.round(r/this._computedSliderRatio)}},gj=class extends xS{constructor(e,t,r){let n=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new wS(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,i.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}},vj=class extends xS{constructor(e,t,r){let n=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new wS(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,i.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}},yj=500,W0=50,_j=class{constructor(e,t,r){this.timestamp=e,this.deltaX=t,this.deltaY=r,this.score=0}},Rf=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,r=0,n=1,i=this._rear;do{let s=i===this._front?t:Math.pow(2,-n);if(t-=s,r+=this._memory[i].score*s,i===this._front)break;i=(this._capacity+i-1)%this._capacity,n++}while(!0);return r<=.5}acceptStandardWheelEvent(t){if(wm){let r=tn(t.browserEvent),n=RE(r);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,r,n){let i=null,s=new _j(t,r,n);this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(i=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]=s),s.score=this._computeScore(s,i)}_computeScore(t,r){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),r){let i=Math.abs(t.deltaX),s=Math.abs(t.deltaY),o=Math.abs(r.deltaX),a=Math.abs(r.deltaY),u=Math.max(Math.min(i,o),1),c=Math.max(Math.min(s,a),1),h=Math.max(i,o),d=Math.max(s,a);h%u===0&&d%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Rf.INSTANCE=new Rf;var xj=Rf,wj=class extends km{constructor(e,t,r){super(),this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Q),this.onWillScroll=this._onWillScroll.event,this._options=bj(t),this._scrollable=r,this._register(this._scrollable.onScroll(i=>{this._onWillScroll.fire(i),this._onDidScroll(i),this._onScroll.fire(i)}));let n={onMouseWheel:i=>this._onMouseWheel(i),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new vj(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new gj(this._scrollable,this._options,n)),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=ga(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ga(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ga(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,i=>this._onMouseOver(i)),this.onmouseleave(this._listenOnDomNode,i=>this._onMouseLeave(i)),this._hideTimeout=this._register(new bm),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=os(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,sn&&(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 O0(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=os(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new O0(r))};this._mouseWheelToDispose.push(ie(this._listenOnDomNode,lt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var i;if((i=e.browserEvent)!=null&&i.defaultPrevented)return;let t=xj.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+s===0?o=s=0:Math.abs(s)>=Math.abs(o)?o=0:s=0),this._options.flipAxes&&([s,o]=[o,s]);let a=!sn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!o&&(o=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);let u=this._scrollable.getFutureScrollPosition(),c={};if(s){let h=W0*s,d=u.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(c,d)}if(o){let h=W0*o,d=u.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(c,d)}c=this._scrollable.validateScrollPosition(c),(u.scrollLeft!==c.scrollLeft||u.scrollTop!==c.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(c):this._scrollable.setScrollPositionNow(c),r=!0)}let n=r;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(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,r=e.scrollLeft>0,n=r?" left":"",i=t?" top":"",s=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${i}${n}`)}}_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(),yj)}},Sj=class extends wj{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function bj(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,sn&&(t.className+=" mac"),t}var Df=class extends fe{constructor(e,t,r,n,i,s,o,a){super(),this._bufferService=r,this._optionsService=o,this._renderService=a,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let u=this._register(new uj({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>Cm(n.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{u.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Sj(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},u)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(vt.runAndSubscribe(s.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=s.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Ae(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Ae(()=>this._styleElement.remove())),this._register(vt.runAndSubscribe(s.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${s.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${s.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${s.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
415
|
+
`)})),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(c=>this._handleScroll(c)))}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),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};Df=qe([J(2,It),J(3,Ln),J(4,tS),J(5,No),J(6,Bt),J(7,An)],Df);var Mf=class extends fe{constructor(e,t,r,n,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=n,this._renderService=i,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(s=>this._removeDecoration(s))),this._register(Ae(()=>{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 n;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((n=e==null?void 0:e.options)==null?void 0:n.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 r=e.options.x??0;return r&&r>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 r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*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()}};Mf=qe([J(1,It),J(2,Ln),J(3,ll),J(4,An)],Mf);var Cj=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,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Wr={full:0,left:0,center:0,right:0},zn={full:0,left:0,center:0,right:0},$o={full:0,left:0,center:0,right:0},Zc=class extends fe{constructor(e,t,r,n,i,s,o,a){var c;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=n,this._renderService=i,this._optionsService=s,this._themeService=o,this._coreBrowserService=a,this._colorZoneStore=new Cj,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(),(c=this._viewportElement.parentElement)==null||c.insertBefore(this._canvas,this._viewportElement),this._register(Ae(()=>{var h;return(h=this._canvas)==null?void 0:h.remove()}));let u=this._canvas.getContext("2d");if(u)this._ctx=u;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);zn.full=this._canvas.width,zn.left=e,zn.center=t,zn.right=e,this._refreshDrawHeightConstants(),$o.full=1,$o.left=1,$o.center=1+zn.left,$o.right=1+zn.left+zn.center}_refreshDrawHeightConstants(){Wr.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);Wr.left=t,Wr.center=t,Wr.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Wr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Wr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Wr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Wr.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($o[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Wr[e.position||"full"]/2),zn[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Wr[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}))}};Zc=qe([J(2,It),J(3,ll),J(4,An),J(5,Bt),J(6,No),J(7,Ln)],Zc);var H;(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=`
|
|
416
|
+
`,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=""))(H||(H={}));var vc;(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=""))(vc||(vc={}));var SS;(e=>e.ST=`${H.ESC}\\`)(SS||(SS={}));var Tf=class{constructor(e,t,r,n,i,s){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=n,this._coreService=i,this._renderService=s,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 r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!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,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.length<e.length?this._coreService.triggerDataEvent(`${H.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),r=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let s=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Tf=qe([J(2,It),J(3,Bt),J(4,ps),J(5,An)],Tf);var ut=0,ht=0,dt=0,He=0,U0={css:"#00000000",rgba:0},Ge;(e=>{function t(i,s,o,a){return a!==void 0?`#${Ri(i)}${Ri(s)}${Ri(o)}${Ri(a)}`:`#${Ri(i)}${Ri(s)}${Ri(o)}`}e.toCss=t;function r(i,s,o,a=255){return(i<<24|s<<16|o<<8|a)>>>0}e.toRgba=r;function n(i,s,o,a){return{css:e.toCss(i,s,o,a),rgba:e.toRgba(i,s,o,a)}}e.toColor=n})(Ge||(Ge={}));var Me;(e=>{function t(u,c){if(He=(c.rgba&255)/255,He===1)return{css:c.css,rgba:c.rgba};let h=c.rgba>>24&255,d=c.rgba>>16&255,f=c.rgba>>8&255,p=u.rgba>>24&255,m=u.rgba>>16&255,y=u.rgba>>8&255;ut=p+Math.round((h-p)*He),ht=m+Math.round((d-m)*He),dt=y+Math.round((f-y)*He);let w=Ge.toCss(ut,ht,dt),g=Ge.toRgba(ut,ht,dt);return{css:w,rgba:g}}e.blend=t;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function n(u,c,h){let d=yc.ensureContrastRatio(u.rgba,c.rgba,h);if(d)return Ge.toColor(d>>24&255,d>>16&255,d>>8&255)}e.ensureContrastRatio=n;function i(u){let c=(u.rgba|255)>>>0;return[ut,ht,dt]=yc.toChannels(c),{css:Ge.toCss(ut,ht,dt),rgba:c}}e.opaque=i;function s(u,c){return He=Math.round(c*255),[ut,ht,dt]=yc.toChannels(u.rgba),{css:Ge.toCss(ut,ht,dt,He),rgba:Ge.toRgba(ut,ht,dt,He)}}e.opacity=s;function o(u,c){return He=u.rgba&255,s(u,He*c/255)}e.multiplyOpacity=o;function a(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=a})(Me||(Me={}));var Ie;(e=>{let t,r;try{let i=document.createElement("canvas");i.width=1,i.height=1;let s=i.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return ut=parseInt(i.slice(1,2).repeat(2),16),ht=parseInt(i.slice(2,3).repeat(2),16),dt=parseInt(i.slice(3,4).repeat(2),16),Ge.toColor(ut,ht,dt);case 5:return ut=parseInt(i.slice(1,2).repeat(2),16),ht=parseInt(i.slice(2,3).repeat(2),16),dt=parseInt(i.slice(3,4).repeat(2),16),He=parseInt(i.slice(4,5).repeat(2),16),Ge.toColor(ut,ht,dt,He);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let s=i.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return ut=parseInt(s[1]),ht=parseInt(s[2]),dt=parseInt(s[3]),He=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),Ge.toColor(ut,ht,dt,He);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=i,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[ut,ht,dt,He]=t.getImageData(0,0,1,1).data,He!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ge.toRgba(ut,ht,dt,He),css:i}}e.toColor=n})(Ie||(Ie={}));var Et;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,i,s){let o=n/255,a=i/255,u=s/255,c=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),h=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),d=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return c*.2126+h*.7152+d*.0722}e.relativeLuminance2=r})(Et||(Et={}));var yc;(e=>{function t(o,a){if(He=(a&255)/255,He===1)return a;let u=a>>24&255,c=a>>16&255,h=a>>8&255,d=o>>24&255,f=o>>16&255,p=o>>8&255;return ut=d+Math.round((u-d)*He),ht=f+Math.round((c-f)*He),dt=p+Math.round((h-p)*He),Ge.toRgba(ut,ht,dt)}e.blend=t;function r(o,a,u){let c=Et.relativeLuminance(o>>8),h=Et.relativeLuminance(a>>8);if(dn(c,h)<u){if(h<c){let p=n(o,a,u),m=dn(c,Et.relativeLuminance(p>>8));if(m<u){let y=i(o,a,u),w=dn(c,Et.relativeLuminance(y>>8));return m>w?p:y}return p}let d=i(o,a,u),f=dn(c,Et.relativeLuminance(d>>8));if(f<u){let p=n(o,a,u),m=dn(c,Et.relativeLuminance(p>>8));return f>m?d:p}return d}}e.ensureContrastRatio=r;function n(o,a,u){let c=o>>24&255,h=o>>16&255,d=o>>8&255,f=a>>24&255,p=a>>16&255,m=a>>8&255,y=dn(Et.relativeLuminance2(f,p,m),Et.relativeLuminance2(c,h,d));for(;y<u&&(f>0||p>0||m>0);)f-=Math.max(0,Math.ceil(f*.1)),p-=Math.max(0,Math.ceil(p*.1)),m-=Math.max(0,Math.ceil(m*.1)),y=dn(Et.relativeLuminance2(f,p,m),Et.relativeLuminance2(c,h,d));return(f<<24|p<<16|m<<8|255)>>>0}e.reduceLuminance=n;function i(o,a,u){let c=o>>24&255,h=o>>16&255,d=o>>8&255,f=a>>24&255,p=a>>16&255,m=a>>8&255,y=dn(Et.relativeLuminance2(f,p,m),Et.relativeLuminance2(c,h,d));for(;y<u&&(f<255||p<255||m<255);)f=Math.min(255,f+Math.ceil((255-f)*.1)),p=Math.min(255,p+Math.ceil((255-p)*.1)),m=Math.min(255,m+Math.ceil((255-m)*.1)),y=dn(Et.relativeLuminance2(f,p,m),Et.relativeLuminance2(c,h,d));return(f<<24|p<<16|m<<8|255)>>>0}e.increaseLuminance=i;function s(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=s})(yc||(yc={}));function Ri(e){let t=e.toString(16);return t.length<2?"0"+t:t}function dn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var kj=class extends al{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}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()]}},eu=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new kr}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 r=[],n=t.translateToString(!0),i=0,s=0,o=0,a=t.getFg(0),u=t.getBg(0);for(let c=0;c<t.getTrimmedLength();c++)if(t.loadCell(c,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==a||this._workCell.bg!==u){if(c-i>1){let h=this._getJoinedRanges(n,o,s,t,i);for(let d=0;d<h.length;d++)r.push(h[d])}i=c,o=s,a=this._workCell.fg,u=this._workCell.bg}s+=this._workCell.getChars().length||ai.length}if(this._bufferService.cols-i>1){let c=this._getJoinedRanges(n,o,s,t,i);for(let h=0;h<c.length;h++)r.push(c[h])}return r}_getJoinedRanges(e,t,r,n,i){let s=e.substring(t,r),o=[];try{o=this._characterJoiners[0].handler(s)}catch(a){console.error(a)}for(let a=1;a<this._characterJoiners.length;a++)try{let u=this._characterJoiners[a].handler(s);for(let c=0;c<u.length;c++)eu._mergeRanges(o,u[c])}catch(u){console.error(u)}return this._stringRangesToCellRanges(o,n,i),o}_stringRangesToCellRanges(e,t,r){let n=0,i=!1,s=0,o=e[n];if(o){for(let a=r;a<this._bufferService.cols;a++){let u=t.getWidth(a),c=t.getString(a).length||ai.length;if(u!==0){if(!i&&o[0]<=s&&(o[0]=a,i=!0),o[1]<=s){if(o[1]=a,o=e[++n],!o)break;o[0]<=s?(o[0]=a,i=!0):i=!1}s+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let r=!1;for(let n=0;n<e.length;n++){let i=e[n];if(r){if(t[1]<=i[0])return e[n-1][1]=t[1],e;if(t[1]<=i[1])return e[n-1][1]=Math.max(t[1],i[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=i[0])return e.splice(n,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),r=!0);continue}}return r?e[e.length-1][1]=t[1]:e.push(t),e}};eu=qe([J(0,It)],eu);function Nj(e){return 57508<=e&&e<=57558}function Ej(e){return 9472<=e&&e<=9631}function jj(e){return Nj(e)||Ej(e)}function Pj(){return{css:{canvas:Hl(),cell:Hl()},device:{canvas:Hl(),cell:Hl(),char:{width:0,height:0,left:0,top:0}}}}function Hl(){return{width:0,height:0}}var Lf=class{constructor(e,t,r,n,i,s,o){this._document=e,this._characterJoinerService=t,this._optionsService=r,this._coreBrowserService=n,this._coreService=i,this._decorationService=s,this._themeService=o,this._workCell=new kr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,r){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=r}createRow(e,t,r,n,i,s,o,a,u,c,h){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();r&&m<s+1&&(m=s+1);let y,w=0,g="",_=0,v=0,x=0,k=0,b=!1,E=0,L=!1,F=0,D=0,A=[],j=c!==-1&&h!==-1;for(let M=0;M<m;M++){e.loadCell(M,this._workCell);let O=this._workCell.getWidth();if(O===0)continue;let T=!1,B=M>=D,U=M,R=this._workCell;if(f.length>0&&M===f[0][0]&&B){let ye=f.shift(),ee=this._isCellInSelection(ye[0],t);for(_=ye[0]+1;_<ye[1];_++)B&&(B=ee===this._isCellInSelection(_,t));B&&(B=!r||s<ye[0]||s>=ye[1]),B?(T=!0,R=new kj(this._workCell,e.translateToString(!0,ye[0],ye[1]),ye[1]-ye[0]),U=ye[1]-1,O=R.getWidth()):D=ye[1]}let W=this._isCellInSelection(M,t),N=r&&M===s,$=j&&M>=c&&M<=h,I=!1;this._decorationService.forEachDecorationAtCell(M,t,void 0,ye=>{I=!0});let C=R.getChars()||ai;if(C===" "&&(R.isUnderline()||R.isOverline())&&(C=" "),F=O*a-u.get(C,R.isBold(),R.isItalic()),!y)y=this._document.createElement("span");else if(w&&(W&&L||!W&&!L&&R.bg===v)&&(W&&L&&p.selectionForeground||R.fg===x)&&R.extended.ext===k&&$===b&&F===E&&!N&&!T&&!I&&B){R.isInvisible()?g+=ai:g+=C,w++;continue}else w&&(y.textContent=g),y=this._document.createElement("span"),w=0,g="";if(v=R.bg,x=R.fg,k=R.extended.ext,b=$,E=F,L=W,T&&s>=M&&s<=U&&(s=M),!this._coreService.isCursorHidden&&N&&this._coreService.isCursorInitialized){if(A.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&A.push("xterm-cursor-blink"),A.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(i)switch(i){case"outline":A.push("xterm-cursor-outline");break;case"block":A.push("xterm-cursor-block");break;case"bar":A.push("xterm-cursor-bar");break;case"underline":A.push("xterm-cursor-underline");break}}if(R.isBold()&&A.push("xterm-bold"),R.isItalic()&&A.push("xterm-italic"),R.isDim()&&A.push("xterm-dim"),R.isInvisible()?g=ai:g=R.getChars()||ai,R.isUnderline()&&(A.push(`xterm-underline-${R.extended.underlineStyle}`),g===" "&&(g=" "),!R.isUnderlineColorDefault()))if(R.isUnderlineColorRGB())y.style.textDecorationColor=`rgb(${al.toColorRGB(R.getUnderlineColor()).join(",")})`;else{let ye=R.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&R.isBold()&&ye<8&&(ye+=8),y.style.textDecorationColor=p.ansi[ye].css}R.isOverline()&&(A.push("xterm-overline"),g===" "&&(g=" ")),R.isStrikethrough()&&A.push("xterm-strikethrough"),$&&(y.style.textDecoration="underline");let q=R.getFgColor(),Y=R.getFgColorMode(),Z=R.getBgColor(),oe=R.getBgColorMode(),ke=!!R.isInverse();if(ke){let ye=q;q=Z,Z=ye;let ee=Y;Y=oe,oe=ee}let me,Ze,er=!1;this._decorationService.forEachDecorationAtCell(M,t,void 0,ye=>{ye.options.layer!=="top"&&er||(ye.backgroundColorRGB&&(oe=50331648,Z=ye.backgroundColorRGB.rgba>>8&16777215,me=ye.backgroundColorRGB),ye.foregroundColorRGB&&(Y=50331648,q=ye.foregroundColorRGB.rgba>>8&16777215,Ze=ye.foregroundColorRGB),er=ye.options.layer==="top")}),!er&&W&&(me=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,Z=me.rgba>>8&16777215,oe=50331648,er=!0,p.selectionForeground&&(Y=50331648,q=p.selectionForeground.rgba>>8&16777215,Ze=p.selectionForeground)),er&&A.push("xterm-decoration-top");let tr;switch(oe){case 16777216:case 33554432:tr=p.ansi[Z],A.push(`xterm-bg-${Z}`);break;case 50331648:tr=Ge.toColor(Z>>16,Z>>8&255,Z&255),this._addStyle(y,`background-color:#${q0((Z>>>0).toString(16),"0",6)}`);break;case 0:default:ke?(tr=p.foreground,A.push("xterm-bg-257")):tr=p.background}switch(me||R.isDim()&&(me=Me.multiplyOpacity(tr,.5)),Y){case 16777216:case 33554432:R.isBold()&&q<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(q+=8),this._applyMinimumContrast(y,tr,p.ansi[q],R,me,void 0)||A.push(`xterm-fg-${q}`);break;case 50331648:let ye=Ge.toColor(q>>16&255,q>>8&255,q&255);this._applyMinimumContrast(y,tr,ye,R,me,Ze)||this._addStyle(y,`color:#${q0(q.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(y,tr,p.foreground,R,me,Ze)||ke&&A.push("xterm-fg-257")}A.length&&(y.className=A.join(" "),A.length=0),!N&&!T&&!I&&B?w++:y.textContent=g,F!==this.defaultSpacing&&(y.style.letterSpacing=`${F}px`),d.push(y),M=U}return y&&w&&(y.textContent=g),d}_applyMinimumContrast(e,t,r,n,i,s){if(this._optionsService.rawOptions.minimumContrastRatio===1||jj(n.getCode()))return!1;let o=this._getContrastCache(n),a;if(!i&&!s&&(a=o.getColor(t.rgba,r.rgba)),a===void 0){let u=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);a=Me.ensureContrastRatio(i||t,s||r,u),o.setColor((i||t).rgba,(s||r).rgba,a??null)}return a?(this._addStyle(e,`color:${a.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 r=this._selectionStart,n=this._selectionEnd;return!r||!n?!1:this._columnSelectMode?r[0]<=n[0]?e>=r[0]&&t>=r[1]&&e<n[0]&&t<=n[1]:e<r[0]&&t>=r[1]&&e>=n[0]&&t<=n[1]:t>r[1]&&t<n[1]||r[1]===n[1]&&t===r[1]&&e>=r[0]&&e<n[0]||r[1]<n[1]&&t===n[1]&&e<n[0]||r[1]<n[1]&&t===r[1]&&e>=r[0]}};Lf=qe([J(1,iS),J(2,Bt),J(3,Ln),J(4,ps),J(5,ll),J(6,No)],Lf);function q0(e,t,r){for(;e.length<r;)e=t+e;return e}var Rj=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 r=e.createElement("span");r.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontStyle="italic";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold",s.style.fontStyle="italic",this._measureElements=[r,n,i,s],this._container.appendChild(r),this._container.appendChild(n),this._container.appendChild(i),this._container.appendChild(s),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,r,n){e===this._font&&t===this._fontSize&&r===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=r,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,r){let n=0;if(!t&&!r&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let o=this._measure(e,0);return o>0&&(this._flat[n]=o),o}let i=e;t&&(i+="B"),r&&(i+="I");let s=this._holey.get(i);if(s===void 0){let o=0;t&&(o|=1),r&&(o|=2),s=this._measure(e,o),s>0&&this._holey.set(i,s)}return s}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},Dj=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,r,n=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let i=e.buffers.active.ydisp,s=t[1]-i,o=r[1]-i,a=Math.max(s,0),u=Math.min(o,e.rows-1);if(a>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=s,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=u,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t<this.endCol&&r<=this.viewportCappedEndRow:t<this.startCol&&r>=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol):!1}};function Mj(){return new Dj}var Ch="xterm-dom-renderer-owner-",mr="xterm-rows",Wl="xterm-fg-",K0="xterm-bg-",Ho="xterm-focus",Ul="xterm-selection",Tj=1,Af=class extends fe{constructor(e,t,r,n,i,s,o,a,u,c,h,d,f,p){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=n,this._viewportElement=i,this._helperContainer=s,this._linkifier2=o,this._charSizeService=u,this._optionsService=c,this._bufferService=h,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=Tj++,this._rowElements=[],this._selectionRenderModel=Mj(),this.onRequestRedraw=this._register(new Q).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(mr),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(Ul),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Pj(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(m=>this._injectCss(m))),this._injectCss(this._themeService.colors),this._rowFactory=a.createInstance(Lf,document),this._element.classList.add(Ch+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(m=>this._handleLinkHover(m))),this._register(this._linkifier2.onHideLinkUnderline(m=>this._handleLinkLeave(m))),this._register(Ae(()=>{this._element.classList.remove(Ch+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Rj(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 r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${mr} 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} .${mr} { 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} .${mr} .xterm-dim { color: ${Me.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 r=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${mr}.${Ho} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${mr}.${Ho} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${mr}.${Ho} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Ul} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ul} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ul} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[s,o]of e.ansi.entries())t+=`${this._terminalSelector} .${Wl}${s} { color: ${o.css}; }${this._terminalSelector} .${Wl}${s}.xterm-dim { color: ${Me.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${K0}${s} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${Wl}257 { color: ${Me.opaque(e.background).css}; }${this._terminalSelector} .${Wl}257.xterm-dim { color: ${Me.multiplyOpacity(Me.opaque(e.background),.5).css}; }${this._terminalSelector} .${K0}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 r=this._rowElements.length;r<=t;r++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}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(Ho),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Ho),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,s=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(r){let u=e[0]>t[0];a.appendChild(this._createSelectionElement(s,u?t[0]:e[0],u?e[0]:t[0],o-s+1))}else{let u=n===s?e[0]:0,c=s===i?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(s,u,c));let h=o-s-1;if(a.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,h)),s!==o){let d=i===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,d))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,r,n=1){let i=this._document.createElement("div"),s=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(r-t);return s+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-s),i.style.height=`${n*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${s}px`,i.style.width=`${o}px`,i}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 r=this._bufferService.buffer,n=r.ybase+r.y,i=Math.min(r.x,this._bufferService.cols-1),s=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let u=e;u<=t;u++){let c=u+r.ydisp,h=this._rowElements[u],d=r.lines.get(c);if(!h||!d)break;h.replaceChildren(...this._rowFactory.createRow(d,c,c===n,o,a,i,s,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Ch}${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,r,n,i,s){r<0&&(e=0),n<0&&(t=0);let o=this._bufferService.rows-1;r=Math.max(Math.min(r,o),0),n=Math.max(Math.min(n,o),0),i=Math.min(i,this._bufferService.cols);let a=this._bufferService.buffer,u=a.ybase+a.y,c=Math.min(a.x,i-1),h=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let p=r;p<=n;++p){let m=p+a.ydisp,y=this._rowElements[p],w=a.lines.get(m);if(!y||!w)break;y.replaceChildren(...this._rowFactory.createRow(w,m,m===u,d,f,c,h,this.dimensions.css.cell.width,this._widthCache,s?p===r?e:0:-1,s?(p===n?t:i)-1:-1))}}};Af=qe([J(7,ym),J(8,Ru),J(9,Bt),J(10,It),J(11,ps),J(12,Ln),J(13,No)],Af);var Of=class extends fe{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Q),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new Aj(this._optionsService))}catch{this._measureStrategy=this._register(new Lj(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())}};Of=qe([J(2,Bt)],Of);var bS=class extends fe{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)}},Lj=class extends bS{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},Aj=class extends bS{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}},Oj=class extends fe{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new Ij(this._window)),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Q),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(vt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(ie(this._textarea,"focus",()=>this._isFocused=!0)),this._register(ie(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}},Ij=class extends fe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new wo),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Ae(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=ie(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)}},Bj=class extends fe{constructor(){super(),this.linkProviders=[],this._register(Ae(()=>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 Nm(e,t,r){let n=r.getBoundingClientRect(),i=e.getComputedStyle(r),s=parseInt(i.getPropertyValue("padding-left")),o=parseInt(i.getPropertyValue("padding-top"));return[t.clientX-n.left-s,t.clientY-n.top-o]}function Fj(e,t,r,n,i,s,o,a,u){if(!s)return;let c=Nm(e,t,r);if(c)return c[0]=Math.ceil((c[0]+(u?o/2:0))/o),c[1]=Math.ceil(c[1]/a),c[0]=Math.min(Math.max(c[0],1),n+(u?1:0)),c[1]=Math.min(Math.max(c[1],1),i),c}var If=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,n,i){return Fj(window,e,t,r,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let r=Nm(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};If=qe([J(0,An),J(1,Ru)],If);var zj=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,r){this._rowCount=r,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=[]}},CS={};XN(CS,{getSafariVersion:()=>Hj,isChromeOS:()=>jS,isFirefox:()=>kS,isIpad:()=>Wj,isIphone:()=>Uj,isLegacyEdge:()=>$j,isLinux:()=>Em,isMac:()=>tu,isNode:()=>Du,isSafari:()=>NS,isWindows:()=>ES});var Du=typeof process<"u"&&"title"in process,cl=Du?"node":navigator.userAgent,ul=Du?"node":navigator.platform,kS=cl.includes("Firefox"),$j=cl.includes("Edge"),NS=/^((?!chrome|android).)*safari/i.test(cl);function Hj(){if(!NS)return 0;let e=cl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var tu=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(ul),Wj=ul==="iPad",Uj=ul==="iPhone",ES=["Windows","Win16","Win32","WinCE"].includes(ul),Em=ul.indexOf("Linux")>=0,jS=/\bCrOS\b/.test(cl),PS=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,r=0,n=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),r=Math.max(t,r),i=e.timeRemaining(),r*1.5>i){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=i}this.clear()}},qj=class extends PS{_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())}}},Kj=class extends PS{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},ru=!Du&&"requestIdleCallback"in window?Kj:qj,Vj=class{constructor(){this._queue=new ru}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Bf=class extends fe{constructor(e,t,r,n,i,s,o,a,u){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=n,this._coreService=i,this._coreBrowserService=a,this._renderer=this._register(new wo),this._pausedResizeTask=new Vj,this._observerDisposable=this._register(new wo),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 Q),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Q),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Q),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new zj((c,h)=>this._renderRows(c,h),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new Qj(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Ae(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>{var c;return(c=this._renderer.value)==null?void 0:c.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(s.onDecorationRegistered(()=>this._fullRefresh())),this._register(s.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(u.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=Ae(()=>r.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,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),r||(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 r;return(r=this._renderer.value)==null?void 0:r.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,r){var n;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(n=this._renderer.value)==null||n.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Bf=qe([J(2,Bt),J(3,Ru),J(4,ps),J(5,ll),J(6,It),J(7,Ln),J(8,No)],Bf);var Qj=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,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 Yj(e,t,r,n){let i=r.buffer.x,s=r.buffer.y;if(!r.buffer.hasScrollback)return Jj(i,s,e,t,r,n)+Mu(s,t,r,n)+Zj(i,s,e,t,r,n);let o;if(s===t)return o=i>e?"D":"C",Wa(Math.abs(i-e),Ha(o,n));o=s>t?"D":"C";let a=Math.abs(s-t),u=Gj(s>t?e:i,r)+(a-1)*r.cols+1+Xj(s>t?i:e);return Wa(u,Ha(o,n))}function Xj(e,t){return e-1}function Gj(e,t){return t.cols-e}function Jj(e,t,r,n,i,s){return Mu(t,n,i,s).length===0?"":Wa(DS(e,t,e,t-as(t,i),!1,i).length,Ha("D",s))}function Mu(e,t,r,n){let i=e-as(e,r),s=t-as(t,r),o=Math.abs(i-s)-e4(e,t,r);return Wa(o,Ha(RS(e,t),n))}function Zj(e,t,r,n,i,s){let o;Mu(t,n,i,s).length>0?o=n-as(n,i):o=t;let a=n,u=t4(e,t,r,n,i,s);return Wa(DS(e,o,r,a,u==="C",i).length,Ha(u,s))}function e4(e,t,r){var o;let n=0,i=e-as(e,r),s=t-as(t,r);for(let a=0;a<Math.abs(i-s);a++){let u=RS(e,t)==="A"?-1:1;(o=r.buffer.lines.get(i+u*a))!=null&&o.isWrapped&&n++}return n}function as(e,t){let r=0,n=t.buffer.lines.get(e),i=n==null?void 0:n.isWrapped;for(;i&&e>=0&&e<t.rows;)r++,n=t.buffer.lines.get(--e),i=n==null?void 0:n.isWrapped;return r}function t4(e,t,r,n,i,s){let o;return Mu(r,n,i,s).length>0?o=n-as(n,i):o=t,e<r&&o<=n||e>=r&&o<n?"C":"D"}function RS(e,t){return e>t?"A":"B"}function DS(e,t,r,n,i,s){let o=e,a=t,u="";for(;(o!==r||a!==n)&&a>=0&&a<s.buffer.lines.length;)o+=i?1:-1,i&&o>s.cols-1?(u+=s.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!i&&o<0&&(u+=s.buffer.translateBufferLineToString(a,!1,0,e+1),o=s.cols-1,e=o,a--);return u+s.buffer.translateBufferLineToString(a,!1,e,o)}function Ha(e,t){let r=t?"O":"[";return H.ESC+r+e}function Wa(e,t){e=Math.floor(e);let r="";for(let n=0;n<e;n++)r+=t;return r}var r4=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 V0(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 kh=50,n4=15,i4=50,s4=500,o4=" ",a4=new RegExp(o4,"g"),Ff=class extends fe{constructor(e,t,r,n,i,s,o,a,u){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=n,this._coreService=i,this._mouseService=s,this._optionsService=o,this._renderService=a,this._coreBrowserService=u,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new kr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Q),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Q),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new r4(this._bufferService),this._activeSelectionMode=0,this._register(Ae(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.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 r=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let i=e[0]<t[0]?e[0]:t[0],s=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let a=r.translateBufferLineToString(o,!0,i,s);n.push(a)}}else{let i=e[1]===t[1]?t[0]:void 0;n.push(r.translateBufferLineToString(e[1],!0,e[0],i));for(let s=e[1]+1;s<=t[1]-1;s++){let o=r.lines.get(s),a=r.translateBufferLineToString(s,!0);o!=null&&o.isWrapped?n[n.length-1]+=a:n.push(a)}if(e[1]!==t[1]){let s=r.lines.get(t[1]),o=r.translateBufferLineToString(t[1],!0,0,t[0]);s&&s.isWrapped?n[n.length-1]+=o:n.push(o)}}return n.map(i=>i.replace(a4," ")).join(ES?`\r
|
|
417
|
+
`:`
|
|
418
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Em&&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),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n||!t?!1:this._areCoordsInSelection(t,r,n)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n?!1:this._areCoordsInSelection([e,t],r,n)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var i,s;let r=(s=(i=this._linkifier.currentLink)==null?void 0:i.link)==null?void 0:s.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=V0(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,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=Nm(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-kh),kh),t/=kh,t/Math.abs(t)+Math.round(t*(n4-1)))}shouldForceSelection(e){return tu?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(),i4)}_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&&!(tu&&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 r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let n=r.lines.get(this._model.selectionEnd[1]);n&&n.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<s4&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&r[0]!==void 0&&r[1]!==void 0){let n=Yj(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,t,r);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,r)}_fireOnSelectionChange(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let n=0;t>=n;n++){let i=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:i>1&&t!==n&&(r+=i-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,s=i.lines.get(e[1]);if(!s)return;let o=i.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(s,e[0]),u=a,c=e[0]-a,h=0,d=0,f=0,p=0;if(o.charAt(a)===" "){for(;a>0&&o.charAt(a-1)===" ";)a--;for(;u<o.length&&o.charAt(u+1)===" ";)u++}else{let w=e[0],g=e[0];s.getWidth(w)===0&&(h++,w--),s.getWidth(g)===2&&(d++,g++);let _=s.getString(g).length;for(_>1&&(p+=_-1,u+=_-1);w>0&&a>0&&!this._isCharWordSeparator(s.loadCell(w-1,this._workCell));){s.loadCell(w-1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===0?(h++,w--):v>1&&(f+=v-1,a-=v-1),a--,w--}for(;g<s.length&&u+1<o.length&&!this._isCharWordSeparator(s.loadCell(g+1,this._workCell));){s.loadCell(g+1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,g++):v>1&&(p+=v-1,u+=v-1),u++,g++}}u++;let m=a+c-h+f,y=Math.min(this._bufferService.cols,u-a+h+d-f-p);if(!(!t&&o.slice(a,u).trim()==="")){if(r&&m===0&&s.getCodePoint(0)!==32){let w=i.lines.get(e[1]-1);if(w&&s.isWrapped&&w.getCodePoint(this._bufferService.cols-1)!==32){let g=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(g){let _=this._bufferService.cols-g.start;m-=_,y+=_}}}if(n&&m+y===this._bufferService.cols&&s.getCodePoint(this._bufferService.cols-1)!==32){let w=i.lines.get(e[1]+1);if(w!=null&&w.isWrapped&&w.getCodePoint(0)!==32){let g=this._getWordAt([0,e[1]+1],!1,!1,!0);g&&(y+=g.length)}}return{start:m,length:y}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={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=V0(r,this._bufferService.cols)}};Ff=qe([J(3,It),J(4,ps),J(5,_m),J(6,Bt),J(7,An),J(8,Ln)],Ff);var Q0=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Y0=class{constructor(){this._color=new Q0,this._css=new Q0}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},et=Object.freeze((()=>{let e=[Ie.toColor("#2e3436"),Ie.toColor("#cc0000"),Ie.toColor("#4e9a06"),Ie.toColor("#c4a000"),Ie.toColor("#3465a4"),Ie.toColor("#75507b"),Ie.toColor("#06989a"),Ie.toColor("#d3d7cf"),Ie.toColor("#555753"),Ie.toColor("#ef2929"),Ie.toColor("#8ae234"),Ie.toColor("#fce94f"),Ie.toColor("#729fcf"),Ie.toColor("#ad7fa8"),Ie.toColor("#34e2e2"),Ie.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],i=t[r/6%6|0],s=t[r%6];e.push({css:Ge.toCss(n,i,s),rgba:Ge.toRgba(n,i,s)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:Ge.toCss(n,n,n),rgba:Ge.toRgba(n,n,n)})}return e})()),Ti=Ie.toColor("#ffffff"),ra=Ie.toColor("#000000"),X0=Ie.toColor("#ffffff"),G0=ra,Wo={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},l4=Ti,zf=class extends fe{constructor(e){super(),this._optionsService=e,this._contrastCache=new Y0,this._halfContrastCache=new Y0,this._onChangeColors=this._register(new Q),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Ti,background:ra,cursor:X0,cursorAccent:G0,selectionForeground:void 0,selectionBackgroundTransparent:Wo,selectionBackgroundOpaque:Me.blend(ra,Wo),selectionInactiveBackgroundTransparent:Wo,selectionInactiveBackgroundOpaque:Me.blend(ra,Wo),scrollbarSliderBackground:Me.opacity(Ti,.2),scrollbarSliderHoverBackground:Me.opacity(Ti,.4),scrollbarSliderActiveBackground:Me.opacity(Ti,.5),overviewRulerBorder:Ti,ansi:et.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=Ne(e.foreground,Ti),t.background=Ne(e.background,ra),t.cursor=Me.blend(t.background,Ne(e.cursor,X0)),t.cursorAccent=Me.blend(t.background,Ne(e.cursorAccent,G0)),t.selectionBackgroundTransparent=Ne(e.selectionBackground,Wo),t.selectionBackgroundOpaque=Me.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Ne(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Me.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Ne(e.selectionForeground,U0):void 0,t.selectionForeground===U0&&(t.selectionForeground=void 0),Me.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Me.opacity(t.selectionBackgroundTransparent,.3)),Me.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Me.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Ne(e.scrollbarSliderBackground,Me.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Ne(e.scrollbarSliderHoverBackground,Me.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Ne(e.scrollbarSliderActiveBackground,Me.opacity(t.foreground,.5)),t.overviewRulerBorder=Ne(e.overviewRulerBorder,l4),t.ansi=et.slice(),t.ansi[0]=Ne(e.black,et[0]),t.ansi[1]=Ne(e.red,et[1]),t.ansi[2]=Ne(e.green,et[2]),t.ansi[3]=Ne(e.yellow,et[3]),t.ansi[4]=Ne(e.blue,et[4]),t.ansi[5]=Ne(e.magenta,et[5]),t.ansi[6]=Ne(e.cyan,et[6]),t.ansi[7]=Ne(e.white,et[7]),t.ansi[8]=Ne(e.brightBlack,et[8]),t.ansi[9]=Ne(e.brightRed,et[9]),t.ansi[10]=Ne(e.brightGreen,et[10]),t.ansi[11]=Ne(e.brightYellow,et[11]),t.ansi[12]=Ne(e.brightBlue,et[12]),t.ansi[13]=Ne(e.brightMagenta,et[13]),t.ansi[14]=Ne(e.brightCyan,et[14]),t.ansi[15]=Ne(e.brightWhite,et[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)t.ansi[n+16]=Ne(e.extendedAnsi[n],et[n+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()}}};zf=qe([J(0,Bt)],zf);function Ne(e,t){if(e!==void 0)try{return Ie.toColor(e)}catch{}return t}var c4=class{constructor(...e){this._entries=new Map;for(let[t,r]of e)this.set(t,r)}set(e,t){let r=this._entries.get(e);return this._entries.set(e,t),r}forEach(e){for(let[t,r]of this._entries.entries())e(t,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},u4=class{constructor(){this._services=new c4,this._services.set(ym,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let r=nE(e).sort((s,o)=>s.index-o.index),n=[];for(let s of r){let o=this._services.get(s.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${s.id._id}.`);n.push(o)}let i=r.length>0?r[0].index:t.length;if(t.length!==i)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},h4={trace:0,debug:1,info:2,warn:3,error:4,off:5},d4="xterm.js: ",$f=class extends fe{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=h4[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,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":d4)+t,...r)}trace(e,...t){var r;this._logLevel<=0&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var r;this._logLevel<=1&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var r;this._logLevel<=2&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var r;this._logLevel<=3&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var r;this._logLevel<=4&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,e,t)}};$f=qe([J(0,Bt)],$f);var J0=class extends fe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Q),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Q),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Q),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 r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];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,...r){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<r.length;n++)this._array[this._getCyclicIndex(e+n)]=r[n];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let n=this._length+r.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let i=t-1;i>=0;i--)this.set(e+i+r,this.get(e+i));let n=e+t+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},de=3,Xe=Object.freeze(new al),ql=0,Nh=2,na=class MS{constructor(t,r,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*de);let i=r||kr.fromCharData([0,Gw,1,0]);for(let s=0;s<t;++s)this.setCell(s,i);this.length=t}get(t){let r=this._data[t*de+0],n=r&2097151;return[this._data[t*de+1],r&2097152?this._combined[t]:n?Vn(n):"",r>>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,r){this._data[t*de+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*de+0]=t|2097152|r[2]<<22):this._data[t*de+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*de+0]>>22}hasWidth(t){return this._data[t*de+0]&12582912}getFg(t){return this._data[t*de+1]}getBg(t){return this._data[t*de+2]}hasContent(t){return this._data[t*de+0]&4194303}getCodePoint(t){let r=this._data[t*de+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*de+0]&2097152}getString(t){let r=this._data[t*de+0];return r&2097152?this._combined[t]:r&2097151?Vn(r&2097151):""}isProtected(t){return this._data[t*de+2]&536870912}loadCell(t,r){return ql=t*de,r.content=this._data[ql+0],r.fg=this._data[ql+1],r.bg=this._data[ql+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*de+0]=r.content,this._data[t*de+1]=r.fg,this._data[t*de+2]=r.bg}setCellFromCodepoint(t,r,n,i){i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*de+0]=r|n<<22,this._data[t*de+1]=i.fg,this._data[t*de+2]=i.bg}addCodepointToCell(t,r,n){let i=this._data[t*de+0];i&2097152?this._combined[t]+=Vn(r):i&2097151?(this._combined[t]=Vn(i&2097151)+Vn(r),i&=-2097152,i|=2097152):i=r|1<<22,n&&(i&=-12582913,i|=n<<22),this._data[t*de+0]=i}insertCells(t,r,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length-t){let i=new kr;for(let s=this.length-t-r-1;s>=0;--s)this.setCell(t+r+s,this.loadCell(t+s,i));for(let s=0;s<r;++s)this.setCell(t+s,n)}else for(let i=t;i<this.length;++i)this.setCell(i,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,r,n){if(t%=this.length,r<this.length-t){let i=new kr;for(let s=0;s<this.length-t-r;++s)this.setCell(t+s,this.loadCell(t+r+s,i));for(let s=this.length-r;s<this.length;++s)this.setCell(s,n)}else for(let i=t;i<this.length;++i)this.setCell(i,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,r,n,i=!1){if(i){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.setCell(t++,n)}resize(t,r){if(t===this.length)return this._data.length*4*Nh<this._data.buffer.byteLength;let n=t*de;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let i=new Uint32Array(n);i.set(this._data),this._data=i}for(let i=this.length;i<t;++i)this.setCell(i,r)}else{this._data=this._data.subarray(0,n);let i=Object.keys(this._combined);for(let o=0;o<i.length;o++){let a=parseInt(i[o],10);a>=t&&delete this._combined[a]}let s=Object.keys(this._extendedAttrs);for(let o=0;o<s.length;o++){let a=parseInt(s[o],10);a>=t&&delete this._extendedAttrs[a]}}return this.length=t,n*4*Nh<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Nh<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,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 r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(let r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){let t=new MS(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let r in this._combined)t._combined[r]=this._combined[r];for(let r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*de+0]&4194303)return t+(this._data[t*de+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*de+0]&4194303||this._data[t*de+2]&50331648)return t+(this._data[t*de+0]>>22);return 0}copyCellsFrom(t,r,n,i,s){let o=t._data;if(s)for(let u=i-1;u>=0;u--){for(let c=0;c<de;c++)this._data[(n+u)*de+c]=o[(r+u)*de+c];o[(r+u)*de+2]&268435456&&(this._extendedAttrs[n+u]=t._extendedAttrs[r+u])}else for(let u=0;u<i;u++){for(let c=0;c<de;c++)this._data[(n+u)*de+c]=o[(r+u)*de+c];o[(r+u)*de+2]&268435456&&(this._extendedAttrs[n+u]=t._extendedAttrs[r+u])}let a=Object.keys(t._combined);for(let u=0;u<a.length;u++){let c=parseInt(a[u],10);c>=r&&(this._combined[c-r+n]=t._combined[c])}}translateToString(t,r,n,i){r=r??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),i&&(i.length=0);let s="";for(;r<n;){let o=this._data[r*de+0],a=o&2097151,u=o&2097152?this._combined[r]:a?Vn(a):ai;if(s+=u,i)for(let c=0;c<u.length;++c)i.push(r);r+=o>>22||1}return i&&i.push(r),s}};function f4(e,t,r,n,i,s){let o=[];for(let a=0;a<e.length-1;a++){let u=a,c=e.get(++u);if(!c.isWrapped)continue;let h=[e.get(a)];for(;u<e.length&&c.isWrapped;)h.push(c),c=e.get(++u);if(!s&&n>=a&&n<u){a+=h.length-1;continue}let d=0,f=Ua(h,d,t),p=1,m=0;for(;p<h.length;){let w=Ua(h,p,t),g=w-m,_=r-f,v=Math.min(g,_);h[d].copyCellsFrom(h[p],m,f,v,!1),f+=v,f===r&&(d++,f=0),m+=v,m===w&&(p++,m=0),f===0&&d!==0&&h[d-1].getWidth(r-1)===2&&(h[d].copyCellsFrom(h[d-1],r-1,f++,1,!1),h[d-1].setCell(r-1,i))}h[d].replaceCells(f,r,i);let y=0;for(let w=h.length-1;w>0&&(w>d||h[w].getTrimmedLength()===0);w--)y++;y>0&&(o.push(a+h.length-y),o.push(y)),a+=h.length-1}return o}function p4(e,t){let r=[],n=0,i=t[n],s=0;for(let o=0;o<e.length;o++)if(i===o){let a=t[++n];e.onDeleteEmitter.fire({index:o-s,amount:a}),o+=a-1,s+=a,i=t[++n]}else r.push(o);return{layout:r,countRemoved:s}}function m4(e,t){let r=[];for(let n=0;n<t.length;n++)r.push(e.get(t[n]));for(let n=0;n<r.length;n++)e.set(n,r[n]);e.length=t.length}function g4(e,t,r){let n=[],i=e.map((u,c)=>Ua(e,c,t)).reduce((u,c)=>u+c),s=0,o=0,a=0;for(;a<i;){if(i-a<r){n.push(i-a);break}s+=r;let u=Ua(e,o,t);s>u&&(s-=u,o++);let c=e[o].getWidth(s-1)===2;c&&s--;let h=c?r-1:r;n.push(h),a+=h}return n}function Ua(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,i=e[t+1].getWidth(0)===2;return n&&i?r-1:r}var TS=class LS{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=LS._nextId++,this._onDispose=this.register(new Q),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),os(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};TS._nextId=1;var v4=TS,ot={},Li=ot.B;ot[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ot.A={"#":"£"};ot.B=void 0;ot[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ot.C=ot[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ot.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ot.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ot.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ot.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ot.E=ot[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ot.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ot.H=ot[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ot["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Z0=4294967295,ev=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Xe.clone(),this.savedCharset=Li,this.markers=[],this._nullCell=kr.fromCharData([0,Gw,1,0]),this._whitespaceCell=kr.fromCharData([0,ai,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new ru,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new J0(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 Jc),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 Jc),this._whitespaceCell}getBlankLine(e,t){return new na(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>Z0?Z0:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Xe);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 J0(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(Xe),n=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let o=0;o<this.lines.length;o++)n+=+this.lines.get(o).resize(e,r);let s=0;if(this._rows<t)for(let o=this._rows;o<t;o++)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 na(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new na(e,r)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let o=this.lines.length-i;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),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 s=0;s<this.lines.length;s++)n+=+this.lines.get(s).resize(e,r);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.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 r=this._optionsService.rawOptions.reflowCursorLine,n=f4(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Xe),r);if(n.length>0){let i=p4(this.lines,n);m4(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let n=this.getNullCell(Xe),i=r;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new na(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(Xe),i=[],s=0;for(let o=this.lines.length-1;o>=0;o--){let a=this.lines.get(o);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let u=[a];for(;a.isWrapped&&o>0;)a=this.lines.get(--o),u.unshift(a);if(!r){let v=this.ybase+this.y;if(v>=o&&v<o+u.length)continue}let c=u[u.length-1].getTrimmedLength(),h=g4(u,this._cols,e),d=h.length-u.length,f;this.ybase===0&&this.y!==this.lines.length-1?f=Math.max(0,this.y-this.lines.maxLength+d):f=Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let v=0;v<d;v++){let x=this.getBlankLine(Xe,!0);p.push(x)}p.length>0&&(i.push({start:o+u.length+s,newLines:p}),s+=p.length),u.push(...p);let m=h.length-1,y=h[m];y===0&&(m--,y=h[m]);let w=u.length-d-1,g=c;for(;w>=0;){let v=Math.min(g,y);if(u[m]===void 0)break;if(u[m].copyCellsFrom(u[w],g-v,y-v,v,!0),y-=v,y===0&&(m--,y=h[m]),g-=v,g===0){w--;let x=Math.max(w,0);g=Ua(u,x,this._cols)}}for(let v=0;v<u.length;v++)h[v]<e&&u[v].setCell(h[v],n);let _=d-f;for(;_-- >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+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.length>0){let o=[],a=[];for(let y=0;y<this.lines.length;y++)a.push(this.lines.get(y));let u=this.lines.length,c=u-1,h=0,d=i[h];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);let f=0;for(let y=Math.min(this.lines.maxLength-1,u+s-1);y>=0;y--)if(d&&d.start>c+f){for(let w=d.newLines.length-1;w>=0;w--)this.lines.set(y--,d.newLines[w]);y++,o.push({index:c+1,amount:d.newLines.length}),f+=d.newLines.length,d=i[++h]}else this.lines.set(y,a[c--]);let p=0;for(let y=o.length-1;y>=0;y--)o[y].index+=p,this.lines.onInsertEmitter.fire(o[y]),p+=o[y].amount;let m=Math.max(0,u+s-this.lines.maxLength);m>0&&this.lines.onTrimEmitter.fire(m)}}translateBufferLineToString(e,t,r=0,n){let i=this.lines.get(e);return i?i.translateToString(t,r,n):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}}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 v4(e);return this.markers.push(t),t.register(this.lines.onTrim(r=>{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.line<r.index+r.amount&&t.dispose(),t.line>r.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},y4=class extends fe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new Q),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 ev(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new ev(!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)}},AS=2,OS=1,Hf=class extends fe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,AS),this.rows=Math.max(e.rawOptions.rows||0,OS),this.buffers=this._register(new y4(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=r.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let i=r.ybase+r.scrollTop,s=r.ybase+r.scrollBottom;if(r.scrollTop===0){let o=r.lines.isFull;s===r.lines.length-1?o?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(s+1,0,n.clone()),o?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let o=s-i+1;r.lines.shiftElements(i+1,o-1,-1),r.lines.set(s,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};Hf=qe([J(0,Bt)],Hf);var ws={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:tu,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},_4=["normal","bold","100","200","300","400","500","600","700","800","900"],x4=class extends fe{constructor(e){super(),this._onOptionChange=this._register(new Q),this.onOptionChange=this._onOptionChange.event;let t={...ws};for(let r in e)if(r in t)try{let n=e[r];t[r]=this._sanitizeAndValidateOption(r,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Ae(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in ws))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,n)=>{if(!(r in ws))throw new Error(`No option with key "${r}"`);n=this._sanitizeAndValidateOption(r,n),this.rawOptions[r]!==n&&(this.rawOptions[r]=n,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=ws[e]),!w4(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ws[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=_4.includes(t)?t:ws[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 w4(e){return e==="block"||e==="underline"||e==="bar"}function ia(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=t<=1?e[n]:e[n]&&ia(e[n],t-1);return r}var tv=Object.freeze({insertMode:!1}),rv=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Wf=class extends fe{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Q),this.onData=this._onData.event,this._onUserInput=this._register(new Q),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Q),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ia(tv),this.decPrivateModes=ia(rv)}reset(){this.modes=ia(tv),this.decPrivateModes=ia(rv)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.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))}};Wf=qe([J(0,It),J(1,rS),J(2,Bt)],Wf);var nv={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 Eh(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var jh=String.fromCharCode,iv={DEFAULT:e=>{let t=[Eh(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${jh(t[0])}${jh(t[1])}${jh(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Eh(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Eh(e,!0)};${e.x};${e.y}${t}`}},Uf=class extends fe{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Q),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(nv))this.addProtocol(n,nv[n]);for(let n of Object.keys(iv))this.addEncoding(n,iv[n]);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,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let n=t/r,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=n+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_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,r){if(r){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)}};Uf=qe([J(0,It),J(1,ps),J(2,Bt)],Uf);var Ph=[[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]],S4=[[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]],tt;function b4(e,t){let r=0,n=t.length-1,i;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(i=r+n>>1,e>t[i][1])r=i+1;else if(e<t[i][0])n=i-1;else return!0;return!1}var C4=class{constructor(){if(this.version="6",!tt){tt=new Uint8Array(65536),tt.fill(1),tt[0]=0,tt.fill(0,1,32),tt.fill(0,127,160),tt.fill(2,4352,4448),tt[9001]=2,tt[9002]=2,tt.fill(2,11904,42192),tt[12351]=1,tt.fill(2,44032,55204),tt.fill(2,63744,64256),tt.fill(2,65040,65050),tt.fill(2,65072,65136),tt.fill(2,65280,65377),tt.fill(2,65504,65511);for(let e=0;e<Ph.length;++e)tt.fill(0,Ph[e][0],Ph[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?tt[e]:b4(e,S4)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),n=r===0&&t!==0;if(n){let i=zi.extractWidth(t);i===0?n=!1:i>r&&(r=i)}return zi.createPropertyValue(0,r,n)}},zi=class _c{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Q,this.onChange=this._onChange.event;let t=new C4;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,r,n=!1){return(t&16777215)<<3|(r&3)<<1|(n?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 r=0,n=0,i=t.length;for(let s=0;s<i;++s){let o=t.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=i)return r+this.wcwidth(o);let c=t.charCodeAt(s);56320<=c&&c<=57343?o=(o-55296)*1024+c-56320+65536:r+=this.wcwidth(c)}let a=this.charProperties(o,n),u=_c.extractWidth(a);_c.extractShouldJoin(a)&&(u-=_c.extractWidth(n)),r+=u,n=a}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},k4=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 sv(e){var n;let t=(n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:n.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var Uo=2147483647,N4=256,IS=class qf{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>N4)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new qf;if(!t.length)return r;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let i=t[n];if(Array.isArray(i))for(let s=0;s<i.length;++s)r.addSubParam(i[s]);else r.addParam(i)}return r}clone(){let t=new qf(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 r=0;r<this.length;++r){t.push(this.params[r]);let n=this._subParamsIdx[r]>>8,i=this._subParamsIdx[r]&255;i-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,i))}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>Uo?Uo: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>Uo?Uo:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-r>0?this._subParams.subarray(r,n):null}getSubParamsAll(){let t={};for(let r=0;r<this.length;++r){let n=this._subParamsIdx[r]>>8,i=this._subParamsIdx[r]&255;i-n>0&&(t[r]=this._subParams.slice(n,i))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,i=n[r-1];n[r-1]=~i?Math.min(i*10+t,Uo):t}},qo=[],E4=class{constructor(){this._state=0,this._active=qo,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 r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=qo}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=qo,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||qo,!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,r){if(!this._active.length)this._handlerFb(this._id,"PUT",Pu(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t<r;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&r-t>0&&this._put(e,t,r)}}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 r=!1,n=this._active.length-1,i=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&r===!1){for(;n>=0&&(r=this._active[n].end(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=qo,this._id=-1,this._state=0}}},ir=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,r,n){this._hitLimit||(this._data+=Pu(t,r,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let r=!1;if(this._hitLimit)r=!1;else if(t&&(r=this._handler(this._data),r instanceof Promise))return r.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,r}},Ko=[],j4=class{constructor(){this._handlers=Object.create(null),this._active=Ko,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Ko}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=Ko,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Ko,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",Pu(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,n=this._active.length-1,i=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&r===!1){for(;n>=0&&(r=this._active[n].unhook(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=Ko,this._ident=0}},sa=new IS;sa.addParam(0);var ov=class{constructor(e){this._handler=e,this._data="",this._params=sa,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():sa,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=Pu(e,t,r),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(r=>(this._params=sa,this._data="",this._hitLimit=!1,r));return this._params=sa,this._data="",this._hitLimit=!1,t}},P4=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,n){this.table[t<<8|e]=r<<4|n}addMany(e,t,r,n){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=r<<4|n}},_r=160,R4=function(){let e=new P4(4095),t=Array.apply(null,Array(256)).map((a,u)=>u),r=(a,u)=>t.slice(a,u),n=r(32,127),i=r(0,24);i.push(25),i.push.apply(i,r(28,32));let s=r(0,14),o;e.setDefault(1,0),e.addMany(n,0,2,0);for(o in s)e.addMany([24,26,153,154],o,3,0),e.addMany(r(128,144),o,3,0),e.addMany(r(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(_r,0,2,0),e.add(_r,8,5,8),e.add(_r,6,0,6),e.add(_r,11,0,11),e.add(_r,13,13,13),e}(),D4=class extends fe{constructor(e=R4){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 IS,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},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(Ae(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new E4),this._dcsParser=this._register(new j4),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>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 i=0;i<e.intermediates.length;++i){let s=e.intermediates.charCodeAt(i);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=s}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=n,r}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 r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,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 r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,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,r,n,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=i}parse(e,t,r){let n=0,i=0,s=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,s=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,u=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&u>-1){for(;u>=0&&(o=a[u](this._params),o!==!0);u--)if(o instanceof Promise)return this._parseStack.handlerPos=u,o}this._parseStack.handlers=[];break;case 4:if(r===!1&&u>-1){for(;u>=0&&(o=a[u](),o!==!0);u--)if(o instanceof Promise)return this._parseStack.handlerPos=u,o}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(n!==24&&n!==26,r),o)return o;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],o=this._oscParser.end(n!==24&&n!==26,r),o)return o;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,s=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=s;a<t;++a){switch(n=e[a],i=this._transitions.table[this.currentState<<8|(n<160?n:_r)],i>>4){case 2:for(let f=a+1;;++f){if(f>=t||(n=e[f])<32||n>126&&n<_r){this._printHandler(e,a,f),a=f-1;break}if(++f>=t||(n=e[f])<32||n>126&&n<_r){this._printHandler(e,a,f),a=f-1;break}if(++f>=t||(n=e[f])<32||n>126&&n<_r){this._printHandler(e,a,f),a=f-1;break}if(++f>=t||(n=e[f])<32||n>126&&n<_r){this._printHandler(e,a,f),a=f-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:a,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let u=this._csiHandlers[this._collect<<8|n],c=u?u.length-1:-1;for(;c>=0&&(o=u[c](this._params),o!==!0);c--)if(o instanceof Promise)return this._preserveStack(3,u,c,i,a),o;c<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++a<t&&(n=e[a])>47&&n<60);a--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let h=this._escHandlers[this._collect<<8|n],d=h?h.length-1:-1;for(;d>=0&&(o=h[d](),o!==!0);d--)if(o instanceof Promise)return this._preserveStack(4,h,d,i,a),o;d<0&&this._escHandlerFb(this._collect<<8|n),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|n,this._params);break;case 13:for(let f=a+1;;++f)if(f>=t||(n=e[f])===24||n===26||n===27||n>127&&n<_r){this._dcsParser.put(e,a,f),a=f-1;break}break;case 14:if(o=this._dcsParser.unhook(n!==24&&n!==26),o)return this._preserveStack(6,[],0,i,a),o;n===27&&(i|=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 f=a+1;;f++)if(f>=t||(n=e[f])<32||n>127&&n<_r){this._oscParser.put(e,a,f),a=f-1;break}break;case 6:if(o=this._oscParser.end(n!==24&&n!==26),o)return this._preserveStack(5,[],0,i,a),o;n===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=i&15}}},M4=/^([\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})$/,T4=/^[\da-f]+$/;function av(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let r=M4.exec(t);if(r){let n=r[1]?15:r[4]?255:r[7]?4095:65535;return[Math.round(parseInt(r[1]||r[4]||r[7]||r[10],16)/n*255),Math.round(parseInt(r[2]||r[5]||r[8]||r[11],16)/n*255),Math.round(parseInt(r[3]||r[6]||r[9]||r[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),T4.exec(t)&&[3,6,9,12].includes(t.length))){let r=t.length/3,n=[0,0,0];for(let i=0;i<3;++i){let s=parseInt(t.slice(r*i,r*i+r),16);n[i]=r===1?s<<4:r===2?s:r===3?s>>4:s>>8}return n}}function Rh(e,t){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function L4(e,t=16){let[r,n,i]=e;return`rgb:${Rh(r,t)}/${Rh(n,t)}/${Rh(i,t)}`}var A4={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$n=131072,lv=10;function cv(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 uv=5e3,hv=0,O4=class extends fe{constructor(e,t,r,n,i,s,o,a,u=new D4){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=n,this._optionsService=i,this._oscLinkService=s,this._coreMouseService=o,this._unicodeService=a,this._parser=u,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new tE,this._utf8Decoder=new rE,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Xe.clone(),this._eraseAttrDataInternal=Xe.clone(),this._onRequestBell=this._register(new Q),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Q),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Q),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Q),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Q),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Q),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Q),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Q),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Q),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 Kf(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(c=>this._activeBuffer=c.activeBuffer)),this._parser.setCsiHandlerFallback((c,h)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(c),params:h.toArray()})}),this._parser.setEscHandlerFallback(c=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(c)})}),this._parser.setExecuteHandlerFallback(c=>{this._logService.debug("Unknown EXECUTE code: ",{code:c})}),this._parser.setOscHandlerFallback((c,h,d)=>{this._logService.debug("Unknown OSC code: ",{identifier:c,action:h,data:d})}),this._parser.setDcsHandlerFallback((c,h,d)=>{h==="HOOK"&&(d=d.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(c),action:h,payload:d})}),this._parser.setPrintHandler((c,h,d)=>this.print(c,h,d)),this._parser.registerCsiHandler({final:"@"},c=>this.insertChars(c)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},c=>this.scrollLeft(c)),this._parser.registerCsiHandler({final:"A"},c=>this.cursorUp(c)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},c=>this.scrollRight(c)),this._parser.registerCsiHandler({final:"B"},c=>this.cursorDown(c)),this._parser.registerCsiHandler({final:"C"},c=>this.cursorForward(c)),this._parser.registerCsiHandler({final:"D"},c=>this.cursorBackward(c)),this._parser.registerCsiHandler({final:"E"},c=>this.cursorNextLine(c)),this._parser.registerCsiHandler({final:"F"},c=>this.cursorPrecedingLine(c)),this._parser.registerCsiHandler({final:"G"},c=>this.cursorCharAbsolute(c)),this._parser.registerCsiHandler({final:"H"},c=>this.cursorPosition(c)),this._parser.registerCsiHandler({final:"I"},c=>this.cursorForwardTab(c)),this._parser.registerCsiHandler({final:"J"},c=>this.eraseInDisplay(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},c=>this.eraseInDisplay(c,!0)),this._parser.registerCsiHandler({final:"K"},c=>this.eraseInLine(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},c=>this.eraseInLine(c,!0)),this._parser.registerCsiHandler({final:"L"},c=>this.insertLines(c)),this._parser.registerCsiHandler({final:"M"},c=>this.deleteLines(c)),this._parser.registerCsiHandler({final:"P"},c=>this.deleteChars(c)),this._parser.registerCsiHandler({final:"S"},c=>this.scrollUp(c)),this._parser.registerCsiHandler({final:"T"},c=>this.scrollDown(c)),this._parser.registerCsiHandler({final:"X"},c=>this.eraseChars(c)),this._parser.registerCsiHandler({final:"Z"},c=>this.cursorBackwardTab(c)),this._parser.registerCsiHandler({final:"`"},c=>this.charPosAbsolute(c)),this._parser.registerCsiHandler({final:"a"},c=>this.hPositionRelative(c)),this._parser.registerCsiHandler({final:"b"},c=>this.repeatPrecedingCharacter(c)),this._parser.registerCsiHandler({final:"c"},c=>this.sendDeviceAttributesPrimary(c)),this._parser.registerCsiHandler({prefix:">",final:"c"},c=>this.sendDeviceAttributesSecondary(c)),this._parser.registerCsiHandler({final:"d"},c=>this.linePosAbsolute(c)),this._parser.registerCsiHandler({final:"e"},c=>this.vPositionRelative(c)),this._parser.registerCsiHandler({final:"f"},c=>this.hVPosition(c)),this._parser.registerCsiHandler({final:"g"},c=>this.tabClear(c)),this._parser.registerCsiHandler({final:"h"},c=>this.setMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"h"},c=>this.setModePrivate(c)),this._parser.registerCsiHandler({final:"l"},c=>this.resetMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"l"},c=>this.resetModePrivate(c)),this._parser.registerCsiHandler({final:"m"},c=>this.charAttributes(c)),this._parser.registerCsiHandler({final:"n"},c=>this.deviceStatus(c)),this._parser.registerCsiHandler({prefix:"?",final:"n"},c=>this.deviceStatusPrivate(c)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},c=>this.softReset(c)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},c=>this.setCursorStyle(c)),this._parser.registerCsiHandler({final:"r"},c=>this.setScrollRegion(c)),this._parser.registerCsiHandler({final:"s"},c=>this.saveCursor(c)),this._parser.registerCsiHandler({final:"t"},c=>this.windowOptions(c)),this._parser.registerCsiHandler({final:"u"},c=>this.restoreCursor(c)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},c=>this.insertColumns(c)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},c=>this.deleteColumns(c)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},c=>this.selectProtected(c)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},c=>this.requestMode(c,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},c=>this.requestMode(c,!1)),this._parser.setExecuteHandler(H.BEL,()=>this.bell()),this._parser.setExecuteHandler(H.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(H.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(H.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(H.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(H.BS,()=>this.backspace()),this._parser.setExecuteHandler(H.HT,()=>this.tab()),this._parser.setExecuteHandler(H.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(H.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(vc.IND,()=>this.index()),this._parser.setExecuteHandler(vc.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(vc.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new ir(c=>(this.setTitle(c),this.setIconName(c),!0))),this._parser.registerOscHandler(1,new ir(c=>this.setIconName(c))),this._parser.registerOscHandler(2,new ir(c=>this.setTitle(c))),this._parser.registerOscHandler(4,new ir(c=>this.setOrReportIndexedColor(c))),this._parser.registerOscHandler(8,new ir(c=>this.setHyperlink(c))),this._parser.registerOscHandler(10,new ir(c=>this.setOrReportFgColor(c))),this._parser.registerOscHandler(11,new ir(c=>this.setOrReportBgColor(c))),this._parser.registerOscHandler(12,new ir(c=>this.setOrReportCursorColor(c))),this._parser.registerOscHandler(104,new ir(c=>this.restoreIndexedColor(c))),this._parser.registerOscHandler(110,new ir(c=>this.restoreFgColor(c))),this._parser.registerOscHandler(111,new ir(c=>this.restoreBgColor(c))),this._parser.registerOscHandler(112,new ir(c=>this.restoreCursorColor(c))),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 c in ot)this._parser.registerEscHandler({intermediates:"(",final:c},()=>this.selectCharset("("+c)),this._parser.registerEscHandler({intermediates:")",final:c},()=>this.selectCharset(")"+c)),this._parser.registerEscHandler({intermediates:"*",final:c},()=>this.selectCharset("*"+c)),this._parser.registerEscHandler({intermediates:"+",final:c},()=>this.selectCharset("+"+c)),this._parser.registerEscHandler({intermediates:"-",final:c},()=>this.selectCharset("-"+c)),this._parser.registerEscHandler({intermediates:".",final:c},()=>this.selectCharset("."+c)),this._parser.registerEscHandler({intermediates:"/",final:c},()=>this.selectCharset("/"+c));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(c=>(this._logService.error("Parsing error: ",c),c)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new ov((c,h)=>this.requestStatusString(c,h)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),uv))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${uv} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,n=this._activeBuffer.x,i=this._activeBuffer.y,s=0,o=this._parseStack.paused;if(o){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>$n&&(s=this._parseStack.position+$n)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,c=>String.fromCharCode(c)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(c=>c.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<$n&&(this._parseBuffer=new Uint32Array(Math.min(e.length,$n))),o||this._dirtyRowTracker.clearRange(),e.length>$n)for(let c=s;c<e.length;c+=$n){let h=c+$n<e.length?c+$n:e.length,d=typeof e=="string"?this._stringDecoder.decode(e.substring(c,h),this._parseBuffer):this._utf8Decoder.decode(e.subarray(c,h),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,d))return this._preserveStack(n,i,d,c),this._logSlowResolvingAsync(r),r}else if(!o){let c=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,c))return this._preserveStack(n,i,c,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let a=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),u=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);u<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(u,this._bufferService.rows-1),end:Math.min(a,this._bufferService.rows-1)})}print(e,t,r){let n,i,s=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,a=this._bufferService.cols,u=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,h=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,h);let f=this._parser.precedingJoinState;for(let p=t;p<r;++p){if(n=e[p],n<127&&s){let g=s[String.fromCharCode(n)];g&&(n=g.charCodeAt(0))}let m=this._unicodeService.charProperties(n,f);i=zi.extractWidth(m);let y=zi.extractShouldJoin(m),w=y?zi.extractWidth(f):0;if(f=m,o&&this._onA11yChar.fire(Vn(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-w>a){if(u){let g=d,_=this._activeBuffer.x-w;for(this._activeBuffer.x=w,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),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),w>0&&d instanceof na&&d.copyCellsFrom(g,_,0,w,!1);_<a;)g.setCellFromCodepoint(_++,0,1,h)}else if(this._activeBuffer.x=a-1,i===2)continue}if(y&&this._activeBuffer.x){let g=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-g,n,i);for(let _=i-w;--_>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,h);continue}if(c&&(d.insertCells(this._activeBuffer.x,i-w,this._activeBuffer.getNullCell(h)),d.getWidth(a-1)===2&&d.setCellFromCodepoint(a-1,0,1,h)),d.setCellFromCodepoint(this._activeBuffer.x++,n,i,h),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,h)}this._parser.precedingJoinState=f,this._activeBuffer.x<a&&r-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,h),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>cv(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new ov(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new ir(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,r,n=!1,i=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),i),n&&(s.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var n;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r<this._bufferService.rows;r++)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&n.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let i=this._activeBuffer.lines.length-this._bufferService.rows;i>0&&(this._activeBuffer.lines.trimStart(i),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-i,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-i,0),this._onScroll.fire(0));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 r=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(i-1,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}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 r=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(r,1),this._activeBuffer.lines.splice(n,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(Xe));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 r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 r=e.params[0]||1,n=zi.extractWidth(t),i=this._activeBuffer.x-n,s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(s.length*r),a=0;for(let c=0;c<s.length;){let h=s.codePointAt(c)||0;o[a++]=h,c+=h>65535?2:1}let u=a;for(let c=1;c<r;++c)o.copyWithin(u,0,a),u+=a;return this.print(o,0,u),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(H.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(H.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(H.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(H.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(H.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,Li),this._charsetService.setgCharset(1,Li),this._charsetService.setgCharset(2,Li),this._charsetService.setgCharset(3,Li);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){(y=>(y[y.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",y[y.SET=1]="SET",y[y.RESET=2]="RESET",y[y.PERMANENTLY_SET=3]="PERMANENTLY_SET",y[y.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let n=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:s}=this._coreMouseService,o=this._coreService,{buffers:a,cols:u}=this._bufferService,{active:c,alt:h}=a,d=this._optionsService.rawOptions,f=(y,w)=>(o.triggerDataEvent(`${H.ESC}[${t?"":"?"}${y};${w}$y`),!0),p=y=>y?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(n.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?u===80?2:u===132?1:0:0):m===6?f(m,p(n.origin)):m===7?f(m,p(n.wraparound)):m===8?f(m,3):m===9?f(m,p(i==="X10")):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(n.reverseWraparound)):m===66?f(m,p(n.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i==="VT200")):m===1002?f(m,p(i==="DRAG")):m===1003?f(m,p(i==="ANY")):m===1004?f(m,p(n.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(s==="SGR")):m===1015?f(m,4):m===1016?f(m,p(s==="SGR_PIXELS")):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(c===h)):m===2004?f(m,p(n.bracketedPasteMode)):m===2026?f(m,p(n.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,r,n,i){return t===2?(e|=50331648,e&=-16777216,e|=al.fromColorRGB([r,n,i])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let n=[0,0,-1,0,0,0],i=0,s=0;do{if(n[s+i]=e.params[t+s],e.hasSubParams(t+s)){let o=e.getSubParams(t+s),a=0;do n[1]===5&&(i=1),n[s+a+1+i]=o[a];while(++a<o.length&&a+s+1+i<n.length);break}if(n[1]===5&&s+i>=2||n[1]===2&&s+i>=5)break;n[1]&&(i=1)}while(++s+t<e.length&&s+i<n.length);for(let o=2;o<n.length;++o)n[o]===-1&&(n[o]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return s}_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=Xe.fg,e.bg=Xe.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,r,n=this._curAttrData;for(let i=0;i<t;i++)r=e.params[i],r>=30&&r<=37?(n.fg&=-50331904,n.fg|=16777216|r-30):r>=40&&r<=47?(n.bg&=-50331904,n.bg|=16777216|r-40):r>=90&&r<=97?(n.fg&=-50331904,n.fg|=16777216|r-90|8):r>=100&&r<=107?(n.bg&=-50331904,n.bg|=16777216|r-100|8):r===0?this._processSGR0(n):r===1?n.fg|=134217728:r===3?n.bg|=67108864:r===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,n)):r===5?n.fg|=536870912:r===7?n.fg|=67108864:r===8?n.fg|=1073741824:r===9?n.fg|=2147483648:r===2?n.bg|=134217728:r===21?this._processUnderline(2,n):r===22?(n.fg&=-134217729,n.bg&=-134217729):r===23?n.bg&=-67108865:r===24?(n.fg&=-268435457,this._processUnderline(0,n)):r===25?n.fg&=-536870913:r===27?n.fg&=-67108865:r===28?n.fg&=-1073741825:r===29?n.fg&=2147483647:r===39?(n.fg&=-67108864,n.fg|=Xe.fg&16777215):r===49?(n.bg&=-67108864,n.bg|=Xe.bg&16777215):r===38||r===48||r===58?i+=this._extractColor(e,i,n):r===53?n.bg|=1073741824:r===55?n.bg&=-1073741825:r===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):r===100?(n.fg&=-67108864,n.fg|=Xe.fg&16777215,n.bg&=-67108864,n.bg|=Xe.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${H.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${H.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${H.ESC}[?${t};${r}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=Xe.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 r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!cv(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(`${H.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>lv&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>lv&&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=[],r=e.split(";");for(;r.length>1;){let n=r.shift(),i=r.shift();if(/^\d+$/.exec(n)){let s=parseInt(n);if(dv(s))if(i==="?")t.push({type:0,index:s});else{let o=av(i);o&&t.push({type:1,index:s,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(r,n):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,i=r.findIndex(s=>s.startsWith("id="));return i!==-1&&(n=r[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,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 r=e.split(";");for(let n=0;n<r.length&&!(t>=this._specialColors.length);++n,++t)if(r[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let i=av(r[n]);i&&this._onColor.fire([{type:1,index:this._specialColors[t],color:i}])}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=[],r=e.split(";");for(let n=0;n<r.length;++n)if(/^\d+$/.exec(r[n])){let i=parseInt(r[n]);dv(i)&&t.push({type:2,index:i})}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,Li),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(A4[e[0]],ot[e[1]]||Li),!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=Xe.clone(),this._eraseAttrDataInternal=Xe.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 kr;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 r=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let r=o=>(this._coreService.triggerDataEvent(`${H.ESC}${o}${H.ESC}\\`),!0),n=this._bufferService.buffer,i=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-(i.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Kf=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&&(hv=e,e=t,t=hv),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Kf=qe([J(0,It)],Kf);function dv(e){return 0<=e&&e<256}var I4=5e7,fv=12,B4=50,F4=class extends fe{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 Q),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 r;for(;r=this._writeBuffer.shift();){this._action(r);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>I4)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 r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],i=this._action(n,t);if(i){let o=a=>performance.now()-r>=fv?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(r,a);i.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(o);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-r>=fv)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>B4&&(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()}},Vf=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 a=t.addMarker(t.ybase+t.y),u={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(u,a)),this._dataByLinkId.set(u.id,u),u.id}let r=e,n=this._getEntryIdKey(r),i=this._entriesWithId.get(n);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let s=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(o,s)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);r.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(r,n))}}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 r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Vf=qe([J(0,It)],Vf);var pv=!1,z4=class extends fe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new wo),this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onData=this._register(new Q),this.onData=this._onData.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Q),this._instantiationService=new u4,this.optionsService=this._register(new x4(e)),this._instantiationService.setService(Bt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Hf)),this._instantiationService.setService(It,this._bufferService),this._logService=this._register(this._instantiationService.createInstance($f)),this._instantiationService.setService(rS,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Wf)),this._instantiationService.setService(ps,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Uf)),this._instantiationService.setService(tS,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(zi)),this._instantiationService.setService(oE,this.unicodeService),this._charsetService=this._instantiationService.createInstance(k4),this._instantiationService.setService(sE,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Vf),this._instantiationService.setService(nS,this._oscLinkService),this._inputHandler=this._register(new O4(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(vt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(vt.forward(this._bufferService.onResize,this._onResize)),this._register(vt.forward(this.coreService.onData,this._onData)),this._register(vt.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 F4((t,r)=>this._inputHandler.parse(t,r))),this._register(vt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Q),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&&!pv&&(this._logService.warn("writeSync is unreliable and will be removed soon."),pv=!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,AS),t=Math.max(t,OS),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(sv.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(sv(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Ae(()=>{for(let t of e)t.dispose()})}}},$4={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 H4(e,t,r,n){var o;let i={type:0,cancel:!1,key:void 0},s=(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?i.key=H.ESC+"OA":i.key=H.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?i.key=H.ESC+"OD":i.key=H.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?i.key=H.ESC+"OC":i.key=H.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?i.key=H.ESC+"OB":i.key=H.ESC+"[B");break;case 8:i.key=e.ctrlKey?"\b":H.DEL,e.altKey&&(i.key=H.ESC+i.key);break;case 9:if(e.shiftKey){i.key=H.ESC+"[Z";break}i.key=H.HT,i.cancel=!0;break;case 13:i.key=e.altKey?H.ESC+H.CR:H.CR,i.cancel=!0;break;case 27:i.key=H.ESC,e.altKey&&(i.key=H.ESC+H.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;s?i.key=H.ESC+"[1;"+(s+1)+"D":t?i.key=H.ESC+"OD":i.key=H.ESC+"[D";break;case 39:if(e.metaKey)break;s?i.key=H.ESC+"[1;"+(s+1)+"C":t?i.key=H.ESC+"OC":i.key=H.ESC+"[C";break;case 38:if(e.metaKey)break;s?i.key=H.ESC+"[1;"+(s+1)+"A":t?i.key=H.ESC+"OA":i.key=H.ESC+"[A";break;case 40:if(e.metaKey)break;s?i.key=H.ESC+"[1;"+(s+1)+"B":t?i.key=H.ESC+"OB":i.key=H.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=H.ESC+"[2~");break;case 46:s?i.key=H.ESC+"[3;"+(s+1)+"~":i.key=H.ESC+"[3~";break;case 36:s?i.key=H.ESC+"[1;"+(s+1)+"H":t?i.key=H.ESC+"OH":i.key=H.ESC+"[H";break;case 35:s?i.key=H.ESC+"[1;"+(s+1)+"F":t?i.key=H.ESC+"OF":i.key=H.ESC+"[F";break;case 33:e.shiftKey?i.type=2:e.ctrlKey?i.key=H.ESC+"[5;"+(s+1)+"~":i.key=H.ESC+"[5~";break;case 34:e.shiftKey?i.type=3:e.ctrlKey?i.key=H.ESC+"[6;"+(s+1)+"~":i.key=H.ESC+"[6~";break;case 112:s?i.key=H.ESC+"[1;"+(s+1)+"P":i.key=H.ESC+"OP";break;case 113:s?i.key=H.ESC+"[1;"+(s+1)+"Q":i.key=H.ESC+"OQ";break;case 114:s?i.key=H.ESC+"[1;"+(s+1)+"R":i.key=H.ESC+"OR";break;case 115:s?i.key=H.ESC+"[1;"+(s+1)+"S":i.key=H.ESC+"OS";break;case 116:s?i.key=H.ESC+"[15;"+(s+1)+"~":i.key=H.ESC+"[15~";break;case 117:s?i.key=H.ESC+"[17;"+(s+1)+"~":i.key=H.ESC+"[17~";break;case 118:s?i.key=H.ESC+"[18;"+(s+1)+"~":i.key=H.ESC+"[18~";break;case 119:s?i.key=H.ESC+"[19;"+(s+1)+"~":i.key=H.ESC+"[19~";break;case 120:s?i.key=H.ESC+"[20;"+(s+1)+"~":i.key=H.ESC+"[20~";break;case 121:s?i.key=H.ESC+"[21;"+(s+1)+"~":i.key=H.ESC+"[21~";break;case 122:s?i.key=H.ESC+"[23;"+(s+1)+"~":i.key=H.ESC+"[23~";break;case 123:s?i.key=H.ESC+"[24;"+(s+1)+"~":i.key=H.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=H.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=H.DEL:e.keyCode===219?i.key=H.ESC:e.keyCode===220?i.key=H.FS:e.keyCode===221&&(i.key=H.GS);else if((!r||n)&&e.altKey&&!e.metaKey){let a=(o=$4[e.keyCode])==null?void 0:o[e.shiftKey?1:0];if(a)i.key=H.ESC+a;else if(e.keyCode>=65&&e.keyCode<=90){let u=e.ctrlKey?e.keyCode-64:e.keyCode+32,c=String.fromCharCode(u);e.shiftKey&&(c=c.toUpperCase()),i.key=H.ESC+c}else if(e.keyCode===32)i.key=H.ESC+(e.ctrlKey?H.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let u=e.code.slice(3,4);e.shiftKey||(u=u.toLowerCase()),i.key=H.ESC+u,i.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(i.key=H.US),e.key==="@"&&(i.key=H.NUL));break}return i}var Ke=0,W4=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new ru,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new ru,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((i,s)=>this._getKey(i)-this._getKey(s)),t=0,r=0,n=new Array(this._array.length+this._insertedValues.length);for(let i=0;i<n.length;i++)r>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(n[i]=e[t],t++):n[i]=this._array[r++];this._array=n,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||(Ke=this._search(t),Ke===-1)||this._getKey(this._array[Ke])!==t)return!1;do if(this._array[Ke]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Ke),!0;while(++Ke<this._array.length&&this._getKey(this._array[Ke])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((i,s)=>i-s),t=0,r=new Array(this._array.length-e.length),n=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:r[n++]=this._array[i];this._array=r,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&&(Ke=this._search(e),!(Ke<0||Ke>=this._array.length)&&this._getKey(this._array[Ke])===e))do yield this._array[Ke];while(++Ke<this._array.length&&this._getKey(this._array[Ke])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ke=this._search(e),!(Ke<0||Ke>=this._array.length)&&this._getKey(this._array[Ke])===e))do t(this._array[Ke]);while(++Ke<this._array.length&&this._getKey(this._array[Ke])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,r=this._array.length-1;for(;r>=t;){let n=t+r>>1,i=this._getKey(this._array[n]);if(i>e)r=n-1;else if(i<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},Dh=0,mv=0,U4=class extends fe{constructor(){super(),this._decorations=new W4(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new Q),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Q),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Ae(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new q4(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.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,r){let n=0,i=0;for(let s of this._decorations.getKeyIterator(t))n=s.options.x??0,i=n+(s.options.width??1),e>=n&&e<i&&(!r||(s.options.layer??"bottom")===r)&&(yield s)}forEachDecorationAtCell(e,t,r,n){this._decorations.forEachByKey(t,i=>{Dh=i.options.x??0,mv=Dh+(i.options.width??1),e>=Dh&&e<mv&&(!r||(i.options.layer??"bottom")===r)&&n(i)})}},q4=class extends vi{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Q),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Q),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=Ie.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ie.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},K4=1e3,V4=class{constructor(e,t=K4){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,r){this._rowCount=r,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 n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let i=n-this._lastRefreshMs,s=this._debounceThresholdMS-i;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},s)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;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)}},gv=20,nu=class extends fe{constructor(e,t,r,n){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=i.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let s=0;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);if(this._topBoundaryFocusListener=s=>this._handleBoundaryFocus(s,0),this._bottomBoundaryFocusListener=s=>this._handleBoundaryFocus(s,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new V4(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(s=>this._handleResize(s.rows))),this._register(this._terminal.onRender(s=>this._refreshRows(s.start,s.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(s=>this._handleChar(s))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
419
|
+
`))),this._register(this._terminal.onA11yTab(s=>this._handleTab(s))),this._register(this._terminal.onKey(s=>this._handleKey(s.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(ie(i,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Ae(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<gv+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
420
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===gv+1&&(this._liveRegion.textContent+=ff.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 r=this._terminal.buffer,n=r.lines.length.toString();for(let i=e;i<=t;i++){let s=r.lines.get(r.ydisp+i),o=[],a=(s==null?void 0:s.translateToString(!0,void 0,void 0,o))||"",u=(r.ydisp+i+1).toString(),c=this._rowElements[i];c&&(a.length===0?(c.textContent=" ",this._rowColumns.set(c,[0,1])):(c.textContent=a,this._rowColumns.set(c,o)),c.setAttribute("aria-posinset",u),c.setAttribute("aria-setsize",n),this._alignRowWidth(c))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],i=r.getAttribute("aria-posinset"),s=t===0?"1":`${this._terminal.buffer.lines.length}`;if(i===s||e.relatedTarget!==n)return;let o,a;if(t===0?(o=r,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(o=this._rowElements.shift(),a=r,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let u=this._createAccessibilityTreeNode();this._rowElements.unshift(u),this._rowContainer.insertAdjacentElement("afterbegin",u)}else{let u=this._createAccessibilityTreeNode();this._rowElements.push(u),this._rowContainer.appendChild(u)}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 a;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},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,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 n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:((a=n.textContent)==null?void 0:a.length)??0}),!this._rowContainer.contains(r.node))return;let i=({node:u,offset:c})=>{let h=u instanceof Text?u.parentNode:u,d=parseInt(h==null?void 0:h.getAttribute("aria-posinset"),10)-1;if(isNaN(d))return console.warn("row is invalid. Race condition?"),null;let f=this._rowColumns.get(h);if(!f)return console.warn("columns is null. Race condition?"),null;let p=c<f.length?f[c]:f.slice(-1)[0]+1;return p>=this._terminal.cols&&(++d,p=0),{row:d,column:p}},s=i(t),o=i(r);if(!(!s||!o)){if(s.row>o.row||s.row===o.row&&s.column>=o.column)throw new Error("invalid range");this._terminal.select(s.column,s.row,(o.row-s.row)*this._terminal.cols-s.column+o.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 i,s;e.style.transform="";let t=e.getBoundingClientRect().width,r=(s=(i=this._rowColumns.get(e))==null?void 0:i.slice(-1))==null?void 0:s[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};nu=qe([J(1,ym),J(2,Ln),J(3,An)],nu);var Qf=class extends fe{constructor(e,t,r,n,i){super(),this._element=e,this._mouseService=t,this._renderService=r,this._bufferService=n,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new Q),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Q),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Ae(()=>{var s;os(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(s=this._activeProviderReplies)==null||s.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(ie(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(ie(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(ie(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(ie(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 r=e.composedPath();for(let n=0;n<r.length;n++){let i=r[n];if(i.classList.contains("xterm"))break;if(i.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 n,i;(!this._activeProviderReplies||!t)&&((n=this._activeProviderReplies)==null||n.forEach(s=>{s==null||s.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[s,o]of this._linkProviderService.linkProviders.entries())t?(i=this._activeProviderReplies)!=null&&i.get(s)&&(r=this._checkLinkProviderResult(s,e,r)):o.provideLinks(e.y,a=>{var c,h;if(this._isMouseOut)return;let u=a==null?void 0:a.map(d=>({link:d}));(c=this._activeProviderReplies)==null||c.set(s,u),r=this._checkLinkProviderResult(s,e,r),((h=this._activeProviderReplies)==null?void 0:h.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let n=0;n<t.size;n++){let i=t.get(n);if(i)for(let s=0;s<i.length;s++){let o=i[s],a=o.link.range.start.y<e?0:o.link.range.start.x,u=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let c=a;c<=u;c++){if(r.has(c)){i.splice(s--,1);break}r.add(c)}}}}_checkLinkProviderResult(e,t,r){var s;if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),i=!1;for(let o=0;o<e;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(i=!0);if(!i&&n){let o=n.find(a=>this._linkAtPosition(a.link,t));o&&(r=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let o=0;o<this._activeProviderReplies.size;o++){let a=(s=this._activeProviderReplies.get(o))==null?void 0:s.find(u=>this._linkAtPosition(u.link,t));if(a){r=!0,this._handleNewLink(a);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&Q4(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,os(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 r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.pointerCursor},set:r=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.underline},set:r=>{var n,i,s;(n=this._currentLink)!=null&&n.state&&((s=(i=this._currentLink)==null?void 0:i.state)==null?void 0:s.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let n=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,i=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(n,i),this._lastMouseEvent)){let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._askForLink(s,!1)}})))}_linkHover(e,t,r){var n;(n=this._currentLink)!=null&&n.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(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,n=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,r){var n;(n=this._currentLink)!=null&&n.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(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return r<=i&&i<=n}_positionFromMouseEvent(e,t,r){let n=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,n,i){return{x1:e,y1:t,x2:r,y2:n,cols:this._bufferService.cols,fg:i}}};Qf=qe([J(1,_m),J(2,An),J(3,It),J(4,sS)],Qf);function Q4(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 Y4=class extends z4{constructor(e={}){super(e),this._linkifier=this._register(new wo),this.browser=CS,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new wo),this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Q),this.onKey=this._onKey.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Q),this.onBell=this._onBell.event,this._onFocus=this._register(new Q),this._onBlur=this._register(new Q),this._onA11yCharEmitter=this._register(new Q),this._onA11yTabEmitter=this._register(new Q),this._onWillOpen=this._register(new Q),this._setup(),this._decorationService=this._instantiationService.createInstance(U4),this._instantiationService.setService(ll,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Bj),this._instantiationService.setService(sS,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(mf)),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(vt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(vt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(vt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(vt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Ae(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.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 r,n="";switch(t.index){case 256:r="foreground",n="10";break;case 257:r="background",n="11";break;case 258:r="cursor",n="12";break;default:r="ansi",n="4;"+t.index}switch(t.type){case 0:let i=Me.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${H.ESC}]${n};${L4(i)}${SS.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(s=>s.ansi[t.index]=Ge.toColor(...t.color));else{let s=r;this._themeService.modifyColors(o=>o[s]=Ge.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(nu,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.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(H.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 r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,i=t.getWidth(r),s=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=s+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(ie(this.element,"copy",t=>{this.hasSelection()&&ZN(t,this._selectionService)}));let e=t=>eE(t,this.textarea,this.coreService,this.optionsService);this._register(ie(this.textarea,"paste",e)),this._register(ie(this.element,"paste",e)),kS?this._register(ie(this.element,"mousedown",t=>{t.button===2&&N0(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(ie(this.element,"contextmenu",t=>{N0(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Em&&this._register(ie(this.element,"auxclick",t=>{t.button===1&&Xw(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(ie(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(ie(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(ie(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(ie(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(ie(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(ie(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(ie(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var i;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"),((i=this.element)==null?void 0:i.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(ie(this.screenElement,"mousemove",s=>this.updateCursorStyle(s))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",df.get()),jS||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",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(Oj,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Ln,this._coreBrowserService),this._register(ie(this.textarea,"focus",s=>this._handleTextAreaFocus(s))),this._register(ie(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Of,this._document,this._helperContainer),this._instantiationService.setService(Ru,this._charSizeService),this._themeService=this._instantiationService.createInstance(zf),this._instantiationService.setService(No,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(eu),this._instantiationService.setService(iS,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Bf,this.rows,this.screenElement)),this._instantiationService.setService(An,this._renderService),this._register(this._renderService.onRenderedViewportChange(s=>this._onRender.fire(s))),this.onResize(s=>this._renderService.resize(s.cols,s.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Tf,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(If),this._instantiationService.setService(_m,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(Qf,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(Df,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(s=>{super.scrollLines(s,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ff,this.element,this.screenElement,n)),this._instantiationService.setService(lE,this._selectionService),this._register(this._selectionService.onRequestScrollLines(s=>this.scrollLines(s.amount,s.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(s=>this._renderService.handleSelectionChanged(s.start,s.end,s.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(s=>{this.textarea.value=s,this.textarea.focus(),this.textarea.select()})),this._register(vt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var s;this._selectionService.refresh(),(s=this._viewport)==null||s.queueSync()})),this._register(this._instantiationService.createInstance(Mf,this.screenElement)),this._register(ie(this.element,"mousedown",s=>this._selectionService.handleMouseDown(s))),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(nu,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",s=>this._handleScreenReaderModeOptionChange(s))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Zc,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",s=>{!this._overviewRulerRenderer&&s&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Zc,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Af,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(s){var c,h,d,f,p;let o=e._mouseService.getMouseReportCoords(s,e.screenElement);if(!o)return!1;let a,u;switch(s.overrideType||s.type){case"mousemove":u=32,s.buttons===void 0?(a=3,s.button!==void 0&&(a=s.button<3?s.button:3)):a=s.buttons&1?0:s.buttons&4?1:s.buttons&2?2:3;break;case"mouseup":u=0,a=s.button<3?s.button:3;break;case"mousedown":u=1,a=s.button<3?s.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(s)===!1)return!1;let m=s.deltaY;if(m===0||e.coreMouseService.consumeWheelEvent(s,(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,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return!1;u=m<0?0:1,a=4;break;default:return!1}return u===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:a,action:u,ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:s=>(r(s),s.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(s)),wheel:s=>(r(s),this.cancel(s,!0)),mousedrag:s=>{s.buttons&&r(s)},mousemove:s=>{s.buttons||r(s)}};this._register(this.coreMouseService.onProtocolChange(s=>{s?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(s)),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()),s&8?n.mousemove||(t.addEventListener("mousemove",i.mousemove),n.mousemove=i.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),s&16?n.wheel||(t.addEventListener("wheel",i.wheel,{passive:!1}),n.wheel=i.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),s&2?n.mouseup||(n.mouseup=i.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),s&4?n.mousedrag||(n.mousedrag=i.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(ie(t,"mousedown",s=>{if(s.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(s)))return r(s),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(s)})),this._register(ie(t,"wheel",s=>{var o,a,u,c,h;if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(s)===!1)return!1;if(!this.buffer.hasScrollback){if(s.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(s,(c=(u=(a=(o=e._renderService)==null?void 0:o.dimensions)==null?void 0:a.device)==null?void 0:u.cell)==null?void 0:c.height,(h=e._coreBrowserService)==null?void 0:h.dpr)===0)return this.cancel(s,!0);let d=H.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(s.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(d,!0),this.cancel(s,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.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){Yw(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,r){this._selectionService.setSelection(e,t,r)}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 r;(r=this._selectionService)==null||r.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 r=H4(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let n=this.rows-1;return this.scrollLines(r.type===2?-n:n),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.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((r.key===H.ETX||r.key===H.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=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"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(X4(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 r;(r=this._charSizeService)==null||r.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(Xe));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(H.ESC+"[I"):this.coreService.triggerDataEvent(H.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${H.ESC}[4;${r};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),i=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${H.ESC}[6;${i};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function X4(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var G4=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;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)}},J4=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 kr)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},vv=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 J4(t)}getNullCell(){return new kr}},Z4=class extends fe{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Q),this.onBufferChange=this._onBufferChange.event,this._normal=new vv(this._core.buffers.normal,"normal"),this._alternate=new vv(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)}},e3=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,n)=>t(r,n.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)}},t3=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}},r3=["cols","rows"],Ur=0,n3=class extends fe{constructor(e){super(),this._core=this._register(new Y4(e)),this._addonManager=this._register(new G4),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],r=(n,i)=>{this._checkReadonlyOptions(n),this._core.options[n]=i};for(let n in this._core.options){let i={get:t.bind(this,n),set:r.bind(this,n)};Object.defineProperty(this._publicOptions,n,i)}}_checkReadonlyOptions(e){if(r3.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 e3(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new t3(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 Z4(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,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}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
|
|
421
|
+
`,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 df.get()},set promptLabel(e){df.set(e)},get tooMuchOutput(){return ff.get()},set tooMuchOutput(e){ff.set(e)}}}_verifyIntegers(...e){for(Ur of e)if(Ur===1/0||isNaN(Ur)||Ur%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Ur of e)if(Ur&&(Ur===1/0||isNaN(Ur)||Ur%1!==0||Ur<0))throw new Error("This API only accepts positive integers")}};/**
|
|
422
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
423
|
+
* @license MIT
|
|
424
|
+
*
|
|
425
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
426
|
+
* @license MIT
|
|
427
|
+
*
|
|
428
|
+
* Originally forked from (with the author's permission):
|
|
429
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
430
|
+
* http://bellard.org/jslinux/
|
|
431
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
432
|
+
*/var i3=2,s3=1,o3=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 d;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:((d=this._terminal.options.overviewRuler)==null?void 0:d.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),i=Math.max(0,parseInt(r.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),o={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},a=o.top+o.bottom,u=o.right+o.left,c=n-a,h=i-u-t;return{cols:Math.max(i3,Math.floor(h/e.css.cell.width)),rows:Math.max(s3,Math.floor(c/e.css.cell.height))}}};function yv(e,t){let r;return(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>e(...n),t)}}function _v({sessionName:e,onDisconnect:t}){const r=S.useRef(null),n=S.useRef(null),i=S.useRef(null),s=S.useRef(null),o=S.useRef(0),a=S.useRef(null),u=5,[c,h]=S.useState(!0),d=S.useRef(t);d.current=t;const f=y=>Math.min(1e3*Math.pow(2,y),3e4),p=S.useCallback(()=>{if(!r.current||!e)return;a.current&&(clearTimeout(a.current),a.current=null);const y=r.current;if(y.clientWidth===0||y.clientHeight===0){console.warn("XTerminal: Container has no size, retrying in 100ms"),setTimeout(()=>p(),100);return}console.log("XTerminal: Creating terminal, container size:",y.clientWidth,"x",y.clientHeight);let w=n.current,g=i.current;w||(w=new n3({cursorBlink:!0,cursorStyle:"block",fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',cols:120,rows:30,scrollback:1e4,convertEol:!0,scrollOnUserInput:!0,allowProposedApi:!0,theme:{background:"#1a1a2e",foreground:"#eaeaea",cursor:"#eaeaea",cursorAccent:"#1a1a2e",selectionBackground:"#3a3a5e",black:"#1a1a2e",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#6272a4",magenta:"#ff79c6",cyan:"#8be9fd",white:"#f8f8f2",brightBlack:"#6272a4",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"}}),g=new o3,w.loadAddon(g),w.open(r.current),g.fit(),n.current=w,i.current=g);const x=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.hostname}:3011/ws/terminal?session=${encodeURIComponent(e)}`,k=new WebSocket(x);s.current=k,k.onopen=()=>{console.log("XTerminal: WebSocket opened"),o.current=0,w.clear(),setTimeout(()=>{k.readyState===WebSocket.OPEN&&(g==null||g.fit(),console.log("XTerminal: After fit, size:",w.cols,"x",w.rows),k.send(JSON.stringify({type:"resize",cols:w.cols,rows:w.rows})))},100)},k.onmessage=E=>{const L=F=>{w.write(F),w.scrollToBottom()};typeof E.data=="string"?L(E.data):E.data instanceof ArrayBuffer?L(new Uint8Array(E.data)):E.data instanceof Blob&&E.data.text().then(F=>L(F))},k.onclose=E=>{var L,F;if(console.log("XTerminal: WebSocket closed",E.code,E.reason),!c||E.code===1e3){w.writeln(`\r
|
|
433
|
+
\x1B[33m● Session disconnected\x1B[0m`),(L=d.current)==null||L.call(d);return}if(o.current<u){const D=f(o.current);o.current+=1,w.writeln(`\r
|
|
434
|
+
\x1B[33m● Connection lost. Reconnecting in ${D/1e3}s (attempt ${o.current}/${u})...\x1B[0m`),a.current=setTimeout(()=>{p()},D)}else w.writeln(`\r
|
|
435
|
+
\x1B[31m● Connection lost after multiple attempts.\x1B[0m`),(F=d.current)==null||F.call(d)},k.onerror=E=>{console.error("WebSocket error:",E)},w.onData(E=>{k.readyState===WebSocket.OPEN&&k.send(E)}),w.onResize(({cols:E,rows:L})=>{k.readyState===WebSocket.OPEN&&k.send(JSON.stringify({type:"resize",cols:E,rows:L}))});const b=yv(()=>{k.readyState===WebSocket.OPEN&&(g==null||g.fit())},200);return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b),h(!1),a.current&&clearTimeout(a.current),k.close(),w.dispose(),n.current=null,i.current=null}},[e,c]);S.useEffect(()=>{let y=!1,w;const g=setTimeout(()=>{y||(w=p())},50);return()=>{y=!0,clearTimeout(g),w==null||w()}},[p]),S.useEffect(()=>{const y=yv(()=>{var g,_;((g=s.current)==null?void 0:g.readyState)===WebSocket.OPEN&&((_=i.current)==null||_.fit())},200),w=new ResizeObserver(y);return r.current&&w.observe(r.current),()=>{w.disconnect()}},[]);const m=()=>{var y;(y=n.current)==null||y.focus()};return l.jsx("div",{ref:r,className:"absolute inset-0",onClick:m,tabIndex:0,style:{padding:"8px",backgroundColor:"#1a1a2e",overflow:"hidden",outline:"none"}})}const a3=()=>{const e=localStorage.getItem("panopticon.planning.startDocker");return e!==null?e==="true":!0};function l3({issue:e,isOpen:t,onClose:r,onComplete:n}){var U;const[i,s]=S.useState("checking"),[o,a]=S.useState(null),[u,c]=S.useState(null),[h,d]=S.useState(!1),[f,p]=S.useState({x:-1,y:-1}),[m,y]=S.useState({width:900,height:600}),[w,g]=S.useState(a3),_=S.useRef(!1),v=Jt(),x=ue({mutationFn:async()=>{const R=await fetch(`/api/issues/${e.identifier}/start-planning`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({startDocker:w})});if(!R.ok){const W=await R.json();throw new Error(W.error||"Failed to start planning")}return R.json()},onSuccess:R=>{a(R),R.planningAgent.started?(_.current=!0,s("planning")):R.planningAgent.error&&(c(R.planningAgent.error),s("error"))},onError:R=>{c(R.message),s("error")}}),k=he({queryKey:["planningStatus",e.identifier],queryFn:async()=>{const R=await fetch(`/api/planning/${e.identifier}/status`);if(!R.ok)throw new Error("Failed to get status");return R.json()},enabled:i==="planning",refetchInterval:i==="planning"?2e3:!1}),b=ue({mutationFn:async()=>{const R=await fetch(`/api/planning/${e.identifier}`,{method:"DELETE"});if(!R.ok)throw new Error("Failed to stop planning");const W=await R.json();return(await fetch(`/api/issues/${e.identifier}/complete-planning`,{method:"POST"})).ok||console.warn("Failed to mark planning complete, continuing anyway"),W},onSuccess:()=>{v.invalidateQueries({queryKey:["issues"]}),s("complete")},onError:R=>{console.error("Stop planning failed:",R),c(R.message),s("error")}}),E=ue({mutationFn:async()=>{const R=await fetch(`/api/issues/${e.identifier}/abort-planning`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deleteWorkspace:!1})});if(!R.ok){const W=await R.json();throw new Error(W.error||"Failed to abort planning")}return R.json()},onSuccess:()=>{n(),r()},onError:R=>{c(R.message)}}),L=ue({mutationFn:async()=>{const R=await fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issueId:e.identifier})});if(!R.ok){const W=await R.json();throw new Error(W.error||"Failed to start agent")}return R.json()},onSuccess:()=>{v.invalidateQueries({queryKey:["agents"]}),v.invalidateQueries({queryKey:["issues"]}),n(),r()},onError:R=>{c(`Failed to start agent: ${R.message}`)}}),F=S.useRef(null);S.useEffect(()=>{const R=F.current!==null&&F.current!==e.identifier;F.current=e.identifier,t?R?(s("checking"),a(null),c(null),d(!1),_.current=!1,v.invalidateQueries({queryKey:["planningStatus",e.identifier]})):(v.invalidateQueries({queryKey:["planningStatus",e.identifier]}),_.current=!1):(s("checking"),a(null),c(null),d(!1),_.current=!1)},[t,e.identifier,v]),S.useEffect(()=>{t&&i==="checking"&&fetch(`/api/planning/${e.identifier}/status`).then(R=>R.json()).then(R=>{R.active?(_.current=!0,s("planning")):s("ready")}).catch(()=>{s("ready")})},[t,e.identifier,i]),S.useEffect(()=>{i==="planning"&&k.data&&!k.data.active&&_.current&&s("complete")},[i,k.data]);const D=()=>{s("starting"),x.mutate()},A=()=>{b.mutate()},j=()=>{confirm(`Abort planning and return to Todo?
|
|
436
|
+
|
|
437
|
+
This will:
|
|
438
|
+
• Stop the planning agent
|
|
439
|
+
• Move the issue back to "Todo"
|
|
440
|
+
• Keep the workspace (can be deleted separately)
|
|
441
|
+
|
|
442
|
+
Any planning artifacts in the workspace will be preserved.`)&&E.mutate()},M=()=>{L.mutate()};if(!t)return null;const O=f.x===-1?(window.innerWidth-m.width)/2:f.x,T=f.y===-1?(window.innerHeight-m.height)/2:f.y,B=()=>{var W,N;const R=((W=o==null?void 0:o.workspace)==null?void 0:W.path)||((N=k.data)==null?void 0:N.workspacePath);return R?`${R}/docs/${e.identifier}-plan.md`:null};return h?l.jsxs("div",{className:"fixed bottom-4 right-4 z-50 bg-gray-800 rounded-lg shadow-2xl border border-gray-700 px-4 py-2 flex items-center gap-3 cursor-pointer hover:bg-gray-700 transition-colors",onClick:()=>d(!1),children:[l.jsx("div",{className:"w-6 h-6 rounded bg-gradient-to-br from-purple-500 to-blue-500 flex items-center justify-center",children:l.jsx(uf,{className:"w-3 h-3 text-white"})}),l.jsxs("span",{className:"text-sm text-white font-medium",children:["Plan: ",e.identifier]}),i==="planning"&&l.jsx("span",{className:"w-2 h-2 bg-purple-400 rounded-full animate-pulse"})]}):l.jsxs("div",{className:"fixed inset-0 z-50",children:[l.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:()=>d(!0)}),l.jsx(QN,{position:{x:O,y:T},size:m,onDragStop:(R,W)=>p({x:W.x,y:W.y}),onResizeStop:(R,W,N,$,I)=>{y({width:N.offsetWidth,height:N.offsetHeight}),p({x:I.x,y:I.y})},minWidth:600,minHeight:400,bounds:"window",dragHandleClassName:"drag-handle",enableResizing:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},children:l.jsxs("div",{className:"w-full h-full bg-gray-800 rounded-xl shadow-2xl border border-gray-700 overflow-hidden flex flex-col",children:[l.jsxs("div",{className:"drag-handle flex items-center justify-between px-6 py-4 border-b border-gray-700 cursor-move",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-purple-500 to-blue-500 flex items-center justify-center",children:l.jsx(uf,{className:"w-5 h-5 text-white"})}),l.jsxs("div",{children:[l.jsxs("h2",{className:"text-lg font-semibold text-white",children:["Plan: ",e.identifier]}),l.jsx("p",{className:"text-sm text-gray-400 line-clamp-1",children:e.title})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[i==="planning"&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-1 bg-purple-500/20 text-purple-400 text-xs rounded-full",children:[l.jsx("span",{className:"w-2 h-2 bg-purple-400 rounded-full animate-pulse"}),"Planning Active"]}),l.jsxs("button",{onClick:A,disabled:b.isPending,className:"flex items-center gap-1 px-3 py-1.5 bg-red-600 hover:bg-red-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50",title:"Stop the planning agent",children:[l.jsx($a,{className:"w-4 h-4"}),"Stop"]})]}),l.jsx("button",{onClick:()=>d(!0),className:"p-2 text-gray-400 hover:text-white hover:bg-gray-700 rounded-lg transition-colors",title:"Hide (planning continues in background)",children:l.jsx(Vt,{className:"w-5 h-5"})})]})]}),l.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[i==="checking"&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8",children:[l.jsx(Se,{className:"w-12 h-12 text-purple-400 animate-spin mb-4"}),l.jsx("p",{className:"text-gray-300",children:"Checking session status..."})]}),i==="ready"&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8",children:[l.jsx("div",{className:"w-20 h-20 rounded-2xl bg-gradient-to-br from-purple-500/20 to-blue-500/20 border border-purple-500/30 flex items-center justify-center mb-6",children:l.jsx(wi,{className:"w-10 h-10 text-purple-400"})}),["In Planning","Planning","Planned","Discovery"].includes(e.status)?l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Resume Planning Session"}),l.jsxs("p",{className:"text-gray-400 text-center max-w-md mb-6",children:["This issue is in ",l.jsx("span",{className:"text-purple-400 font-medium",children:'"In Planning"'})," state. You can resume planning or abort to return to Todo."]}),l.jsxs("div",{className:"bg-gray-700/50 rounded-lg p-4 mb-6 max-w-md w-full",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-300 mb-2",children:"Options:"}),l.jsxs("ul",{className:"space-y-2 text-sm text-gray-400",children:[l.jsxs("li",{className:"flex items-center gap-2",children:[l.jsx(Tt,{className:"w-4 h-4 text-purple-400"}),l.jsxs("span",{children:[l.jsx("strong",{className:"text-purple-400",children:"Resume"})," - Start a new planning agent session"]})]}),l.jsxs("li",{className:"flex items-center gap-2",children:[l.jsx(Vt,{className:"w-4 h-4 text-orange-400"}),l.jsxs("span",{children:[l.jsx("strong",{className:"text-orange-400",children:"Abort"})," - Return issue to Todo (keeps workspace)"]})]})]})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("button",{onClick:j,disabled:E.isPending,className:"flex items-center gap-2 px-5 py-3 bg-orange-600/20 hover:bg-orange-600/30 text-orange-400 rounded-lg transition-colors font-medium disabled:opacity-50",children:[l.jsx(Vt,{className:"w-5 h-5"}),E.isPending?"Aborting...":"Abort Planning"]}),l.jsxs("button",{onClick:D,className:"flex items-center gap-2 px-6 py-3 bg-purple-600 hover:bg-purple-500 text-white rounded-lg transition-colors font-medium",children:[l.jsx(Tt,{className:"w-5 h-5"}),"Resume Planning"]})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Start Planning Session"}),l.jsxs("p",{className:"text-gray-400 text-center max-w-md mb-6",children:["This will move the issue to ",l.jsx("span",{className:"text-purple-400 font-medium",children:'"In Planning"'}),", create a workspace, and start an AI discovery session to help define the implementation plan."]}),l.jsxs("div",{className:"bg-gray-700/50 rounded-lg p-4 mb-6 max-w-md w-full",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-300 mb-2",children:"What happens:"}),l.jsxs("ul",{className:"space-y-2 text-sm text-gray-400",children:[l.jsxs("li",{className:"flex items-center gap-2",children:[l.jsx(Ns,{className:"w-4 h-4 text-green-400"}),'Issue moves to "In Planning" in Linear']}),l.jsxs("li",{className:"flex items-center gap-2",children:[l.jsx(Ns,{className:"w-4 h-4 text-green-400"}),"Git worktree created for feature branch"]}),l.jsxs("li",{className:"flex items-center gap-2",children:[l.jsx(Ns,{className:"w-4 h-4 text-green-400"}),"Opus agent starts discovery conversation"]})]})]}),l.jsxs("label",{className:"flex items-center gap-3 mb-6 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:w,onChange:R=>{g(R.target.checked),localStorage.setItem("panopticon.planning.startDocker",String(R.target.checked))},className:"w-4 h-4 rounded border-gray-500 bg-gray-700 text-purple-500 focus:ring-purple-500 focus:ring-offset-gray-800"}),l.jsxs("span",{className:"text-sm text-gray-300",children:["Start Docker containers",l.jsx("span",{className:"text-gray-500 ml-1",children:"(dev environment ready for testing)"})]})]}),l.jsxs("button",{onClick:D,className:"flex items-center gap-2 px-6 py-3 bg-purple-600 hover:bg-purple-500 text-white rounded-lg transition-colors font-medium",children:[l.jsx(Tt,{className:"w-5 h-5"}),"Start Planning"]})]})]}),i==="starting"&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8",children:[l.jsx(Se,{className:"w-12 h-12 text-purple-400 animate-spin mb-4"}),l.jsx("p",{className:"text-gray-300",children:"Starting planning session..."}),l.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Moving to In Planning, creating workspace, spawning agent"})]}),i==="planning"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex-1 bg-black relative overflow-hidden",style:{minHeight:"400px"},children:o!=null&&o.planningAgent.sessionName?l.jsx(_v,{sessionName:o.planningAgent.sessionName,onDisconnect:()=>{k.refetch().then(({data:R})=>{R!=null&&R.active||s("complete")})}}):(U=k.data)!=null&&U.sessionName?l.jsx(_v,{sessionName:k.data.sessionName,onDisconnect:()=>{k.refetch().then(({data:R})=>{R!=null&&R.active||s("complete")})}}):l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("div",{className:"flex items-center gap-2 text-gray-500",children:[l.jsx(Se,{className:"w-4 h-4 animate-spin"}),"Connecting to terminal..."]})})}),l.jsxs("div",{className:"border-t border-gray-700 px-4 py-2 flex items-center justify-between bg-gray-800",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[l.jsx(wi,{className:"w-4 h-4"}),"Interactive planning session"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:j,disabled:E.isPending,className:"flex items-center gap-1 px-3 py-1 bg-orange-600/20 hover:bg-orange-600/30 text-orange-400 text-sm rounded transition-colors disabled:opacity-50",title:"Stop planning and return to Todo",children:[l.jsx(Vt,{className:"w-4 h-4"}),"Abort"]}),l.jsxs("button",{onClick:()=>{b.mutate(),k.refetch()},disabled:b.isPending,className:"flex items-center gap-1 px-3 py-1 bg-green-600/20 hover:bg-green-600/30 text-green-400 text-sm rounded transition-colors disabled:opacity-50",title:"Done - mark planning complete",children:[l.jsx(Ns,{className:"w-4 h-4"}),"Done"]})]})]})]}),i==="complete"&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8",children:[l.jsx("div",{className:"w-16 h-16 rounded-full bg-green-500/20 flex items-center justify-center mb-4",children:l.jsx(Ns,{className:"w-10 h-10 text-green-400"})}),l.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Planning Complete"}),l.jsx("p",{className:"text-gray-400 text-center max-w-md mb-6",children:"The planning session has ended. Review the plan and start the execution agent."}),B()&&l.jsx("div",{className:"bg-purple-500/10 border border-purple-500/30 rounded-lg p-4 mb-6 max-w-md w-full",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(fc,{className:"w-8 h-8 text-purple-400"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"Feature Plan"}),l.jsx("p",{className:"text-xs text-gray-500 font-mono truncate",children:B()})]}),l.jsxs("a",{href:`vscode://file${B()}`,className:"flex items-center gap-1 px-3 py-1.5 bg-purple-600 hover:bg-purple-500 text-white text-sm rounded-lg transition-colors",title:"Open in VS Code",children:[l.jsx(ol,{className:"w-4 h-4"}),"Open"]})]})}),o&&l.jsxs("div",{className:"bg-gray-700/50 rounded-lg p-4 mb-6 max-w-md w-full",children:[l.jsx("p",{className:"text-sm text-gray-400 mb-2",children:"Summary:"}),l.jsxs("ul",{className:"space-y-1 text-sm",children:[l.jsxs("li",{className:"text-gray-300",children:[l.jsx("span",{className:"text-gray-500",children:"Issue:"})," ",o.issue.identifier]}),l.jsxs("li",{className:"text-gray-300",children:[l.jsx("span",{className:"text-gray-500",children:"State:"})," ",l.jsx("span",{className:"text-purple-400",children:o.issue.newState})]}),o.workspace.created&&l.jsxs("li",{className:"text-gray-300",children:[l.jsx("span",{className:"text-gray-500",children:"Workspace:"})," ",l.jsx("span",{className:"text-blue-400 font-mono text-xs",children:o.workspace.path})]})]})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{onClick:r,disabled:L.isPending,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-white rounded-lg transition-colors disabled:opacity-50",children:"Close"}),l.jsxs("button",{onClick:M,disabled:L.isPending,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg transition-colors disabled:opacity-50",children:[L.isPending?l.jsx(Se,{className:"w-5 h-5 animate-spin"}):l.jsx(Tt,{className:"w-5 h-5"}),L.isPending?"Starting Agent...":"Start Agent"]})]})]}),i==="error"&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8",children:[l.jsx("div",{className:"w-16 h-16 rounded-full bg-red-500/20 flex items-center justify-center mb-4",children:l.jsx(xo,{className:"w-10 h-10 text-red-400"})}),l.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Planning Failed"}),l.jsx("p",{className:"text-red-400 text-center max-w-md mb-6",children:u}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{onClick:r,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-white rounded-lg transition-colors",children:"Close"}),l.jsx("button",{onClick:()=>{s("ready"),c(null)},className:"px-4 py-2 bg-purple-600 hover:bg-purple-500 text-white rounded-lg transition-colors",children:"Try Again"})]})]})]})]})})]})}function c3(e){const t=e.find(i=>i.startsWith("difficulty:"));if(!t)return null;const r=t.split(":")[1];return["trivial","simple","medium","complex","expert"].includes(r)?r:null}const u3={trivial:"bg-green-900/50 text-green-400",simple:"bg-green-900/50 text-green-400",medium:"bg-yellow-900/50 text-yellow-400",complex:"bg-orange-900/50 text-orange-400",expert:"bg-red-900/50 text-red-400"};function h3({level:e}){const t=u3[e];return l.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs font-medium ${t}`,children:e})}async function d3(){try{const e=await fetch("/api/costs/by-issue");if(!e.ok)return{};const t=await e.json(),r={};for(const n of t.issues||[])r[n.issueId.toLowerCase()]=n;return r}catch{return{}}}function f3(e){return e>=100?`$${e.toFixed(0)}`:e>=10?`$${e.toFixed(1)}`:e>=1?`$${e.toFixed(2)}`:e>0?`$${e.toFixed(2)}`:""}function p3(e){return e>=50?"bg-red-900/50 text-red-400":e>=20?"bg-orange-900/50 text-orange-400":e>=5?"bg-yellow-900/50 text-yellow-400":"bg-green-900/50 text-green-400"}async function m3(e="current",t=!1){const r=new URLSearchParams;r.set("cycle",e),t&&r.set("includeCompleted","true");const n=await fetch(`/api/issues?${r}`);if(!n.ok)throw new Error("Failed to fetch issues");return n.json()}async function g3(){const e=await fetch("/api/agents");if(!e.ok)throw new Error("Failed to fetch agents");return e.json()}function v3(e){const t={backlog:[],todo:[],planning:[],in_progress:[],in_review:[],done:[]};for(const r of e){const n=mn[r.status]||"backlog";n==="canceled"?t.done.push(r):t[n]?t[n].push(r):t.backlog.push(r)}return t}const xv={backlog:"border-gray-600",todo:"border-blue-600",planning:"border-purple-600",in_progress:"border-yellow-500",in_review:"border-pink-500",done:"border-green-500"},y3={backlog:"Backlog",todo:"To Do",planning:"Planning",in_progress:"In Progress",in_review:"In Review",done:"Done"};function _3({selectedIssue:e,onSelectIssue:t}){const r=Jt(),[n,i]=S.useState(null),[s,o]=S.useState(new Set),[a,u]=S.useState(null),[c,h]=S.useState(null),[d,f]=S.useState("current"),[p,m]=S.useState(!1),y=e!==void 0?e:n,w=t||i,{data:g,isLoading:_,error:v}=he({queryKey:["issues",d,p],queryFn:()=>m3(d,p)}),{data:x=[]}=he({queryKey:["agents"],queryFn:g3,refetchInterval:5e3}),{data:k={}}=he({queryKey:["issueCosts"],queryFn:d3,refetchInterval:3e4,staleTime:1e4}),b=S.useMemo(()=>{if(!g)return[];const D=new Map;for(const A of g)A.project&&!D.has(A.project.id)&&D.set(A.project.id,A.project);return Array.from(D.values()).sort((A,j)=>A.name.localeCompare(j.name))},[g]),E=S.useMemo(()=>g?s.size===0?g:g.filter(D=>D.project&&s.has(D.project.id)):[],[g,s]),L=D=>{o(A=>{const j=new Set(A);return j.has(D)?j.delete(D):j.add(D),j})};if(_)return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2 animate-pulse",children:[l.jsx("div",{className:"w-4 h-4 bg-gray-700 rounded"}),l.jsx("div",{className:"w-16 h-4 bg-gray-700 rounded"}),l.jsx("div",{className:"w-24 h-6 bg-gray-700 rounded"}),l.jsx("div",{className:"w-20 h-6 bg-gray-700 rounded"}),l.jsx("div",{className:"w-28 h-6 bg-gray-700 rounded"})]}),l.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4",children:g0.map(D=>l.jsx("div",{className:"flex-shrink-0 w-80",children:l.jsxs("div",{className:`border-t-4 ${xv[D]} bg-gray-800 rounded-lg`,children:[l.jsx("div",{className:"px-4 py-3 border-b border-gray-700",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"h-5 bg-gray-700 rounded w-24 animate-pulse"}),l.jsx("div",{className:"h-4 bg-gray-700 rounded w-6 animate-pulse"})]})}),l.jsx("div",{className:"p-2 space-y-2",children:[1,2,3].map(A=>l.jsxs("div",{className:"bg-gray-700 rounded-lg p-3 border-l-4 border-l-gray-600 animate-pulse",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("div",{className:"w-2 h-2 bg-gray-600 rounded-full"}),l.jsx("div",{className:"h-4 bg-gray-600 rounded w-16"})]}),l.jsx("div",{className:"h-4 bg-gray-600 rounded w-full mb-1"}),l.jsx("div",{className:"h-4 bg-gray-600 rounded w-3/4"}),l.jsxs("div",{className:"flex gap-2 mt-3",children:[l.jsx("div",{className:"h-5 bg-gray-600 rounded w-16"}),l.jsx("div",{className:"h-5 bg-gray-600 rounded w-12"})]})]},A))})]})},D))})]});if(v)return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsxs("div",{className:"text-red-400",children:["Error loading issues: ",v.message]})});const F=v3(E);return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(D2,{className:"w-4 h-4 text-gray-400"}),l.jsx("span",{className:"text-sm text-gray-400",children:"Cycle:"}),l.jsx("div",{className:"flex rounded-lg overflow-hidden border border-gray-600",children:["current","all","backlog"].map(D=>l.jsx("button",{onClick:()=>f(D),className:`px-3 py-1 text-xs transition-colors ${d===D?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:text-white hover:bg-gray-700"}`,children:D==="current"?"Current":D==="all"?"All":"Backlog"},D))})]}),l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:p,onChange:D=>m(D.target.checked),className:"w-4 h-4 rounded border-gray-600 bg-gray-800 text-blue-600 focus:ring-blue-500 focus:ring-offset-gray-900"}),l.jsx("span",{className:"text-sm text-gray-400",children:"Include completed"})]}),l.jsxs("span",{className:"text-sm text-gray-500",children:[(g==null?void 0:g.length)||0," issues"]}),b.length>1&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"w-px h-6 bg-gray-700"}),l.jsx("span",{className:"text-sm text-gray-400",children:"Projects:"}),b.map(D=>l.jsxs("button",{onClick:()=>L(D.id),className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors ${s.size===0||s.has(D.id)?"bg-gray-700 text-white":"bg-gray-800 text-gray-500 hover:text-gray-300"}`,children:[l.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:D.color||"#6b7280"}}),D.name]},D.id)),s.size>0&&l.jsx("button",{onClick:()=>o(new Set),className:"text-xs text-gray-400 hover:text-white",children:"Clear"})]})]}),l.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4",children:g0.map(D=>l.jsx("div",{className:"flex-shrink-0 w-80",children:l.jsxs("div",{className:`border-t-4 ${xv[D]} bg-gray-800 rounded-lg`,children:[l.jsx("div",{className:"px-4 py-3 border-b border-gray-700",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"font-semibold text-white",children:y3[D]}),l.jsx("span",{className:"text-sm text-gray-400",children:F[D].length})]})}),l.jsxs("div",{className:"p-2 space-y-2 max-h-[calc(100vh-220px)] overflow-y-auto",children:[F[D].map(A=>{const j=A.identifier.toLowerCase(),M=x.find(T=>{var B;return((B=T.issueId)==null?void 0:B.toLowerCase())===j&&T.type==="planning"}),O=x.find(T=>{var B;return((B=T.issueId)==null?void 0:B.toLowerCase())===j&&T.type!=="planning"});return l.jsx(w3,{issue:A,planningAgent:M,workAgent:O,cost:k[A.identifier.toLowerCase()],isSelected:y===A.identifier,onSelect:()=>w(y===A.identifier?null:A.identifier),onPlan:()=>u(A),onViewBeads:T=>h(T)},A.id)}),F[D].length===0&&l.jsx("div",{className:"text-center text-gray-500 py-8 text-sm",children:"No issues"})]})]})},D))}),a&&l.jsx(l3,{issue:a,isOpen:!0,onClose:()=>u(null),onComplete:()=>{u(null),r.invalidateQueries({queryKey:["issues"]})}}),c&&l.jsx(x3,{issue:c,onClose:()=>h(null)})]})}function x3({issue:e,onClose:t}){var s,o;const{data:r,isLoading:n,error:i}=he({queryKey:["beads",e.identifier],queryFn:async()=>{const a=await fetch(`/api/issues/${e.identifier}/beads`);if(!a.ok)throw new Error("Failed to fetch tasks");return a.json()}});return l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:t}),l.jsxs("div",{className:"relative bg-gray-800 rounded-xl shadow-2xl w-full max-w-lg mx-4 max-h-[70vh] overflow-hidden flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-700",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ew,{className:"w-5 h-5 text-green-400"}),l.jsxs("h2",{className:"font-semibold text-white",children:["Tasks: ",e.identifier]})]}),l.jsx("button",{onClick:t,className:"p-1 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors",children:l.jsx(Vt,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[n&&l.jsxs("div",{className:"flex items-center justify-center py-8 text-gray-400",children:[l.jsx(Se,{className:"w-5 h-5 animate-spin mr-2"}),"Loading tasks..."]}),i&&l.jsx("div",{className:"text-red-400 text-center py-8",children:"Failed to load tasks"}),r&&((s=r.tasks)==null?void 0:s.length)===0&&l.jsx("div",{className:"text-gray-500 text-center py-8",children:"No tasks created yet"}),r&&((o=r.tasks)==null?void 0:o.length)>0&&l.jsx("div",{className:"space-y-2",children:r.tasks.map(a=>l.jsxs("div",{className:`flex items-start gap-3 p-3 rounded-lg ${a.status==="closed"?"bg-green-900/20":a.status==="in_progress"?"bg-blue-900/20":"bg-gray-700/50"}`,children:[l.jsx("div",{className:`mt-0.5 ${a.status==="closed"?"text-green-400":a.status==="in_progress"?"text-blue-400":"text-gray-400"}`,children:a.status==="closed"?l.jsx(Fa,{className:"w-4 h-4"}):a.status==="in_progress"?l.jsx(Se,{className:"w-4 h-4 animate-spin"}):l.jsx("div",{className:"w-4 h-4 border-2 border-current rounded-full"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm text-white",children:a.title}),l.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[a.id," · ",a.status]})]})]},a.id))})]}),l.jsxs("div",{className:"px-4 py-3 border-t border-gray-700 text-xs text-gray-500",children:[(r==null?void 0:r.count)||0," task",(r==null?void 0:r.count)!==1?"s":""," · Beads"]})]})]})}function w3({issue:e,planningAgent:t,workAgent:r,cost:n,isSelected:i,onSelect:s,onPlan:o,onViewBeads:a}){const u=Jt(),h=mn[e.status]==="planning"?t:r,d=h&&h.status!=="dead",f=h,[p,m]=S.useState(!1),[y,w]=S.useState(!1),g=e.labels.some($=>$.toLowerCase()==="review ready"),_={0:"border-l-gray-500",1:"border-l-red-500",2:"border-l-orange-500",3:"border-l-yellow-500",4:"border-l-blue-500"},v=ue({mutationFn:async $=>{const I=await fetch(`/api/agents/${$}`,{method:"DELETE"});if(!I.ok)throw new Error("Failed to kill agent");return I.json()},onSuccess:()=>{u.invalidateQueries({queryKey:["agents"]})}}),[x,k]=S.useState(""),[b,E]=S.useState(!1),L=ue({mutationFn:async({agentId:$,message:I})=>{const C=await fetch(`/api/agents/${$}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:I})});if(!C.ok)throw new Error("Failed to send message");return C.json()},onSuccess:()=>{k(""),E(!1)}}),F=$=>{$.stopPropagation(),f&&confirm(`Kill agent ${f.id}?`)&&v.mutate(f.id)},D=$=>{$.stopPropagation(),s()},A=$=>{$.stopPropagation(),E(!b)},j=$=>{$.preventDefault(),$.stopPropagation(),f&&x.trim()&&L.mutate({agentId:f.id,message:x.trim()})},M=ue({mutationFn:async()=>{const $=await fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issueId:e.identifier})});if(!$.ok){const I=await $.json();throw new Error(I.error||"Failed to start agent")}return $.json()},onSuccess:()=>{u.invalidateQueries({queryKey:["agents"]}),u.invalidateQueries({queryKey:["issues"]})},onError:$=>{alert(`Failed to start agent: ${$.message}`)}}),O=$=>{$.stopPropagation(),confirm(`Start agent for ${e.identifier}?`)&&M.mutate()},T=$=>{$.stopPropagation(),o()},B=ue({mutationFn:async $=>{const I=await fetch(`/api/issues/${e.identifier}/abort-planning`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deleteWorkspace:$.deleteWorkspace})});if(!I.ok){const C=await I.json();throw new Error(C.error||"Failed to abort planning")}return I.json()},onSuccess:()=>{m(!1),w(!1),u.invalidateQueries({queryKey:["issues"]}),u.invalidateQueries({queryKey:["agents"]})}}),U=ue({mutationFn:async $=>{const I=await fetch(`/api/issues/${e.identifier}/deep-wipe`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deleteWorkspace:$.deleteWorkspace})});if(!I.ok){const C=await I.json();throw new Error(C.error||"Deep wipe failed")}return I.json()},onSuccess:$=>{m(!1),w(!1),u.invalidateQueries({queryKey:["issues"]}),u.invalidateQueries({queryKey:["agents"]}),console.log("Deep wipe completed:",$.cleanupLog)}}),R=$=>{$.stopPropagation(),m(!0)},W=$=>{$.stopPropagation(),B.mutate({deleteWorkspace:y})},N=$=>{$.stopPropagation(),m(!1),w(!1)};return l.jsxs("div",{onClick:s,className:`bg-gray-700 rounded-lg p-3 border-l-4 cursor-pointer transition-all ${_[e.priority]||"border-l-gray-500"} ${i?"ring-2 ring-blue-500 bg-gray-650":"hover:bg-gray-650"} ${d?"bg-blue-900/20":""}`,children:[l.jsx("div",{className:"flex items-start justify-between gap-2",children:l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[e.project&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:e.project.color||"#6b7280"},title:e.project.name}),d&&l.jsxs("div",{className:"flex gap-0.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse",style:{animationDelay:"0ms"}}),l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse",style:{animationDelay:"150ms"}}),l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse",style:{animationDelay:"300ms"}})]}),l.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:$=>$.stopPropagation(),className:"text-sm font-medium text-white hover:text-blue-400 flex items-center gap-1",children:[e.source==="github"&&l.jsx("span",{title:"GitHub Issue",children:l.jsx(fm,{className:"w-3 h-3 text-gray-400"})}),l.jsx("span",{className:"text-gray-400",children:e.identifier}),l.jsx(ol,{className:"w-3 h-3 opacity-50"})]}),f&&l.jsx("span",{className:"text-xs text-blue-400",children:f.model}),g&&l.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium bg-green-600 text-white animate-pulse",title:"Agent completed work - ready for human review",children:[l.jsx(k2,{className:"w-3 h-3"}),"Ready"]}),(f==null?void 0:f.hasPendingQuestion)&&l.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium bg-amber-600 text-white animate-pulse",title:`Agent is waiting for user input (${f.pendingQuestionCount||1} question${(f.pendingQuestionCount||1)>1?"s":""})`,children:[l.jsx(j2,{className:"w-3 h-3"}),"Input"]}),(()=>{const $=c3(e.labels);return $?l.jsx(h3,{level:$}):null})(),n&&n.totalCost>0&&l.jsxs("span",{className:`ml-auto px-1.5 py-0.5 rounded text-xs font-medium ${p3(n.totalCost)}`,title:`${(n.tokenCount/1e6).toFixed(2)}M tokens${n.model?` • ${n.model.replace("claude-","").replace(/-20[0-9]{6}$/,"")}`:""}${n.durationMinutes?` • ${Math.round(n.durationMinutes)}min`:""}`,children:[l.jsx(sl,{className:"w-3 h-3 inline -mt-0.5"}),f3(n.totalCost).slice(1)]})]}),l.jsx("p",{className:"text-sm text-gray-300 mt-1 line-clamp-2",children:e.title})]})}),l.jsxs("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:[e.assignee&&l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-gray-400",children:[l.jsx(Mw,{className:"w-3 h-3"}),e.assignee.name.split(" ")[0]]}),e.labels.filter($=>$.toLowerCase()!=="review ready").slice(0,2).map($=>l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs bg-gray-600 text-gray-300 px-2 py-0.5 rounded",children:[l.jsx(Pw,{className:"w-3 h-3"}),$]},$))]}),d&&l.jsxs("div",{className:`flex items-center gap-3 mt-3 pt-3 border-t ${(f==null?void 0:f.type)==="planning"?"border-purple-600/50":"border-gray-600"}`,children:[l.jsxs("button",{onClick:(f==null?void 0:f.type)==="planning"?T:D,className:`flex items-center gap-1 text-xs transition-colors ${(f==null?void 0:f.type)==="planning"?"text-purple-400 hover:text-purple-300":i?"text-blue-400":"text-gray-400 hover:text-white"}`,children:[(f==null?void 0:f.type)==="planning"?l.jsx(uf,{className:"w-3.5 h-3.5"}):l.jsx(Nw,{className:"w-3.5 h-3.5"}),(f==null?void 0:f.type)==="planning"?"Continue Planning":"Watch"]}),l.jsxs("button",{onClick:A,className:`flex items-center gap-1 text-xs transition-colors ${b?"text-blue-400":"text-gray-400 hover:text-white"}`,children:[l.jsx(I2,{className:"w-3.5 h-3.5"}),"Tell"]}),l.jsxs("button",{onClick:F,disabled:v.isPending,className:"flex items-center gap-1 text-xs text-red-400 hover:text-red-300 transition-colors ml-auto",children:[v.isPending?l.jsx(Se,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Vt,{className:"w-3.5 h-3.5"}),"Kill"]})]}),b&&f&&l.jsx("form",{onSubmit:j,className:"mt-2",onClick:$=>$.stopPropagation(),children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",value:x,onChange:$=>k($.target.value),placeholder:"Type a message...",className:"flex-1 bg-gray-800 text-white text-sm px-3 py-1.5 rounded border border-gray-600 focus:border-blue-500 focus:outline-none",autoFocus:!0}),l.jsx("button",{type:"submit",disabled:!x.trim()||L.isPending,className:"px-3 py-1.5 bg-blue-600 text-white text-sm rounded hover:bg-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:L.isPending?"...":"Send"})]})}),!d&&(mn[e.status]==="backlog"||mn[e.status]==="todo")&&l.jsxs("div",{className:"flex items-center gap-3 mt-3 pt-3 border-t border-gray-600 flex-wrap",children:[l.jsxs("button",{onClick:T,className:"flex items-center gap-1 text-xs text-purple-400 hover:text-purple-300 transition-colors",children:[l.jsx(fc,{className:"w-3.5 h-3.5"}),"Plan"]}),l.jsxs("button",{onClick:O,disabled:M.isPending,className:"flex items-center gap-1 text-xs text-gray-500 hover:text-gray-400 transition-colors disabled:opacity-50",title:"Plan first recommended",children:[M.isPending?l.jsx(Se,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Tt,{className:"w-3.5 h-3.5"}),M.isPending?"Starting...":"Start Agent"]}),l.jsxs("button",{onClick:$=>{$.stopPropagation(),confirm(`Deep wipe ${e.identifier}? This will clean up any stale state:
|
|
443
|
+
• Kill agents
|
|
444
|
+
• Delete agent state
|
|
445
|
+
• Delete workspace & branches`)&&U.mutate({deleteWorkspace:!0})},disabled:U.isPending,className:"flex items-center gap-1 text-xs text-red-400/60 hover:text-red-400 transition-colors disabled:opacity-50",title:"Clean up stale workspace, branches, and state",children:[U.isPending?l.jsx(Se,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Rw,{className:"w-3.5 h-3.5"}),U.isPending?"Wiping...":"Reset"]})]}),!d&&mn[e.status]==="planning"&&l.jsxs("div",{className:"flex items-center gap-3 mt-3 pt-3 border-t border-purple-600/50 flex-wrap",children:[l.jsxs("button",{onClick:T,className:"flex items-center gap-1 text-xs text-purple-400 hover:text-purple-300 transition-colors",children:[l.jsx(fc,{className:"w-3.5 h-3.5"}),"Resume Planning"]}),l.jsxs("button",{onClick:()=>a&&a(e),className:"flex items-center gap-1 text-xs text-green-400 hover:text-green-300 transition-colors",title:"View tasks created during planning",children:[l.jsx(Ew,{className:"w-3.5 h-3.5"}),"Tasks"]}),l.jsxs("button",{onClick:O,className:"flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300 transition-colors",children:[l.jsx(Tt,{className:"w-3.5 h-3.5"}),"Start Agent"]}),l.jsxs("button",{onClick:R,disabled:B.isPending,className:"flex items-center gap-1 text-xs text-orange-400 hover:text-orange-300 transition-colors disabled:opacity-50",title:"Return to Todo",children:[l.jsx(Vt,{className:"w-3.5 h-3.5"}),B.isPending?"Aborting...":"Abort"]})]}),p&&l.jsxs("div",{className:"mt-3 pt-3 border-t border-orange-600/50 bg-orange-950/30 -mx-3 -mb-3 px-3 pb-3 rounded-b-lg",children:[l.jsx("p",{className:"text-xs text-orange-300 mb-2",children:"Abort planning and return to Backlog?"}),l.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-400 mb-3 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:y,onChange:$=>w($.target.checked),onClick:$=>$.stopPropagation(),className:"rounded border-gray-600 bg-gray-700 text-orange-500 focus:ring-orange-500"}),"Also delete workspace (git worktree)"]}),l.jsxs("div",{className:"flex gap-2 flex-wrap",children:[l.jsx("button",{onClick:N,className:"px-2 py-1 text-xs text-gray-400 hover:text-white transition-colors",children:"Cancel"}),l.jsx("button",{onClick:W,disabled:B.isPending||U.isPending,className:"px-2 py-1 text-xs bg-orange-600 hover:bg-orange-500 text-white rounded transition-colors disabled:opacity-50",children:B.isPending?"Aborting...":"Abort"}),l.jsx("button",{onClick:$=>{$.stopPropagation(),confirm(`Deep wipe ${e.identifier}? This will:
|
|
446
|
+
• Kill all agents
|
|
447
|
+
• Delete all state
|
|
448
|
+
• Reset to Backlog
|
|
449
|
+
• Remove labels${y?`
|
|
450
|
+
• Delete workspace`:""}`)&&U.mutate({deleteWorkspace:y})},disabled:B.isPending||U.isPending,className:"px-2 py-1 text-xs bg-red-700 hover:bg-red-600 text-white rounded transition-colors disabled:opacity-50",title:"Complete reset - kills agents, deletes state, resets Linear",children:U.isPending?"Wiping...":"🔥 Deep Wipe"})]})]}),!d&&mn[e.status]==="in_progress"&&l.jsxs("div",{className:"flex items-center gap-3 mt-3 pt-3 border-t border-gray-600",children:[l.jsxs("button",{onClick:T,className:"flex items-center gap-1 text-xs text-purple-400 hover:text-purple-300 transition-colors",children:[l.jsx(fc,{className:"w-3.5 h-3.5"}),"Re-plan"]}),l.jsxs("button",{onClick:O,className:"flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300 transition-colors",children:[l.jsx(Tt,{className:"w-3.5 h-3.5"}),"Resume Agent"]})]}),!d&&(mn[e.status]==="done"||mn[e.status]==="in_review")&&l.jsx(S3,{issue:e})]})}function S3({issue:e}){const t=Jt(),r=ue({mutationFn:async()=>{const i=await fetch(`/api/issues/${e.identifier}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!i.ok){const s=await i.json();throw new Error(s.error||"Failed to reopen issue")}return i.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["issues"]})}}),n=i=>{i.stopPropagation(),confirm(`Reopen ${e.identifier} and start planning?`)&&r.mutate()};return l.jsxs("div",{className:"flex items-center gap-3 mt-3 pt-3 border-t border-green-600/30",children:[l.jsxs("button",{onClick:n,disabled:r.isPending,className:"flex items-center gap-1 text-xs text-orange-400 hover:text-orange-300 transition-colors disabled:opacity-50",children:[r.isPending?l.jsx(Se,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(pm,{className:"w-3.5 h-3.5"}),r.isPending?"Reopening...":"Reopen"]}),r.isError&&l.jsx("span",{className:"text-xs text-red-400",children:r.error.message})]})}const b3={sleeping:"😴",active:"🟢",uninitialized:"⚪",suspended:"⏸️"},C3={sleeping:"Sleeping",active:"Active",uninitialized:"Not Initialized",suspended:"Suspended"},k3={sleeping:"text-blue-400",active:"text-green-400",uninitialized:"text-gray-500",suspended:"text-yellow-400"};async function N3(e){const t=await fetch(`/api/specialists/${e}/wake`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok){const r=await t.json();throw new Error(r.error||"Failed to wake specialist")}}async function E3(e){const t=await fetch(`/api/specialists/${e}/reset`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reinitialize:!1})});if(!t.ok){const r=await t.json();throw new Error(r.error||"Failed to reset specialist")}}async function j3(e){if(!(await fetch(`/api/agents/${e}`,{method:"DELETE"})).ok)throw new Error("Failed to kill specialist")}async function P3(e,t){const r=await fetch(`/api/agents/${e}/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t})});if(!r.ok){const n=await r.json();throw new Error(n.error||"Failed to resume agent")}}async function R3(e){const t=await fetch(`/api/agents/${e}/activity?limit=20`);return t.ok?(await t.json()).activity||[]:[]}async function D3(e){const t=await fetch(`/api/specialists/${e}/cost`);return t.ok?t.json():{cost:0,inputTokens:0,outputTokens:0}}function M3(e,t){return he({queryKey:["specialist-cost",e],queryFn:()=>D3(e),enabled:t,refetchInterval:1e4})}async function T3(e){const t=await fetch(`/api/specialists/${e}/queue`);return t.ok?t.json():{specialistName:e,hasWork:!1,urgentCount:0,totalCount:0,items:[]}}async function L3(e,t){const r=await fetch(`/api/specialists/${e}/queue/${t}`,{method:"DELETE"});if(!r.ok){const n=await r.json();throw new Error(n.error||"Failed to remove queue item")}}async function A3(e,t){const r=await fetch(`/api/specialists/${e}/queue/reorder`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({itemIds:t})});if(!r.ok){const n=await r.json();throw new Error(n.error||"Failed to reorder queue")}}function O3(e){return he({queryKey:["specialist-queue",e],queryFn:()=>T3(e),refetchInterval:5e3})}function I3(e,t){return he({queryKey:["activity",e],queryFn:()=>R3(e),enabled:t,refetchInterval:1e4})}function B3(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function F3(e){if(!e)return"Never";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),s=Math.floor(i/60),o=Math.floor(s/24);return o>0?`${o}d ago`:s>0?`${s}h ago`:i>0?`${i}m ago`:"Just now"}function z3({specialist:e,issueInfo:t,onSelect:r,isSelected:n}){const i=Jt(),{data:s}=M3(e.name,e.state!=="uninitialized"),{data:o}=O3(e.name),{data:a}=I3(e.tmuxSession,e.state!=="uninitialized"),[u,c]=S.useState(!1),[h,d]=S.useState(!1),f=ue({mutationFn:()=>N3(e.name),onSuccess:()=>{i.invalidateQueries({queryKey:["specialists"]}),i.invalidateQueries({queryKey:["agents"]})},onError:j=>{alert(`Failed to wake ${e.displayName}: ${j.message}`)}}),p=ue({mutationFn:()=>E3(e.name),onSuccess:()=>{i.invalidateQueries({queryKey:["specialists"]})},onError:j=>{alert(`Failed to reset ${e.displayName}: ${j.message}`)}}),m=ue({mutationFn:()=>j3(e.tmuxSession),onSuccess:()=>{i.invalidateQueries({queryKey:["specialists"]}),i.invalidateQueries({queryKey:["agents"]})}}),y=ue({mutationFn:j=>P3(e.tmuxSession,j),onSuccess:()=>{i.invalidateQueries({queryKey:["specialists"]}),i.invalidateQueries({queryKey:["agents"]})},onError:j=>{alert(`Failed to resume ${e.displayName}: ${j.message}`)}}),w=ue({mutationFn:j=>L3(e.name,j),onSuccess:()=>{i.invalidateQueries({queryKey:["specialist-queue",e.name]})},onError:j=>{alert(`Failed to remove queue item: ${j.message}`)}}),g=ue({mutationFn:j=>A3(e.name,j),onSuccess:()=>{i.invalidateQueries({queryKey:["specialist-queue",e.name]})},onError:j=>{alert(`Failed to reorder queue: ${j.message}`)}}),_=j=>{j.stopPropagation(),f.mutate()},v=j=>{j.stopPropagation(),confirm(`Reset ${e.displayName}? This will clear the session file and context.`)&&p.mutate()},x=j=>{j.stopPropagation(),confirm(`Kill ${e.displayName}?`)&&m.mutate()},k=(j,M)=>{j.stopPropagation(),w.mutate(M)},b=(j,M)=>{if(j.stopPropagation(),!o||M===0)return;const O=[...o.items];[O[M-1],O[M]]=[O[M],O[M-1]],g.mutate(O.map(T=>T.id))},E=(j,M)=>{if(j.stopPropagation(),!o||M===o.items.length-1)return;const O=[...o.items];[O[M],O[M+1]]=[O[M+1],O[M]],g.mutate(O.map(T=>T.id))},L=j=>{j.stopPropagation(),c(!u)},F=j=>{j.stopPropagation(),d(!h)},D=j=>{j.stopPropagation(),y.mutate(void 0)},A={urgent:"text-red-400",high:"text-orange-400",normal:"text-blue-400",low:"text-gray-400"};return l.jsxs("div",{onClick:r,className:`p-4 cursor-pointer transition-colors ${n?"bg-gray-700":"hover:bg-gray-750"}`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Sw,{className:"w-5 h-5 text-purple-400"}),l.jsxs("div",{children:[l.jsxs("div",{className:"font-medium text-white flex items-center gap-2",children:[e.displayName,e.state==="active"?l.jsx(Se,{className:"w-4 h-4 text-green-400 animate-spin"}):l.jsx("span",{className:`text-xs ${k3[e.state]}`,children:b3[e.state]}),o&&o.totalCount>0&&l.jsxs("button",{onClick:L,className:"text-xs text-yellow-400 hover:text-yellow-300 flex items-center gap-1",title:`${o.totalCount} queued task${o.totalCount>1?"s":""}`,children:["(",o.totalCount,")",u?l.jsx(N2,{className:"w-3 h-3"}):l.jsx(E2,{className:"w-3 h-3"})]})]}),l.jsx("div",{className:"text-sm text-gray-400",children:e.description}),e.currentIssue&&l.jsxs("div",{className:"text-xs text-cyan-400 mt-1 flex items-center gap-1",children:[l.jsx("span",{className:"text-gray-500",children:"Working on:"}),l.jsx("span",{className:"font-mono",children:e.currentIssue}),t&&l.jsxs("span",{className:"text-gray-400 truncate max-w-[200px]",title:t.title,children:["- ",t.title]})]}),e.sessionId&&!e.currentIssue&&l.jsxs("div",{className:"text-xs text-gray-500 font-mono mt-1",children:["Session: ",e.sessionId.slice(0,8),"..."]})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"text-right",children:[l.jsx("div",{className:"text-sm text-gray-400",children:C3[e.state]}),s&&s.cost>0&&l.jsxs("div",{className:"text-xs text-green-400 font-medium",title:"Total cost",children:["$",s.cost.toFixed(4)]}),e.contextTokens&&l.jsxs("div",{className:"text-xs text-gray-500",children:[B3(e.contextTokens)," tokens"]}),e.lastWake&&l.jsxs("div",{className:"text-xs text-gray-500",children:["Last wake: ",F3(e.lastWake)]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[e.state!=="uninitialized"&&a&&a.length>0&&l.jsx("button",{onClick:F,className:"p-2 text-gray-400 hover:text-blue-400 hover:bg-gray-600 rounded",title:`Show activity history (${a.length} entries)`,children:l.jsx(_o,{className:"w-4 h-4"})}),e.state==="suspended"&&l.jsx("button",{onClick:D,disabled:y.isPending,className:"p-2 text-gray-400 hover:text-green-400 hover:bg-gray-600 rounded disabled:opacity-50",title:"Resume specialist",children:l.jsx(Tt,{className:"w-4 h-4"})}),(e.state==="sleeping"||e.state==="uninitialized")&&l.jsx("button",{onClick:_,disabled:f.isPending||e.state==="uninitialized",className:"p-2 text-gray-400 hover:text-green-400 hover:bg-gray-600 rounded disabled:opacity-50 disabled:cursor-not-allowed",title:e.state==="uninitialized"?"Specialist not initialized - needs session ID":"Wake specialist",children:l.jsx($2,{className:"w-4 h-4"})}),e.state==="active"&&l.jsx("button",{onClick:x,disabled:m.isPending,className:"p-2 text-gray-400 hover:text-red-400 hover:bg-gray-600 rounded",title:"Kill specialist",children:l.jsx(Cu,{className:"w-4 h-4"})}),(e.state==="sleeping"||e.state==="uninitialized")&&l.jsx("button",{onClick:v,disabled:p.isPending,className:"p-2 text-gray-400 hover:text-yellow-400 hover:bg-gray-600 rounded",title:"Reset specialist (clear session)",children:l.jsx(pm,{className:"w-4 h-4"})})]})]})]}),u&&o&&o.totalCount>0&&l.jsxs("div",{className:"mt-3 pl-8 border-l-2 border-gray-600",children:[l.jsxs("div",{className:"text-xs text-gray-400 font-medium mb-2",children:["Queued Tasks (",o.totalCount,")"]}),l.jsx("div",{className:"space-y-2",children:o.items.map((j,M)=>l.jsxs("div",{className:"flex items-center justify-between bg-gray-750 px-3 py-2 rounded text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[l.jsxs("span",{className:"text-gray-500",children:[M+1,"."]}),l.jsx("span",{className:"text-white font-mono",children:j.payload.issueId||j.payload.message||j.id.substring(0,8)}),l.jsxs("span",{className:`${A[j.priority]} font-medium`,children:["[",j.priority,"]"]}),l.jsx("span",{className:"text-gray-500 text-xs",children:j.source})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:O=>b(O,M),disabled:M===0||g.isPending,className:"p-1 text-gray-400 hover:text-blue-400 disabled:opacity-30 disabled:cursor-not-allowed",title:"Move up",children:l.jsx(z2,{className:"w-3 h-3"})}),l.jsx("button",{onClick:O=>E(O,M),disabled:M===o.items.length-1||g.isPending,className:"p-1 text-gray-400 hover:text-blue-400 disabled:opacity-30 disabled:cursor-not-allowed",title:"Move down",children:l.jsx(F2,{className:"w-3 h-3"})}),l.jsx("button",{onClick:O=>k(O,j.id),disabled:w.isPending,className:"p-1 text-gray-400 hover:text-red-400 disabled:opacity-50",title:"Remove from queue",children:l.jsx(Rw,{className:"w-3 h-3"})})]})]},j.id))})]}),h&&a&&a.length>0&&l.jsxs("div",{className:"mt-3 pl-8 border-l-2 border-gray-600",children:[l.jsxs("div",{className:"text-xs text-gray-400 font-medium mb-2",children:["Recent Activity (",a.length,")"]}),l.jsx("div",{className:"space-y-1",children:a.slice().reverse().map((j,M)=>l.jsxs("div",{className:"flex items-center gap-2 bg-gray-750 px-3 py-1.5 rounded text-xs",children:[l.jsx("span",{className:"text-gray-500",children:new Date(j.ts).toLocaleTimeString()}),l.jsx("span",{className:"text-blue-400 font-mono",children:j.tool}),j.action&&l.jsx("span",{className:"text-gray-400 truncate",children:j.action.substring(0,50)})]},M))})]})]})}async function $3(e){const t=await fetch(`/api/agents/${e}/handoff/suggestion`);if(!t.ok)throw new Error("Failed to fetch handoff suggestion");return t.json()}async function H3(e){const t=await fetch(`/api/agents/${e}/cost`);if(!t.ok)throw new Error("Failed to fetch agent cost");return t.json()}function W3(e){return he({queryKey:["handoff-suggestion",e],queryFn:()=>$3(e),refetchInterval:3e4})}function U3(e){return he({queryKey:["agent-cost",e],queryFn:()=>H3(e),refetchInterval:6e4})}async function q3(e,t,r){const n=await fetch(`/api/agents/${e}/handoff`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toModel:t,reason:r})});if(!n.ok){const i=await n.json();throw new Error(i.error||"Failed to execute handoff")}}const K3={opus:"text-purple-400 bg-purple-900/20 border-purple-500/30",sonnet:"text-blue-400 bg-blue-900/20 border-blue-500/30",haiku:"text-green-400 bg-green-900/20 border-green-500/30"};function V3({agentId:e}){const{data:t,isLoading:r}=W3(e),n=Jt(),i=ue({mutationFn:({toModel:a,reason:u})=>q3(e,a,u),onSuccess:()=>{n.invalidateQueries({queryKey:["agents"]}),n.invalidateQueries({queryKey:["handoff-suggestion",e]}),alert("Handoff completed successfully")},onError:a=>{alert(`Handoff failed: ${a.message}`)}}),s=a=>{confirm(`Hand off ${e} to ${a}?`)&&i.mutate({toModel:a,reason:"Manual handoff from dashboard"})},o=()=>{t!=null&&t.suggestedModel&&confirm(`${t.reason}
|
|
451
|
+
|
|
452
|
+
Proceed with handoff to ${t.suggestedModel}?`)&&i.mutate({toModel:t.suggestedModel,reason:t.reason})};return r?l.jsx("div",{className:"p-3 bg-gray-800 rounded border border-gray-700",children:l.jsx("div",{className:"text-sm text-gray-400",children:"Loading handoff data..."})}):t?l.jsxs("div",{className:"p-3 bg-gray-800 rounded border border-gray-700 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-400",children:"Current Model:"}),l.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded border ${K3[t.currentModel]||"text-gray-400 bg-gray-700 border-gray-600"}`,children:t.currentModel})]}),t.suggested&&t.suggestedModel&&l.jsxs("div",{className:"flex items-start gap-2 p-2 bg-orange-900/20 border border-orange-500/30 rounded",children:[l.jsx(xo,{className:"w-4 h-4 text-orange-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-orange-400 mb-1",children:"Handoff Suggested"}),l.jsx("div",{className:"text-xs text-gray-300 mb-2",children:t.reason}),l.jsxs("button",{onClick:o,disabled:i.isPending,className:"flex items-center gap-2 px-3 py-1.5 text-xs font-medium text-white bg-orange-600 hover:bg-orange-500 rounded disabled:opacity-50 disabled:cursor-not-allowed",children:[l.jsx(lf,{className:"w-3 h-3"}),"Hand off to ",t.suggestedModel]})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-2",children:"Manual Handoff:"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>s("haiku"),disabled:i.isPending||t.currentModel==="haiku",className:"flex-1 px-2 py-1.5 text-xs font-medium text-green-400 bg-green-900/20 hover:bg-green-900/40 border border-green-500/30 rounded disabled:opacity-50 disabled:cursor-not-allowed",children:"Haiku"}),l.jsx("button",{onClick:()=>s("sonnet"),disabled:i.isPending||t.currentModel==="sonnet",className:"flex-1 px-2 py-1.5 text-xs font-medium text-blue-400 bg-blue-900/20 hover:bg-blue-900/40 border border-blue-500/30 rounded disabled:opacity-50 disabled:cursor-not-allowed",children:"Sonnet"}),l.jsx("button",{onClick:()=>s("opus"),disabled:i.isPending||t.currentModel==="opus",className:"flex-1 px-2 py-1.5 text-xs font-medium text-purple-400 bg-purple-900/20 hover:bg-purple-900/40 border border-purple-500/30 rounded disabled:opacity-50 disabled:cursor-not-allowed",children:"Opus"})]})]})]}):null}const Q3={healthy:"bg-status-healthy",warning:"bg-status-warning",stuck:"bg-status-stuck",dead:"bg-status-dead"},Y3={active:"🟢",stale:"🟡",warning:"🟠",stuck:"🔴",suspended:"⏸️"},X3={active:"Active",stale:"Stale",warning:"Warning",stuck:"Stuck",suspended:"Suspended"},G3={active:"text-green-400",stale:"text-yellow-400",warning:"text-orange-400",stuck:"text-red-400",suspended:"text-blue-400"};async function J3(e){if(!(await fetch(`/api/agents/${e}`,{method:"DELETE"})).ok)throw new Error("Failed to kill agent")}async function Z3(e){const t=await fetch(`/api/agents/${e}/poke`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok){const r=await t.json();throw new Error(r.error||"Failed to poke agent")}}async function eP(e,t){const r=await fetch(`/api/agents/${e}/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t})});if(!r.ok){const n=await r.json();throw new Error(n.error||"Failed to resume agent")}}async function tP(e){const t=await fetch(`/api/agents/${e}/activity?limit=20`);return t.ok?(await t.json()).activity||[]:[]}function rP(e,t){return he({queryKey:["activity",e],queryFn:()=>tP(e),enabled:t,refetchInterval:1e4})}function nP(e){const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/6e4),s=Math.floor(i/60);return s>0?`${s}h ${i%60}m`:`${i}m`}function iP(e){if(e===null)return"unknown";const t=Math.floor(e/1e3),r=Math.floor(t/60),n=Math.floor(r/60);return n>0?`${n}h ago`:r>0?`${r}m ago`:`${t}s ago`}function sP({agent:e,health:t,onSelect:r,isSelected:n}){const i=Jt(),[s,o]=S.useState(!1),[a,u]=S.useState(!1),{data:c}=U3(e.id),{data:h}=rP(e.id,(t==null?void 0:t.isRunning)||(t==null?void 0:t.state)==="suspended"),d=ue({mutationFn:()=>J3(e.id),onSuccess:()=>{i.invalidateQueries({queryKey:["agents"]})}}),f=ue({mutationFn:()=>Z3(e.id),onSuccess:()=>{alert(`Poked ${e.id} successfully`)},onError:x=>{alert(`Failed to poke ${e.id}: ${x.message}`)}}),p=ue({mutationFn:x=>eP(e.id,x),onSuccess:()=>{i.invalidateQueries({queryKey:["agents"]})},onError:x=>{alert(`Failed to resume ${e.id}: ${x.message}`)}}),m=x=>{x.stopPropagation(),confirm(`Kill agent ${e.id}?`)&&d.mutate()},y=x=>{x.stopPropagation(),f.mutate()},w=x=>{x.stopPropagation(),p.mutate(void 0)},g=x=>{x.stopPropagation(),u(!a)},_=(t==null?void 0:t.state)==="warning"||(t==null?void 0:t.state)==="stuck",v=x=>{x.stopPropagation(),o(!s)};return l.jsxs("div",{onClick:r,className:`p-4 cursor-pointer transition-colors ${n?"bg-gray-700":"hover:bg-gray-750"}`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`w-3 h-3 rounded-full ${Q3[e.status]}`}),l.jsxs("div",{children:[l.jsxs("div",{className:"font-medium text-white flex items-center gap-2",children:[e.id,t&&l.jsx("span",{className:`text-xs ${G3[t.state]}`,title:`Cloister: ${X3[t.state]}`,children:Y3[t.state]})]}),l.jsxs("div",{className:"text-sm text-gray-400 flex items-center gap-2",children:[e.runtime," / ",e.model,c&&c.cost>0&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-emerald-400",title:"Agent cost so far",children:[l.jsx(sl,{className:"w-3 h-3"}),"$",c.cost.toFixed(4)]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-right",children:[l.jsxs("div",{className:"flex items-center gap-1 text-sm text-gray-400",children:[l.jsx(za,{className:"w-4 h-4"}),nP(e.startedAt)]}),t&&t.timeSinceActivity!==null&&l.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-500",children:[l.jsx(_o,{className:"w-3 h-3"}),iP(t.timeSinceActivity)]}),e.consecutiveFailures>0&&l.jsxs("div",{className:"flex items-center gap-1 text-sm text-orange-400",children:[l.jsx(Mn,{className:"w-4 h-4"}),e.consecutiveFailures," failures"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[t&&(t.isRunning||t.state==="suspended")&&h&&h.length>0&&l.jsx("button",{onClick:g,className:"p-2 text-gray-400 hover:text-blue-400 hover:bg-gray-600 rounded",title:`Show activity history (${h.length} entries)`,children:l.jsx(_o,{className:"w-4 h-4"})}),l.jsx("button",{onClick:v,className:`p-2 hover:bg-gray-600 rounded ${s?"text-blue-400":"text-gray-400 hover:text-blue-400"}`,title:"Model handoff controls",children:l.jsx(hm,{className:"w-4 h-4"})}),(t==null?void 0:t.state)==="suspended"&&l.jsx("button",{onClick:w,disabled:p.isPending,className:"p-2 text-gray-400 hover:text-green-400 hover:bg-gray-600 rounded disabled:opacity-50",title:"Resume agent",children:l.jsx(Tt,{className:"w-4 h-4"})}),_&&l.jsx("button",{onClick:y,disabled:f.isPending,className:"p-2 text-gray-400 hover:text-yellow-400 hover:bg-gray-600 rounded",title:"Poke agent (send nudge message)",children:l.jsx(xw,{className:"w-4 h-4"})}),(t==null?void 0:t.state)!=="suspended"&&l.jsx("button",{onClick:m,disabled:d.isPending,className:"p-2 text-gray-400 hover:text-red-400 hover:bg-gray-600 rounded",title:"Kill agent",children:l.jsx($a,{className:"w-4 h-4"})})]})]})]}),s&&l.jsx("div",{className:"mt-3 pt-3 border-t border-gray-700",children:l.jsx(V3,{agentId:e.id})}),a&&h&&h.length>0&&l.jsxs("div",{className:"mt-3 pl-8 border-l-2 border-gray-600",children:[l.jsxs("div",{className:"text-xs text-gray-400 font-medium mb-2",children:["Recent Activity (",h.length,")"]}),l.jsx("div",{className:"space-y-1",children:h.slice().reverse().map((x,k)=>l.jsxs("div",{className:"flex items-center gap-2 bg-gray-750 px-3 py-1.5 rounded text-xs",children:[l.jsx("span",{className:"text-gray-500",children:new Date(x.ts).toLocaleTimeString()}),l.jsx("span",{className:"text-blue-400 font-mono",children:x.tool}),x.action&&l.jsx("span",{className:"text-gray-400 truncate",children:x.action.substring(0,50)})]},k))})]})]})}async function oP(){const e=await fetch("/api/agents");if(!e.ok)throw new Error("Failed to fetch agents");return e.json()}async function aP(){const e=await fetch("/api/specialists");if(!e.ok)throw new Error("Failed to fetch specialists");return e.json()}async function lP(){const e=await fetch("/api/cloister/agents/health");if(!e.ok)throw new Error("Failed to fetch Cloister health");return e.json()}async function cP(){const e=await fetch("/api/cloister/status");if(!e.ok)throw new Error("Failed to fetch Cloister status");return e.json()}async function uP(){const e=await fetch("/api/activity");return e.ok?e.json():[]}async function hP(){const e=await fetch("/api/issues");return e.ok?(await e.json()).issues||[]:[]}async function dP(){if(!(await fetch("/api/cloister/start",{method:"POST"})).ok)throw new Error("Failed to start Cloister")}async function fP(){if(!(await fetch("/api/cloister/stop",{method:"POST"})).ok)throw new Error("Failed to stop Cloister")}function pP(e){if(!e)return"Never";const t=new Date(e),n=new Date().getTime()-t.getTime(),i=Math.floor(n/1e3),s=Math.floor(i/60);return i<60?`${i}s ago`:s<60?`${s}m ago`:`${Math.floor(s/60)}h ago`}async function mP(){const e=await fetch("/api/specialists/reset-all",{method:"POST",headers:{"Content-Type":"application/json"}});if(!e.ok){const t=await e.json();throw new Error(t.error||"Failed to reset specialists")}}function gP({selectedAgent:e,onSelectAgent:t}){const r=Jt(),{data:n,isLoading:i,error:s}=he({queryKey:["agents"],queryFn:oP,refetchInterval:3e3}),{data:o,isLoading:a}=he({queryKey:["specialists"],queryFn:aP,refetchInterval:5e3}),{data:u}=he({queryKey:["cloister-health"],queryFn:lP,refetchInterval:5e3}),{data:c}=he({queryKey:["cloister-status"],queryFn:cP,refetchInterval:5e3}),{data:h}=he({queryKey:["activity"],queryFn:uP,refetchInterval:5e3}),{data:d}=he({queryKey:["issues"],queryFn:hP,refetchInterval:3e4}),f=ue({mutationFn:dP,onSuccess:()=>{r.invalidateQueries({queryKey:["cloister-status"]})}}),p=ue({mutationFn:fP,onSuccess:()=>{r.invalidateQueries({queryKey:["cloister-status"]})}}),m=ue({mutationFn:mP,onSuccess:()=>{r.invalidateQueries({queryKey:["specialists"]}),r.invalidateQueries({queryKey:["agents"]})},onError:b=>{alert(`Failed to reset specialists: ${b.message}`)}}),y=()=>{confirm(`Reset ALL specialist agents?
|
|
453
|
+
|
|
454
|
+
This will kill any running specialists and clear their session files.`)&&m.mutate()},w=b=>{if(!b||!d)return;const E=d.find(L=>L.identifier.toLowerCase()===b.toLowerCase());if(E)return{id:E.id,identifier:E.identifier,title:E.title}},g=(o==null?void 0:o.some(b=>b.isRunning))||!1,_=(c==null?void 0:c.running)||!1,v=(h||[]).slice(-5).reverse();if(i||a)return l.jsx("div",{className:"bg-gray-800 rounded-lg p-6",children:l.jsx("div",{className:"text-gray-400",children:"Loading agents..."})});if(s)return l.jsx("div",{className:"bg-gray-800 rounded-lg p-6",children:l.jsxs("div",{className:"text-red-400",children:["Error: ",s.message]})});const x=(n==null?void 0:n.filter(b=>b.status!=="dead"))||[],k=(o==null?void 0:o.filter(b=>b.enabled))||[];return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"bg-gray-800 rounded-lg",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-700 flex items-center justify-between",children:[l.jsxs("h2",{className:"font-semibold text-white flex items-center gap-2",children:[l.jsx(za,{className:"w-5 h-5 text-blue-400"}),"Cloister Deacon"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`text-xs px-2 py-1 rounded ${g?"bg-green-900/50 text-green-400":"bg-gray-700 text-gray-400"}`,children:g?"● Specialists Active":"○ Specialists Idle"}),_?l.jsxs("button",{onClick:()=>p.mutate(),disabled:p.isPending,className:"flex items-center gap-1 px-2 py-1 text-xs text-red-400 hover:bg-gray-700 rounded transition-colors disabled:opacity-50",title:"Stop patrol loop",children:[l.jsx($a,{className:"w-3 h-3"}),"Stop Patrol"]}):l.jsxs("button",{onClick:()=>f.mutate(),disabled:f.isPending,className:"flex items-center gap-1 px-2 py-1 text-xs text-green-400 hover:bg-gray-700 rounded transition-colors disabled:opacity-50",title:"Start patrol loop (health monitoring)",children:[l.jsx(Tt,{className:"w-3 h-3"}),"Start Patrol"]})]})]}),l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-400",children:"Patrol Status:"})," ",l.jsx("span",{className:_?"text-green-400":"text-gray-500",children:_?"● Running":"○ Stopped"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-400",children:"Last Check:"})," ",l.jsx("span",{className:"text-gray-300",children:pP((c==null?void 0:c.lastCheck)||null)})]}),(c==null?void 0:c.summary)&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ns,{className:"w-4 h-4 text-green-400"}),l.jsxs("span",{className:"text-gray-300",children:[c.summary.active," active"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[c.summary.stuck>0?l.jsx(xo,{className:"w-4 h-4 text-red-400"}):l.jsx(xo,{className:"w-4 h-4 text-gray-500"}),l.jsxs("span",{className:c.summary.stuck>0?"text-red-400":"text-gray-400",children:[c.summary.stuck," stuck"]})]})]})]})})]}),v.length>0&&l.jsxs("div",{className:"bg-gray-800 rounded-lg",children:[l.jsx("div",{className:"px-4 py-3 border-b border-gray-700",children:l.jsxs("h2",{className:"font-semibold text-white flex items-center gap-2",children:[l.jsx(_o,{className:"w-5 h-5 text-cyan-400"}),"Recent Activity"]})}),l.jsx("div",{className:"divide-y divide-gray-700",children:v.map(b=>l.jsxs("div",{className:"px-4 py-2 flex items-center gap-3 text-sm",children:[l.jsx("span",{className:"text-gray-500 text-xs w-16",children:new Date(b.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),l.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs ${b.type==="spawn"?"bg-green-900/50 text-green-400":b.type==="complete"?"bg-blue-900/50 text-blue-400":b.type==="error"?"bg-red-900/50 text-red-400":"bg-gray-700 text-gray-300"}`,children:b.type}),l.jsxs("span",{className:"text-gray-300 truncate flex-1",children:[b.source,b.issueId&&l.jsxs("span",{className:"text-cyan-400 ml-1",children:["(",b.issueId,")"]})]})]},b.id))})]}),l.jsxs("div",{className:"bg-gray-800 rounded-lg",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-700 flex items-center justify-between",children:[l.jsxs("h2",{className:"font-semibold text-white flex items-center gap-2",children:[l.jsx(Sw,{className:"w-5 h-5 text-purple-400"}),"Specialist Agents (",k.length,")"]}),l.jsxs("button",{onClick:y,disabled:m.isPending,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-gray-400 hover:text-yellow-400 hover:bg-gray-700 rounded transition-colors disabled:opacity-50",title:"Reset all specialists (kill & clear sessions)",children:[m.isPending?l.jsx(Se,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(pm,{className:"w-3.5 h-3.5"}),"Reset All"]})]}),l.jsx("div",{className:"divide-y divide-gray-700",children:k.length===0?l.jsx("div",{className:"p-8 text-center text-gray-500",children:"No specialist agents configured."}):k.map(b=>l.jsx(z3,{specialist:b,issueInfo:w(b.currentIssue),onSelect:()=>t(b.tmuxSession===e?null:b.tmuxSession),isSelected:b.tmuxSession===e},b.name))})]}),l.jsxs("div",{className:"bg-gray-800 rounded-lg",children:[l.jsx("div",{className:"px-4 py-3 border-b border-gray-700",children:l.jsxs("h2",{className:"font-semibold text-white flex items-center gap-2",children:[l.jsx(Cw,{className:"w-5 h-5"}),"Issue Agents (",x.length,")"]})}),l.jsx("div",{className:"divide-y divide-gray-700",children:x.length===0?l.jsxs("div",{className:"p-8 text-center text-gray-500",children:["No agents running. Use"," ",l.jsx("code",{className:"bg-gray-700 px-2 py-1 rounded",children:"/work-issue"})," to spawn one."]}):x.map(b=>{const E=u==null?void 0:u.agents.find(L=>L.agentId===b.id);return l.jsx(sP,{agent:b,health:E,onSelect:()=>t(b.id===e?null:b.id),isSelected:b.id===e},b.id)})})]})]})}async function vP(e){const t=await fetch(`/api/agents/${e}/output`);if(!t.ok)throw new Error("Failed to fetch output");return(await t.json()).output||""}async function yP(e,t){if(!(await fetch(`/api/agents/${e}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t})})).ok)throw new Error("Failed to send message")}function _P({agentId:e}){const[t,r]=S.useState(""),n=S.useRef(null),{data:i,isLoading:s,refetch:o}=he({queryKey:["agent-output",e],queryFn:()=>vP(e),refetchInterval:2e3}),a=ue({mutationFn:c=>yP(e,c),onSuccess:()=>{r(""),setTimeout(()=>o(),500)}});S.useEffect(()=>{n.current&&(n.current.scrollTop=n.current.scrollHeight)},[i]);const u=c=>{c.preventDefault(),t.trim()&&a.mutate(t.trim())};return l.jsxs("div",{className:"bg-gray-800 rounded-lg flex flex-col h-[600px]",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-700 flex items-center justify-between",children:[l.jsxs("h2",{className:"font-semibold text-white flex items-center gap-2",children:[l.jsx(wi,{className:"w-5 h-5"}),e]}),l.jsx("button",{onClick:()=>o(),className:"p-2 text-gray-400 hover:text-white hover:bg-gray-700 rounded",title:"Refresh",children:l.jsx(bn,{className:"w-4 h-4"})})]}),l.jsx("pre",{ref:n,className:"flex-1 overflow-auto p-4 terminal-output text-gray-300 bg-gray-900",children:s?l.jsx("span",{className:"text-gray-500",children:"Loading..."}):i||l.jsx("span",{className:"text-gray-500",children:"No output yet"})}),l.jsx("form",{onSubmit:u,className:"p-3 border-t border-gray-700",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",value:t,onChange:c=>r(c.target.value),placeholder:"Send message to agent...",className:"flex-1 bg-gray-700 border border-gray-600 rounded px-3 py-2 text-white placeholder-gray-400 focus:outline-none focus:border-blue-500"}),l.jsxs("button",{type:"submit",disabled:!t.trim()||a.isPending,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[l.jsx(jw,{className:"w-4 h-4"}),"Send"]})]})})]})}async function xP(){const e=await fetch("/api/health/agents");if(!e.ok)throw new Error("Failed to fetch health");return e.json()}const wv={healthy:{icon:Fa,color:"text-green-400",bg:"bg-green-900/30"},warning:{icon:Mn,color:"text-yellow-400",bg:"bg-yellow-900/30"},stuck:{icon:za,color:"text-orange-400",bg:"bg-orange-900/30"},dead:{icon:Cu,color:"text-red-400",bg:"bg-red-900/30"}};function wP(){const{data:e,isLoading:t,error:r}=he({queryKey:["health"],queryFn:xP,refetchInterval:5e3});if(t)return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx("div",{className:"text-gray-400",children:"Loading health data..."})});if(r)return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsxs("div",{className:"text-red-400",children:["Error: ",r.message]})});if(!e||e.length===0)return l.jsxs("div",{className:"bg-gray-800 rounded-lg p-8 text-center",children:[l.jsx(_o,{className:"w-12 h-12 text-gray-600 mx-auto mb-4"}),l.jsx("h3",{className:"text-lg font-medium text-gray-400",children:"No agents to monitor"}),l.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Health data will appear here when agents are running"})]});const n=e.reduce((i,s)=>(i[s.status]=(i[s.status]||0)+1,i),{});return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"grid grid-cols-4 gap-4",children:["healthy","warning","stuck","dead"].map(i=>{const s=wv[i],o=s.icon;return l.jsx("div",{className:`${s.bg} rounded-lg p-4 border border-gray-700`,children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(o,{className:`w-8 h-8 ${s.color}`}),l.jsxs("div",{children:[l.jsx("div",{className:"text-2xl font-bold text-white",children:n[i]||0}),l.jsx("div",{className:"text-sm text-gray-400 capitalize",children:i})]})]})},i)})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(i=>{const s=wv[i.status],o=s.icon;return l.jsxs("div",{className:`${s.bg} rounded-lg p-4 border border-gray-700`,children:[l.jsx("div",{className:"flex items-start justify-between",children:l.jsxs("div",{children:[l.jsx("div",{className:"font-medium text-white",children:i.agentId}),l.jsxs("div",{className:`flex items-center gap-1 text-sm ${s.color} mt-1`,children:[l.jsx(o,{className:"w-4 h-4"}),l.jsx("span",{className:"capitalize",children:i.status})]})]})}),i.reason&&l.jsx("div",{className:"mt-2 text-sm text-gray-400 italic",children:i.reason}),l.jsxs("div",{className:"mt-4 space-y-2 text-sm",children:[i.lastPing&&l.jsxs("div",{className:"flex justify-between text-gray-400",children:[l.jsx("span",{children:"Last ping:"}),l.jsx("span",{children:new Date(i.lastPing).toLocaleTimeString()})]}),l.jsxs("div",{className:"flex justify-between text-gray-400",children:[l.jsx("span",{children:"Failures:"}),l.jsx("span",{className:i.consecutiveFailures>0?"text-orange-400":"",children:i.consecutiveFailures})]}),l.jsxs("div",{className:"flex justify-between text-gray-400",children:[l.jsx("span",{children:"Kill count:"}),l.jsx("span",{className:i.killCount>0?"text-red-400":"",children:i.killCount})]})]})]},i.agentId)})})]})}function SP(){const[e,t]=S.useState([]),[r,n]=S.useState(!0),[i,s]=S.useState(null),o=async()=>{try{n(!0);const c=await fetch("/api/skills");if(!c.ok)throw new Error("Failed to fetch skills");const h=await c.json();t(h),s(null)}catch(c){s(c instanceof Error?c.message:"Unknown error")}finally{n(!1)}};if(S.useEffect(()=>{o()},[]),r)return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(bn,{className:"w-6 h-6 text-gray-400 animate-spin"})});if(i)return l.jsxs("div",{className:"bg-red-900/20 border border-red-800 rounded-lg p-4 text-red-400",children:[l.jsx(xo,{className:"w-5 h-5 inline mr-2"}),i]});const a=e.filter(c=>c.source==="panopticon"),u=e.filter(c=>c.source==="claude");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-white",children:"Skills"}),l.jsxs("button",{onClick:o,className:"flex items-center gap-2 px-3 py-1.5 text-sm text-gray-400 hover:text-white hover:bg-gray-700 rounded-lg transition-colors",children:[l.jsx(bn,{className:"w-4 h-4"}),"Refresh"]})]}),e.length===0?l.jsxs("div",{className:"bg-gray-800 rounded-lg p-8 text-center text-gray-400",children:[l.jsx(dm,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),l.jsx("p",{children:"No skills found"}),l.jsx("p",{className:"text-sm mt-2",children:"Add skills to ~/.panopticon/skills/ or ~/.claude/skills/"})]}):l.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[l.jsxs("div",{className:"bg-gray-800 rounded-lg p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"}),l.jsxs("h3",{className:"font-medium text-white",children:["Panopticon (",a.length,")"]})]}),l.jsxs("div",{className:"space-y-2",children:[a.map(c=>l.jsx(Sv,{skill:c},c.path)),a.length===0&&l.jsx("p",{className:"text-gray-500 text-sm",children:"No Panopticon skills"})]})]}),l.jsxs("div",{className:"bg-gray-800 rounded-lg p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-purple-500"}),l.jsxs("h3",{className:"font-medium text-white",children:["Claude (",u.length,")"]})]}),l.jsxs("div",{className:"space-y-2",children:[u.map(c=>l.jsx(Sv,{skill:c},c.path)),u.length===0&&l.jsx("p",{className:"text-gray-500 text-sm",children:"No Claude skills"})]})]})]}),l.jsxs("div",{className:"bg-gray-800 rounded-lg p-4",children:[l.jsx("h3",{className:"font-medium text-white mb-2",children:"Skill Locations"}),l.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[l.jsxs("p",{children:[l.jsx("span",{className:"text-blue-400",children:"Panopticon:"})," ","~/.panopticon/skills/"]}),l.jsxs("p",{children:[l.jsx("span",{className:"text-purple-400",children:"Claude:"})," ~/.claude/skills/"]})]})]})]})}function Sv({skill:e}){return l.jsxs("div",{className:"bg-gray-700/50 rounded-lg p-3 hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ww,{className:"w-4 h-4 text-gray-400"}),l.jsx("span",{className:"font-medium text-white",children:e.name})]}),e.hasSkillMd?l.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-400",children:[l.jsx($s,{className:"w-3 h-3"}),"SKILL.md"]}):l.jsxs("span",{className:"flex items-center gap-1 text-xs text-yellow-400",children:[l.jsx(xo,{className:"w-3 h-3"}),"No SKILL.md"]})]}),e.description&&l.jsx("p",{className:"mt-2 text-sm text-gray-400 line-clamp-2",children:e.description}),l.jsx("p",{className:"mt-2 text-xs text-gray-500 truncate",children:e.path})]})}function bP(e){if(navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(e),!0;const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),document.body.removeChild(t),!0}catch{return document.body.removeChild(t),!1}}async function CP(e){const t=await fetch(`/api/agents/${e}/output?lines=200`);if(!t.ok)throw new Error("Failed to fetch output");return(await t.json()).output||""}function kP({agent:e,issueId:t,issueUrl:r,onClose:n}){var tr,ye;const i=Jt(),[s,o]=S.useState(""),[a,u]=S.useState(!1),[c,h]=S.useState("logs"),d=S.useRef(null),f=S.useRef(null),[p,m]=S.useState(!0),y=`tmux attach -t ${e.id}`,{data:w,refetch:g}=he({queryKey:["agent-output",e.id],queryFn:()=>CP(e.id),refetchInterval:1e3}),{data:_}=he({queryKey:["workspace",t],queryFn:async()=>{const ee=await fetch(`/api/workspaces/${t}`);if(!ee.ok)throw new Error("Failed to fetch workspace info");return ee.json()},refetchInterval:5e3}),{data:v}=he({queryKey:["review-status",t],queryFn:async()=>{const ee=await fetch(`/api/workspaces/${t}/review-status`);if(!ee.ok)throw new Error("Failed to fetch review status");return ee.json()},refetchInterval:3e3}),x=ue({mutationFn:async()=>{const ee=await fetch(`/api/workspaces/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!ee.ok){const xe=await ee.json();throw new Error(xe.error||"Failed to start containers")}return ee.json()},onSuccess:()=>{setTimeout(()=>{i.invalidateQueries({queryKey:["workspace",t]})},5e3)}}),[k,b]=S.useState(null);S.useEffect(()=>{const ee=()=>b(null);if(k)return document.addEventListener("click",ee),()=>document.removeEventListener("click",ee)},[k]);const E=ue({mutationFn:async({containerName:ee,action:xe})=>{const Ft=await fetch(`/api/workspaces/${t}/containers/${ee}/${xe}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!Ft.ok){const $r=await Ft.json();throw new Error($r.error||`Failed to ${xe} container`)}return Ft.json()},onSuccess:()=>{b(null),setTimeout(()=>{i.invalidateQueries({queryKey:["workspace",t]})},2e3)}}),L=(ee,xe,Ft)=>{ee.preventDefault(),b({x:ee.clientX,y:ee.clientY,containerName:xe,isRunning:Ft})},F=ue({mutationFn:async()=>{const ee=await fetch(`/api/workspaces/${t}/containerize`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!ee.ok){const xe=await ee.json();throw new Error(xe.error||"Failed to containerize workspace")}return ee.json()},onSuccess:()=>{setTimeout(()=>{i.invalidateQueries({queryKey:["workspace",t]})},3e3)}}),D=ue({mutationFn:async()=>{const ee=await fetch(`/api/workspaces/${t}/review`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!ee.ok){const xe=await ee.json();throw new Error(xe.error||"Failed to start review")}return ee.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["workspace",t]}),i.invalidateQueries({queryKey:["review-status",t]})}}),A=ue({mutationFn:async()=>{const ee=await fetch(`/api/workspaces/${t}/merge`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!ee.ok){const xe=await ee.json();throw new Error(xe.error||"Failed to merge")}return ee.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["workspace",t]}),i.invalidateQueries({queryKey:["agents"]}),i.invalidateQueries({queryKey:["issues"]}),i.invalidateQueries({queryKey:["review-status",t]}),n()}}),j=ue({mutationFn:async()=>{const ee=await fetch(`/api/issues/${t}/close`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:"Closed manually"})});if(!ee.ok){const xe=await ee.json();throw new Error(xe.error||"Failed to close issue")}return ee.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["workspace",t]}),i.invalidateQueries({queryKey:["agents"]}),i.invalidateQueries({queryKey:["issues"]}),n()}}),M=ue({mutationFn:async()=>{const ee=await fetch(`/api/workspaces/${t}/pending`,{method:"DELETE"});if(!ee.ok)throw new Error("Failed to dismiss");return ee.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["workspace",t]})}}),O=ue({mutationFn:async()=>{const ee=await fetch(`/api/workspaces/${t}/clean`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!ee.ok){const xe=await ee.json();throw new Error(xe.error||"Failed to clean workspace")}return ee.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["workspace",t]}),i.invalidateQueries({queryKey:["agents"]})}}),T=()=>{confirm(`Clean and recreate corrupted workspace for ${t}?
|
|
455
|
+
|
|
456
|
+
This will:
|
|
457
|
+
- Remove the corrupted workspace directory
|
|
458
|
+
- Create a fresh workspace`)&&O.mutate()},B=()=>{x.mutate()},U=()=>{F.mutate()},R=()=>{const xe=(v==null?void 0:v.readyForMerge)||(v==null?void 0:v.reviewStatus)==="passed"||(v==null?void 0:v.testStatus)==="passed"?`Re-run review & test pipeline for ${t}?
|
|
459
|
+
|
|
460
|
+
This will reset the current status and:
|
|
461
|
+
- Run strict code review (review-agent)
|
|
462
|
+
- Run tests (test-agent)
|
|
463
|
+
|
|
464
|
+
MERGE button will appear when both pass.`:`Start review & test pipeline for ${t}?
|
|
465
|
+
|
|
466
|
+
This will:
|
|
467
|
+
- Run strict code review (review-agent)
|
|
468
|
+
- Run tests (test-agent)
|
|
469
|
+
|
|
470
|
+
MERGE button will appear when both pass.`;confirm(xe)&&D.mutate()},W=()=>{confirm(`Merge ${t} to main?
|
|
471
|
+
|
|
472
|
+
Review and tests have passed. This will:
|
|
473
|
+
- Merge the feature branch to main
|
|
474
|
+
- Run final verification tests
|
|
475
|
+
- Clean up workspace`)&&A.mutate()},N=()=>{confirm(`Close ${t} without merging? This will:
|
|
476
|
+
- Close the issue (no merge)
|
|
477
|
+
- Stop any running agent
|
|
478
|
+
- Remove the workspace
|
|
479
|
+
(Feature branch is preserved for history)`)&&j.mutate()},$=ue({mutationFn:async ee=>{if(!(await fetch(`/api/agents/${e.id}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:ee})})).ok)throw new Error("Failed to send")},onSuccess:()=>{o(""),setTimeout(()=>g(),500)}}),I=ue({mutationFn:async()=>{if(!(await fetch(`/api/agents/${e.id}`,{method:"DELETE"})).ok)throw new Error("Failed to kill")},onSuccess:()=>{i.invalidateQueries({queryKey:["agents"]}),n()}}),C=S.useCallback(()=>{bP(y),u(!0),setTimeout(()=>u(!1),2e3)},[y]);S.useEffect(()=>{p&&f.current&&f.current.scrollIntoView({behavior:"auto"})},[w,p]);const q=S.useCallback(()=>{if(d.current){const{scrollTop:ee,scrollHeight:xe,clientHeight:Ft}=d.current,$r=xe-ee-Ft<50;m($r)}},[]),Y=()=>{s.trim()&&$.mutate(s.trim())},Z=()=>{confirm(`Kill agent ${e.id}?`)&&I.mutate()},oe=new Date(e.startedAt),ke=Date.now()-oe.getTime(),me=Math.floor(ke/6e4),Ze=Math.floor(me/60),er=Ze>0?`${Ze}h ${me%60}m`:`${me}m`;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex h-full bg-gray-800 border-l border-gray-700",children:[l.jsxs("div",{className:"w-64 border-r border-gray-700 flex flex-col overflow-y-auto",children:[l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex gap-0.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse",style:{animationDelay:"0ms"}}),l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse",style:{animationDelay:"150ms"}}),l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse",style:{animationDelay:"300ms"}})]}),l.jsx("span",{className:"text-xs text-gray-400",children:"Agent Running"})]}),l.jsx("h2",{className:"font-mono text-sm text-white font-medium mt-1",children:e.issueId})]}),l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700 text-xs",children:[l.jsx("div",{className:"text-gray-500 uppercase tracking-wider mb-2",children:"Agent"}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-gray-400",children:"Model"}),l.jsx("span",{className:"text-white",children:e.model})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-gray-400",children:"Runtime"}),l.jsx("span",{className:"text-white",children:e.runtime})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-gray-400",children:"Uptime"}),l.jsx("span",{className:"text-white",children:er})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-gray-400",children:"Session"}),l.jsx("span",{className:"text-white font-mono text-[10px]",children:e.id})]})]})]}),e.git&&l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700 text-xs",children:[l.jsx("div",{className:"text-gray-500 uppercase tracking-wider mb-2",children:"Git Status"}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-white",children:[l.jsx(ma,{className:"w-3 h-3"}),l.jsx("span",{className:"font-mono",children:e.git.branch})]}),e.git.uncommittedFiles>0&&l.jsxs("div",{className:"text-yellow-400 text-[10px] ml-4",children:[e.git.uncommittedFiles," uncommitted files"]}),l.jsx("div",{className:"text-gray-400 text-[10px] mt-1 truncate",title:e.git.latestCommit,children:e.git.latestCommit})]})]}),e.workspace&&l.jsx("div",{className:"px-3 py-2 border-b border-gray-700 text-xs",children:l.jsxs("div",{className:"flex items-center gap-1.5 text-gray-400",children:[l.jsx(dm,{className:"w-3 h-3"}),l.jsx("span",{className:"font-mono truncate text-[10px]",title:e.workspace,children:e.workspace})]})}),l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700 text-xs",children:[l.jsx("div",{className:"text-gray-500 uppercase tracking-wider mb-2",children:"Links"}),l.jsx("div",{className:"space-y-1.5",children:r&&l.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-blue-400 hover:text-blue-300",children:[l.jsx(ol,{className:"w-3 h-3"}),l.jsx("span",{children:"Linear Issue"})]})})]}),(_==null?void 0:_.corrupted)&&l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700",children:[l.jsxs("div",{className:"flex items-center gap-2 text-yellow-500 mb-2",children:[l.jsx(Mn,{className:"w-4 h-4"}),l.jsx("span",{className:"text-xs font-medium",children:"Workspace Corrupted"})]}),l.jsx("p",{className:"text-xs text-gray-400 mb-2",children:_.message||"The workspace exists but is not a valid git worktree."}),l.jsx("button",{onClick:T,disabled:O.isPending,className:"flex items-center gap-1 px-2 py-1 bg-yellow-600 hover:bg-yellow-500 disabled:bg-yellow-800 text-white text-xs rounded transition-colors w-full justify-center",children:O.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"w-3 h-3 animate-spin"}),"Cleaning..."]}):l.jsxs(l.Fragment,{children:[l.jsx(bn,{className:"w-3 h-3"}),"Clean & Recreate"]})}),O.isError&&l.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1 rounded mt-2",children:O.error instanceof Error?O.error.message:"Failed to clean workspace"}),O.isSuccess&&l.jsx("div",{className:"text-xs text-green-400 bg-green-900/20 px-2 py-1 rounded mt-2",children:"Workspace cleaned! Recreating..."})]}),(_==null?void 0:_.hasDocker)&&((_==null?void 0:_.frontendUrl)||(_==null?void 0:_.apiUrl))&&l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700 text-xs",children:[l.jsx("div",{className:"text-gray-500 uppercase tracking-wider mb-2",children:"Services"}),l.jsxs("div",{className:"space-y-1.5",children:[_.frontendUrl&&l.jsxs("a",{href:_.frontendUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-blue-400 hover:text-blue-300",children:[l.jsx(cf,{className:"w-3 h-3"}),l.jsx("span",{children:"Frontend"})]}),_.apiUrl&&l.jsxs("a",{href:_.apiUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-blue-400 hover:text-blue-300",children:[l.jsx(cf,{className:"w-3 h-3"}),l.jsx("span",{children:"API"})]})]})]}),(_==null?void 0:_.hasDocker)&&_.containers&&Object.values(_.containers).some(ee=>!ee.running)&&l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-yellow-500",children:"Some containers stopped"}),l.jsx("button",{onClick:B,disabled:x.isPending,className:"flex items-center gap-1 px-2 py-1 bg-green-600 hover:bg-green-500 disabled:bg-green-800 text-white text-xs rounded transition-colors",children:x.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"w-3 h-3 animate-spin"}),"Starting..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Tt,{className:"w-3 h-3"}),"Start Containers"]})})]}),x.isError&&l.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1 rounded mt-2",children:x.error instanceof Error?x.error.message:"Failed to start containers"})]}),(_==null?void 0:_.exists)&&!_.hasDocker&&l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700",children:[l.jsx("div",{className:"text-gray-500 uppercase tracking-wider text-xs mb-2",children:"Containers"}),_.canContainerize?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-500",children:"Git-only workspace"}),l.jsx("button",{onClick:U,disabled:F.isPending,className:"flex items-center gap-1 px-2 py-1 bg-purple-600 hover:bg-purple-500 disabled:bg-purple-800 text-white text-xs rounded transition-colors",children:F.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"w-3 h-3 animate-spin"}),"Setting up..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Gc,{className:"w-3 h-3"}),"Containerize"]})})]}),F.isError&&l.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1 rounded",children:F.error instanceof Error?F.error.message:"Failed to containerize workspace"})]}):l.jsxs("div",{className:"text-xs text-gray-400 bg-gray-800 px-2 py-2 rounded",children:[l.jsx("span",{className:"text-gray-500",children:"No Docker support."})," This workspace doesn't have container infrastructure set up yet."]})]}),(_==null?void 0:_.containers)&&Object.keys(_.containers).length>0&&l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700 text-xs",children:[l.jsxs("div",{className:"text-gray-500 uppercase tracking-wider mb-2",children:["Containers",l.jsx("span",{className:"text-gray-600 font-normal ml-2",children:"(right-click for options)"})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(_.containers).map(([ee,xe])=>{const Ft=x.isPending&&!xe.running,$r=E.isPending&&(k==null?void 0:k.containerName)===ee;return l.jsxs("span",{onContextMenu:$u=>L($u,ee,xe.running),className:`flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] cursor-context-menu select-none ${xe.running?"bg-green-900/30 text-green-400 hover:bg-green-900/50":Ft||$r?"bg-yellow-900/30 text-yellow-400 animate-pulse":"bg-gray-700 text-gray-500 hover:bg-gray-600"}`,title:"Right-click for start/stop/restart options",children:[Ft||$r?l.jsx(Se,{className:"w-2.5 h-2.5 animate-spin"}):ee==="postgres"||ee==="redis"?l.jsx(kw,{className:"w-2.5 h-2.5"}):l.jsx(Gc,{className:"w-2.5 h-2.5"}),ee,xe.running&&xe.uptime&&l.jsx("span",{className:"text-gray-400 ml-1",children:xe.uptime}),(Ft||$r)&&l.jsx("span",{className:"text-yellow-500 ml-1",children:"..."})]},ee)})})]}),l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700 text-xs",children:[l.jsx("div",{className:"text-gray-500 uppercase tracking-wider mb-2",children:"Attach Command"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex-1 flex items-center gap-1.5 px-2 py-1.5 bg-gray-900 rounded font-mono text-[11px] text-gray-300 overflow-hidden",children:[l.jsx(wi,{className:"w-3 h-3 shrink-0 text-blue-400"}),l.jsx("span",{className:"truncate",children:y})]}),l.jsx("button",{onClick:C,className:`p-1.5 rounded transition-colors ${a?"bg-green-900/30 text-green-400":"bg-gray-700 hover:bg-gray-600 text-gray-400 hover:text-white"}`,title:"Copy to clipboard",children:a?l.jsx($s,{className:"w-3.5 h-3.5"}):l.jsx(bw,{className:"w-3.5 h-3.5"})})]})]}),l.jsxs("div",{className:"px-3 py-2 border-b border-gray-700",children:[l.jsx("div",{className:"text-xs text-gray-500 uppercase tracking-wider mb-2",children:"Actions"}),((tr=_==null?void 0:_.pendingOperation)==null?void 0:tr.type)==="approve"&&_.pendingOperation.status==="running"&&l.jsxs("div",{className:"flex items-center gap-2 text-xs text-blue-400 bg-blue-900/20 px-2 py-1.5 rounded mb-2",children:[l.jsx(Se,{className:"w-3 h-3 animate-spin"}),l.jsx("span",{children:"Merging in progress... (survives tab switches)"})]}),((ye=_==null?void 0:_.pendingOperation)==null?void 0:ye.status)==="failed"&&l.jsxs("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1.5 rounded mb-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"font-medium",children:"Operation failed"}),l.jsx("button",{onClick:()=>M.mutate(),className:"text-gray-400 hover:text-white",title:"Dismiss",children:l.jsx(Vt,{className:"w-3 h-3"})})]}),l.jsx("div",{className:"mt-1 text-gray-400 whitespace-pre-wrap",children:_.pendingOperation.error})]}),v&&(v.reviewStatus!=="pending"||v.testStatus!=="pending")&&l.jsxs("div",{className:"mb-2 p-2 bg-gray-900/50 rounded text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"text-gray-400",children:"Review:"}),l.jsx("span",{className:v.reviewStatus==="passed"?"text-green-400":v.reviewStatus==="blocked"||v.reviewStatus==="failed"?"text-red-400":v.reviewStatus==="reviewing"?"text-yellow-400":"text-gray-500",children:v.reviewStatus==="passed"?"✓ Passed":v.reviewStatus==="blocked"?"✗ Blocked":v.reviewStatus==="failed"?"✗ Failed":v.reviewStatus==="reviewing"?"⟳ Reviewing...":"Pending"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-gray-400",children:"Tests:"}),l.jsx("span",{className:v.testStatus==="passed"?"text-green-400":v.testStatus==="failed"?"text-red-400":v.testStatus==="testing"?"text-yellow-400":"text-gray-500",children:v.testStatus==="passed"?"✓ Passed":v.testStatus==="failed"?"✗ Failed":v.testStatus==="testing"?"⟳ Testing...":v.testStatus==="skipped"?"⊘ Skipped":"Pending"})]}),v.reviewNotes&&l.jsx("div",{className:"mt-1 text-gray-400 text-xs",children:v.reviewNotes}),v.testNotes&&l.jsx("div",{className:"mt-1 text-gray-400 text-xs",children:v.testNotes})]}),l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(v==null?void 0:v.readyForMerge)&&(v==null?void 0:v.mergeStatus)!=="merged"&&l.jsxs("button",{onClick:W,disabled:A.isPending||(v==null?void 0:v.mergeStatus)==="merging",className:"flex items-center gap-1 px-2 py-1 text-xs bg-green-600 text-white rounded hover:bg-green-500 disabled:opacity-50 font-medium",children:[A.isPending||(v==null?void 0:v.mergeStatus)==="merging"?l.jsx(Se,{className:"w-3 h-3 animate-spin"}):l.jsx(Fa,{className:"w-3 h-3"}),(v==null?void 0:v.mergeStatus)==="merging"?"MERGING...":"MERGE"]}),(v==null?void 0:v.mergeStatus)==="merged"&&l.jsxs("span",{className:"flex items-center gap-1 px-2 py-1 text-xs bg-green-900/30 text-green-400 rounded font-medium",children:[l.jsx(Fa,{className:"w-3 h-3"}),"MERGED"]}),l.jsxs("button",{onClick:R,disabled:D.isPending||(v==null?void 0:v.reviewStatus)==="reviewing"||(v==null?void 0:v.testStatus)==="testing",className:`flex items-center gap-1 px-2 py-1 text-xs rounded disabled:opacity-50 ${v!=null&&v.readyForMerge?"bg-gray-700/50 text-gray-300 hover:bg-gray-700":"bg-blue-900/30 text-blue-400 hover:bg-blue-900/50"}`,children:[D.isPending||(v==null?void 0:v.reviewStatus)==="reviewing"||(v==null?void 0:v.testStatus)==="testing"?l.jsx(Se,{className:"w-3 h-3 animate-spin"}):l.jsx(bn,{className:"w-3 h-3"}),v!=null&&v.readyForMerge?"Re-Review":"Review & Test"]}),l.jsxs("button",{onClick:Z,disabled:I.isPending,className:"flex items-center gap-1 px-2 py-1 text-xs bg-red-900/30 text-red-400 rounded hover:bg-red-900/50",children:[l.jsx($a,{className:"w-3 h-3"}),"Stop Agent"]}),l.jsxs("button",{onClick:N,disabled:j.isPending,className:"flex items-center gap-1 px-2 py-1 text-xs bg-orange-900/30 text-orange-400 rounded hover:bg-orange-900/50 disabled:opacity-50",children:[j.isPending?l.jsx(Se,{className:"w-3 h-3 animate-spin"}):l.jsx(Cu,{className:"w-3 h-3"}),"Close (No Merge)"]})]}),D.isError&&l.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1 rounded mt-2",children:D.error instanceof Error?D.error.message:"Failed to start review"}),A.isError&&l.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1 rounded mt-2",children:A.error instanceof Error?A.error.message:"Failed to merge"}),j.isError&&l.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1 rounded mt-2",children:j.error instanceof Error?j.error.message:"Failed to close"})]}),l.jsx("div",{className:"flex-1"})]}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-gray-700",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:()=>h("logs"),className:`px-2 py-1 text-xs rounded transition-colors ${c==="logs"?"bg-gray-700 text-white":"text-gray-400 hover:text-white"}`,children:"Logs"}),l.jsx("button",{onClick:()=>h("status"),className:`px-2 py-1 text-xs rounded transition-colors ${c==="status"?"bg-gray-700 text-white":"text-gray-400 hover:text-white"}`,children:"Status"})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:()=>g(),className:"p-1 text-gray-400 hover:text-white",title:"Refresh",children:l.jsx(bn,{className:"w-3.5 h-3.5"})}),l.jsx("button",{onClick:n,className:"p-1 text-gray-400 hover:text-white",children:l.jsx(Vt,{className:"w-3.5 h-3.5"})})]})]}),c==="logs"?l.jsxs(l.Fragment,{children:[l.jsxs("pre",{ref:d,onScroll:q,className:"flex-1 min-h-0 overflow-auto p-3 bg-gray-900 text-gray-200 font-mono text-xs leading-relaxed m-0 whitespace-pre",children:[w||"Connecting to agent...",l.jsx("div",{ref:f})]}),l.jsx("div",{className:"p-2 border-t border-gray-700 bg-gray-800",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",value:s,onChange:ee=>o(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&Y(),placeholder:"Send message to agent...",className:"flex-1 px-3 py-2 bg-gray-700 border border-gray-600 rounded text-sm text-white placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500"}),l.jsxs("button",{onClick:Y,disabled:!s.trim()||$.isPending,className:"px-3 py-2 bg-blue-600 text-white rounded text-sm font-medium hover:bg-blue-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[l.jsx(jw,{className:"w-4 h-4"}),"Send"]})]})})]}):l.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 bg-gray-900",children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-white mb-2",children:"Agent Summary"}),l.jsxs("div",{className:"text-xs text-gray-300 space-y-1",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Issue:"})," ",e.issueId]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Session:"})," ",l.jsx("span",{className:"font-mono text-[10px]",children:e.id})]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Model:"})," ",e.model]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Runtime:"})," ",e.runtime]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Started:"})," ",oe.toLocaleString()]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Uptime:"})," ",er]})]})]}),e.workspace&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-white mb-2",children:"Workspace"}),l.jsx("div",{className:"text-xs text-gray-300 space-y-1",children:l.jsx("p",{className:"font-mono text-[10px] break-all",children:e.workspace})})]}),e.git&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-white mb-2",children:"Git Status"}),l.jsxs("div",{className:"text-xs text-gray-300 space-y-1",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Branch:"})," ",l.jsx("span",{className:"font-mono",children:e.git.branch})]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Uncommitted:"})," ",e.git.uncommittedFiles," files"]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Latest:"})," ",e.git.latestCommit]})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-white mb-2",children:"Health"}),l.jsxs("div",{className:"text-xs text-gray-300 space-y-1",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Status:"})," ",l.jsx("span",{className:"text-green-400",children:e.status})]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Consecutive Failures:"})," ",e.consecutiveFailures]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Total Restarts:"})," ",e.killCount]})]})]})]})})]})]}),k&&l.jsxs("div",{className:"fixed z-50 bg-gray-800 border border-gray-600 rounded shadow-lg py-1 min-w-[140px]",style:{left:k.x,top:k.y},onClick:ee=>ee.stopPropagation(),children:[l.jsx("div",{className:"px-3 py-1 text-xs text-gray-400 border-b border-gray-700 mb-1",children:k.containerName}),k.isRunning?l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>E.mutate({containerName:k.containerName,action:"restart"}),disabled:E.isPending,className:"w-full text-left px-3 py-1.5 text-xs text-gray-200 hover:bg-gray-700 flex items-center gap-2 disabled:opacity-50",children:[l.jsx(bn,{className:"w-3 h-3"}),"Restart"]}),l.jsxs("button",{onClick:()=>E.mutate({containerName:k.containerName,action:"stop"}),disabled:E.isPending,className:"w-full text-left px-3 py-1.5 text-xs text-red-400 hover:bg-gray-700 flex items-center gap-2 disabled:opacity-50",children:[l.jsx($a,{className:"w-3 h-3"}),"Stop"]})]}):l.jsxs("button",{onClick:()=>E.mutate({containerName:k.containerName,action:"start"}),disabled:E.isPending,className:"w-full text-left px-3 py-1.5 text-xs text-green-400 hover:bg-gray-700 flex items-center gap-2 disabled:opacity-50",children:[l.jsx(Tt,{className:"w-3 h-3"}),"Start"]}),E.isError&&l.jsx("div",{className:"px-3 py-1 text-xs text-red-400 border-t border-gray-700 mt-1",children:E.error instanceof Error?E.error.message:"Action failed"})]})]})}function NP(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const EP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PP={};function bv(e,t){return(PP.jsx?jP:EP).test(e)}const RP=/[ \t\n\f\r]/g;function DP(e){return typeof e=="object"?e.type==="text"?Cv(e.value):!1:Cv(e)}function Cv(e){return e.replace(RP,"")===""}class hl{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}hl.prototype.normal={};hl.prototype.property={};hl.prototype.space=void 0;function BS(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new hl(r,n,t)}function Yf(e){return e.toLowerCase()}class Zt{constructor(t,r){this.attribute=r,this.property=t}}Zt.prototype.attribute="";Zt.prototype.booleanish=!1;Zt.prototype.boolean=!1;Zt.prototype.commaOrSpaceSeparated=!1;Zt.prototype.commaSeparated=!1;Zt.prototype.defined=!1;Zt.prototype.mustUseProperty=!1;Zt.prototype.number=!1;Zt.prototype.overloadedBoolean=!1;Zt.prototype.property="";Zt.prototype.spaceSeparated=!1;Zt.prototype.space=void 0;let MP=0;const le=ms(),Ye=ms(),Xf=ms(),V=ms(),je=ms(),Xs=ms(),or=ms();function ms(){return 2**++MP}const Gf=Object.freeze(Object.defineProperty({__proto__:null,boolean:le,booleanish:Ye,commaOrSpaceSeparated:or,commaSeparated:Xs,number:V,overloadedBoolean:Xf,spaceSeparated:je},Symbol.toStringTag,{value:"Module"})),Mh=Object.keys(Gf);class jm extends Zt{constructor(t,r,n,i){let s=-1;if(super(t,r),kv(this,"space",i),typeof n=="number")for(;++s<Mh.length;){const o=Mh[s];kv(this,Mh[s],(n&Gf[o])===Gf[o])}}}jm.prototype.defined=!0;function kv(e,t,r){r&&(e[t]=r)}function jo(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const s=new jm(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),t[n]=s,r[Yf(n)]=n,r[Yf(s.attribute)]=n}return new hl(t,r,e.space)}const FS=jo({properties:{ariaActiveDescendant:null,ariaAtomic:Ye,ariaAutoComplete:null,ariaBusy:Ye,ariaChecked:Ye,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:je,ariaCurrent:null,ariaDescribedBy:je,ariaDetails:null,ariaDisabled:Ye,ariaDropEffect:je,ariaErrorMessage:null,ariaExpanded:Ye,ariaFlowTo:je,ariaGrabbed:Ye,ariaHasPopup:null,ariaHidden:Ye,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:je,ariaLevel:V,ariaLive:null,ariaModal:Ye,ariaMultiLine:Ye,ariaMultiSelectable:Ye,ariaOrientation:null,ariaOwns:je,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:Ye,ariaReadOnly:Ye,ariaRelevant:null,ariaRequired:Ye,ariaRoleDescription:je,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:Ye,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zS(e,t){return t in e?e[t]:t}function $S(e,t){return zS(e,t.toLowerCase())}const TP=jo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xs,acceptCharset:je,accessKey:je,action:null,allow:null,allowFullScreen:le,allowPaymentRequest:le,allowUserMedia:le,alt:null,as:null,async:le,autoCapitalize:null,autoComplete:je,autoFocus:le,autoPlay:le,blocking:je,capture:null,charSet:null,checked:le,cite:null,className:je,cols:V,colSpan:null,content:null,contentEditable:Ye,controls:le,controlsList:je,coords:V|Xs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:le,defer:le,dir:null,dirName:null,disabled:le,download:Xf,draggable:Ye,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:le,formTarget:null,headers:je,height:V,hidden:Xf,high:V,href:null,hrefLang:null,htmlFor:je,httpEquiv:je,id:null,imageSizes:null,imageSrcSet:null,inert:le,inputMode:null,integrity:null,is:null,isMap:le,itemId:null,itemProp:je,itemRef:je,itemScope:le,itemType:je,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:le,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,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:V,pattern:null,ping:je,placeholder:null,playsInline:le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:le,referrerPolicy:null,rel:je,required:le,reversed:le,rows:V,rowSpan:V,sandbox:je,scope:null,scoped:le,seamless:le,selected:le,shadowRootClonable:le,shadowRootDelegatesFocus:le,shadowRootMode:null,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:Ye,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:le,useMap:null,value:Ye,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:je,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,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:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:le,noHref:le,noShade:le,noWrap:le,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:Ye,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:le,disableRemotePlayback:le,prefix:null,property:null,results:V,security:null,unselectable:null},space:"html",transform:$S}),LP=jo({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:or,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:je,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:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:le,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,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:Xs,g2:Xs,glyphName:Xs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:or,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,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:V,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:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:je,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:or,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:or,rev:or,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:or,requiredFeatures:or,requiredFonts:or,requiredFormats:or,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:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:or,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:or,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:or,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zS}),HS=jo({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()}}),WS=jo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$S}),US=jo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),AP={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"},OP=/[A-Z]/g,Nv=/-[a-z]/g,IP=/^data[-\w.:]+$/i;function BP(e,t){const r=Yf(t);let n=t,i=Zt;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&IP.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Nv,zP);n="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Nv.test(s)){let o=s.replace(OP,FP);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=jm}return new i(n,t)}function FP(e){return"-"+e.toLowerCase()}function zP(e){return e.charAt(1).toUpperCase()}const $P=BS([FS,TP,HS,WS,US],"html"),Pm=BS([FS,LP,HS,WS,US],"svg");function HP(e){return e.join(" ").trim()}var Rm={},Ev=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,WP=/\n/g,UP=/^\s*/,qP=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,KP=/^:\s*/,VP=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,QP=/^[;\s]*/,YP=/^\s+|\s+$/g,XP=`
|
|
480
|
+
`,jv="/",Pv="*",Ai="",GP="comment",JP="declaration";function ZP(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function i(m){var y=m.match(WP);y&&(r+=y.length);var w=m.lastIndexOf(XP);n=~w?m.length-w:n+m.length}function s(){var m={line:r,column:n};return function(y){return y.position=new o(m),c(),y}}function o(m){this.start=m,this.end={line:r,column:n},this.source=t.source}o.prototype.content=e;function a(m){var y=new Error(t.source+":"+r+":"+n+": "+m);if(y.reason=m,y.filename=t.source,y.line=r,y.column=n,y.source=e,!t.silent)throw y}function u(m){var y=m.exec(e);if(y){var w=y[0];return i(w),e=e.slice(w.length),y}}function c(){u(UP)}function h(m){var y;for(m=m||[];y=d();)y!==!1&&m.push(y);return m}function d(){var m=s();if(!(jv!=e.charAt(0)||Pv!=e.charAt(1))){for(var y=2;Ai!=e.charAt(y)&&(Pv!=e.charAt(y)||jv!=e.charAt(y+1));)++y;if(y+=2,Ai===e.charAt(y-1))return a("End of comment missing");var w=e.slice(2,y-2);return n+=2,i(w),e=e.slice(y),n+=2,m({type:GP,comment:w})}}function f(){var m=s(),y=u(qP);if(y){if(d(),!u(KP))return a("property missing ':'");var w=u(VP),g=m({type:JP,property:Rv(y[0].replace(Ev,Ai)),value:w?Rv(w[0].replace(Ev,Ai)):Ai});return u(QP),g}}function p(){var m=[];h(m);for(var y;y=f();)y!==!1&&(m.push(y),h(m));return m}return c(),p()}function Rv(e){return e?e.replace(YP,Ai):Ai}var e5=ZP,t5=Cc&&Cc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rm,"__esModule",{value:!0});Rm.default=n5;const r5=t5(e5);function n5(e,t){let r=null;if(!e||typeof e!="string")return r;const n=(0,r5.default)(e),i=typeof t=="function";return n.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(r=r||{},r[o]=a)}),r}var Tu={};Object.defineProperty(Tu,"__esModule",{value:!0});Tu.camelCase=void 0;var i5=/^--[a-zA-Z0-9_-]+$/,s5=/-([a-z])/g,o5=/^[^-]+$/,a5=/^-(webkit|moz|ms|o|khtml)-/,l5=/^-(ms)-/,c5=function(e){return!e||o5.test(e)||i5.test(e)},u5=function(e,t){return t.toUpperCase()},Dv=function(e,t){return"".concat(t,"-")},h5=function(e,t){return t===void 0&&(t={}),c5(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(l5,Dv):e=e.replace(a5,Dv),e.replace(s5,u5))};Tu.camelCase=h5;var d5=Cc&&Cc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},f5=d5(Rm),p5=Tu;function Jf(e,t){var r={};return!e||typeof e!="string"||(0,f5.default)(e,function(n,i){n&&i&&(r[(0,p5.camelCase)(n,t)]=i)}),r}Jf.default=Jf;var m5=Jf;const g5=Za(m5),qS=KS("end"),Dm=KS("start");function KS(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function v5(e){const t=Dm(e),r=qS(e);if(t&&r)return{start:t,end:r}}function va(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Mv(e.position):"start"in e||"end"in e?Mv(e):"line"in e||"column"in e?Zf(e):""}function Zf(e){return Tv(e&&e.line)+":"+Tv(e&&e.column)}function Mv(e){return Zf(e&&e.start)+"-"+Zf(e&&e.end)}function Tv(e){return e&&typeof e=="number"?e:1}class Nt extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",s={},o=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof n=="string"){const u=n.indexOf(":");u===-1?s.ruleId=n:(s.source=n.slice(0,u),s.ruleId=n.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=va(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Nt.prototype.file="";Nt.prototype.name="";Nt.prototype.reason="";Nt.prototype.message="";Nt.prototype.stack="";Nt.prototype.column=void 0;Nt.prototype.line=void 0;Nt.prototype.ancestors=void 0;Nt.prototype.cause=void 0;Nt.prototype.fatal=void 0;Nt.prototype.place=void 0;Nt.prototype.ruleId=void 0;Nt.prototype.source=void 0;const Mm={}.hasOwnProperty,y5=new Map,_5=/[A-Z]/g,x5=new Set(["table","tbody","thead","tfoot","tr"]),w5=new Set(["td","th"]),VS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function S5(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=R5(r,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");n=P5(r,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Pm:$P,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=QS(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function QS(e,t,r){if(t.type==="element")return b5(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return C5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return N5(e,t,r);if(t.type==="mdxjsEsm")return k5(e,t);if(t.type==="root")return E5(e,t,r);if(t.type==="text")return j5(e,t)}function b5(e,t,r){const n=e.schema;let i=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Pm,e.schema=i),e.ancestors.push(t);const s=XS(e,t.tagName,!1),o=D5(e,t);let a=Lm(e,t);return x5.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!DP(u):!0})),YS(e,o,s,t),Tm(o,a),e.ancestors.pop(),e.schema=n,e.create(t,s,o,r)}function C5(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}qa(e,t.position)}function k5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);qa(e,t.position)}function N5(e,t,r){const n=e.schema;let i=n;t.name==="svg"&&n.space==="html"&&(i=Pm,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:XS(e,t.name,!0),o=M5(e,t),a=Lm(e,t);return YS(e,o,s,t),Tm(o,a),e.ancestors.pop(),e.schema=n,e.create(t,s,o,r)}function E5(e,t,r){const n={};return Tm(n,Lm(e,t)),e.create(t,e.Fragment,n,r)}function j5(e,t){return t.value}function YS(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function Tm(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function P5(e,t,r){return n;function n(i,s,o,a){const c=Array.isArray(o.children)?r:t;return a?c(s,o,a):c(s,o)}}function R5(e,t){return r;function r(n,i,s,o){const a=Array.isArray(s.children),u=Dm(n);return t(i,s,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function D5(e,t){const r={};let n,i;for(i in t.properties)if(i!=="children"&&Mm.call(t.properties,i)){const s=T5(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&w5.has(t.tagName)?n=a:r[o]=a}}if(n){const s=r.style||(r.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function M5(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const s=n.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else qa(e,t.position);else{const i=n.name;let s;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const a=n.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else qa(e,t.position);else s=n.value===null?!0:n.value;r[i]=s}return r}function Lm(e,t){const r=[];let n=-1;const i=e.passKeys?new Map:y5;for(;++n<t.children.length;){const s=t.children[n];let o;if(e.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const c=i.get(u)||0;o=u+"-"+c,i.set(u,c+1)}}const a=QS(e,s,o);a!==void 0&&r.push(a)}return r}function T5(e,t,r){const n=BP(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?NP(r):HP(r)),n.property==="style"){let i=typeof r=="object"?r:L5(e,String(r));return e.stylePropertyNameCase==="css"&&(i=A5(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&n.space?AP[n.property]||n.property:n.attribute,r]}}function L5(e,t){try{return g5(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,i=new Nt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=VS+"#cannot-parse-style-attribute",i}}function XS(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=bv(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}n=o}else n=bv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const i=n.value;return Mm.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);qa(e)}function qa(e,t){const r=new Nt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=VS+"#cannot-handle-mdx-estrees-without-createevaluater",r}function A5(e){const t={};let r;for(r in e)Mm.call(e,r)&&(t[O5(r)]=e[r]);return t}function O5(e){let t=e.replace(_5,I5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function I5(e){return"-"+e.toLowerCase()}const Th={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"]},B5={};function F5(e,t){const r=B5,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return GS(e,n,i)}function GS(e,t,r){if(z5(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Lv(e.children,t,r)}return Array.isArray(e)?Lv(e,t,r):""}function Lv(e,t,r){const n=[];let i=-1;for(;++i<e.length;)n[i]=GS(e[i],t,r);return n.join("")}function z5(e){return!!(e&&typeof e=="object")}const Av=document.createElement("i");function Am(e){const t="&"+e+";";Av.innerHTML=t;const r=Av.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function an(e,t,r,n){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(t,r),e.splice(...o);else for(r&&e.splice(t,r);s<n.length;)o=n.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Sr(e,t){return e.length>0?(an(e,e.length,0,t),e):t}const Ov={}.hasOwnProperty;function $5(e){const t={};let r=-1;for(;++r<e.length;)H5(t,e[r]);return t}function H5(e,t){let r;for(r in t){const i=(Ov.call(e,r)?e[r]:void 0)||(e[r]={}),s=t[r];let o;if(s)for(o in s){Ov.call(i,o)||(i[o]=[]);const a=s[o];W5(i[o],Array.isArray(a)?a:a?[a]:[])}}}function W5(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);an(e,0,0,n)}function JS(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Gs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zr=Ei(/[A-Za-z]/),cr=Ei(/[\dA-Za-z]/),U5=Ei(/[#-'*+\--9=?A-Z^-~]/);function ep(e){return e!==null&&(e<32||e===127)}const tp=Ei(/\d/),q5=Ei(/[\dA-Fa-f]/),K5=Ei(/[!-/:-@[-`{-~]/);function se(e){return e!==null&&e<-2}function Gt(e){return e!==null&&(e<0||e===32)}function we(e){return e===-2||e===-1||e===32}const V5=Ei(new RegExp("\\p{P}|\\p{S}","u")),Q5=Ei(/\s/);function Ei(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Po(e){const t=[];let r=-1,n=0,i=0;for(;++r<e.length;){const s=e.charCodeAt(r);let o="";if(s===37&&cr(e.charCodeAt(r+1))&&cr(e.charCodeAt(r+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(r+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(n,r),encodeURIComponent(o)),n=r+i+1,o=""),i&&(r+=i,i=0)}return t.join("")+e.slice(n)}function Re(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return we(u)?(e.enter(r),a(u)):t(u)}function a(u){return we(u)&&s++<i?(e.consume(u),a):(e.exit(r),t(u))}}const Y5={tokenize:X5};function X5(e){const t=e.attempt(this.parser.constructs.contentInitial,n,i);let r;return t;function n(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Re(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const u=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return se(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const G5={tokenize:J5},Iv={tokenize:Z5};function J5(e){const t=this,r=[];let n=0,i,s,o;return a;function a(v){if(n<r.length){const x=r[n];return t.containerState=x[1],e.attempt(x[0].continuation,u,c)(v)}return c(v)}function u(v){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&_();const x=t.events.length;let k=x,b;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){b=t.events[k][1].end;break}g(n);let E=x;for(;E<t.events.length;)t.events[E][1].end={...b},E++;return an(t.events,k+1,0,t.events.slice(x)),t.events.length=E,c(v)}return a(v)}function c(v){if(n===r.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return m(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Iv,h,d)(v)}function h(v){return i&&_(),g(n),f(v)}function d(v){return t.parser.lazy[t.now().line]=n!==r.length,o=t.now().offset,m(v)}function f(v){return t.containerState={},e.attempt(Iv,p,m)(v)}function p(v){return n++,r.push([t.currentConstruct,t.containerState]),f(v)}function m(v){if(v===null){i&&_(),g(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),y(v)}function y(v){if(v===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(v);return}return se(v)?(e.consume(v),w(e.exit("chunkFlow")),n=0,t.interrupt=void 0,a):(e.consume(v),y)}function w(v,x){const k=t.sliceStream(v);if(x&&k.push(null),v.previous=s,s&&(s.next=v),s=v,i.defineSkip(v.start),i.write(k),t.parser.lazy[v.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<o&&(!i.events[b][1].end||i.events[b][1].end.offset>o))return;const E=t.events.length;let L=E,F,D;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(F){D=t.events[L][1].end;break}F=!0}for(g(n),b=E;b<t.events.length;)t.events[b][1].end={...D},b++;an(t.events,L+1,0,t.events.slice(E)),t.events.length=b}}function g(v){let x=r.length;for(;x-- >v;){const k=r[x];t.containerState=k[1],k[0].exit.call(t,e)}r.length=v}function _(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Z5(e,t,r){return Re(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Bv(e){if(e===null||Gt(e)||Q5(e))return 1;if(V5(e))return 2}function Om(e,t,r){const n=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!n.includes(s)&&(t=s(t,r),n.push(s))}return t}const rp={name:"attention",resolveAll:eR,tokenize:tR};function eR(e,t){let r=-1,n,i,s,o,a,u,c,h;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;u=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const d={...e[n][1].end},f={...e[r][1].start};Fv(d,-u),Fv(f,u),o={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:f},s={type:u>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[n][1].end={...o.start},e[r][1].start={...a.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=Sr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=Sr(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=Sr(c,Om(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=Sr(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[r][1].end.offset-e[r][1].start.offset?(h=2,c=Sr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):h=0,an(e,n-1,r-n+3,c),r=n+c.length-h-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function tR(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=Bv(n);let s;return o;function o(u){return s=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===s)return e.consume(u),a;const c=e.exit("attentionSequence"),h=Bv(u),d=!h||h===2&&i||r.includes(u),f=!i||i===2&&h||r.includes(n);return c._open=!!(s===42?d:d&&(i||!f)),c._close=!!(s===42?f:f&&(h||!d)),t(u)}}function Fv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const rR={name:"autolink",tokenize:nR};function nR(e,t,r){let n=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return Zr(p)?(e.consume(p),o):p===64?r(p):c(p)}function o(p){return p===43||p===45||p===46||cr(p)?(n=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),n=0,u):(p===43||p===45||p===46||cr(p))&&n++<32?(e.consume(p),a):(n=0,c(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||ep(p)?r(p):(e.consume(p),u)}function c(p){return p===64?(e.consume(p),h):U5(p)?(e.consume(p),c):r(p)}function h(p){return cr(p)?d(p):r(p)}function d(p){return p===46?(e.consume(p),n=0,h):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||cr(p))&&n++<63){const m=p===45?f:d;return e.consume(p),m}return r(p)}}const Lu={partial:!0,tokenize:iR};function iR(e,t,r){return n;function n(s){return we(s)?Re(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||se(s)?t(s):r(s)}}const ZS={continuation:{tokenize:oR},exit:aR,name:"blockQuote",tokenize:sR};function sR(e,t,r){const n=this;return i;function i(o){if(o===62){const a=n.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return r(o)}function s(o){return we(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function oR(e,t,r){const n=this;return i;function i(o){return we(o)?Re(e,s,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(ZS,t,r)(o)}}function aR(e){e.exit("blockQuote")}const e1={name:"characterEscape",tokenize:lR};function lR(e,t,r){return n;function n(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return K5(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(s)}}const t1={name:"characterReference",tokenize:cR};function cR(e,t,r){const n=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=cr,h(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=q5,h):(e.enter("characterReferenceValue"),s=7,o=tp,h(d))}function h(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return o===cr&&!Am(n.sliceSerialize(f))?r(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),h):r(d)}}const zv={partial:!0,tokenize:hR},$v={concrete:!0,name:"codeFenced",tokenize:uR};function uR(e,t,r){const n=this,i={partial:!0,tokenize:k};let s=0,o=0,a;return u;function u(b){return c(b)}function c(b){const E=n.events[n.events.length-1];return s=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(b)}function h(b){return b===a?(o++,e.consume(b),h):o<3?r(b):(e.exit("codeFencedFenceSequence"),we(b)?Re(e,d,"whitespace")(b):d(b))}function d(b){return b===null||se(b)?(e.exit("codeFencedFence"),n.interrupt?t(b):e.check(zv,y,x)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||se(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(b)):we(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Re(e,p,"whitespace")(b)):b===96&&b===a?r(b):(e.consume(b),f)}function p(b){return b===null||se(b)?d(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||se(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(b)):b===96&&b===a?r(b):(e.consume(b),m)}function y(b){return e.attempt(i,x,w)(b)}function w(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g}function g(b){return s>0&&we(b)?Re(e,_,"linePrefix",s+1)(b):_(b)}function _(b){return b===null||se(b)?e.check(zv,y,x)(b):(e.enter("codeFlowValue"),v(b))}function v(b){return b===null||se(b)?(e.exit("codeFlowValue"),_(b)):(e.consume(b),v)}function x(b){return e.exit("codeFenced"),t(b)}function k(b,E,L){let F=0;return D;function D(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),A}function A(T){return b.enter("codeFencedFence"),we(T)?Re(b,j,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):j(T)}function j(T){return T===a?(b.enter("codeFencedFenceSequence"),M(T)):L(T)}function M(T){return T===a?(F++,b.consume(T),M):F>=o?(b.exit("codeFencedFenceSequence"),we(T)?Re(b,O,"whitespace")(T):O(T)):L(T)}function O(T){return T===null||se(T)?(b.exit("codeFencedFence"),E(T)):L(T)}}}function hR(e,t,r){const n=this;return i;function i(o){return o===null?r(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return n.parser.lazy[n.now().line]?r(o):t(o)}}const Lh={name:"codeIndented",tokenize:fR},dR={partial:!0,tokenize:pR};function fR(e,t,r){const n=this;return i;function i(c){return e.enter("codeIndented"),Re(e,s,"linePrefix",5)(c)}function s(c){const h=n.events[n.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(c):r(c)}function o(c){return c===null?u(c):se(c)?e.attempt(dR,o,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||se(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),t(c)}}function pR(e,t,r){const n=this;return i;function i(o){return n.parser.lazy[n.now().line]?r(o):se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Re(e,s,"linePrefix",5)(o)}function s(o){const a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):se(o)?i(o):r(o)}}const mR={name:"codeText",previous:vR,resolve:gR,tokenize:yR};function gR(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)i===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(i=n):(n===t||e[n][1].type==="lineEnding")&&(e[i][1].type="codeTextData",n!==i+2&&(e[i][1].end=e[n-1][1].end,e.splice(i+2,n-i-2),t-=n-i-2,n=i+2),i=void 0);return e}function vR(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yR(e,t,r){let n=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),n++,a):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?r(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(s=e.enter("codeTextSequence"),i=0,h(d)):se(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||se(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function h(d){return d===96?(e.consume(d),i++,h):i===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}class _R{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,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const i=r||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&Vo(this.left,n),s.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),Vo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vo(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 r=this.left.splice(t,Number.POSITIVE_INFINITY);Vo(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Vo(this.left,r.reverse())}}}function Vo(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function r1(e){const t={};let r=-1,n,i,s,o,a,u,c;const h=new _R(e);for(;++r<h.length;){for(;r in t;)r=t[r];if(n=h.get(r),r&&n[1].type==="chunkFlow"&&h.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,xR(h,r)),r=t[r],c=!0);else if(n[1]._container){for(s=r,i=void 0;s--;)if(o=h.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(n[1].end={...h.get(i)[1].start},a=h.slice(i,r),a.unshift(n),h.splice(i,r-i+1,a))}}return an(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function xR(e,t){const r=e.get(t)[1],n=e.get(t)[2];let i=t-1;const s=[];let o=r._tokenizer;o||(o=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,u=[],c={};let h,d,f=-1,p=r,m=0,y=0;const w=[y];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(h=n.sliceStream(p),p.next||h.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(h),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=r;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(y=f+1,w.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):w.pop(),f=w.length;f--;){const g=a.slice(w[f],w[f+1]),_=s.pop();u.push([_,_+g.length-1]),e.splice(_,2,g)}for(u.reverse(),f=-1;++f<u.length;)c[m+u[f][0]]=m+u[f][1],m+=u[f][1]-u[f][0]-1;return c}const wR={resolve:bR,tokenize:CR},SR={partial:!0,tokenize:kR};function bR(e){return r1(e),e}function CR(e,t){let r;return n;function n(a){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):se(a)?e.check(SR,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function kR(e,t,r){const n=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Re(e,s,"linePrefix")}function s(o){if(o===null||se(o))return r(o);const a=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(n.parser.constructs.flow,r,t)(o)}}function n1(e,t,r,n,i,s,o,a,u){const c=u||Number.POSITIVE_INFINITY;let h=0;return d;function d(g){return g===60?(e.enter(n),e.enter(i),e.enter(s),e.consume(g),e.exit(s),f):g===null||g===32||g===41||ep(g)?r(g):(e.enter(n),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(g))}function f(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),e.exit(n),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(a),f(g)):g===null||g===60||se(g)?r(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!h&&(g===null||g===41||Gt(g))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(n),t(g)):h<c&&g===40?(e.consume(g),h++,y):g===41?(e.consume(g),h--,y):g===null||g===32||g===40||ep(g)?r(g):(e.consume(g),g===92?w:y)}function w(g){return g===40||g===41||g===92?(e.consume(g),y):y(g)}}function i1(e,t,r,n,i,s){const o=this;let a=0,u;return c;function c(p){return e.enter(n),e.enter(i),e.consume(p),e.exit(i),e.enter(s),h}function h(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?r(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(n),t):se(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||se(p)||a++>999?(e.exit("chunkString"),h(p)):(e.consume(p),u||(u=!we(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function s1(e,t,r,n,i,s){let o;return a;function a(f){return f===34||f===39||f===40?(e.enter(n),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,u):r(f)}function u(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(n),t):(e.enter(s),c(f))}function c(f){return f===o?(e.exit(s),u(o)):f===null?r(f):se(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Re(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===o||f===null||se(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:h)}function d(f){return f===o||f===92?(e.consume(f),h):h(f)}}function ya(e,t){let r;return n;function n(i){return se(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r=!0,n):we(i)?Re(e,n,r?"linePrefix":"lineSuffix")(i):t(i)}}const NR={name:"definition",tokenize:jR},ER={partial:!0,tokenize:PR};function jR(e,t,r){const n=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return i1.call(n,e,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Gs(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):r(p)}function u(p){return Gt(p)?ya(e,c)(p):c(p)}function c(p){return n1(e,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return e.attempt(ER,d,d)(p)}function d(p){return we(p)?Re(e,f,"whitespace")(p):f(p)}function f(p){return p===null||se(p)?(e.exit("definition"),n.parser.defined.push(i),t(p)):r(p)}}function PR(e,t,r){return n;function n(a){return Gt(a)?ya(e,i)(a):r(a)}function i(a){return s1(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return we(a)?Re(e,o,"whitespace")(a):o(a)}function o(a){return a===null||se(a)?t(a):r(a)}}const RR={name:"hardBreakEscape",tokenize:DR};function DR(e,t,r){return n;function n(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return se(s)?(e.exit("hardBreakEscape"),t(s)):r(s)}}const MR={name:"headingAtx",resolve:TR,tokenize:LR};function TR(e,t){let r=e.length-2,n=3,i,s;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},s={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},an(e,n,r-n+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function LR(e,t,r){let n=0;return i;function i(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&n++<6?(e.consume(h),o):h===null||Gt(h)?(e.exit("atxHeadingSequence"),a(h)):r(h)}function a(h){return h===35?(e.enter("atxHeadingSequence"),u(h)):h===null||se(h)?(e.exit("atxHeading"),t(h)):we(h)?Re(e,a,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function u(h){return h===35?(e.consume(h),u):(e.exit("atxHeadingSequence"),a(h))}function c(h){return h===null||h===35||Gt(h)?(e.exit("atxHeadingText"),a(h)):(e.consume(h),c)}}const AR=["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"],Hv=["pre","script","style","textarea"],OR={concrete:!0,name:"htmlFlow",resolveTo:FR,tokenize:zR},IR={partial:!0,tokenize:HR},BR={partial:!0,tokenize:$R};function FR(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 zR(e,t,r){const n=this;let i,s,o,a,u;return c;function c(C){return h(C)}function h(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),f):C===47?(e.consume(C),s=!0,y):C===63?(e.consume(C),i=3,n.interrupt?t:N):Zr(C)?(e.consume(C),o=String.fromCharCode(C),w):r(C)}function f(C){return C===45?(e.consume(C),i=2,p):C===91?(e.consume(C),i=5,a=0,m):Zr(C)?(e.consume(C),i=4,n.interrupt?t:N):r(C)}function p(C){return C===45?(e.consume(C),n.interrupt?t:N):r(C)}function m(C){const q="CDATA[";return C===q.charCodeAt(a++)?(e.consume(C),a===q.length?n.interrupt?t:j:m):r(C)}function y(C){return Zr(C)?(e.consume(C),o=String.fromCharCode(C),w):r(C)}function w(C){if(C===null||C===47||C===62||Gt(C)){const q=C===47,Y=o.toLowerCase();return!q&&!s&&Hv.includes(Y)?(i=1,n.interrupt?t(C):j(C)):AR.includes(o.toLowerCase())?(i=6,q?(e.consume(C),g):n.interrupt?t(C):j(C)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(C):s?_(C):v(C))}return C===45||cr(C)?(e.consume(C),o+=String.fromCharCode(C),w):r(C)}function g(C){return C===62?(e.consume(C),n.interrupt?t:j):r(C)}function _(C){return we(C)?(e.consume(C),_):D(C)}function v(C){return C===47?(e.consume(C),D):C===58||C===95||Zr(C)?(e.consume(C),x):we(C)?(e.consume(C),v):D(C)}function x(C){return C===45||C===46||C===58||C===95||cr(C)?(e.consume(C),x):k(C)}function k(C){return C===61?(e.consume(C),b):we(C)?(e.consume(C),k):v(C)}function b(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(e.consume(C),u=C,E):we(C)?(e.consume(C),b):L(C)}function E(C){return C===u?(e.consume(C),u=null,F):C===null||se(C)?r(C):(e.consume(C),E)}function L(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Gt(C)?k(C):(e.consume(C),L)}function F(C){return C===47||C===62||we(C)?v(C):r(C)}function D(C){return C===62?(e.consume(C),A):r(C)}function A(C){return C===null||se(C)?j(C):we(C)?(e.consume(C),A):r(C)}function j(C){return C===45&&i===2?(e.consume(C),B):C===60&&i===1?(e.consume(C),U):C===62&&i===4?(e.consume(C),$):C===63&&i===3?(e.consume(C),N):C===93&&i===5?(e.consume(C),W):se(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(IR,I,M)(C)):C===null||se(C)?(e.exit("htmlFlowData"),M(C)):(e.consume(C),j)}function M(C){return e.check(BR,O,I)(C)}function O(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),T}function T(C){return C===null||se(C)?M(C):(e.enter("htmlFlowData"),j(C))}function B(C){return C===45?(e.consume(C),N):j(C)}function U(C){return C===47?(e.consume(C),o="",R):j(C)}function R(C){if(C===62){const q=o.toLowerCase();return Hv.includes(q)?(e.consume(C),$):j(C)}return Zr(C)&&o.length<8?(e.consume(C),o+=String.fromCharCode(C),R):j(C)}function W(C){return C===93?(e.consume(C),N):j(C)}function N(C){return C===62?(e.consume(C),$):C===45&&i===2?(e.consume(C),N):j(C)}function $(C){return C===null||se(C)?(e.exit("htmlFlowData"),I(C)):(e.consume(C),$)}function I(C){return e.exit("htmlFlow"),t(C)}}function $R(e,t,r){const n=this;return i;function i(o){return se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):r(o)}function s(o){return n.parser.lazy[n.now().line]?r(o):t(o)}}function HR(e,t,r){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Lu,t,r)}}const WR={name:"htmlText",tokenize:UR};function UR(e,t,r){const n=this;let i,s,o;return a;function a(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),u}function u(N){return N===33?(e.consume(N),c):N===47?(e.consume(N),k):N===63?(e.consume(N),v):Zr(N)?(e.consume(N),L):r(N)}function c(N){return N===45?(e.consume(N),h):N===91?(e.consume(N),s=0,m):Zr(N)?(e.consume(N),_):r(N)}function h(N){return N===45?(e.consume(N),p):r(N)}function d(N){return N===null?r(N):N===45?(e.consume(N),f):se(N)?(o=d,U(N)):(e.consume(N),d)}function f(N){return N===45?(e.consume(N),p):d(N)}function p(N){return N===62?B(N):N===45?f(N):d(N)}function m(N){const $="CDATA[";return N===$.charCodeAt(s++)?(e.consume(N),s===$.length?y:m):r(N)}function y(N){return N===null?r(N):N===93?(e.consume(N),w):se(N)?(o=y,U(N)):(e.consume(N),y)}function w(N){return N===93?(e.consume(N),g):y(N)}function g(N){return N===62?B(N):N===93?(e.consume(N),g):y(N)}function _(N){return N===null||N===62?B(N):se(N)?(o=_,U(N)):(e.consume(N),_)}function v(N){return N===null?r(N):N===63?(e.consume(N),x):se(N)?(o=v,U(N)):(e.consume(N),v)}function x(N){return N===62?B(N):v(N)}function k(N){return Zr(N)?(e.consume(N),b):r(N)}function b(N){return N===45||cr(N)?(e.consume(N),b):E(N)}function E(N){return se(N)?(o=E,U(N)):we(N)?(e.consume(N),E):B(N)}function L(N){return N===45||cr(N)?(e.consume(N),L):N===47||N===62||Gt(N)?F(N):r(N)}function F(N){return N===47?(e.consume(N),B):N===58||N===95||Zr(N)?(e.consume(N),D):se(N)?(o=F,U(N)):we(N)?(e.consume(N),F):B(N)}function D(N){return N===45||N===46||N===58||N===95||cr(N)?(e.consume(N),D):A(N)}function A(N){return N===61?(e.consume(N),j):se(N)?(o=A,U(N)):we(N)?(e.consume(N),A):F(N)}function j(N){return N===null||N===60||N===61||N===62||N===96?r(N):N===34||N===39?(e.consume(N),i=N,M):se(N)?(o=j,U(N)):we(N)?(e.consume(N),j):(e.consume(N),O)}function M(N){return N===i?(e.consume(N),i=void 0,T):N===null?r(N):se(N)?(o=M,U(N)):(e.consume(N),M)}function O(N){return N===null||N===34||N===39||N===60||N===61||N===96?r(N):N===47||N===62||Gt(N)?F(N):(e.consume(N),O)}function T(N){return N===47||N===62||Gt(N)?F(N):r(N)}function B(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):r(N)}function U(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),R}function R(N){return we(N)?Re(e,W,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):W(N)}function W(N){return e.enter("htmlTextData"),o(N)}}const Im={name:"labelEnd",resolveAll:QR,resolveTo:YR,tokenize:XR},qR={tokenize:GR},KR={tokenize:JR},VR={tokenize:ZR};function QR(e){let t=-1;const r=[];for(;++t<e.length;){const n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const i=n.type==="labelImage"?4:2;n.type="data",t+=i}}return e.length!==r.length&&an(e,0,e.length,r),e}function YR(e,t){let r=e.length,n=0,i,s,o,a;for(;r--;)if(i=e[r][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(o=r);const u={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},h={type:"labelText",start:{...e[s+n+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",u,t],["enter",c,t]],a=Sr(a,e.slice(s+1,s+n+3)),a=Sr(a,[["enter",h,t]]),a=Sr(a,Om(t.parser.constructs.insideSpan.null,e.slice(s+n+4,o-3),t)),a=Sr(a,[["exit",h,t],e[o-2],e[o-1],["exit",c,t]]),a=Sr(a,e.slice(o+1)),a=Sr(a,[["exit",u,t]]),an(e,s,e.length,a),e}function XR(e,t,r){const n=this;let i=n.events.length,s,o;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){s=n.events[i][1];break}return a;function a(f){return s?s._inactive?d(f):(o=n.parser.defined.includes(Gs(n.sliceSerialize({start:s.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),u):r(f)}function u(f){return f===40?e.attempt(qR,h,o?h:d)(f):f===91?e.attempt(KR,h,o?c:d)(f):o?h(f):d(f)}function c(f){return e.attempt(VR,h,d)(f)}function h(f){return t(f)}function d(f){return s._balanced=!0,r(f)}}function GR(e,t,r){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Gt(d)?ya(e,s)(d):s(d)}function s(d){return d===41?h(d):n1(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Gt(d)?ya(e,u)(d):h(d)}function a(d){return r(d)}function u(d){return d===34||d===39||d===40?s1(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return Gt(d)?ya(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):r(d)}}function JR(e,t,r){const n=this;return i;function i(a){return i1.call(n,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return n.parser.defined.includes(Gs(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(a):r(a)}function o(a){return r(a)}}function ZR(e,t,r){return n;function n(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):r(s)}}const eD={name:"labelStartImage",resolveAll:Im.resolveAll,tokenize:tD};function tD(e,t,r){const n=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):r(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):t(a)}}const rD={name:"labelStartLink",resolveAll:Im.resolveAll,tokenize:nD};function nD(e,t,r){const n=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(o):t(o)}}const Ah={name:"lineEnding",tokenize:iD};function iD(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Re(e,t,"linePrefix")}}const xc={name:"thematicBreak",tokenize:sD};function sD(e,t,r){let n=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):n>=3&&(c===null||se(c))?(e.exit("thematicBreak"),t(c)):r(c)}function u(c){return c===i?(e.consume(c),n++,u):(e.exit("thematicBreakSequence"),we(c)?Re(e,a,"whitespace")(c):a(c))}}const Ht={continuation:{tokenize:cD},exit:hD,name:"list",tokenize:lD},oD={partial:!0,tokenize:dD},aD={partial:!0,tokenize:uD};function lD(e,t,r){const n=this,i=n.events[n.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const m=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:tp(p)){if(n.containerState.type||(n.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(xc,r,c)(p):c(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return r(p)}function u(p){return tp(p)&&++o<10?(e.consume(p),u):(!n.interrupt||o<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):r(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(Lu,n.interrupt?r:h,e.attempt(oD,f,d))}function h(p){return n.containerState.initialBlankLine=!0,s++,f(p)}function d(p){return we(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):r(p)}function f(p){return n.containerState.size=s+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function cD(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(Lu,i,s);function i(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Re(e,t,"listItemIndent",n.containerState.size+1)(a)}function s(a){return n.containerState.furtherBlankLines||!we(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(aD,t,o)(a))}function o(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,Re(e,e.attempt(Ht,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function uD(e,t,r){const n=this;return Re(e,i,"listItemIndent",n.containerState.size+1);function i(s){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?t(s):r(s)}}function hD(e){e.exit(this.containerState.type)}function dD(e,t,r){const n=this;return Re(e,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=n.events[n.events.length-1];return!we(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):r(s)}}const Wv={name:"setextUnderline",resolveTo:fD,tokenize:pD};function fD(e,t){let r=e.length,n,i,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(i=r)}else e[r][1].type==="content"&&e.splice(r,1),!s&&e[r][1].type==="definition"&&(s=r);const o={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[n][1],t]),e[n][1].end={...e[s][1].end}):e[n][1]=o,e.push(["exit",o,t]),e}function pD(e,t,r){const n=this;let i;return s;function s(c){let h=n.events.length,d;for(;h--;)if(n.events[h][1].type!=="lineEnding"&&n.events[h][1].type!=="linePrefix"&&n.events[h][1].type!=="content"){d=n.events[h][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),i=c,o(c)):r(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),we(c)?Re(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||se(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}const mD={tokenize:gD};function gD(e){const t=this,r=e.attempt(Lu,n,e.attempt(this.parser.constructs.flowInitial,i,Re(e,e.attempt(this.parser.constructs.flow,i,e.attempt(wR,i)),"linePrefix")));return r;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const vD={resolveAll:a1()},yD=o1("string"),_D=o1("text");function o1(e){return{resolveAll:a1(e==="text"?xD:void 0),tokenize:t};function t(r){const n=this,i=this.parser.constructs[e],s=r.attempt(i,o,a);return o;function o(h){return c(h)?s(h):a(h)}function a(h){if(h===null){r.consume(h);return}return r.enter("data"),r.consume(h),u}function u(h){return c(h)?(r.exit("data"),s(h)):(r.consume(h),u)}function c(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(n,n.previous))return!0}return!1}}}function a1(e){return t;function t(r,n){let i=-1,s;for(;++i<=r.length;)s===void 0?r[i]&&r[i][1].type==="data"&&(s=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==s+2&&(r[s][1].end=r[i-1][1].end,r.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(r,n):r}}function xD(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const n=e[r-1][1],i=t.sliceStream(n);let s=i.length,o=-1,a=0,u;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)u=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(a=0),a){const c={type:r===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:n.start._bufferIndex+o,_index:n.start._index+s,line:n.end.line,column:n.end.column-a,offset:n.end.offset-a},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}const wD={42:Ht,43:Ht,45:Ht,48:Ht,49:Ht,50:Ht,51:Ht,52:Ht,53:Ht,54:Ht,55:Ht,56:Ht,57:Ht,62:ZS},SD={91:NR},bD={[-2]:Lh,[-1]:Lh,32:Lh},CD={35:MR,42:xc,45:[Wv,xc],60:OR,61:Wv,95:xc,96:$v,126:$v},kD={38:t1,92:e1},ND={[-5]:Ah,[-4]:Ah,[-3]:Ah,33:eD,38:t1,42:rp,60:[rR,WR],91:rD,92:[RR,e1],93:Im,95:rp,96:mR},ED={null:[rp,vD]},jD={null:[42,95]},PD={null:[]},RD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:jD,contentInitial:SD,disable:PD,document:wD,flow:CD,flowInitial:bD,insideSpan:ED,string:kD,text:ND},Symbol.toStringTag,{value:"Module"}));function DD(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const i={},s=[];let o=[],a=[];const u={attempt:E(k),check:E(b),consume:_,enter:v,exit:x,interrupt:E(b,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d};let h=t.tokenize.call(c,u);return t.resolveAll&&s.push(t),c;function d(A){return o=Sr(o,A),w(),o[o.length-1]!==null?[]:(L(t,0),c.events=Om(s,c.events,c),c.events)}function f(A,j){return TD(p(A),j)}function p(A){return MD(o,A)}function m(){const{_bufferIndex:A,_index:j,line:M,column:O,offset:T}=n;return{_bufferIndex:A,_index:j,line:M,column:O,offset:T}}function y(A){i[A.line]=A.column,D()}function w(){let A;for(;n._index<o.length;){const j=o[n._index];if(typeof j=="string")for(A=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===A&&n._bufferIndex<j.length;)g(j.charCodeAt(n._bufferIndex));else g(j)}}function g(A){h=h(A)}function _(A){se(A)?(n.line++,n.column=1,n.offset+=A===-3?2:1,D()):A!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===o[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=A}function v(A,j){const M=j||{};return M.type=A,M.start=m(),c.events.push(["enter",M,c]),a.push(M),M}function x(A){const j=a.pop();return j.end=m(),c.events.push(["exit",j,c]),j}function k(A,j){L(A,j.from)}function b(A,j){j.restore()}function E(A,j){return M;function M(O,T,B){let U,R,W,N;return Array.isArray(O)?I(O):"tokenize"in O?I([O]):$(O);function $(Z){return oe;function oe(ke){const me=ke!==null&&Z[ke],Ze=ke!==null&&Z.null,er=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ze)?Ze:Ze?[Ze]:[]];return I(er)(ke)}}function I(Z){return U=Z,R=0,Z.length===0?B:C(Z[R])}function C(Z){return oe;function oe(ke){return N=F(),W=Z,Z.partial||(c.currentConstruct=Z),Z.name&&c.parser.constructs.disable.null.includes(Z.name)?Y():Z.tokenize.call(j?Object.assign(Object.create(c),j):c,u,q,Y)(ke)}}function q(Z){return A(W,N),T}function Y(Z){return N.restore(),++R<U.length?C(U[R]):B}}}function L(A,j){A.resolveAll&&!s.includes(A)&&s.push(A),A.resolve&&an(c.events,j,c.events.length-j,A.resolve(c.events.slice(j),c)),A.resolveTo&&(c.events=A.resolveTo(c.events,c))}function F(){const A=m(),j=c.previous,M=c.currentConstruct,O=c.events.length,T=Array.from(a);return{from:O,restore:B};function B(){n=A,c.previous=j,c.currentConstruct=M,c.events.length=O,a=T,D()}}function D(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function MD(e,t){const r=t.start._index,n=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(r===i)o=[e[r].slice(n,s)];else{if(o=e.slice(r,i),n>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(n):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function TD(e,t){let r=-1;const n=[];let i;for(;++r<e.length;){const s=e[r];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
481
|
+
`;break}case-3:{o=`\r
|
|
482
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,n.push(o)}return n.join("")}function LD(e){const n={constructs:$5([RD,...(e||{}).extensions||[]]),content:i(Y5),defined:[],document:i(G5),flow:i(mD),lazy:{},string:i(yD),text:i(_D)};return n;function i(s){return o;function o(a){return DD(n,s,a)}}}function AD(e){for(;!r1(e););return e}const Uv=/[\0\t\n\r]/g;function OD(){let e=1,t="",r=!0,n;return i;function i(s,o,a){const u=[];let c,h,d,f,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",r&&(s.charCodeAt(0)===65279&&d++,r=void 0);d<s.length;){if(Uv.lastIndex=d,c=Uv.exec(s),f=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(f),!c){t=s.slice(d);break}if(p===10&&d===f&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),d<f&&(u.push(s.slice(d,f)),e+=f-d),p){case 0:{u.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,u.push(-2);e++<h;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:n=!0,e=1}d=f+1}return a&&(n&&u.push(-5),t&&u.push(t),u.push(null)),u}}const ID=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BD(e){return e.replace(ID,FD)}function FD(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),s=i===120||i===88;return JS(r.slice(s?2:1),s?16:10)}return Am(r)||e}const l1={}.hasOwnProperty;function zD(e,t,r){return typeof t!="string"&&(r=t,t=void 0),$D(r)(AD(LD(r).document().write(OD()(e,t,!0))))}function $D(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Vm),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(xe),blockQuote:s(Ze),characterEscape:F,characterReference:F,codeFenced:s(er),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(er,o),codeText:s(tr,o),codeTextData:F,data:F,codeFlowValue:F,definition:s(ye),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(ee),hardBreakEscape:s(Ft),hardBreakTrailing:s(Ft),htmlFlow:s($r,o),htmlFlowData:F,htmlText:s($r,o),htmlTextData:F,image:s($u),label:o,link:s(Vm),listItem:s(nb),listItemValue:f,listOrdered:s(Qm,d),listUnordered:s(Qm),paragraph:s(ib),reference:C,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(xe),strong:s(sb),thematicBreak:s(ab)},exit:{atxHeading:u(),atxHeadingSequence:k,autolink:u(),autolinkEmail:me,autolinkProtocol:ke,blockQuote:u(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:Z,characterReference:oe,codeFenced:u(w),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:D,codeIndented:u(g),codeText:u(T),codeTextData:D,data:D,definition:u(),definitionDestinationString:x,definitionLabelString:_,definitionTitleString:v,emphasis:u(),hardBreakEscape:u(j),hardBreakTrailing:u(j),htmlFlow:u(M),htmlFlowData:D,htmlText:u(O),htmlTextData:D,image:u(U),label:W,labelText:R,lineEnding:A,link:u(B),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:q,resourceDestinationString:N,resourceTitleString:$,resource:I,setextHeading:u(L),setextHeadingLineSequence:E,setextHeadingText:b,strong:u(),thematicBreak:u()}};c1(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(z){let X={type:"root",children:[]};const ae={stack:[X],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:h,data:r},ge=[];let Ee=-1;for(;++Ee<z.length;)if(z[Ee][1].type==="listOrdered"||z[Ee][1].type==="listUnordered")if(z[Ee][0]==="enter")ge.push(Ee);else{const jr=ge.pop();Ee=i(z,jr,Ee)}for(Ee=-1;++Ee<z.length;){const jr=t[z[Ee][0]];l1.call(jr,z[Ee][1].type)&&jr[z[Ee][1].type].call(Object.assign({sliceSerialize:z[Ee][2].sliceSerialize},ae),z[Ee][1])}if(ae.tokenStack.length>0){const jr=ae.tokenStack[ae.tokenStack.length-1];(jr[1]||qv).call(ae,void 0,jr[0])}for(X.position={start:Hn(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:Hn(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},Ee=-1;++Ee<t.transforms.length;)X=t.transforms[Ee](X)||X;return X}function i(z,X,ae){let ge=X-1,Ee=-1,jr=!1,Pi,un,Ro,Do;for(;++ge<=ae;){const rr=z[ge];switch(rr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rr[0]==="enter"?Ee++:Ee--,Do=void 0;break}case"lineEndingBlank":{rr[0]==="enter"&&(Pi&&!Do&&!Ee&&!Ro&&(Ro=ge),Do=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Do=void 0}if(!Ee&&rr[0]==="enter"&&rr[1].type==="listItemPrefix"||Ee===-1&&rr[0]==="exit"&&(rr[1].type==="listUnordered"||rr[1].type==="listOrdered")){if(Pi){let vs=ge;for(un=void 0;vs--;){const hn=z[vs];if(hn[1].type==="lineEnding"||hn[1].type==="lineEndingBlank"){if(hn[0]==="exit")continue;un&&(z[un][1].type="lineEndingBlank",jr=!0),hn[1].type="lineEnding",un=vs}else if(!(hn[1].type==="linePrefix"||hn[1].type==="blockQuotePrefix"||hn[1].type==="blockQuotePrefixWhitespace"||hn[1].type==="blockQuoteMarker"||hn[1].type==="listItemIndent"))break}Ro&&(!un||Ro<un)&&(Pi._spread=!0),Pi.end=Object.assign({},un?z[un][1].start:rr[1].end),z.splice(un||ge,0,["exit",Pi,rr[2]]),ge++,ae++}if(rr[1].type==="listItemPrefix"){const vs={type:"listItem",_spread:!1,start:Object.assign({},rr[1].start),end:void 0};Pi=vs,z.splice(ge,0,["enter",vs,rr[2]]),ge++,ae++,Ro=void 0,Do=!0}}}return z[X][1]._spread=jr,ae}function s(z,X){return ae;function ae(ge){a.call(this,z(ge),ge),X&&X.call(this,ge)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(z,X,ae){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([X,ae||void 0]),z.position={start:Hn(X.start),end:void 0}}function u(z){return X;function X(ae){z&&z.call(this,ae),c.call(this,ae)}}function c(z,X){const ae=this.stack.pop(),ge=this.tokenStack.pop();if(ge)ge[0].type!==z.type&&(X?X.call(this,z,ge[0]):(ge[1]||qv).call(this,z,ge[0]));else throw new Error("Cannot close `"+z.type+"` ("+va({start:z.start,end:z.end})+"): it’s not open");ae.position.end=Hn(z.end)}function h(){return F5(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(z){if(this.data.expectingFirstListItemValue){const X=this.stack[this.stack.length-2];X.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function p(){const z=this.resume(),X=this.stack[this.stack.length-1];X.lang=z}function m(){const z=this.resume(),X=this.stack[this.stack.length-1];X.meta=z}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const z=this.resume(),X=this.stack[this.stack.length-1];X.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const z=this.resume(),X=this.stack[this.stack.length-1];X.value=z.replace(/(\r?\n|\r)$/g,"")}function _(z){const X=this.resume(),ae=this.stack[this.stack.length-1];ae.label=X,ae.identifier=Gs(this.sliceSerialize(z)).toLowerCase()}function v(){const z=this.resume(),X=this.stack[this.stack.length-1];X.title=z}function x(){const z=this.resume(),X=this.stack[this.stack.length-1];X.url=z}function k(z){const X=this.stack[this.stack.length-1];if(!X.depth){const ae=this.sliceSerialize(z).length;X.depth=ae}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function E(z){const X=this.stack[this.stack.length-1];X.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function F(z){const ae=this.stack[this.stack.length-1].children;let ge=ae[ae.length-1];(!ge||ge.type!=="text")&&(ge=ob(),ge.position={start:Hn(z.start),end:void 0},ae.push(ge)),this.stack.push(ge)}function D(z){const X=this.stack.pop();X.value+=this.sliceSerialize(z),X.position.end=Hn(z.end)}function A(z){const X=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=X.children[X.children.length-1];ae.position.end=Hn(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(X.type)&&(F.call(this,z),D.call(this,z))}function j(){this.data.atHardBreak=!0}function M(){const z=this.resume(),X=this.stack[this.stack.length-1];X.value=z}function O(){const z=this.resume(),X=this.stack[this.stack.length-1];X.value=z}function T(){const z=this.resume(),X=this.stack[this.stack.length-1];X.value=z}function B(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const X=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=X,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function U(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const X=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=X,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function R(z){const X=this.sliceSerialize(z),ae=this.stack[this.stack.length-2];ae.label=BD(X),ae.identifier=Gs(X).toLowerCase()}function W(){const z=this.stack[this.stack.length-1],X=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const ge=z.children;ae.children=ge}else ae.alt=X}function N(){const z=this.resume(),X=this.stack[this.stack.length-1];X.url=z}function $(){const z=this.resume(),X=this.stack[this.stack.length-1];X.title=z}function I(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function q(z){const X=this.resume(),ae=this.stack[this.stack.length-1];ae.label=X,ae.identifier=Gs(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function Y(z){this.data.characterReferenceType=z.type}function Z(z){const X=this.sliceSerialize(z),ae=this.data.characterReferenceType;let ge;ae?(ge=JS(X,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ge=Am(X);const Ee=this.stack[this.stack.length-1];Ee.value+=ge}function oe(z){const X=this.stack.pop();X.position.end=Hn(z.end)}function ke(z){D.call(this,z);const X=this.stack[this.stack.length-1];X.url=this.sliceSerialize(z)}function me(z){D.call(this,z);const X=this.stack[this.stack.length-1];X.url="mailto:"+this.sliceSerialize(z)}function Ze(){return{type:"blockquote",children:[]}}function er(){return{type:"code",lang:null,meta:null,value:""}}function tr(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ee(){return{type:"emphasis",children:[]}}function xe(){return{type:"heading",depth:0,children:[]}}function Ft(){return{type:"break"}}function $r(){return{type:"html",value:""}}function $u(){return{type:"image",title:null,url:"",alt:null}}function Vm(){return{type:"link",title:null,url:"",children:[]}}function Qm(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function nb(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function ib(){return{type:"paragraph",children:[]}}function sb(){return{type:"strong",children:[]}}function ob(){return{type:"text",value:""}}function ab(){return{type:"thematicBreak"}}}function Hn(e){return{line:e.line,column:e.column,offset:e.offset}}function c1(e,t){let r=-1;for(;++r<t.length;){const n=t[r];Array.isArray(n)?c1(e,n):HD(e,n)}}function HD(e,t){let r;for(r in t)if(l1.call(t,r))switch(r){case"canContainEols":{const n=t[r];n&&e[r].push(...n);break}case"transforms":{const n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{const n=t[r];n&&Object.assign(e[r],n);break}}}function qv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+va({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+va({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+va({start:t.start,end:t.end})+") is still open")}function WD(e){const t=this;t.parser=r;function r(n){return zD(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function UD(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function qD(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
483
|
+
`}]}function KD(e,t){const r=t.value?t.value+`
|
|
484
|
+
`:"",n={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(n.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function VD(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function QD(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function YD(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),i=Po(n.toLowerCase()),s=e.footnoteOrder.indexOf(n);let o,a=e.footnoteCounts.get(n);a===void 0?(a=0,e.footnoteOrder.push(n),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(n,a);const u={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function XD(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function GD(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function u1(e,t){const r=t.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=n:i.push({type:"text",value:n}),i}function JD(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return u1(e,t);const i={src:Po(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function ZD(e,t){const r={src:Po(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function eM(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function tM(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return u1(e,t);const i={href:Po(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function rM(e,t){const r={href:Po(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nM(e,t,r){const n=e.all(t),i=r?iM(r):h1(t),s={},o=[];if(typeof t.checked=="boolean"){const h=n[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<n.length;){const h=n[a];(i||a!==0||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
|
|
485
|
+
`}),h.type==="element"&&h.tagName==="p"&&!i?o.push(...h.children):o.push(h)}const u=n[n.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
486
|
+
`});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function iM(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let n=-1;for(;!t&&++n<r.length;)t=h1(r[n])}return t}function h1(e){const t=e.spread;return t??e.children.length>1}function sM(e,t){const r={},n=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++i<n.length;){const o=n[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,s),e.applyData(t,s)}function oM(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function aM(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function lM(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cM(e,t){const r=e.all(t),n=r.shift(),i=[];if(n){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],o),i.push(o)}if(r.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},a=Dm(t.children[1]),u=qS(t.children[t.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function uM(e,t,r){const n=r?r.children:void 0,s=(n?n.indexOf(t):1)===0?"th":"td",o=r&&r.type==="table"?r.align:void 0,a=o?o.length:t.children.length;let u=-1;const c=[];for(;++u<a;){const d=t.children[u],f={},p=o?o[u]:void 0;p&&(f.align=p);let m={type:"element",tagName:s,properties:f,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function hM(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const Kv=9,Vv=32;function dM(e){const t=String(e),r=/\r?\n|\r/g;let n=r.exec(t),i=0;const s=[];for(;n;)s.push(Qv(t.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=r.exec(t);return s.push(Qv(t.slice(i),i>0,!1)),s.join("")}function Qv(e,t,r){let n=0,i=e.length;if(t){let s=e.codePointAt(n);for(;s===Kv||s===Vv;)n++,s=e.codePointAt(n)}if(r){let s=e.codePointAt(i-1);for(;s===Kv||s===Vv;)i--,s=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function fM(e,t){const r={type:"text",value:dM(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function pM(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const mM={blockquote:UD,break:qD,code:KD,delete:VD,emphasis:QD,footnoteReference:YD,heading:XD,html:GD,imageReference:JD,image:ZD,inlineCode:eM,linkReference:tM,link:rM,listItem:nM,list:sM,paragraph:oM,root:aM,strong:lM,table:cM,tableCell:hM,tableRow:uM,text:fM,thematicBreak:pM,toml:Kl,yaml:Kl,definition:Kl,footnoteDefinition:Kl};function Kl(){}const d1=-1,Au=0,_a=1,iu=2,Bm=3,Fm=4,zm=5,$m=6,f1=7,p1=8,Yv=typeof self=="object"?self:globalThis,gM=(e,t)=>{const r=(i,s)=>(e.set(s,i),i),n=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Au:case d1:return r(o,i);case _a:{const a=r([],i);for(const u of o)a.push(n(u));return a}case iu:{const a=r({},i);for(const[u,c]of o)a[n(u)]=n(c);return a}case Bm:return r(new Date(o),i);case Fm:{const{source:a,flags:u}=o;return r(new RegExp(a,u),i)}case zm:{const a=r(new Map,i);for(const[u,c]of o)a.set(n(u),n(c));return a}case $m:{const a=r(new Set,i);for(const u of o)a.add(n(u));return a}case f1:{const{name:a,message:u}=o;return r(new Yv[a](u),i)}case p1:return r(BigInt(o),i);case"BigInt":return r(Object(BigInt(o)),i);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return r(new DataView(a),o)}}return r(new Yv[s](o),i)};return n},Xv=e=>gM(new Map,e)(0),Ss="",{toString:vM}={},{keys:yM}=Object,Qo=e=>{const t=typeof e;if(t!=="object"||!e)return[Au,t];const r=vM.call(e).slice(8,-1);switch(r){case"Array":return[_a,Ss];case"Object":return[iu,Ss];case"Date":return[Bm,Ss];case"RegExp":return[Fm,Ss];case"Map":return[zm,Ss];case"Set":return[$m,Ss];case"DataView":return[_a,r]}return r.includes("Array")?[_a,r]:r.includes("Error")?[f1,r]:[iu,r]},Vl=([e,t])=>e===Au&&(t==="function"||t==="symbol"),_M=(e,t,r,n)=>{const i=(o,a)=>{const u=n.push(o)-1;return r.set(a,u),u},s=o=>{if(r.has(o))return r.get(o);let[a,u]=Qo(o);switch(a){case Au:{let h=o;switch(u){case"bigint":a=p1,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([d1],o)}return i([a,h],o)}case _a:{if(u){let f=o;return u==="DataView"?f=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(f=new Uint8Array(o)),i([u,[...f]],o)}const h=[],d=i([a,h],o);for(const f of o)h.push(s(f));return d}case iu:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const h=[],d=i([a,h],o);for(const f of yM(o))(e||!Vl(Qo(o[f])))&&h.push([s(f),s(o[f])]);return d}case Bm:return i([a,o.toISOString()],o);case Fm:{const{source:h,flags:d}=o;return i([a,{source:h,flags:d}],o)}case zm:{const h=[],d=i([a,h],o);for(const[f,p]of o)(e||!(Vl(Qo(f))||Vl(Qo(p))))&&h.push([s(f),s(p)]);return d}case $m:{const h=[],d=i([a,h],o);for(const f of o)(e||!Vl(Qo(f)))&&h.push(s(f));return d}}const{message:c}=o;return i([a,{name:u,message:c}],o)};return s},Gv=(e,{json:t,lossy:r}={})=>{const n=[];return _M(!(t||r),!!t,new Map,n)(e),n},su=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Xv(Gv(e,t)):structuredClone(e):(e,t)=>Xv(Gv(e,t));function xM(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function wM(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function SM(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||xM,n=e.options.footnoteBackLabel||wM,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const h=e.all(c),d=String(c.identifier).toUpperCase(),f=Po(d.toLowerCase());let p=0;const m=[],y=e.footnoteCounts.get(d);for(;y!==void 0&&++p<=y;){m.length>0&&m.push({type:"text",value:" "});let _=typeof r=="string"?r:r(u,p);typeof _=="string"&&(_={type:"text",value:_}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(u,p),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const w=h[h.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const _=w.children[w.children.length-1];_&&_.type==="text"?_.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else h.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(h,!0)};e.patch(c,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...su(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
487
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
488
|
+
`}]}}const m1=function(e){if(e==null)return NM;if(typeof e=="function")return Ou(e);if(typeof e=="object")return Array.isArray(e)?bM(e):CM(e);if(typeof e=="string")return kM(e);throw new Error("Expected function, string, or object as test")};function bM(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=m1(e[r]);return Ou(n);function n(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function CM(e){const t=e;return Ou(r);function r(n){const i=n;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function kM(e){return Ou(t);function t(r){return r&&r.type===e}}function Ou(e){return t;function t(r,n,i){return!!(EM(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function NM(){return!0}function EM(e){return e!==null&&typeof e=="object"&&"type"in e}const g1=[],jM=!0,Jv=!1,PM="skip";function RM(e,t,r,n){let i;typeof t=="function"&&typeof r!="function"?(n=r,r=t):i=t;const s=m1(i),o=n?-1:1;a(e,void 0,[])();function a(u,c,h){const d=u&&typeof u=="object"?u:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=g1,m,y,w;if((!t||s(u,c,h[h.length-1]||void 0))&&(p=DM(r(u,h)),p[0]===Jv))return p;if("children"in u&&u.children){const g=u;if(g.children&&p[0]!==PM)for(y=(n?g.children.length:-1)+o,w=h.concat(g);y>-1&&y<g.children.length;){const _=g.children[y];if(m=a(_,y,w)(),m[0]===Jv)return m;y=typeof m[1]=="number"?m[1]:y+o}}return p}}}function DM(e){return Array.isArray(e)?e:typeof e=="number"?[jM,e]:e==null?g1:[e]}function v1(e,t,r,n){let i,s,o;typeof t=="function"&&typeof r!="function"?(s=void 0,o=t,i=r):(s=t,o=r,i=n),RM(e,s,a,i);function a(u,c){const h=c[c.length-1],d=h?h.children.indexOf(u):void 0;return o(u,d,h)}}const np={}.hasOwnProperty,MM={};function TM(e,t){const r=t||MM,n=new Map,i=new Map,s=new Map,o={...mM,...r.handlers},a={all:c,applyData:AM,definitionById:n,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:u,options:r,patch:LM,wrap:IM};return v1(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?n:i,f=String(h.identifier).toUpperCase();d.has(f)||d.set(f,h)}}),a;function u(h,d){const f=h.type,p=a.handlers[f];if(np.call(a.handlers,f)&&p)return p(a,h,d);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in h){const{children:y,...w}=h,g=su(w);return g.children=a.all(h),g}return su(h)}return(a.options.unknownHandler||OM)(a,h,d)}function c(h){const d=[];if("children"in h){const f=h.children;let p=-1;for(;++p<f.length;){const m=a.one(f[p],h);if(m){if(p&&f[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Zv(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=Zv(y.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function LM(e,t){e.position&&(t.position=v5(e))}function AM(e,t){let r=t;if(e&&e.data){const n=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const o="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:o}}r.type==="element"&&s&&Object.assign(r.properties,su(s)),"children"in r&&r.children&&i!==null&&i!==void 0&&(r.children=i)}return r}function OM(e,t){const r=t.data||{},n="value"in t&&!(np.call(r,"hProperties")||np.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IM(e,t){const r=[];let n=-1;for(t&&r.push({type:"text",value:`
|
|
489
|
+
`});++n<e.length;)n&&r.push({type:"text",value:`
|
|
490
|
+
`}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
491
|
+
`}),r}function Zv(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function ey(e,t){const r=TM(e,t),n=r.one(e,void 0),i=SM(r),s=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
492
|
+
`},i),s}function BM(e,t){return e&&"run"in e?async function(r,n){const i=ey(r,{file:n,...t});await e.run(i,n)}:function(r,n){return ey(r,{file:n,...e||t})}}function ty(e){if(e)throw e}var wc=Object.prototype.hasOwnProperty,y1=Object.prototype.toString,ry=Object.defineProperty,ny=Object.getOwnPropertyDescriptor,iy=function(t){return typeof Array.isArray=="function"?Array.isArray(t):y1.call(t)==="[object Array]"},sy=function(t){if(!t||y1.call(t)!=="[object Object]")return!1;var r=wc.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&wc.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||wc.call(t,i)},oy=function(t,r){ry&&r.name==="__proto__"?ry(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},ay=function(t,r){if(r==="__proto__")if(wc.call(t,r)){if(ny)return ny(t,r).value}else return;return t[r]},FM=function e(){var t,r,n,i,s,o,a=arguments[0],u=1,c=arguments.length,h=!1;for(typeof a=="boolean"&&(h=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<c;++u)if(t=arguments[u],t!=null)for(r in t)n=ay(a,r),i=ay(t,r),a!==i&&(h&&i&&(sy(i)||(s=iy(i)))?(s?(s=!1,o=n&&iy(n)?n:[]):o=n&&sy(n)?n:{},oy(a,{name:r,newValue:e(h,o,i)})):typeof i<"u"&&oy(a,{name:r,newValue:i}));return a};const Oh=Za(FM);function ip(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 zM(){const e=[],t={run:r,use:n};return t;function r(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(u,...c){const h=e[++s];let d=-1;if(u){o(u);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,h?$M(h,a)(...c):o(null,...c)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function $M(e,t){let r;return n;function n(...o){const a=e.length>o.length;let u;a&&o.push(i);try{u=e.apply(this,o)}catch(c){const h=c;if(a&&r)throw h;return i(h)}a||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...a){r||(r=!0,t(o,...a))}function s(o){i(null,o)}}const Qr={basename:HM,dirname:WM,extname:UM,join:qM,sep:"/"};function HM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dl(e);let r=0,n=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){r=i+1;break}}else n<0&&(s=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){r=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(n=i):(a=-1,n=o));return r===n?n=o:n<0&&(n=e.length),e.slice(r,n)}function WM(e){if(dl(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function UM(e){dl(e);let t=e.length,r=-1,n=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){n=t+1;break}continue}r<0&&(o=!0,r=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||r<0||s===0||s===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function qM(...e){let t=-1,r;for(;++t<e.length;)dl(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":KM(r)}function KM(e){dl(e);const t=e.codePointAt(0)===47;let r=VM(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function VM(e,t){let r="",n=0,i=-1,s=0,o=-1,a,u;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(u=r.lastIndexOf("/"),u!==r.length-1){u<0?(r="",n=0):(r=r.slice(0,u),n=r.length-1-r.lastIndexOf("/")),i=o,s=0;continue}}else if(r.length>0){r="",n=0,i=o,s=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,o):r=e.slice(i+1,o),n=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return r}function dl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const QM={cwd:YM};function YM(){return"/"}function sp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function XM(e){if(typeof e=="string")e=new URL(e);else if(!sp(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 GM(e)}function GM(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ih=["history","path","basename","stem","extname","dirname"];class _1{constructor(t){let r;t?sp(t)?r={path:t}:typeof t=="string"||JM(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":QM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Ih.length;){const s=Ih[n];s in r&&r[s]!==void 0&&r[s]!==null&&(this[s]=s==="history"?[...r[s]]:r[s])}let i;for(i in r)Ih.includes(i)||(this[i]=r[i])}get basename(){return typeof this.path=="string"?Qr.basename(this.path):void 0}set basename(t){Fh(t,"basename"),Bh(t,"basename"),this.path=Qr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qr.dirname(this.path):void 0}set dirname(t){ly(this.basename,"dirname"),this.path=Qr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qr.extname(this.path):void 0}set extname(t){if(Bh(t,"extname"),ly(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=Qr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sp(t)&&(t=XM(t)),Fh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qr.basename(this.path,this.extname):void 0}set stem(t){Fh(t,"stem"),Bh(t,"stem"),this.path=Qr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){const i=this.message(t,r,n);throw i.fatal=!0,i}info(t,r,n){const i=this.message(t,r,n);return i.fatal=void 0,i}message(t,r,n){const i=new Nt(t,r,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Bh(e,t){if(e&&e.includes(Qr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qr.sep+"`")}function Fh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ly(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function JM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ZM=function(e){const n=this.constructor.prototype,i=n[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,n),s},eT={}.hasOwnProperty;class Hm extends ZM{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=zM()}copy(){const t=new Hm;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(Oh(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Hh("data",this.frozen),this.namespace[t]=r,this):eT.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Hh("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[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=r.call(t,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Ql(t),n=this.parser||this.Parser;return zh("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),zh("process",this.parser||this.Parser),$h("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(s,o){const a=Ql(t),u=n.parse(a);n.run(u,a,function(h,d,f){if(h||!d||!f)return c(h);const p=d,m=n.stringify(p,f);nT(m)?f.value=m:f.result=m,c(h,f)});function c(h,d){h||!d?o(h):s?s(d):r(void 0,d)}}}processSync(t){let r=!1,n;return this.freeze(),zh("processSync",this.parser||this.Parser),$h("processSync",this.compiler||this.Compiler),this.process(t,i),uy("processSync","process",r),n;function i(s,o){r=!0,ty(s),n=o}}run(t,r,n){cy(t),this.freeze();const i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?s(void 0,n):new Promise(s);function s(o,a){const u=Ql(r);i.run(t,u,c);function c(h,d,f){const p=d||t;h?a(h):o?o(p):n(void 0,p,f)}}}runSync(t,r){let n=!1,i;return this.run(t,r,s),uy("runSync","run",n),i;function s(o,a){ty(o),i=a,n=!0}}stringify(t,r){this.freeze();const n=Ql(r),i=this.compiler||this.Compiler;return $h("stringify",i),cy(t),i(t,n)}use(t,...r){const n=this.attachers,i=this.namespace;if(Hh("use",this.frozen),t!=null)if(typeof t=="function")u(t,r);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...d]=c;u(h,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))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");a(c.plugins),c.settings&&(i.settings=Oh(!0,i.settings,c.settings))}function a(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const d=c[h];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,h){let d=-1,f=-1;for(;++d<n.length;)if(n[d][0]===c){f=d;break}if(f===-1)n.push([c,...h]);else if(h.length>0){let[p,...m]=h;const y=n[f][1];ip(y)&&ip(p)&&(p=Oh(!0,y,p)),n[f]=[c,p,...m]}}}}const tT=new Hm().freeze();function zh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function $h(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hh(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 cy(e){if(!ip(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function uy(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ql(e){return rT(e)?e:new _1(e)}function rT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function nT(e){return typeof e=="string"||iT(e)}function iT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hy=[],dy={allowDangerousHtml:!0},oT=/^(https?|ircs?|mailto|xmpp)$/i,aT=[{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 lT(e){const t=cT(e),r=uT(e);return hT(t.runSync(t.parse(r),r),e)}function cT(e){const t=e.rehypePlugins||hy,r=e.remarkPlugins||hy,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dy}:dy;return tT().use(WD).use(r).use(BM,n).use(t)}function uT(e){const t=e.children||"",r=new _1;return typeof t=="string"&&(r.value=t),r}function hT(e,t){const r=t.allowedElements,n=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||dT;for(const h of aT)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+sT+h.id,void 0);return v1(e,c),S5(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function c(h,d,f){if(h.type==="raw"&&f&&typeof d=="number")return o?f.children.splice(d,1):f.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let p;for(p in Th)if(Object.hasOwn(Th,p)&&Object.hasOwn(h.properties,p)){const m=h.properties[p],y=Th[p];(y===null||y.includes(h.tagName))&&(h.properties[p]=u(String(m||""),p,h))}}if(h.type==="element"){let p=r?!r.includes(h.tagName):s?s.includes(h.tagName):!1;if(!p&&n&&typeof d=="number"&&(p=!n(h,d,f)),p&&f&&typeof d=="number")return a&&h.children?f.children.splice(d,1,...h.children):f.children.splice(d,1),d}}}function dT(e){const t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||r!==-1&&t>r||n!==-1&&t>n||oT.test(e.slice(0,t))?e:""}async function fT(e){const t=await fetch(`/api/issues/${e}/costs`);if(!t.ok)throw new Error("Failed to fetch costs");return t.json()}function Wh(e){return e>=100?`$${e.toFixed(0)}`:e>=10?`$${e.toFixed(1)}`:e>=1?`$${e.toFixed(2)}`:e>0?`$${e.toFixed(3)}`:"$0.00"}function fy(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function py(e){if(navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(e),!0;const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),document.body.removeChild(t),!0}catch{return document.body.removeChild(t),!1}}function pT({issue:e,onClose:t,onStartAgent:r}){var B,U,R,W,N,$,I;const n=Jt(),[i,s]=S.useState(!1),[o,a]=S.useState(!1),[u,c]=S.useState(!1),[h,d]=S.useState(!0),{data:f,isLoading:p}=he({queryKey:["workspace",e.identifier],queryFn:async()=>{const C=await fetch(`/api/workspaces/${e.identifier}`);if(!C.ok)throw new Error("Failed to fetch workspace info");return C.json()},refetchInterval:5e3}),{data:m}=he({queryKey:["issueCosts",e.identifier],queryFn:()=>fT(e.identifier),refetchInterval:3e4,staleTime:1e4}),y=()=>{py(e.identifier),s(!0),setTimeout(()=>s(!1),2e3)},w=()=>{f!=null&&f.path&&(py(`cd ${f.path}`),a(!0),setTimeout(()=>a(!1),2e3))},g=ue({mutationKey:["startAgent",e.identifier],mutationFn:async()=>{var q;const C=await fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issueId:e.identifier,projectId:(q=e.project)==null?void 0:q.id})});if(!C.ok)throw new Error("Failed to start agent");return C.json()},onSuccess:()=>{setTimeout(()=>{n.invalidateQueries({queryKey:["agents"]})},2e3),r==null||r()}}),_=ue({mutationFn:async()=>{var q;const C=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issueId:e.identifier,projectId:(q=e.project)==null?void 0:q.id})});if(!C.ok)throw new Error("Failed to create workspace");return C.json()},onSuccess:()=>{n.invalidateQueries({queryKey:["workspace",e.identifier]})}}),v=ue({mutationFn:async()=>{const C=await fetch(`/api/workspaces/${e.identifier}/containerize`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!C.ok){const q=await C.json();throw new Error(q.error||"Failed to containerize workspace")}return C.json()},onSuccess:()=>{setTimeout(()=>{n.invalidateQueries({queryKey:["workspace",e.identifier]})},3e3)}}),x=ue({mutationFn:async()=>{const C=await fetch(`/api/workspaces/${e.identifier}/start`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!C.ok){const q=await C.json();throw new Error(q.error||"Failed to start containers")}return C.json()},onSuccess:()=>{setTimeout(()=>{n.invalidateQueries({queryKey:["workspace",e.identifier]})},5e3)}}),{data:k,isLoading:b}=he({queryKey:["workspace-clean-preview",e.identifier],queryFn:async()=>{const C=await fetch(`/api/workspaces/${e.identifier}/clean/preview`);if(!C.ok)throw new Error("Failed to fetch preview");return C.json()},enabled:u&&(f==null?void 0:f.corrupted)===!0}),E=ue({mutationFn:async C=>{const q=await fetch(`/api/workspaces/${e.identifier}/clean`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({createBackup:C.createBackup})});if(!q.ok){const Y=await q.json();throw new Error(Y.error||"Failed to clean workspace")}return q.json()},onSuccess:C=>{c(!1),n.invalidateQueries({queryKey:["workspace",e.identifier]}),C.backupPath&&alert(`Workspace backed up to:
|
|
493
|
+
${C.backupPath}
|
|
494
|
+
|
|
495
|
+
You can restore files from there after the new workspace is created.`)}}),L=()=>{g.mutate()},F=()=>{_.mutate()},D=()=>{v.mutate()},A=()=>{x.mutate()},j=()=>{c(!0)},M=()=>{E.mutate({createBackup:h})},O={0:{label:"No priority",color:"text-gray-400"},1:{label:"Urgent",color:"text-red-400"},2:{label:"High",color:"text-orange-400"},3:{label:"Medium",color:"text-yellow-400"},4:{label:"Low",color:"text-blue-400"}},T=O[e.priority]||O[0];return l.jsxs("div",{className:"flex flex-col h-full bg-gray-800 border-l border-gray-700",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-700 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:y,className:`font-mono text-sm font-medium transition-colors ${i?"text-green-400":"text-white hover:text-blue-400"}`,title:"Click to copy",children:[e.identifier,i?l.jsx($s,{className:"w-3 h-3 inline ml-1"}):l.jsx(bw,{className:"w-3 h-3 inline ml-1 opacity-50"})]}),l.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-blue-400",children:l.jsx(ol,{className:"w-4 h-4"})})]}),l.jsx("button",{onClick:t,className:"text-gray-400 hover:text-white p-1",children:l.jsx(Vt,{className:"w-4 h-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[l.jsx("h2",{className:"text-lg font-medium text-white mb-4",children:e.title}),l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx("span",{className:"px-2 py-1 bg-gray-700 text-white text-xs rounded",children:e.status}),l.jsx("span",{className:`text-xs ${T.color}`,children:T.label})]}),l.jsxs("div",{className:"space-y-3 mb-6",children:[e.assignee&&l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(Mw,{className:"w-4 h-4 text-gray-400"}),l.jsx("span",{className:"text-gray-300",children:e.assignee.name}),l.jsx("span",{className:"text-gray-500 text-xs",children:e.assignee.email})]}),e.labels.length>0&&l.jsxs("div",{className:"flex items-center gap-2 text-sm flex-wrap",children:[l.jsx(Pw,{className:"w-4 h-4 text-gray-400 shrink-0"}),e.labels.map(C=>l.jsx("span",{className:"px-2 py-0.5 bg-gray-700 text-gray-300 text-xs rounded",children:C},C))]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[l.jsx(C2,{className:"w-4 h-4"}),l.jsxs("span",{children:["Updated ",new Date(e.updatedAt).toLocaleDateString()]})]})]}),e.description&&l.jsxs("div",{className:"mb-6",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-2",children:"Description"}),l.jsx("div",{className:"text-sm text-gray-300 bg-gray-900 rounded p-3 max-h-64 overflow-y-auto prose prose-sm prose-invert prose-p:my-2 prose-headings:my-2 prose-ul:my-1 prose-li:my-0",children:l.jsx(lT,{children:e.description})})]}),m&&(m.totalCost>0||m.sessions.length>0)&&l.jsxs("div",{className:"mb-6",children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-400 mb-2 flex items-center gap-2",children:[l.jsx(sl,{className:"w-4 h-4"}),"Cost Summary"]}),l.jsxs("div",{className:"bg-gray-900 rounded p-3 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-gray-400",children:"Total Cost"}),l.jsx("span",{className:"text-xl font-semibold text-green-400",children:Wh(m.totalCost)})]}),m.totalTokens>0&&l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsxs("span",{className:"text-gray-500 flex items-center gap-1",children:[l.jsx(Cw,{className:"w-3 h-3"}),"Total Tokens"]}),l.jsx("span",{className:"text-gray-300",children:fy(m.totalTokens)})]}),Object.keys(m.byModel).length>0&&l.jsxs("div",{className:"border-t border-gray-700 pt-2",children:[l.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-2",children:"By Model"}),l.jsx("div",{className:"space-y-1",children:Object.entries(m.byModel).sort(([,C],[,q])=>q-C).map(([C,q])=>l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsx("span",{className:"text-gray-400 truncate",children:C}),l.jsx("span",{className:"text-gray-300",children:Wh(q)})]},C))})]}),m.sessions.length>0&&l.jsxs("div",{className:"border-t border-gray-700 pt-2",children:[l.jsxs("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-2",children:["Sessions (",m.sessions.length,")"]}),l.jsx("div",{className:"space-y-2 max-h-32 overflow-y-auto",children:m.sessions.map(C=>l.jsxs("div",{className:"flex items-center justify-between text-xs bg-gray-800 rounded px-2 py-1",children:[l.jsxs("div",{className:"flex items-center gap-2 truncate",children:[l.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700 rounded text-gray-400",children:C.type}),l.jsx("span",{className:"text-gray-500 truncate",children:C.model})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[C.tokenCount&&l.jsx("span",{className:"text-gray-500",children:fy(C.tokenCount)}),C.cost?l.jsx("span",{className:"text-green-400",children:Wh(C.cost)}):l.jsx("span",{className:"text-gray-600",children:"-"})]})]},C.id))})]})]})]}),p&&l.jsx("div",{className:"bg-gray-700/30 border border-gray-600/50 rounded-lg p-4 mb-4 animate-pulse",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-8 h-8 bg-gray-600 rounded-full shrink-0"}),l.jsxs("div",{className:"flex-1 space-y-3",children:[l.jsx("div",{className:"h-4 bg-gray-600 rounded w-32"}),l.jsx("div",{className:"h-3 bg-gray-600 rounded w-full"}),l.jsx("div",{className:"h-3 bg-gray-600 rounded w-3/4"}),l.jsxs("div",{className:"flex gap-2 mt-3",children:[l.jsx("div",{className:"h-6 bg-gray-600 rounded w-20"}),l.jsx("div",{className:"h-6 bg-gray-600 rounded w-16"}),l.jsx("div",{className:"h-6 bg-gray-600 rounded w-24"})]})]})]})}),!p&&(f==null?void 0:f.exists)&&(f==null?void 0:f.corrupted)&&l.jsx("div",{className:"bg-yellow-900/20 border border-yellow-700/50 rounded-lg p-4 mb-4",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-8 h-8 bg-yellow-900/50 rounded-full flex items-center justify-center shrink-0",children:l.jsx(Mn,{className:"w-4 h-4 text-yellow-400"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h4",{className:"text-sm font-medium text-yellow-400",children:"Workspace Corrupted"}),l.jsx("p",{className:"text-sm text-gray-400 mt-1",children:f.message||"The workspace exists but is not a valid git worktree."}),l.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Path: ",l.jsx("code",{className:"bg-gray-800 px-1 rounded",children:f.path})]}),l.jsx("button",{onClick:j,disabled:E.isPending,className:"mt-3 flex items-center gap-2 px-3 py-1.5 bg-yellow-600 hover:bg-yellow-500 disabled:bg-yellow-800 text-white text-sm rounded transition-colors",children:E.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"w-4 h-4 animate-spin"}),"Cleaning..."]}):l.jsxs(l.Fragment,{children:[l.jsx(bn,{className:"w-4 h-4"}),"Clean & Recreate"]})}),E.isError&&l.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1 rounded mt-2",children:E.error instanceof Error?E.error.message:"Failed to clean workspace"}),E.isSuccess&&l.jsx("div",{className:"text-xs text-green-400 bg-green-900/20 px-2 py-1 rounded mt-2",children:"Workspace cleaned! Recreating..."})]})]})}),!p&&(f==null?void 0:f.exists)&&!(f!=null&&f.corrupted)&&l.jsx("div",{className:"bg-green-900/20 border border-green-700/50 rounded-lg p-4 mb-4",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-8 h-8 bg-green-900/50 rounded-full flex items-center justify-center shrink-0",children:l.jsx(dm,{className:"w-4 h-4 text-green-400"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("h4",{className:"text-sm font-medium text-green-400",children:"Workspace Ready"}),!f.hasDocker&&l.jsx("span",{className:"px-2 py-0.5 bg-gray-700 text-gray-400 text-xs rounded",children:"Git only"}),f.hasDocker&&l.jsx("span",{className:"px-2 py-0.5 bg-purple-900/50 text-purple-400 text-xs rounded",children:"Containerized"}),f.hasAgent&&l.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 bg-blue-900/50 text-blue-400 text-xs rounded",children:[l.jsx(b2,{className:"w-3 h-3"}),f.agentModel||"Agent"]})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[l.jsx("code",{className:"text-xs text-gray-300 bg-gray-800 px-2 py-1 rounded truncate flex-1",children:f.path}),l.jsx("button",{onClick:w,className:"text-gray-400 hover:text-white p-1",title:"Copy cd command",children:o?l.jsx($s,{className:"w-4 h-4 text-green-400"}):l.jsx(wi,{className:"w-4 h-4"})})]}),f.containers&&Object.values(f.containers).some(C=>C.running)&&l.jsxs("div",{className:"mt-3 space-y-1",children:[l.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider",children:"Services"}),f.frontendUrl&&((U=(B=f.containers)==null?void 0:B.frontend)==null?void 0:U.running)&&l.jsxs("a",{href:f.frontendUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300",children:[l.jsx(cf,{className:"w-3 h-3"}),"Frontend: ",f.frontendUrl]}),f.apiUrl&&((W=(R=f.containers)==null?void 0:R.api)==null?void 0:W.running)&&l.jsxs("a",{href:f.apiUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300",children:[l.jsx(W2,{className:"w-3 h-3"}),"API: ",f.apiUrl]})]}),f.mrUrl&&l.jsx("div",{className:"mt-3",children:l.jsxs("a",{href:f.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-purple-400 hover:text-purple-300",children:[l.jsx(T2,{className:"w-3 h-3"}),"Merge Request"]})}),f.hasDocker&&f.containers&&Object.values(f.containers).some(C=>!C.running)&&l.jsxs("div",{className:"mt-3 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-xs text-yellow-500",children:"Some containers stopped."}),l.jsx("button",{onClick:A,disabled:x.isPending,className:"flex items-center gap-1 px-2 py-1 bg-green-600 hover:bg-green-500 disabled:bg-green-800 text-white text-xs rounded transition-colors",children:x.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"w-3 h-3 animate-spin"}),"Starting..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Tt,{className:"w-3 h-3"}),"Start Containers"]})})]}),x.isError&&l.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1 rounded",children:x.error instanceof Error?x.error.message:"Failed to start containers"})]}),!f.hasDocker&&l.jsx("div",{className:"mt-3",children:f.canContainerize?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-xs text-gray-500",children:"Git-only workspace."}),l.jsx("button",{onClick:D,disabled:v.isPending,className:"flex items-center gap-1 px-2 py-1 bg-purple-600 hover:bg-purple-500 disabled:bg-purple-800 text-white text-xs rounded transition-colors",children:v.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"w-3 h-3 animate-spin"}),"Setting up..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Gc,{className:"w-3 h-3"}),"Containerize"]})})]}),v.isError&&l.jsx("div",{className:"text-xs text-red-400 bg-red-900/20 px-2 py-1 rounded",children:v.error instanceof Error?v.error.message:"Failed to containerize workspace"})]}):l.jsx("div",{className:"text-xs text-gray-500",children:"This is a git-only workspace (no containers)."})}),f.containers&&l.jsxs("div",{className:"mt-3",children:[l.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"Containers"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(f.containers).map(([C,q])=>{const Y=x.isPending&&!q.running;return l.jsxs("span",{className:`flex items-center gap-1 px-2 py-0.5 rounded text-xs ${q.running?"bg-green-900/30 text-green-400":Y?"bg-yellow-900/30 text-yellow-400 animate-pulse":"bg-gray-700 text-gray-500"}`,children:[Y?l.jsx(Se,{className:"w-3 h-3 animate-spin"}):C==="postgres"||C==="redis"?l.jsx(kw,{className:"w-3 h-3"}):l.jsx(Gc,{className:"w-3 h-3"}),C,q.running&&q.uptime&&l.jsx("span",{className:"text-gray-400 ml-1",children:q.uptime}),Y&&l.jsx("span",{className:"text-yellow-500 ml-1",children:"starting..."})]},C)})})]}),f.repoGit&&(f.repoGit.frontend||f.repoGit.api)&&l.jsxs("div",{className:"mt-3 space-y-2",children:[l.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider",children:"Git Status"}),f.repoGit.frontend&&l.jsxs("div",{className:"text-xs",children:[l.jsx("span",{className:"text-gray-400",children:"Frontend:"}),l.jsxs("span",{className:"flex items-center gap-2 mt-0.5",children:[l.jsx(ma,{className:"w-3 h-3 text-gray-500"}),l.jsx("span",{className:"text-gray-300",children:f.repoGit.frontend.branch}),f.repoGit.frontend.uncommittedFiles>0&&l.jsxs("span",{className:"text-yellow-400",children:[f.repoGit.frontend.uncommittedFiles," uncommitted"]})]})]}),f.repoGit.api&&l.jsxs("div",{className:"text-xs",children:[l.jsx("span",{className:"text-gray-400",children:"API:"}),l.jsxs("span",{className:"flex items-center gap-2 mt-0.5",children:[l.jsx(ma,{className:"w-3 h-3 text-gray-500"}),l.jsx("span",{className:"text-gray-300",children:f.repoGit.api.branch}),f.repoGit.api.uncommittedFiles>0&&l.jsxs("span",{className:"text-yellow-400",children:[f.repoGit.api.uncommittedFiles," uncommitted"]})]})]})]}),f.git&&!((N=f.repoGit)!=null&&N.frontend)&&!(($=f.repoGit)!=null&&$.api)&&l.jsxs("div",{className:"flex items-center gap-3 mt-3 text-xs",children:[l.jsxs("span",{className:"flex items-center gap-1 text-gray-400",children:[l.jsx(ma,{className:"w-3 h-3"}),f.git.branch]}),f.git.uncommittedFiles>0&&l.jsxs("span",{className:"text-yellow-400",children:[f.git.uncommittedFiles," uncommitted"]})]})]})]})}),!(f!=null&&f.exists)&&!p&&l.jsx("div",{className:"bg-yellow-900/20 border border-yellow-700/50 rounded-lg p-4 mb-4",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-8 h-8 bg-yellow-900/50 rounded-full flex items-center justify-center shrink-0",children:l.jsx(Tt,{className:"w-4 h-4 text-yellow-400"})}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-medium text-yellow-400",children:"No Workspace"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Create a workspace or start an agent to begin work."})]})]})}),p&&l.jsxs("div",{className:"space-y-3 animate-pulse",children:[l.jsx("div",{className:"h-12 bg-gray-600 rounded-lg w-full"}),l.jsx("div",{className:"h-12 bg-gray-700 rounded-lg w-full"})]}),!p&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("button",{onClick:L,disabled:g.isPending||g.isSuccess,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:g.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"w-5 h-5 animate-spin"}),l.jsx("span",{className:"font-medium",children:"Starting..."})]}):g.isSuccess?l.jsxs(l.Fragment,{children:[l.jsx($s,{className:"w-5 h-5"}),l.jsx("span",{className:"font-medium",children:"Agent Started!"})]}):l.jsxs(l.Fragment,{children:[l.jsx(Tt,{className:"w-5 h-5"}),l.jsx("span",{className:"font-medium",children:f!=null&&f.exists?"Start Agent in Workspace":"Start Agent"})]})}),!(f!=null&&f.exists)&&l.jsx("button",{onClick:F,disabled:_.isPending||_.isSuccess,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-gray-700 text-white rounded-lg hover:bg-gray-600 transition-colors border border-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",children:_.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"w-5 h-5 animate-spin"}),l.jsx("span",{className:"font-medium",children:"Creating..."})]}):_.isSuccess?l.jsxs(l.Fragment,{children:[l.jsx($s,{className:"w-5 h-5"}),l.jsx("span",{className:"font-medium",children:"Workspace Created!"})]}):l.jsxs(l.Fragment,{children:[l.jsx(M2,{className:"w-5 h-5"}),l.jsx("span",{className:"font-medium",children:"Create Workspace Only"})]})}),g.isError&&l.jsx("p",{className:"text-red-400 text-xs",children:"Failed to start agent. Check server logs."}),_.isError&&l.jsx("p",{className:"text-red-400 text-xs",children:"Failed to create workspace. Check server logs."})]}),!p&&l.jsxs("div",{className:"text-xs text-gray-500 mt-3 space-y-1",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Start Agent:"})," ",f!=null&&f.exists?"Starts autonomous agent in existing workspace":"Creates workspace + starts autonomous agent"]}),!(f!=null&&f.exists)&&l.jsxs("p",{children:[l.jsx("strong",{children:"Create Workspace:"})," Creates git worktree for manual work"]})]})]}),u&&l.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:l.jsxs("div",{className:"bg-gray-800 rounded-lg max-w-2xl w-full max-h-[80vh] overflow-hidden flex flex-col",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-700 flex items-center justify-between",children:[l.jsxs("h3",{className:"text-lg font-medium text-white flex items-center gap-2",children:[l.jsx(Mn,{className:"w-5 h-5 text-yellow-500"}),"Clean Corrupted Workspace"]}),l.jsx("button",{onClick:()=>c(!1),className:"text-gray-400 hover:text-white",children:l.jsx(Vt,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"p-4 overflow-y-auto flex-1",children:b?l.jsxs("div",{className:"flex items-center justify-center py-8",children:[l.jsx(Se,{className:"w-6 h-6 animate-spin text-gray-400"}),l.jsx("span",{className:"ml-2 text-gray-400",children:"Scanning workspace..."})]}):k?l.jsxs("div",{className:"space-y-4",children:[k.diffAnalysis&&!k.diffAnalysis.error&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{className:"text-xs text-gray-500",children:["Compared against: ",l.jsx("code",{className:"bg-gray-900 px-1 rounded",children:k.diffAnalysis.comparedAgainst})]}),k.diffAnalysis.modifiedFiles.length>0&&l.jsxs("div",{className:"bg-red-900/30 border border-red-700/50 rounded p-3",children:[l.jsxs("h4",{className:"text-sm font-medium text-red-400 flex items-center gap-2",children:[l.jsx("span",{className:"w-2 h-2 bg-red-500 rounded-full"}),k.diffAnalysis.modifiedFiles.length," Modified Files (WILL BE LOST)"]}),l.jsxs("p",{className:"text-xs text-gray-400 mt-1 mb-2",children:["These files have changes that differ from ",l.jsx("code",{children:k.diffAnalysis.comparedAgainst})]}),l.jsx("div",{className:"bg-gray-900 rounded p-2 max-h-32 overflow-y-auto",children:l.jsxs("ul",{className:"text-xs text-red-300 font-mono space-y-0.5",children:[k.diffAnalysis.modifiedFiles.slice(0,20).map((C,q)=>l.jsxs("li",{className:"truncate",children:["• ",C]},q)),k.diffAnalysis.modifiedFiles.length>20&&l.jsxs("li",{className:"text-gray-500",children:["...and ",k.diffAnalysis.modifiedFiles.length-20," more"]})]})})]}),k.diffAnalysis.newFiles.length>0&&l.jsxs("div",{className:"bg-orange-900/30 border border-orange-700/50 rounded p-3",children:[l.jsxs("h4",{className:"text-sm font-medium text-orange-400 flex items-center gap-2",children:[l.jsx("span",{className:"w-2 h-2 bg-orange-500 rounded-full"}),k.diffAnalysis.newFiles.length," New Files (WILL BE LOST)"]}),l.jsxs("p",{className:"text-xs text-gray-400 mt-1 mb-2",children:["These files don't exist in ",l.jsx("code",{children:k.diffAnalysis.comparedAgainst})]}),l.jsx("div",{className:"bg-gray-900 rounded p-2 max-h-24 overflow-y-auto",children:l.jsxs("ul",{className:"text-xs text-orange-300 font-mono space-y-0.5",children:[k.diffAnalysis.newFiles.slice(0,15).map((C,q)=>l.jsxs("li",{className:"truncate",children:["+ ",C]},q)),k.diffAnalysis.newFiles.length>15&&l.jsxs("li",{className:"text-gray-500",children:["...and ",k.diffAnalysis.newFiles.length-15," more"]})]})})]}),k.diffAnalysis.unchangedFiles.length>0&&l.jsxs("div",{className:"bg-green-900/30 border border-green-700/50 rounded p-3",children:[l.jsxs("h4",{className:"text-sm font-medium text-green-400 flex items-center gap-2",children:[l.jsx("span",{className:"w-2 h-2 bg-green-500 rounded-full"}),k.diffAnalysis.unchangedFiles.length," Unchanged Files (safe to delete)"]}),l.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["These files are identical to ",l.jsx("code",{children:k.diffAnalysis.comparedAgainst})," and will be recreated."]})]}),k.diffAnalysis.modifiedFiles.length===0&&k.diffAnalysis.newFiles.length===0&&l.jsxs("div",{className:"bg-green-900/30 border border-green-700/50 rounded p-3",children:[l.jsx("p",{className:"text-green-400 text-sm font-medium",children:"✓ No unique changes detected"}),l.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["All analyzed files match ",l.jsx("code",{children:k.diffAnalysis.comparedAgainst}),". Safe to clean without backup."]})]})]}),((I=k.diffAnalysis)==null?void 0:I.error)&&l.jsxs("div",{className:"bg-yellow-900/30 border border-yellow-700/50 rounded p-3",children:[l.jsx("p",{className:"text-yellow-400 text-sm font-medium",children:"⚠️ Could not analyze changes"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:k.diffAnalysis.error}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Recommend creating a backup to be safe."})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-700 rounded p-3",children:[l.jsxs("p",{className:"text-gray-400 text-xs",children:[l.jsx("strong",{children:"Path:"})," ",l.jsx("code",{className:"bg-gray-800 px-1 rounded",children:k.workspacePath})]}),l.jsxs("p",{className:"text-gray-400 text-xs mt-1",children:[l.jsx("strong",{children:"Size:"})," ",k.totalSize," • ",k.fileCount," files analyzed"]})]}),l.jsx("div",{className:"border-t border-gray-700 pt-4",children:l.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:h,onChange:C=>d(C.target.checked),className:"mt-1 w-4 h-4 rounded border-gray-600 bg-gray-700 text-blue-500 focus:ring-blue-500"}),l.jsxs("div",{children:[l.jsx("span",{className:"text-white text-sm font-medium",children:"Create backup before cleaning"}),l.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:["Files will be copied to: ",l.jsxs("code",{className:"bg-gray-900 px-1 rounded",children:[".backup-feature-",e.identifier.toLowerCase(),"-*"]})]}),l.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"You can manually restore files from the backup after the new workspace is created."})]})]})}),l.jsxs("details",{className:"group",children:[l.jsx("summary",{className:"text-xs text-gray-500 cursor-pointer hover:text-gray-400",children:"What causes corrupted workspaces?"}),l.jsx("div",{className:"mt-2 bg-blue-900/30 border border-blue-700/50 rounded p-3",children:l.jsxs("ul",{className:"text-xs text-gray-400 space-y-1 list-disc list-inside",children:[l.jsxs("li",{children:["Interrupted ",l.jsx("code",{children:"pan workspace create"})," command"]}),l.jsxs("li",{children:["Manual deletion of the ",l.jsx("code",{children:".git"})," file"]}),l.jsx("li",{children:"Disk space issues during workspace creation"}),l.jsx("li",{children:"Git worktree pruning from the main repository"})]})})]})]}):l.jsx("p",{className:"text-gray-400",children:"Failed to load preview"})}),l.jsxs("div",{className:"px-4 py-3 border-t border-gray-700 flex justify-end gap-3",children:[l.jsx("button",{onClick:()=>c(!1),className:"px-4 py-2 text-gray-400 hover:text-white text-sm",children:"Cancel"}),l.jsx("button",{onClick:M,disabled:E.isPending||b,className:"px-4 py-2 bg-yellow-600 hover:bg-yellow-500 disabled:bg-yellow-800 text-white text-sm rounded flex items-center gap-2",children:E.isPending?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"w-4 h-4 animate-spin"}),h?"Backing up & Cleaning...":"Cleaning..."]}):l.jsxs(l.Fragment,{children:[l.jsx(bn,{className:"w-4 h-4"}),h?"Backup & Recreate":"Delete & Recreate"]})})]}),E.isError&&l.jsx("div",{className:"px-4 py-2 bg-red-900/30 border-t border-red-700",children:l.jsx("p",{className:"text-red-400 text-sm",children:E.error instanceof Error?E.error.message:"Failed to clean workspace"})})]})})]})}async function mT(){const e=await fetch("/api/activity");if(!e.ok)throw new Error("Failed to fetch activity");return e.json()}function gT({status:e}){switch(e){case"running":return l.jsx(Se,{className:"w-4 h-4 text-blue-400 animate-spin"});case"completed":return l.jsx(Fa,{className:"w-4 h-4 text-green-400"});case"failed":return l.jsx(Cu,{className:"w-4 h-4 text-red-400"})}}function vT(e){return new Date(e).toLocaleTimeString()}function yT({onClose:e}){const{data:t,isLoading:r}=he({queryKey:["activity"],queryFn:mT,refetchInterval:1e3});return l.jsxs("div",{className:"flex flex-col h-full bg-gray-800 border-l border-gray-700",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-700 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(wi,{className:"w-5 h-5 text-blue-400"}),l.jsx("h2",{className:"font-medium text-white",children:"Activity Log"})]}),l.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white p-1",children:l.jsx(Vt,{className:"w-4 h-4"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:r?l.jsx("div",{className:"flex items-center justify-center h-32 text-gray-400",children:l.jsx(Se,{className:"w-6 h-6 animate-spin"})}):!t||t.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-32 text-gray-500",children:[l.jsx(wi,{className:"w-8 h-8 mb-2 opacity-50"}),l.jsx("p",{className:"text-sm",children:"No activity yet"}),l.jsx("p",{className:"text-xs mt-1",children:"Start an agent or create a workspace to see output here"})]}):l.jsx("div",{className:"divide-y divide-gray-700",children:t.map(n=>l.jsxs("div",{className:"p-3",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(gT,{status:n.status}),l.jsx("code",{className:"text-sm text-white font-mono flex-1 truncate",children:n.command}),l.jsx("span",{className:"text-xs text-gray-500",children:vT(n.timestamp)})]}),l.jsx("pre",{className:"bg-gray-900 rounded p-2 text-xs text-gray-300 font-mono overflow-x-auto max-h-96 overflow-y-auto",children:n.output.length>0?n.output.join(`
|
|
496
|
+
`):n.status==="running"?"Waiting for output...":"No output"}),l.jsx("div",{className:"mt-2 flex items-center gap-2",children:l.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${n.status==="running"?"bg-blue-900/50 text-blue-400":n.status==="completed"?"bg-green-900/50 text-green-400":"bg-red-900/50 text-red-400"}`,children:n.status})})]},n.id))})})]})}async function _T(){const e=await fetch("/api/cloister/status");if(!e.ok)throw new Error("Failed to fetch Cloister status");return e.json()}async function xT(){const e=await fetch("/api/cloister/config");if(!e.ok)throw new Error("Failed to fetch Cloister config");return e.json()}async function wT(e){if(!(await fetch("/api/cloister/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to update Cloister config")}async function ST(){if(!(await fetch("/api/cloister/start",{method:"POST"})).ok)throw new Error("Failed to start Cloister")}async function bT(){if(!(await fetch("/api/cloister/stop",{method:"POST"})).ok)throw new Error("Failed to stop Cloister")}async function CT(){const e=await fetch("/api/cloister/emergency-stop",{method:"POST"});if(!e.ok)throw new Error("Failed to execute emergency stop");return e.json()}function kT(){const[e,t]=S.useState(!1),[r,n]=S.useState(!1),[i,s]=S.useState(!1),o=Jt(),{data:a,refetch:u}=he({queryKey:["cloister-status"],queryFn:_T,refetchInterval:1e4}),{data:c}=he({queryKey:["cloister-config"],queryFn:xT}),h=ue({mutationFn:wT,onSuccess:()=>{o.invalidateQueries({queryKey:["cloister-config"]})}}),d=async()=>{s(!0);try{a!=null&&a.running?await bT():await ST(),await u()}finally{s(!1)}},f=async()=>{await CT(),t(!1),u()},p=()=>{c&&h.mutate({startup:{auto_start:!c.startup.auto_start}})};if(!a)return null;const m=a.summary.warning>0||a.summary.stuck>0,y=a.agentsNeedingAttention.length;return l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[a.running?l.jsx(xw,{className:"w-5 h-5 text-green-400"}):l.jsx(S2,{className:"w-5 h-5 text-gray-500"}),l.jsx("span",{className:"text-sm text-gray-300",children:a.running?"Cloister: Running":"Cloister: Stopped"})]}),a.running&&a.summary.total>0&&l.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[a.summary.active>0&&l.jsxs("span",{className:"text-green-400",children:["🟢 ",a.summary.active]}),a.summary.stale>0&&l.jsxs("span",{className:"text-yellow-400",children:["🟡 ",a.summary.stale]}),a.summary.warning>0&&l.jsxs("span",{className:"text-orange-400",children:["🟠 ",a.summary.warning]}),a.summary.stuck>0&&l.jsxs("span",{className:"text-red-400",children:["🔴 ",a.summary.stuck]})]}),m&&l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 bg-orange-500/20 rounded-lg border border-orange-500/30",children:[l.jsx(Mn,{className:"w-4 h-4 text-orange-400"}),l.jsxs("span",{className:"text-xs text-orange-300",children:[y," agent",y!==1?"s":""," need attention"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:d,disabled:i,className:`px-3 py-1 rounded text-xs transition-colors ${i?"bg-gray-600 text-gray-400 cursor-wait":a.running?"bg-gray-700 text-gray-300 hover:bg-gray-600":"bg-blue-600 text-white hover:bg-blue-700"}`,children:i?a.running?"Stopping...":"Starting...":a.running?"Pause":"Start"}),e?l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 bg-red-600/20 rounded border border-red-600/30",children:[l.jsx("span",{className:"text-xs text-red-300",children:"Confirm?"}),l.jsx("button",{onClick:f,className:"px-2 py-0.5 rounded text-xs bg-red-600 text-white hover:bg-red-700",children:"Yes"}),l.jsx("button",{onClick:()=>t(!1),className:"px-2 py-0.5 rounded text-xs bg-gray-700 text-gray-300 hover:bg-gray-600",children:"No"})]}):l.jsx("button",{onClick:()=>t(!0),className:"px-3 py-1 rounded text-xs bg-red-600/20 text-red-400 border border-red-600/30 hover:bg-red-600/30 transition-colors",title:"Emergency stop - kill all agents",children:l.jsx(P2,{className:"w-4 h-4"})}),l.jsxs("div",{className:"relative",children:[l.jsx("button",{onClick:()=>n(!r),className:`px-2 py-1 rounded text-xs transition-colors ${r?"bg-gray-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600"}`,title:"Cloister settings",children:l.jsx(U2,{className:"w-4 h-4"})}),r&&l.jsx("div",{className:"absolute right-0 top-full mt-2 w-56 bg-gray-800 border border-gray-700 rounded-lg shadow-lg z-50",children:l.jsxs("div",{className:"p-3",children:[l.jsx("div",{className:"text-xs text-gray-400 font-medium mb-2",children:"Settings"}),l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer hover:bg-gray-700/50 rounded px-2 py-1.5 -mx-2",children:[l.jsx("input",{type:"checkbox",checked:(c==null?void 0:c.startup.auto_start)??!0,onChange:p,disabled:h.isPending,className:"w-4 h-4 rounded border-gray-600 bg-gray-700 text-blue-500 focus:ring-blue-500 focus:ring-offset-gray-800"}),l.jsx("span",{className:"text-sm text-gray-300",children:"Auto-start on dashboard launch"})]})]})})]})]})]})}function my(e){const t=new Date(e),r=t.toLocaleString("default",{month:"short"}),n=t.getDate(),i=t.getHours().toString().padStart(2,"0"),s=t.getMinutes().toString().padStart(2,"0"),o=t.getSeconds().toString().padStart(2,"0");return`${r} ${n}, ${i}:${s}:${o}`}async function NT(e=50){const t=await fetch(`/api/handoffs?limit=${e}`);if(!t.ok)throw new Error("Failed to fetch handoffs");return t.json()}async function ET(){const e=await fetch("/api/handoffs/stats");if(!e.ok)throw new Error("Failed to fetch handoff stats");return e.json()}async function jT(e=50){const t=await fetch(`/api/specialist-handoffs?limit=${e}`);if(!t.ok)throw new Error("Failed to fetch specialist handoffs");return t.json()}async function PT(){const e=await fetch("/api/specialist-handoffs/stats");if(!e.ok)throw new Error("Failed to fetch specialist handoff stats");return e.json()}const gy={opus:"text-purple-400 bg-purple-900/20 border-purple-500/30",sonnet:"text-blue-400 bg-blue-900/20 border-blue-500/30",haiku:"text-green-400 bg-green-900/20 border-green-500/30"},RT={stuck_escalation:"Stuck Escalation",planning_complete:"Planning Complete",test_failure:"Test Failure",task_complete:"Task Complete",manual:"Manual"},DT={stuck_escalation:"text-red-400",planning_complete:"text-green-400",test_failure:"text-orange-400",task_complete:"text-blue-400",manual:"text-gray-400"},vy={"review-agent":"text-purple-400 bg-purple-900/20 border-purple-500/30","test-agent":"text-green-400 bg-green-900/20 border-green-500/30","merge-agent":"text-blue-400 bg-blue-900/20 border-blue-500/30","issue-agent":"text-cyan-400 bg-cyan-900/20 border-cyan-500/30"},MT={queued:"text-yellow-400",processing:"text-blue-400",completed:"text-green-400",failed:"text-red-400"},TT={urgent:"text-red-400",high:"text-orange-400",normal:"text-blue-400",low:"text-gray-400"};function LT(){var u,c,h,d,f;const{data:e,isLoading:t}=he({queryKey:["handoffs"],queryFn:()=>NT(50),refetchInterval:1e4}),{data:r,isLoading:n}=he({queryKey:["handoff-stats"],queryFn:ET,refetchInterval:3e4}),{data:i,isLoading:s}=he({queryKey:["specialist-handoffs"],queryFn:()=>jT(50),refetchInterval:1e4}),{data:o,isLoading:a}=he({queryKey:["specialist-handoff-stats"],queryFn:PT,refetchInterval:3e4});return t||n||s||a?l.jsx("div",{className:"p-6",children:l.jsx("div",{className:"text-gray-400",children:"Loading handoff data..."})}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Model Handoffs"}),l.jsx("p",{className:"text-gray-400",children:"History of automatic and manual model handoffs across agents"})]}),r&&l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg border border-gray-700",children:[l.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"Total Handoffs"}),l.jsx("div",{className:"text-2xl font-bold text-white",children:r.totalHandoffs})]}),l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg border border-gray-700",children:[l.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"Success Rate"}),l.jsxs("div",{className:"text-2xl font-bold text-green-400",children:[(r.successRate*100).toFixed(0),"%"]})]}),l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg border border-gray-700",children:[l.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"Most Common Trigger"}),l.jsx("div",{className:"text-sm font-medium text-white",children:((u=Object.entries(r.byTrigger).sort((p,m)=>m[1]-p[1])[0])==null?void 0:u[0])||"N/A"}),l.jsxs("div",{className:"text-xs text-gray-500",children:[((c=Object.entries(r.byTrigger).sort((p,m)=>m[1]-p[1])[0])==null?void 0:c[1])||0," times"]})]}),l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg border border-gray-700",children:[l.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"Most Popular Target"}),l.jsx("div",{className:"text-sm font-medium text-white",children:((h=Object.entries(r.byModel.to).sort((p,m)=>m[1]-p[1])[0])==null?void 0:h[0])||"N/A"}),l.jsxs("div",{className:"text-xs text-gray-500",children:[((d=Object.entries(r.byModel.to).sort((p,m)=>m[1]-p[1])[0])==null?void 0:d[1])||0," handoffs"]})]})]}),l.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 overflow-hidden",children:[l.jsx("div",{className:"p-4 border-b border-gray-700",children:l.jsx("h3",{className:"text-lg font-semibold text-white",children:"Recent Handoffs"})}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"bg-gray-750 text-left text-sm text-gray-400",children:[l.jsx("th",{className:"px-4 py-3",children:"Timestamp"}),l.jsx("th",{className:"px-4 py-3",children:"Agent"}),l.jsx("th",{className:"px-4 py-3",children:"Transition"}),l.jsx("th",{className:"px-4 py-3",children:"Trigger"}),l.jsx("th",{className:"px-4 py-3",children:"Reason"}),l.jsx("th",{className:"px-4 py-3",children:"Cost"}),l.jsx("th",{className:"px-4 py-3",children:"Status"})]})}),l.jsx("tbody",{className:"text-sm",children:e&&e.handoffs.length>0?e.handoffs.map((p,m)=>l.jsxs("tr",{className:"border-t border-gray-700 hover:bg-gray-750",children:[l.jsx("td",{className:"px-4 py-3 text-gray-400",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(za,{className:"w-3 h-3"}),my(p.timestamp)]})}),l.jsxs("td",{className:"px-4 py-3",children:[l.jsx("div",{className:"font-medium text-white",children:p.agentId}),l.jsx("div",{className:"text-xs text-gray-500",children:p.issueId})]}),l.jsx("td",{className:"px-4 py-3",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`px-2 py-0.5 text-xs rounded border ${gy[p.from.model]||"text-gray-400 bg-gray-700"}`,children:p.from.model}),l.jsx(lf,{className:"w-3 h-3 text-gray-500"}),l.jsx("span",{className:`px-2 py-0.5 text-xs rounded border ${gy[p.to.model]||"text-gray-400 bg-gray-700"}`,children:p.to.model})]})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:`text-xs ${DT[p.trigger]||"text-gray-400"}`,children:RT[p.trigger]||p.trigger})}),l.jsx("td",{className:"px-4 py-3 text-gray-300 max-w-xs truncate",children:p.reason}),l.jsx("td",{className:"px-4 py-3 text-emerald-400",children:p.context.costAtHandoff!==void 0?`$${p.context.costAtHandoff.toFixed(4)}`:"-"}),l.jsx("td",{className:"px-4 py-3",children:p.success?l.jsx("span",{className:"text-green-400 text-xs",children:"✓ Success"}):l.jsx("span",{className:"text-red-400 text-xs",title:p.errorMessage,children:"✗ Failed"})})]},`${p.timestamp}-${m}`)):l.jsx("tr",{children:l.jsx("td",{colSpan:7,className:"px-4 py-8 text-center text-gray-500",children:"No handoffs recorded yet"})})})]})})]}),l.jsxs("div",{className:"mt-12",children:[l.jsxs("div",{className:"mb-6",children:[l.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Specialist Handoffs"}),l.jsx("p",{className:"text-gray-400",children:"Queue-based work handoffs between specialist agents (review, test, merge)"})]}),o&&l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg border border-gray-700",children:[l.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"Today's Handoffs"}),l.jsx("div",{className:"text-2xl font-bold text-white",children:o.todayCount})]}),l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg border border-gray-700",children:[l.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"Queue Depth"}),l.jsx("div",{className:"text-2xl font-bold text-orange-400",children:o.queueDepth})]}),l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg border border-gray-700",children:[l.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"Success Rate"}),l.jsxs("div",{className:"text-2xl font-bold text-green-400",children:[(o.successRate*100).toFixed(0),"%"]})]}),l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg border border-gray-700",children:[l.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"Most Active"}),l.jsx("div",{className:"text-sm font-medium text-white",children:((f=Object.entries(o.bySpecialist).map(([p,m])=>({name:p,total:m.sent+m.received})).sort((p,m)=>m.total-p.total)[0])==null?void 0:f.name)||"N/A"})]})]}),l.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 overflow-hidden mt-6",children:[l.jsx("div",{className:"p-4 border-b border-gray-700",children:l.jsx("h3",{className:"text-lg font-semibold text-white",children:"Recent Specialist Handoffs"})}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"bg-gray-750 text-left text-sm text-gray-400",children:[l.jsx("th",{className:"px-4 py-3",children:"Timestamp"}),l.jsx("th",{className:"px-4 py-3",children:"Issue"}),l.jsx("th",{className:"px-4 py-3",children:"Transition"}),l.jsx("th",{className:"px-4 py-3",children:"Priority"}),l.jsx("th",{className:"px-4 py-3",children:"Status"}),l.jsx("th",{className:"px-4 py-3",children:"Workspace"})]})}),l.jsx("tbody",{className:"text-sm",children:i&&i.handoffs.length>0?i.handoffs.map(p=>{var m,y;return l.jsxs("tr",{className:"border-t border-gray-700 hover:bg-gray-750",children:[l.jsx("td",{className:"px-4 py-3 text-gray-400",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(za,{className:"w-3 h-3"}),my(p.timestamp)]})}),l.jsxs("td",{className:"px-4 py-3",children:[l.jsx("div",{className:"font-medium text-white",children:p.issueId}),((m=p.context)==null?void 0:m.branch)&&l.jsx("div",{className:"text-xs text-gray-500",children:p.context.branch})]}),l.jsx("td",{className:"px-4 py-3",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`px-2 py-0.5 text-xs rounded border ${vy[p.fromSpecialist]||"text-gray-400 bg-gray-700"}`,children:p.fromSpecialist}),l.jsx(lf,{className:"w-3 h-3 text-gray-500"}),l.jsx("span",{className:`px-2 py-0.5 text-xs rounded border ${vy[p.toSpecialist]||"text-gray-400 bg-gray-700"}`,children:p.toSpecialist})]})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:`text-xs ${TT[p.priority]}`,children:p.priority})}),l.jsxs("td",{className:"px-4 py-3",children:[l.jsx("span",{className:`text-xs ${MT[p.status]}`,children:p.status}),p.result&&l.jsxs("span",{className:"ml-2 text-xs text-gray-500",children:["(",p.result,")"]})]}),l.jsx("td",{className:"px-4 py-3 text-gray-400 text-xs",children:((y=p.context)==null?void 0:y.workspace)||"-"})]},p.id)}):l.jsx("tr",{children:l.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-500",children:"No specialist handoffs recorded yet"})})})]})})]})]})]})}function AT({request:e,isOpen:t,onConfirm:r,onDeny:n,onClose:i}){return!t||!e?null:l.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg shadow-2xl w-full max-w-md mx-4",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-700",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Mn,{className:"w-5 h-5 text-orange-400"}),l.jsx("h3",{className:"text-lg font-semibold text-white",children:"Confirmation Required"})]}),l.jsx("button",{onClick:i,className:"text-gray-400 hover:text-gray-300 transition-colors",children:l.jsx(Vt,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"p-4 space-y-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"Agent:"}),l.jsx("p",{className:"text-base text-white font-medium",children:e.agentId})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"Action:"}),l.jsx("p",{className:"text-base text-white font-medium",children:e.action})]}),e.details&&l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"Details:"}),l.jsx("p",{className:"text-sm text-gray-300 bg-gray-900/50 p-2 rounded border border-gray-700",children:e.details})]}),l.jsx("div",{className:"mt-4 p-3 bg-orange-500/10 border border-orange-500/30 rounded",children:l.jsx("p",{className:"text-sm text-orange-200",children:"⚠️ This action cannot be undone. Please confirm that you want to proceed."})})]}),l.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-gray-700 bg-gray-900/30",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 rounded text-sm bg-gray-700 text-gray-300 hover:bg-gray-600 transition-colors",children:"Deny"}),l.jsx("button",{onClick:r,className:"px-4 py-2 rounded text-sm bg-orange-600 text-white hover:bg-orange-700 transition-colors font-medium",children:"Confirm"})]})]})})}async function OT(){const e=await fetch("/api/metrics/summary");if(!e.ok)throw new Error("Failed to fetch metrics summary");return e.json()}async function IT(){const e=await fetch("/api/handoffs/stats");if(!e.ok)throw new Error("Failed to fetch handoff stats");return e.json()}async function BT(){const e=await fetch("/api/specialist-handoffs/stats");if(!e.ok)throw new Error("Failed to fetch specialist handoff stats");return e.json()}function FT(){const{data:e}=he({queryKey:["metrics-summary"],queryFn:OT,refetchInterval:3e4}),{data:t}=he({queryKey:["handoff-stats"],queryFn:IT,refetchInterval:3e4}),{data:r}=he({queryKey:["specialist-handoff-stats"],queryFn:BT,refetchInterval:3e4});if(!e)return null;const n=t?Object.values(t.byTrigger).reduce((i,s)=>i+s,0):0;return l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6",children:[l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex items-center justify-between mb-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(sl,{className:"w-5 h-5 text-green-400"}),l.jsx("span",{className:"text-sm text-gray-400",children:"Cost Today"})]})}),l.jsxs("div",{className:"text-2xl font-bold text-white",children:["$",e.today.totalCost.toFixed(2)]}),e.topSpenders.agents.length>0&&l.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:["Top: ",e.topSpenders.agents[0].agentId," ($",e.topSpenders.agents[0].cost.toFixed(2),")"]})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex items-center justify-between mb-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Tw,{className:"w-5 h-5 text-blue-400"}),l.jsx("span",{className:"text-sm text-gray-400",children:"Agents"})]})}),l.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.today.activeCount," / ",e.today.agentCount]}),l.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[e.today.activeCount," active, ",e.today.agentCount-e.today.activeCount," ","idle"]})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex items-center justify-between mb-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Mn,{className:"w-5 h-5 text-red-400"}),l.jsx("span",{className:"text-sm text-gray-400",children:"Stuck Agents"})]})}),l.jsx("div",{className:"text-2xl font-bold text-white",children:e.today.stuckCount}),l.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[e.today.warningCount," warnings"]})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex items-center justify-between mb-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ma,{className:"w-5 h-5 text-cyan-400"}),l.jsx("span",{className:"text-sm text-gray-400",children:"Specialist Handoffs"})]})}),l.jsx("div",{className:"text-2xl font-bold text-white",children:(r==null?void 0:r.todayCount)??0}),l.jsx("div",{className:"mt-2 text-xs text-gray-500",children:r?`${(r.successRate*100).toFixed(0)}% success rate`:"No data"})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex items-center justify-between mb-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Dw,{className:"w-5 h-5 text-purple-400"}),l.jsx("span",{className:"text-sm text-gray-400",children:"Cost Escalations"})]})}),l.jsx("div",{className:"text-2xl font-bold text-white",children:n}),l.jsx("div",{className:"mt-2 text-xs text-gray-500",children:t?`${(t.successRate*100).toFixed(0)}% success rate`:"No data"})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-4",children:[l.jsx("div",{className:"flex items-center justify-between mb-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(L2,{className:"w-5 h-5 text-orange-400"}),l.jsx("span",{className:"text-sm text-gray-400",children:"Queue Depth"})]})}),l.jsx("div",{className:"text-2xl font-bold text-white",children:(r==null?void 0:r.queueDepth)??0}),l.jsx("div",{className:"mt-2 text-xs text-gray-500",children:(r==null?void 0:r.queueDepth)===0?"All clear":`${r==null?void 0:r.queueDepth} pending`})]})]})}async function zT(){const e=await fetch("/api/metrics/summary");if(!e.ok)throw new Error("Failed to fetch metrics summary");return e.json()}async function $T(){const e=await fetch("/api/metrics/costs");if(!e.ok)throw new Error("Failed to fetch cost metrics");return e.json()}function HT(){const{data:e}=he({queryKey:["metrics-summary"],queryFn:zT,refetchInterval:3e4}),{data:t}=he({queryKey:["metrics-costs"],queryFn:$T,refetchInterval:3e4});return l.jsxs("div",{className:"p-6 overflow-auto h-full",children:[l.jsx("h1",{className:"text-3xl font-bold text-white mb-6",children:"Metrics Dashboard"}),e&&l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx(sl,{className:"w-6 h-6 text-green-400"}),l.jsx("h3",{className:"text-lg font-semibold text-white",children:"Cost Today"})]}),l.jsxs("div",{className:"text-3xl font-bold text-white mb-2",children:["$",e.today.totalCost.toFixed(2)]}),l.jsx("div",{className:"text-sm text-gray-400",children:"Daily total"})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx(Dw,{className:"w-6 h-6 text-blue-400"}),l.jsx("h3",{className:"text-lg font-semibold text-white",children:"Active Agents"})]}),l.jsx("div",{className:"text-3xl font-bold text-white mb-2",children:e.today.activeCount}),l.jsxs("div",{className:"text-sm text-gray-400",children:["of ",e.today.agentCount," total"]})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx(Mn,{className:"w-6 h-6 text-red-400"}),l.jsx("h3",{className:"text-lg font-semibold text-white",children:"Stuck Agents"})]}),l.jsx("div",{className:"text-3xl font-bold text-white mb-2",children:e.today.stuckCount}),l.jsxs("div",{className:"text-sm text-gray-400",children:[e.today.warningCount," warnings"]})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx(hm,{className:"w-6 h-6 text-purple-400"}),l.jsx("h3",{className:"text-lg font-semibold text-white",children:"Handoffs Today"})]}),l.jsx("div",{className:"text-3xl font-bold text-white mb-2",children:"-"}),l.jsx("div",{className:"text-sm text-gray-400",children:"Coming soon"})]})]}),t&&l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8",children:[l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-6",children:[l.jsx("h3",{className:"text-xl font-semibold text-white mb-4",children:"Top Agents by Cost"}),l.jsxs("div",{className:"space-y-3",children:[t.topAgents.slice(0,10).map((r,n)=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-900/50 rounded",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-lg font-bold text-gray-500",children:["#",n+1]}),l.jsx("span",{className:"text-white font-mono text-sm",children:r.agentId})]}),l.jsxs("span",{className:"text-green-400 font-semibold",children:["$",r.cost.toFixed(2)]})]},r.agentId)),t.topAgents.length===0&&l.jsx("div",{className:"text-center text-gray-500 py-8",children:"No cost data yet"})]})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-6",children:[l.jsx("h3",{className:"text-xl font-semibold text-white mb-4",children:"Top Issues by Cost"}),l.jsxs("div",{className:"space-y-3",children:[t.topIssues.slice(0,10).map((r,n)=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-900/50 rounded",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-lg font-bold text-gray-500",children:["#",n+1]}),l.jsx("span",{className:"text-white font-mono text-sm",children:r.issueId})]}),l.jsxs("span",{className:"text-green-400 font-semibold",children:["$",r.cost.toFixed(2)]})]},r.issueId)),t.topIssues.length===0&&l.jsx("div",{className:"text-center text-gray-500 py-8",children:"No cost data yet"})]})]})]}),l.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg p-6",children:[l.jsx("h3",{className:"text-xl font-semibold text-white mb-4",children:"Historical Trends"}),l.jsxs("div",{className:"text-center text-gray-500 py-16",children:[l.jsx("p",{className:"mb-2",children:"Charts coming soon"}),l.jsx("p",{className:"text-sm",children:"Cost over time, handoff success rates, and more"})]})]})]})}var yy=1,WT=.9,UT=.8,qT=.17,Uh=.1,qh=.999,KT=.9999,VT=.99,QT=/[\\\/_+.#"@\[\(\{&]/,YT=/[\\\/_+.#"@\[\(\{&]/g,XT=/[\s-]/,x1=/[\s-]/g;function op(e,t,r,n,i,s,o){if(s===t.length)return i===e.length?yy:VT;var a=`${i},${s}`;if(o[a]!==void 0)return o[a];for(var u=n.charAt(s),c=r.indexOf(u,i),h=0,d,f,p,m;c>=0;)d=op(e,t,r,n,c+1,s+1,o),d>h&&(c===i?d*=yy:QT.test(e.charAt(c-1))?(d*=UT,p=e.slice(i,c-1).match(YT),p&&i>0&&(d*=Math.pow(qh,p.length))):XT.test(e.charAt(c-1))?(d*=WT,m=e.slice(i,c-1).match(x1),m&&i>0&&(d*=Math.pow(qh,m.length))):(d*=qT,i>0&&(d*=Math.pow(qh,c-i))),e.charAt(c)!==t.charAt(s)&&(d*=KT)),(d<Uh&&r.charAt(c-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(c-1)!==n.charAt(s))&&(f=op(e,t,r,n,c+1,s+2,o),f*Uh>d&&(d=f*Uh)),d>h&&(h=d),c=r.indexOf(u,c+1);return o[a]=h,h}function _y(e){return e.toLowerCase().replace(x1," ")}function GT(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,op(e,t,_y(e),_y(t),0,0,{})}function yi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function xy(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Si(...e){return t=>{let r=!1;const n=e.map(i=>{const s=xy(i,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){const s=n[i];typeof s=="function"?s():xy(e[i],null)}}}}function gs(...e){return S.useCallback(Si(...e),e)}function JT(e,t){const r=S.createContext(t),n=s=>{const{children:o,...a}=s,u=S.useMemo(()=>a,Object.values(a));return l.jsx(r.Provider,{value:u,children:o})};n.displayName=e+"Provider";function i(s){const o=S.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,i]}function ZT(e,t=[]){let r=[];function n(s,o){const a=S.createContext(o),u=r.length;r=[...r,o];const c=d=>{var g;const{scope:f,children:p,...m}=d,y=((g=f==null?void 0:f[e])==null?void 0:g[u])||a,w=S.useMemo(()=>m,Object.values(m));return l.jsx(y.Provider,{value:w,children:p})};c.displayName=s+"Provider";function h(d,f){var y;const p=((y=f==null?void 0:f[e])==null?void 0:y[u])||a,m=S.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,h]}const i=()=>{const s=r.map(o=>S.createContext(o));return function(a){const u=(a==null?void 0:a[e])||s;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[n,eL(i,...t)]}function eL(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:u,scopeName:c})=>{const d=u(s)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Ka=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},tL=mp[" useId ".trim().toString()]||(()=>{}),rL=0;function Nn(e){const[t,r]=S.useState(tL());return Ka(()=>{r(n=>n??String(rL++))},[e]),t?`radix-${t}`:""}var nL=mp[" useInsertionEffect ".trim().toString()]||Ka;function iL({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,s,o]=sL({defaultProp:t,onChange:r}),a=e!==void 0,u=a?e:i;{const h=S.useRef(e!==void 0);S.useEffect(()=>{const d=h.current;d!==a&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=a},[a,n])}const c=S.useCallback(h=>{var d;if(a){const f=oL(h)?h(e):h;f!==e&&((d=o.current)==null||d.call(o,f))}else s(h)},[a,e,s,o]);return[u,c]}function sL({defaultProp:e,onChange:t}){const[r,n]=S.useState(e),i=S.useRef(r),s=S.useRef(t);return nL(()=>{s.current=t},[t]),S.useEffect(()=>{var o;i.current!==r&&((o=s.current)==null||o.call(s,r),i.current=r)},[r,i]),[r,n,s]}function oL(e){return typeof e=="function"}function fl(e){const t=aL(e),r=S.forwardRef((n,i)=>{const{children:s,...o}=n,a=S.Children.toArray(s),u=a.find(cL);if(u){const c=u.props.children,h=a.map(d=>d===u?S.Children.count(c)>1?S.Children.only(null):S.isValidElement(c)?c.props.children:null:d);return l.jsx(t,{...o,ref:i,children:S.isValidElement(c)?S.cloneElement(c,void 0,h):null})}return l.jsx(t,{...o,ref:i,children:s})});return r.displayName=`${e}.Slot`,r}function aL(e){const t=S.forwardRef((r,n)=>{const{children:i,...s}=r;if(S.isValidElement(i)){const o=hL(i),a=uL(s,i.props);return i.type!==S.Fragment&&(a.ref=n?Si(n,o):o),S.cloneElement(i,a)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lL=Symbol("radix.slottable");function cL(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lL}function uL(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{const u=s(...a);return i(...a),u}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function hL(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var dL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],w1=dL.reduce((e,t)=>{const r=fl(`Primitive.${t}`),n=S.forwardRef((i,s)=>{const{asChild:o,...a}=i,u=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fL(e,t){e&&ds.flushSync(()=>e.dispatchEvent(t))}function Va(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function pL(e,t=globalThis==null?void 0:globalThis.document){const r=Va(e);S.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var mL="DismissableLayer",ap="dismissableLayer.update",gL="dismissableLayer.pointerDownOutside",vL="dismissableLayer.focusOutside",wy,S1=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),b1=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...u}=e,c=S.useContext(S1),[h,d]=S.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=S.useState({}),m=gs(t,E=>d(E)),y=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(w),_=h?y.indexOf(h):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,x=_>=g,k=xL(E=>{const L=E.target,F=[...c.branches].some(D=>D.contains(L));!x||F||(i==null||i(E),o==null||o(E),E.defaultPrevented||a==null||a())},f),b=wL(E=>{const L=E.target;[...c.branches].some(D=>D.contains(L))||(s==null||s(E),o==null||o(E),E.defaultPrevented||a==null||a())},f);return pL(E=>{_===c.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},f),S.useEffect(()=>{if(h)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(wy=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),Sy(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=wy)}},[h,f,r,c]),S.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),Sy())},[h,c]),S.useEffect(()=>{const E=()=>p({});return document.addEventListener(ap,E),()=>document.removeEventListener(ap,E)},[]),l.jsx(w1.div,{...u,ref:m,style:{pointerEvents:v?x?"auto":"none":void 0,...e.style},onFocusCapture:yi(e.onFocusCapture,b.onFocusCapture),onBlurCapture:yi(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:yi(e.onPointerDownCapture,k.onPointerDownCapture)})});b1.displayName=mL;var yL="DismissableLayerBranch",_L=S.forwardRef((e,t)=>{const r=S.useContext(S1),n=S.useRef(null),i=gs(t,n);return S.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),l.jsx(w1.div,{...e,ref:i})});_L.displayName=yL;function xL(e,t=globalThis==null?void 0:globalThis.document){const r=Va(e),n=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let u=function(){C1(gL,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function wL(e,t=globalThis==null?void 0:globalThis.document){const r=Va(e),n=S.useRef(!1);return S.useEffect(()=>{const i=s=>{s.target&&!n.current&&C1(vL,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Sy(){const e=new CustomEvent(ap);document.dispatchEvent(e)}function C1(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?fL(i,s):i.dispatchEvent(s)}var SL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bL=SL.reduce((e,t)=>{const r=fl(`Primitive.${t}`),n=S.forwardRef((i,s)=>{const{asChild:o,...a}=i,u=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Kh="focusScope.autoFocusOnMount",Vh="focusScope.autoFocusOnUnmount",by={bubbles:!1,cancelable:!0},CL="FocusScope",k1=S.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,u]=S.useState(null),c=Va(i),h=Va(s),d=S.useRef(null),f=gs(t,y=>u(y)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(n){let y=function(v){if(p.paused||!a)return;const x=v.target;a.contains(x)?d.current=x:Un(d.current,{select:!0})},w=function(v){if(p.paused||!a)return;const x=v.relatedTarget;x!==null&&(a.contains(x)||Un(d.current,{select:!0}))},g=function(v){if(document.activeElement===document.body)for(const k of v)k.removedNodes.length>0&&Un(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",w);const _=new MutationObserver(g);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",w),_.disconnect()}}},[n,a,p.paused]),S.useEffect(()=>{if(a){ky.add(p);const y=document.activeElement;if(!a.contains(y)){const g=new CustomEvent(Kh,by);a.addEventListener(Kh,c),a.dispatchEvent(g),g.defaultPrevented||(kL(RL(N1(a)),{select:!0}),document.activeElement===y&&Un(a))}return()=>{a.removeEventListener(Kh,c),setTimeout(()=>{const g=new CustomEvent(Vh,by);a.addEventListener(Vh,h),a.dispatchEvent(g),g.defaultPrevented||Un(y??document.body,{select:!0}),a.removeEventListener(Vh,h),ky.remove(p)},0)}}},[a,c,h,p]);const m=S.useCallback(y=>{if(!r&&!n||p.paused)return;const w=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,g=document.activeElement;if(w&&g){const _=y.currentTarget,[v,x]=NL(_);v&&x?!y.shiftKey&&g===x?(y.preventDefault(),r&&Un(v,{select:!0})):y.shiftKey&&g===v&&(y.preventDefault(),r&&Un(x,{select:!0})):g===_&&y.preventDefault()}},[r,n,p.paused]);return l.jsx(bL.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});k1.displayName=CL;function kL(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Un(n,{select:t}),document.activeElement!==r)return}function NL(e){const t=N1(e),r=Cy(t,e),n=Cy(t.reverse(),e);return[r,n]}function N1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Cy(e,t){for(const r of e)if(!EL(r,{upTo:t}))return r}function EL(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jL(e){return e instanceof HTMLInputElement&&"select"in e}function Un(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&jL(e)&&t&&e.select()}}var ky=PL();function PL(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Ny(e,t),e.unshift(t)},remove(t){var r;e=Ny(e,t),(r=e[0])==null||r.resume()}}}function Ny(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function RL(e){return e.filter(t=>t.tagName!=="A")}var DL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ML=DL.reduce((e,t)=>{const r=fl(`Primitive.${t}`),n=S.forwardRef((i,s)=>{const{asChild:o,...a}=i,u=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),TL="Portal",E1=S.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[i,s]=S.useState(!1);Ka(()=>s(!0),[]);const o=r||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Ak.createPortal(l.jsx(ML.div,{...n,ref:t}),o):null});E1.displayName=TL;function LL(e,t){return S.useReducer((r,n)=>t[r][n]??r,e)}var Iu=e=>{const{present:t,children:r}=e,n=AL(t),i=typeof r=="function"?r({present:n.isPresent}):S.Children.only(r),s=gs(n.ref,OL(i));return typeof r=="function"||n.isPresent?S.cloneElement(i,{ref:s}):null};Iu.displayName="Presence";function AL(e){const[t,r]=S.useState(),n=S.useRef(null),i=S.useRef(e),s=S.useRef("none"),o=e?"mounted":"unmounted",[a,u]=LL(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=Yl(n.current);s.current=a==="mounted"?c:"none"},[a]),Ka(()=>{const c=n.current,h=i.current;if(h!==e){const f=s.current,p=Yl(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(h&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Ka(()=>{if(t){let c;const h=t.ownerDocument.defaultView??window,d=p=>{const y=Yl(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",c=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},f=p=>{p.target===t&&(s.current=Yl(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Yl(e){return(e==null?void 0:e.animationName)||"none"}function OL(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var IL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pl=IL.reduce((e,t)=>{const r=fl(`Primitive.${t}`),n=S.forwardRef((i,s)=>{const{asChild:o,...a}=i,u=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Qh=0;function BL(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ey()),document.body.insertAdjacentElement("beforeend",e[1]??Ey()),Qh++,()=>{Qh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qh--}},[])}function Ey(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var en=function(){return en=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},en.apply(this,arguments)};function j1(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function FL(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}var Sc="right-scroll-bar-position",bc="width-before-scroll-bar",zL="with-scroll-bars-hidden",$L="--removed-body-scroll-bar-size";function Yh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function HL(e,t){var r=S.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=t,r.facade}var WL=typeof window<"u"?S.useLayoutEffect:S.useEffect,jy=new WeakMap;function UL(e,t){var r=HL(null,function(n){return e.forEach(function(i){return Yh(i,n)})});return WL(function(){var n=jy.get(r);if(n){var i=new Set(n),s=new Set(e),o=r.current;i.forEach(function(a){s.has(a)||Yh(a,null)}),s.forEach(function(a){i.has(a)||Yh(a,o)})}jy.set(r,e)},[e]),r}function qL(e){return e}function KL(e,t){t===void 0&&(t=qL);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var o=t(s,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(s),o=r}var u=function(){var h=o;o=[],h.forEach(s)},c=function(){return Promise.resolve().then(u)};c(),r={push:function(h){o.push(h),c()},filter:function(h){return o=o.filter(h),r}}}};return i}function VL(e){e===void 0&&(e={});var t=KL(null);return t.options=en({async:!0,ssr:!1},e),t}var P1=function(e){var t=e.sideCar,r=j1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return S.createElement(n,en({},r))};P1.isSideCarExport=!0;function QL(e,t){return e.useMedium(t),P1}var R1=VL(),Xh=function(){},Bu=S.forwardRef(function(e,t){var r=S.useRef(null),n=S.useState({onScrollCapture:Xh,onWheelCapture:Xh,onTouchMoveCapture:Xh}),i=n[0],s=n[1],o=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,y=e.inert,w=e.allowPinchZoom,g=e.as,_=g===void 0?"div":g,v=e.gapMode,x=j1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,b=UL([r,t]),E=en(en({},x),i);return S.createElement(S.Fragment,null,h&&S.createElement(k,{sideCar:R1,removeScrollBar:c,shards:d,noRelative:p,noIsolation:m,inert:y,setCallbacks:s,allowPinchZoom:!!w,lockRef:r,gapMode:v}),o?S.cloneElement(S.Children.only(a),en(en({},E),{ref:b})):S.createElement(_,en({},E,{className:u,ref:b}),a))});Bu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bu.classNames={fullWidth:bc,zeroRight:Sc};var YL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=YL();return t&&e.setAttribute("nonce",t),e}function GL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ZL=function(){var e=0,t=null;return{add:function(r){e==0&&(t=XL())&&(GL(t,r),JL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eA=function(){var e=ZL();return function(t,r){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},D1=function(){var e=eA(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},tA={left:0,top:0,right:0,gap:0},Gh=function(e){return parseInt(e||"",10)||0},rA=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Gh(r),Gh(n),Gh(i)]},nA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return tA;var t=rA(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},iA=D1(),Js="data-scroll-locked",sA=function(e,t,r,n){var i=e.left,s=e.top,o=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
497
|
+
.`.concat(zL,` {
|
|
498
|
+
overflow: hidden `).concat(n,`;
|
|
499
|
+
padding-right: `).concat(a,"px ").concat(n,`;
|
|
500
|
+
}
|
|
501
|
+
body[`).concat(Js,`] {
|
|
502
|
+
overflow: hidden `).concat(n,`;
|
|
503
|
+
overscroll-behavior: contain;
|
|
504
|
+
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
505
|
+
padding-left: `.concat(i,`px;
|
|
506
|
+
padding-top: `).concat(s,`px;
|
|
507
|
+
padding-right: `).concat(o,`px;
|
|
508
|
+
margin-left:0;
|
|
509
|
+
margin-top:0;
|
|
510
|
+
margin-right: `).concat(a,"px ").concat(n,`;
|
|
511
|
+
`),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.`).concat(Sc,` {
|
|
515
|
+
right: `).concat(a,"px ").concat(n,`;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.`).concat(bc,` {
|
|
519
|
+
margin-right: `).concat(a,"px ").concat(n,`;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.`).concat(Sc," .").concat(Sc,` {
|
|
523
|
+
right: 0 `).concat(n,`;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.`).concat(bc," .").concat(bc,` {
|
|
527
|
+
margin-right: 0 `).concat(n,`;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
body[`).concat(Js,`] {
|
|
531
|
+
`).concat($L,": ").concat(a,`px;
|
|
532
|
+
}
|
|
533
|
+
`)},Py=function(){var e=parseInt(document.body.getAttribute(Js)||"0",10);return isFinite(e)?e:0},oA=function(){S.useEffect(function(){return document.body.setAttribute(Js,(Py()+1).toString()),function(){var e=Py()-1;e<=0?document.body.removeAttribute(Js):document.body.setAttribute(Js,e.toString())}},[])},aA=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;oA();var s=S.useMemo(function(){return nA(i)},[i]);return S.createElement(iA,{styles:sA(s,!t,i,r?"":"!important")})},lp=!1;if(typeof window<"u")try{var Xl=Object.defineProperty({},"passive",{get:function(){return lp=!0,!0}});window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{lp=!1}var bs=lp?{passive:!1}:!1,lA=function(e){return e.tagName==="TEXTAREA"},M1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!lA(e)&&r[t]==="visible")},cA=function(e){return M1(e,"overflowY")},uA=function(e){return M1(e,"overflowX")},Ry=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=T1(e,n);if(i){var s=L1(e,n),o=s[1],a=s[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},hA=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},dA=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},T1=function(e,t){return e==="v"?cA(t):uA(t)},L1=function(e,t){return e==="v"?hA(t):dA(t)},fA=function(e,t){return e==="h"&&t==="rtl"?-1:1},pA=function(e,t,r,n,i){var s=fA(e,window.getComputedStyle(t).direction),o=s*n,a=r.target,u=t.contains(a),c=!1,h=o>0,d=0,f=0;do{if(!a)break;var p=L1(e,a),m=p[0],y=p[1],w=p[2],g=y-w-s*m;(m||g)&&T1(e,a)&&(d+=g,f+=m);var _=a.parentNode;a=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(c=!0),c},Gl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dy=function(e){return[e.deltaX,e.deltaY]},My=function(e){return e&&"current"in e?e.current:e},mA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gA=function(e){return`
|
|
534
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
535
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
536
|
+
`)},vA=0,Cs=[];function yA(e){var t=S.useRef([]),r=S.useRef([0,0]),n=S.useRef(),i=S.useState(vA++)[0],s=S.useState(D1)[0],o=S.useRef(e);S.useEffect(function(){o.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=FL([e.lockRef.current],(e.shards||[]).map(My),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=S.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var g=Gl(y),_=r.current,v="deltaX"in y?y.deltaX:_[0]-g[0],x="deltaY"in y?y.deltaY:_[1]-g[1],k,b=y.target,E=Math.abs(v)>Math.abs(x)?"h":"v";if("touches"in y&&E==="h"&&b.type==="range")return!1;var L=window.getSelection(),F=L&&L.anchorNode,D=F?F===b||F.contains(b):!1;if(D)return!1;var A=Ry(E,b);if(!A)return!0;if(A?k=E:(k=E==="v"?"h":"v",A=Ry(E,b)),!A)return!1;if(!n.current&&"changedTouches"in y&&(v||x)&&(n.current=k),!k)return!0;var j=n.current||k;return pA(j,w,y,j==="h"?v:x)},[]),u=S.useCallback(function(y){var w=y;if(!(!Cs.length||Cs[Cs.length-1]!==s)){var g="deltaY"in w?Dy(w):Gl(w),_=t.current.filter(function(k){return k.name===w.type&&(k.target===w.target||w.target===k.shadowParent)&&mA(k.delta,g)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var v=(o.current.shards||[]).map(My).filter(Boolean).filter(function(k){return k.contains(w.target)}),x=v.length>0?a(w,v[0]):!o.current.noIsolation;x&&w.cancelable&&w.preventDefault()}}},[]),c=S.useCallback(function(y,w,g,_){var v={name:y,delta:w,target:g,should:_,shadowParent:_A(g)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(x){return x!==v})},1)},[]),h=S.useCallback(function(y){r.current=Gl(y),n.current=void 0},[]),d=S.useCallback(function(y){c(y.type,Dy(y),y.target,a(y,e.lockRef.current))},[]),f=S.useCallback(function(y){c(y.type,Gl(y),y.target,a(y,e.lockRef.current))},[]);S.useEffect(function(){return Cs.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,bs),document.addEventListener("touchmove",u,bs),document.addEventListener("touchstart",h,bs),function(){Cs=Cs.filter(function(y){return y!==s}),document.removeEventListener("wheel",u,bs),document.removeEventListener("touchmove",u,bs),document.removeEventListener("touchstart",h,bs)}},[]);var p=e.removeScrollBar,m=e.inert;return S.createElement(S.Fragment,null,m?S.createElement(s,{styles:gA(i)}):null,p?S.createElement(aA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _A(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xA=QL(R1,yA);var A1=S.forwardRef(function(e,t){return S.createElement(Bu,en({},e,{ref:t,sideCar:xA}))});A1.classNames=Bu.classNames;var wA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ks=new WeakMap,Jl=new WeakMap,Zl={},Jh=0,O1=function(e){return e&&(e.host||O1(e.parentNode))},SA=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=O1(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},bA=function(e,t,r,n){var i=SA(t,Array.isArray(e)?e:[e]);Zl[r]||(Zl[r]=new WeakMap);var s=Zl[r],o=[],a=new Set,u=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var h=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))h(f);else try{var p=f.getAttribute(n),m=p!==null&&p!=="false",y=(ks.get(f)||0)+1,w=(s.get(f)||0)+1;ks.set(f,y),s.set(f,w),o.push(f),y===1&&m&&Jl.set(f,!0),w===1&&f.setAttribute(r,"true"),m||f.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return h(t),a.clear(),Jh++,function(){o.forEach(function(d){var f=ks.get(d)-1,p=s.get(d)-1;ks.set(d,f),s.set(d,p),f||(Jl.has(d)||d.removeAttribute(n),Jl.delete(d)),p||d.removeAttribute(r)}),Jh--,Jh||(ks=new WeakMap,ks=new WeakMap,Jl=new WeakMap,Zl={})}},CA=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=wA(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),bA(n,i,r,"aria-hidden")):function(){return null}},Fu="Dialog",[I1]=ZT(Fu),[kA,zr]=I1(Fu),B1=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=S.useRef(null),u=S.useRef(null),[c,h]=iL({prop:n,defaultProp:i??!1,onChange:s,caller:Fu});return l.jsx(kA,{scope:t,triggerRef:a,contentRef:u,contentId:Nn(),titleId:Nn(),descriptionId:Nn(),open:c,onOpenChange:h,onOpenToggle:S.useCallback(()=>h(d=>!d),[h]),modal:o,children:r})};B1.displayName=Fu;var F1="DialogTrigger",NA=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zr(F1,r),s=gs(t,i.triggerRef);return l.jsx(pl.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":qm(i.open),...n,ref:s,onClick:yi(e.onClick,i.onOpenToggle)})});NA.displayName=F1;var Wm="DialogPortal",[EA,z1]=I1(Wm,{forceMount:void 0}),$1=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,s=zr(Wm,t);return l.jsx(EA,{scope:t,forceMount:r,children:S.Children.map(n,o=>l.jsx(Iu,{present:r||s.open,children:l.jsx(E1,{asChild:!0,container:i,children:o})}))})};$1.displayName=Wm;var ou="DialogOverlay",H1=S.forwardRef((e,t)=>{const r=z1(ou,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=zr(ou,e.__scopeDialog);return s.modal?l.jsx(Iu,{present:n||s.open,children:l.jsx(PA,{...i,ref:t})}):null});H1.displayName=ou;var jA=fl("DialogOverlay.RemoveScroll"),PA=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zr(ou,r);return l.jsx(A1,{as:jA,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(pl.div,{"data-state":qm(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ls="DialogContent",W1=S.forwardRef((e,t)=>{const r=z1(ls,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=zr(ls,e.__scopeDialog);return l.jsx(Iu,{present:n||s.open,children:s.modal?l.jsx(RA,{...i,ref:t}):l.jsx(DA,{...i,ref:t})})});W1.displayName=ls;var RA=S.forwardRef((e,t)=>{const r=zr(ls,e.__scopeDialog),n=S.useRef(null),i=gs(t,r.contentRef,n);return S.useEffect(()=>{const s=n.current;if(s)return CA(s)},[]),l.jsx(U1,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yi(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:yi(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:yi(e.onFocusOutside,s=>s.preventDefault())})}),DA=S.forwardRef((e,t)=>{const r=zr(ls,e.__scopeDialog),n=S.useRef(!1),i=S.useRef(!1);return l.jsx(U1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=r.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),U1=S.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=zr(ls,r),u=S.useRef(null),c=gs(t,u);return BL(),l.jsxs(l.Fragment,{children:[l.jsx(k1,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(b1,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":qm(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(AA,{titleId:a.titleId}),l.jsx(IA,{contentRef:u,descriptionId:a.descriptionId})]})]})}),Um="DialogTitle",MA=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zr(Um,r);return l.jsx(pl.h2,{id:i.titleId,...n,ref:t})});MA.displayName=Um;var q1="DialogDescription",TA=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zr(q1,r);return l.jsx(pl.p,{id:i.descriptionId,...n,ref:t})});TA.displayName=q1;var K1="DialogClose",LA=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zr(K1,r);return l.jsx(pl.button,{type:"button",...n,ref:t,onClick:yi(e.onClick,()=>i.onOpenChange(!1))})});LA.displayName=K1;function qm(e){return e?"open":"closed"}var V1="DialogTitleWarning",[LO,Q1]=JT(V1,{contentName:ls,titleName:Um,docsSlug:"dialog"}),AA=({titleId:e})=>{const t=Q1(V1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
537
|
+
|
|
538
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
539
|
+
|
|
540
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},OA="DialogDescriptionWarning",IA=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Q1(OA).contentName}}.`;return S.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},BA=B1,FA=$1,zA=H1,$A=W1,HA=Symbol.for("react.lazy"),au=mp[" use ".trim().toString()];function WA(e){return typeof e=="object"&&e!==null&&"then"in e}function Y1(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===HA&&"_payload"in e&&WA(e._payload)}function UA(e){const t=qA(e),r=S.forwardRef((n,i)=>{let{children:s,...o}=n;Y1(s)&&typeof au=="function"&&(s=au(s._payload));const a=S.Children.toArray(s),u=a.find(VA);if(u){const c=u.props.children,h=a.map(d=>d===u?S.Children.count(c)>1?S.Children.only(null):S.isValidElement(c)?c.props.children:null:d);return l.jsx(t,{...o,ref:i,children:S.isValidElement(c)?S.cloneElement(c,void 0,h):null})}return l.jsx(t,{...o,ref:i,children:s})});return r.displayName=`${e}.Slot`,r}function qA(e){const t=S.forwardRef((r,n)=>{let{children:i,...s}=r;if(Y1(i)&&typeof au=="function"&&(i=au(i._payload)),S.isValidElement(i)){const o=YA(i),a=QA(s,i.props);return i.type!==S.Fragment&&(a.ref=n?Si(n,o):o),S.cloneElement(i,a)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KA=Symbol("radix.slottable");function VA(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KA}function QA(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{const u=s(...a);return i(...a),u}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function YA(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var XA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ji=XA.reduce((e,t)=>{const r=UA(`Primitive.${t}`),n=S.forwardRef((i,s)=>{const{asChild:o,...a}=i,u=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Yo='[cmdk-group=""]',Zh='[cmdk-group-items=""]',GA='[cmdk-group-heading=""]',X1='[cmdk-item=""]',Ty=`${X1}:not([aria-disabled="true"])`,cp="cmdk-item-select",Es="data-value",JA=(e,t,r)=>GT(e,t,r),G1=S.createContext(void 0),ml=()=>S.useContext(G1),J1=S.createContext(void 0),Km=()=>S.useContext(J1),Z1=S.createContext(void 0),eb=S.forwardRef((e,t)=>{let r=js(()=>{var I,C;return{search:"",value:(C=(I=e.value)!=null?I:e.defaultValue)!=null?C:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=js(()=>new Set),i=js(()=>new Map),s=js(()=>new Map),o=js(()=>new Set),a=tb(e),{label:u,children:c,value:h,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:y=!1,vimBindings:w=!0,...g}=e,_=Nn(),v=Nn(),x=Nn(),k=S.useRef(null),b=cO();cs(()=>{if(h!==void 0){let I=h.trim();r.current.value=I,E.emit()}},[h]),cs(()=>{b(6,M)},[]);let E=S.useMemo(()=>({subscribe:I=>(o.current.add(I),()=>o.current.delete(I)),snapshot:()=>r.current,setState:(I,C,q)=>{var Y,Z,oe,ke;if(!Object.is(r.current[I],C)){if(r.current[I]=C,I==="search")j(),D(),b(1,A);else if(I==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let me=document.getElementById(x);me?me.focus():(Y=document.getElementById(_))==null||Y.focus()}if(b(7,()=>{var me;r.current.selectedItemId=(me=O())==null?void 0:me.id,E.emit()}),q||b(5,M),((Z=a.current)==null?void 0:Z.value)!==void 0){let me=C??"";(ke=(oe=a.current).onValueChange)==null||ke.call(oe,me);return}}E.emit()}},emit:()=>{o.current.forEach(I=>I())}}),[]),L=S.useMemo(()=>({value:(I,C,q)=>{var Y;C!==((Y=s.current.get(I))==null?void 0:Y.value)&&(s.current.set(I,{value:C,keywords:q}),r.current.filtered.items.set(I,F(C,q)),b(2,()=>{D(),E.emit()}))},item:(I,C)=>(n.current.add(I),C&&(i.current.has(C)?i.current.get(C).add(I):i.current.set(C,new Set([I]))),b(3,()=>{j(),D(),r.current.value||A(),E.emit()}),()=>{s.current.delete(I),n.current.delete(I),r.current.filtered.items.delete(I);let q=O();b(4,()=>{j(),(q==null?void 0:q.getAttribute("id"))===I&&A(),E.emit()})}),group:I=>(i.current.has(I)||i.current.set(I,new Set),()=>{s.current.delete(I),i.current.delete(I)}),filter:()=>a.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:_,inputId:x,labelId:v,listInnerRef:k}),[]);function F(I,C){var q,Y;let Z=(Y=(q=a.current)==null?void 0:q.filter)!=null?Y:JA;return I?Z(I,r.current.search,C):0}function D(){if(!r.current.search||a.current.shouldFilter===!1)return;let I=r.current.filtered.items,C=[];r.current.filtered.groups.forEach(Y=>{let Z=i.current.get(Y),oe=0;Z.forEach(ke=>{let me=I.get(ke);oe=Math.max(me,oe)}),C.push([Y,oe])});let q=k.current;T().sort((Y,Z)=>{var oe,ke;let me=Y.getAttribute("id"),Ze=Z.getAttribute("id");return((oe=I.get(Ze))!=null?oe:0)-((ke=I.get(me))!=null?ke:0)}).forEach(Y=>{let Z=Y.closest(Zh);Z?Z.appendChild(Y.parentElement===Z?Y:Y.closest(`${Zh} > *`)):q.appendChild(Y.parentElement===q?Y:Y.closest(`${Zh} > *`))}),C.sort((Y,Z)=>Z[1]-Y[1]).forEach(Y=>{var Z;let oe=(Z=k.current)==null?void 0:Z.querySelector(`${Yo}[${Es}="${encodeURIComponent(Y[0])}"]`);oe==null||oe.parentElement.appendChild(oe)})}function A(){let I=T().find(q=>q.getAttribute("aria-disabled")!=="true"),C=I==null?void 0:I.getAttribute(Es);E.setState("value",C||void 0)}function j(){var I,C,q,Y;if(!r.current.search||a.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let Z=0;for(let oe of n.current){let ke=(C=(I=s.current.get(oe))==null?void 0:I.value)!=null?C:"",me=(Y=(q=s.current.get(oe))==null?void 0:q.keywords)!=null?Y:[],Ze=F(ke,me);r.current.filtered.items.set(oe,Ze),Ze>0&&Z++}for(let[oe,ke]of i.current)for(let me of ke)if(r.current.filtered.items.get(me)>0){r.current.filtered.groups.add(oe);break}r.current.filtered.count=Z}function M(){var I,C,q;let Y=O();Y&&(((I=Y.parentElement)==null?void 0:I.firstChild)===Y&&((q=(C=Y.closest(Yo))==null?void 0:C.querySelector(GA))==null||q.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function O(){var I;return(I=k.current)==null?void 0:I.querySelector(`${X1}[aria-selected="true"]`)}function T(){var I;return Array.from(((I=k.current)==null?void 0:I.querySelectorAll(Ty))||[])}function B(I){let C=T()[I];C&&E.setState("value",C.getAttribute(Es))}function U(I){var C;let q=O(),Y=T(),Z=Y.findIndex(ke=>ke===q),oe=Y[Z+I];(C=a.current)!=null&&C.loop&&(oe=Z+I<0?Y[Y.length-1]:Z+I===Y.length?Y[0]:Y[Z+I]),oe&&E.setState("value",oe.getAttribute(Es))}function R(I){let C=O(),q=C==null?void 0:C.closest(Yo),Y;for(;q&&!Y;)q=I>0?aO(q,Yo):lO(q,Yo),Y=q==null?void 0:q.querySelector(Ty);Y?E.setState("value",Y.getAttribute(Es)):U(I)}let W=()=>B(T().length-1),N=I=>{I.preventDefault(),I.metaKey?W():I.altKey?R(1):U(1)},$=I=>{I.preventDefault(),I.metaKey?B(0):I.altKey?R(-1):U(-1)};return S.createElement(ji.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:I=>{var C;(C=g.onKeyDown)==null||C.call(g,I);let q=I.nativeEvent.isComposing||I.keyCode===229;if(!(I.defaultPrevented||q))switch(I.key){case"n":case"j":{w&&I.ctrlKey&&N(I);break}case"ArrowDown":{N(I);break}case"p":case"k":{w&&I.ctrlKey&&$(I);break}case"ArrowUp":{$(I);break}case"Home":{I.preventDefault(),B(0);break}case"End":{I.preventDefault(),W();break}case"Enter":{I.preventDefault();let Y=O();if(Y){let Z=new Event(cp);Y.dispatchEvent(Z)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:L.inputId,id:L.labelId,style:hO},u),zu(e,I=>S.createElement(J1.Provider,{value:E},S.createElement(G1.Provider,{value:L},I))))}),ZA=S.forwardRef((e,t)=>{var r,n;let i=Nn(),s=S.useRef(null),o=S.useContext(Z1),a=ml(),u=tb(e),c=(n=(r=u.current)==null?void 0:r.forceMount)!=null?n:o==null?void 0:o.forceMount;cs(()=>{if(!c)return a.item(i,o==null?void 0:o.id)},[c]);let h=rb(i,s,[e.value,e.children,s],e.keywords),d=Km(),f=bi(b=>b.value&&b.value===h.current),p=bi(b=>c||a.filter()===!1?!0:b.search?b.filtered.items.get(i)>0:!0);S.useEffect(()=>{let b=s.current;if(!(!b||e.disabled))return b.addEventListener(cp,m),()=>b.removeEventListener(cp,m)},[p,e.onSelect,e.disabled]);function m(){var b,E;y(),(E=(b=u.current).onSelect)==null||E.call(b,h.current)}function y(){d.setState("value",h.current,!0)}if(!p)return null;let{disabled:w,value:g,onSelect:_,forceMount:v,keywords:x,...k}=e;return S.createElement(ji.div,{ref:Si(s,t),...k,id:i,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!f,"data-disabled":!!w,"data-selected":!!f,onPointerMove:w||a.getDisablePointerSelection()?void 0:y,onClick:w?void 0:m},e.children)}),eO=S.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:i,...s}=e,o=Nn(),a=S.useRef(null),u=S.useRef(null),c=Nn(),h=ml(),d=bi(p=>i||h.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);cs(()=>h.group(o),[]),rb(o,a,[e.value,e.heading,u]);let f=S.useMemo(()=>({id:o,forceMount:i}),[i]);return S.createElement(ji.div,{ref:Si(a,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},r&&S.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),zu(e,p=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},S.createElement(Z1.Provider,{value:f},p))))}),tO=S.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,i=S.useRef(null),s=bi(o=>!o.search);return!r&&!s?null:S.createElement(ji.div,{ref:Si(i,t),...n,"cmdk-separator":"",role:"separator"})}),rO=S.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,i=e.value!=null,s=Km(),o=bi(c=>c.search),a=bi(c=>c.selectedItemId),u=ml();return S.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),S.createElement(ji.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":a,id:u.inputId,type:"text",value:i?e.value:o,onChange:c=>{i||s.setState("search",c.target.value),r==null||r(c.target.value)}})}),nO=S.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...i}=e,s=S.useRef(null),o=S.useRef(null),a=bi(c=>c.selectedItemId),u=ml();return S.useEffect(()=>{if(o.current&&s.current){let c=o.current,h=s.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=c.offsetHeight;h.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(d),f.unobserve(c)}}},[]),S.createElement(ji.div,{ref:Si(s,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":n,id:u.listId},zu(e,c=>S.createElement("div",{ref:Si(o,u.listInnerRef),"cmdk-list-sizer":""},c)))}),iO=S.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:s,container:o,...a}=e;return S.createElement(BA,{open:r,onOpenChange:n},S.createElement(FA,{container:o},S.createElement(zA,{"cmdk-overlay":"",className:i}),S.createElement($A,{"aria-label":e.label,"cmdk-dialog":"",className:s},S.createElement(eb,{ref:t,...a}))))}),sO=S.forwardRef((e,t)=>bi(r=>r.filtered.count===0)?S.createElement(ji.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),oO=S.forwardRef((e,t)=>{let{progress:r,children:n,label:i="Loading...",...s}=e;return S.createElement(ji.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},zu(e,o=>S.createElement("div",{"aria-hidden":!0},o)))}),xa=Object.assign(eb,{List:nO,Item:ZA,Input:rO,Group:eO,Separator:tO,Dialog:iO,Empty:sO,Loading:oO});function aO(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function lO(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function tb(e){let t=S.useRef(e);return cs(()=>{t.current=e}),t}var cs=typeof window>"u"?S.useEffect:S.useLayoutEffect;function js(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function bi(e){let t=Km(),r=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,r,r)}function rb(e,t,r,n=[]){let i=S.useRef(),s=ml();return cs(()=>{var o;let a=(()=>{var c;for(let h of r){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(c=h.current.textContent)==null?void 0:c.trim():i.current}})(),u=n.map(c=>c.trim());s.value(e,a,u),(o=t.current)==null||o.setAttribute(Es,a),i.current=a}),i}var cO=()=>{let[e,t]=S.useState(),r=js(()=>new Map);return cs(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,i)=>{r.current.set(n,i),t({})}};function uO(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function zu({asChild:e,children:t},r){return e&&S.isValidElement(t)?S.cloneElement(uO(t),{ref:t.ref},r(t.props.children)):r(t)}var hO={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function dO(e,t,r={}){const{cycleFilter:n="current",includeCompletedFilter:i=!1,minQueryLength:s=2,maxResults:o=20,debounceMs:a=150}=r,u=Jt(),[c,h]=S.useState(e);S.useEffect(()=>{const m=setTimeout(()=>{h(e)},a);return()=>clearTimeout(m)},[e,a]);const d=u.getQueryData(["issues",n,i]),f=S.useMemo(()=>{if(!c||c.trim().length<s)return[];if(!d||d.length===0)return[];const m=c.toLowerCase().trim(),y=[];for(const w of d){if(t.sources.size>0&&w.source&&!t.sources.has(w.source)||!t.includeCompleted&&(w.status==="Done"||w.status==="Completed"||w.status==="Closed"))continue;let g=0,_=null;const v=w.identifier.toLowerCase();v===m?(g=100,_="identifier"):v.startsWith(m)?(g=80,_="identifier"):v.includes(m)&&(g=60,_="identifier");const x=w.title.toLowerCase();if(x.includes(m)){const k=x.startsWith(m)?70:50;k>g&&(g=k,_="title")}t.deepSearch&&w.description&&w.description.toLowerCase().includes(m)&&20>g&&(g=20,_="description"),g>0&&_&&y.push({issue:w,score:g,matchType:_})}return y.sort((w,g)=>g.score!==w.score?g.score-w.score:w.issue.identifier.localeCompare(g.issue.identifier)),y.slice(0,o)},[c,d,t,s,o]),p=S.useMemo(()=>{const m={};for(const y of f){const w=y.issue.source||"unknown";m[w]||(m[w]=[]),m[w].push(y)}return m},[f]);return{results:f,groupedResults:p,isSearching:e!==c,hasResults:f.length>0,resultCount:f.length}}const fO={linear:"Linear",github:"GitHub",rally:"Rally",gitlab:"GitLab",jira:"Jira",unknown:"Unknown"},pO={0:"text-gray-500",1:"text-red-500",2:"text-orange-500",3:"text-yellow-500",4:"text-blue-500"},mO={backlog:"bg-gray-600",todo:"bg-blue-600",planning:"bg-purple-600",in_progress:"bg-yellow-600",in_review:"bg-pink-600",done:"bg-green-600",canceled:"bg-gray-500"};function gO({groupedResults:e,onSelect:t,onExternalLink:r}){const n=Object.keys(e).sort();return l.jsx(l.Fragment,{children:n.map(i=>l.jsx(xa.Group,{heading:fO[i]||i,children:e[i].map(s=>{const{issue:o,matchType:a}=s,u=mn[o.status]||"backlog";return l.jsx(xa.Item,{value:o.identifier,onSelect:()=>t(o.identifier),className:"px-4 py-3 cursor-pointer hover:bg-gray-700 transition-colors border-b border-gray-750 last:border-b-0 aria-selected:bg-gray-700",children:l.jsxs("div",{className:"flex items-start gap-3",children:[o.project&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0 mt-1.5",style:{backgroundColor:o.project.color||"#6b7280"},title:o.project.name}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsxs("span",{className:"text-sm font-medium text-white flex items-center gap-1",children:[o.source==="github"&&l.jsx(fm,{className:"w-3 h-3 text-gray-400"}),l.jsx("span",{className:"text-gray-400",children:o.identifier})]}),l.jsx("span",{className:`px-2 py-0.5 rounded text-xs text-white ${mO[u]||"bg-gray-600"}`,children:o.status}),l.jsx("span",{title:`Priority ${o.priority}`,children:l.jsx(R2,{className:`w-2 h-2 fill-current ${pO[o.priority]||"text-gray-500"}`})}),a&&l.jsxs("span",{className:"text-xs text-gray-500",children:["(",a," match)"]})]}),l.jsx("p",{className:"text-sm text-gray-300 mt-1 line-clamp-2",children:o.title}),o.labels.length>0&&l.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[o.labels.slice(0,3).map(c=>l.jsx("span",{className:"text-xs bg-gray-700 text-gray-400 px-2 py-0.5 rounded",children:c},c)),o.labels.length>3&&l.jsxs("span",{className:"text-xs text-gray-500",children:["+",o.labels.length-3," more"]})]})]}),l.jsx("button",{onClick:c=>r(o.url,c),className:"p-1 text-gray-400 hover:text-blue-400 hover:bg-gray-600 rounded transition-colors shrink-0",title:"Open in tracker",children:l.jsx(ol,{className:"w-4 h-4"})})]})},o.id)})},i))})}function vO({isOpen:e,onClose:t,onSelectIssue:r,cycleFilter:n="current",includeCompletedFilter:i=!1}){const[s,o]=S.useState(""),[a,u]=S.useState({sources:new Set,includeCompleted:!1,deepSearch:!1}),{groupedResults:c,isSearching:h,hasResults:d,resultCount:f}=dO(s,a,{cycleFilter:n,includeCompletedFilter:i});S.useEffect(()=>{e||(o(""),u({sources:new Set,includeCompleted:!1,deepSearch:!1}))},[e]),S.useEffect(()=>{const w=g=>{g.key==="Escape"&&t()};if(e)return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[e,t]);const p=w=>{u(g=>{const _=new Set(g.sources);return _.has(w)?_.delete(w):_.add(w),{...g,sources:_}})},m=w=>{r(w),t()},y=(w,g)=>{g.stopPropagation(),window.open(w,"_blank","noopener,noreferrer")};return e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",children:[l.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:t}),l.jsx("div",{className:"relative bg-gray-800 rounded-xl shadow-2xl w-full max-w-2xl mx-4 max-h-[70vh] overflow-hidden flex flex-col border border-gray-700",children:l.jsxs(xa,{className:"flex flex-col h-full",shouldFilter:!1,children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-700",children:[l.jsx(H2,{className:"w-5 h-5 text-gray-400 shrink-0"}),l.jsx(xa.Input,{value:s,onValueChange:o,placeholder:"Search issues...",className:"flex-1 bg-transparent text-white placeholder-gray-400 focus:outline-none text-base",autoFocus:!0}),l.jsx("button",{onClick:t,className:"p-1 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors shrink-0",children:l.jsx(Vt,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-gray-700 bg-gray-850 flex-wrap",children:[l.jsx("span",{className:"text-xs text-gray-400",children:"Filters:"}),["linear","github","rally"].map(w=>l.jsxs("button",{onClick:()=>p(w),className:`px-2 py-1 text-xs rounded transition-colors ${a.sources.size===0||a.sources.has(w)?"bg-blue-600 text-white":"bg-gray-700 text-gray-400 hover:text-white"}`,children:[w==="github"&&l.jsx(fm,{className:"w-3 h-3 inline mr-1"}),w.charAt(0).toUpperCase()+w.slice(1)]},w)),l.jsx("div",{className:"w-px h-4 bg-gray-600"}),l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:a.includeCompleted,onChange:w=>u(g=>({...g,includeCompleted:w.target.checked})),className:"w-3 h-3 rounded border-gray-600 bg-gray-700 text-blue-600 focus:ring-blue-500 focus:ring-offset-gray-800"}),l.jsx("span",{className:"text-xs text-gray-400",children:"Show completed"})]}),l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:a.deepSearch,onChange:w=>u(g=>({...g,deepSearch:w.target.checked})),className:"w-3 h-3 rounded border-gray-600 bg-gray-700 text-blue-600 focus:ring-blue-500 focus:ring-offset-gray-800"}),l.jsx("span",{className:"text-xs text-gray-400",children:"Deep search"})]})]}),l.jsxs(xa.List,{className:"flex-1 overflow-y-auto",children:[s.length>0&&s.length<2&&l.jsx("div",{className:"px-4 py-8 text-center text-sm text-gray-400",children:"Type at least 2 characters to search"}),s.length>=2&&h&&l.jsx("div",{className:"px-4 py-8 text-center text-sm text-gray-400",children:"Searching..."}),s.length>=2&&!h&&!d&&l.jsx("div",{className:"px-4 py-8 text-center text-sm text-gray-400",children:"No issues found"}),s.length>=2&&!h&&d&&l.jsx(gO,{groupedResults:c,onSelect:m,onExternalLink:y})]}),f>0&&l.jsxs("div",{className:"px-4 py-2 border-t border-gray-700 bg-gray-850 text-xs text-gray-400 flex items-center justify-between",children:[l.jsxs("span",{children:[f," result",f!==1?"s":""]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-700 rounded text-xs",children:"↑"}),l.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-700 rounded text-xs",children:"↓"}),"navigate"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-700 rounded text-xs",children:"Enter"}),"select"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-700 rounded text-xs",children:"Esc"}),"close"]})]})]})]})})]}):null}const yO=400,_O=1200,xO=700;async function wO(){const e=await fetch("/api/agents");if(!e.ok)throw new Error("Failed to fetch agents");return e.json()}async function SO(){const e=await fetch("/api/issues");if(!e.ok)throw new Error("Failed to fetch issues");return e.json()}async function bO(){const e=await fetch("/api/confirmations");if(!e.ok)throw new Error("Failed to fetch confirmations");return e.json()}async function Ly(e,t){if(!(await fetch(`/api/confirmations/${e}/respond`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirmed:t})})).ok)throw new Error("Failed to respond to confirmation")}function CO(){const[e,t]=S.useState("kanban"),[r,n]=S.useState(null),[i,s]=S.useState(null),[o,a]=S.useState(xO),[u,c]=S.useState(!1),[h,d]=S.useState(!1),[f,p]=S.useState(null),[m,y]=S.useState(!1),w=S.useRef(null),{data:g=[]}=he({queryKey:["agents"],queryFn:wO,refetchInterval:5e3}),{data:_=[]}=he({queryKey:["issues"],queryFn:SO}),{data:v=[]}=he({queryKey:["confirmations"],queryFn:bO,refetchInterval:2e3});S.useEffect(()=>{v.length>0&&!f&&p(v[0])},[v,f]);const x=i?g.find(T=>{var B;return((B=T.issueId)==null?void 0:B.toLowerCase())===i.toLowerCase()}):null,k=i?_.find(T=>T.identifier.toLowerCase()===i.toLowerCase()):null,b=S.useCallback(T=>{T.preventDefault(),c(!0)},[]),E=S.useCallback(T=>{if(!u||!w.current)return;const U=w.current.getBoundingClientRect().right-T.clientX;a(Math.min(_O,Math.max(yO,U)))},[u]),L=S.useCallback(()=>{c(!1)},[]);S.useEffect(()=>(u&&(document.addEventListener("mousemove",E),document.addEventListener("mouseup",L),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",L),document.body.style.cursor="",document.body.style.userSelect=""}),[u,E,L]);const F=S.useCallback(()=>{d(T=>!T)},[]),D=S.useCallback(async()=>{if(f)try{await Ly(f.id,!0),p(null)}catch(T){console.error("Failed to confirm:",T)}},[f]),A=S.useCallback(async()=>{if(f)try{await Ly(f.id,!1),p(null)}catch(T){console.error("Failed to deny:",T)}},[f]),j=S.useCallback(()=>{p(null)},[]);S.useEffect(()=>{const T=B=>{B.key==="/"&&!["INPUT","TEXTAREA"].includes(B.target.tagName)&&(B.preventDefault(),y(!0))};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[]);const M=S.useCallback(T=>{s(T),t("kanban")},[]),O=h?"calc(100% - 300px)":`${o}px`;return l.jsxs("div",{className:"h-screen bg-gray-900 flex flex-col overflow-hidden",children:[l.jsx("header",{className:"bg-gray-800 border-b border-gray-700 px-6 py-4 shrink-0",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Nw,{className:"w-6 h-6 text-blue-400"}),l.jsx("h1",{className:"text-xl font-bold text-white",children:"Panopticon"})]}),l.jsx(kT,{})]}),l.jsx("nav",{className:"flex gap-2",children:[{id:"kanban",label:"Board",icon:A2},{id:"agents",label:"Agents",icon:Tw},{id:"handoffs",label:"Handoffs",icon:hm},{id:"activity",label:"Activity",icon:wi},{id:"metrics",label:"Metrics",icon:w2},{id:"skills",label:"Skills",icon:ww},{id:"health",label:"Health",icon:_o}].map(({id:T,label:B,icon:U})=>l.jsxs("button",{onClick:()=>t(T),className:`flex items-center gap-2 px-4 py-2 rounded-lg transition-colors ${e===T?"bg-blue-600 text-white":"text-gray-400 hover:text-white hover:bg-gray-700"}`,children:[l.jsx(U,{className:"w-4 h-4"}),B]},T))})]})}),l.jsxs("main",{ref:w,className:"flex-1 flex overflow-hidden",children:[e==="kanban"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`flex-1 overflow-auto p-6 ${i?"":"w-full"}`,children:[l.jsx(FT,{}),l.jsx(_3,{selectedIssue:i,onSelectIssue:s})]}),i&&x&&l.jsxs(l.Fragment,{children:[l.jsx("div",{onMouseDown:b,className:`w-1 hover:w-1.5 bg-gray-700 hover:bg-blue-500 cursor-col-resize transition-colors shrink-0 ${u?"bg-blue-500":""}`}),l.jsxs("div",{style:{width:O},className:"relative shrink-0 h-full flex flex-col",children:[l.jsx("button",{onClick:F,className:"absolute top-2 left-2 z-10 p-1.5 bg-gray-700 hover:bg-gray-600 rounded text-gray-400 hover:text-white",title:h?"Collapse panel":"Expand panel",children:h?l.jsx(B2,{className:"w-4 h-4"}):l.jsx(O2,{className:"w-4 h-4"})}),l.jsx(kP,{agent:x,issueId:i,issueUrl:k==null?void 0:k.url,onClose:()=>s(null)})]})]}),i&&!x&&k&&l.jsx("div",{className:"w-[400px] shrink-0 h-full",children:l.jsx(pT,{issue:k,onClose:()=>s(null)})})]}),e==="agents"&&l.jsx("div",{className:"p-6 w-full",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsx(gP,{selectedAgent:r,onSelectAgent:n}),r&&l.jsx(_P,{agentId:r})]})}),e==="skills"&&l.jsx("div",{className:"p-6 w-full overflow-auto",children:l.jsx(SP,{})}),e==="health"&&l.jsx("div",{className:"p-6 w-full overflow-auto",children:l.jsx(wP,{})}),e==="activity"&&l.jsx("div",{className:"w-full h-full",children:l.jsx(yT,{onClose:()=>t("kanban")})}),e==="metrics"&&l.jsx("div",{className:"w-full overflow-auto",children:l.jsx(HT,{})}),e==="handoffs"&&l.jsx("div",{className:"w-full overflow-auto",children:l.jsx(LT,{})})]}),l.jsx(AT,{request:f,isOpen:!!f,onConfirm:D,onDeny:A,onClose:j}),l.jsx(vO,{isOpen:m,onClose:()=>y(!1),onSelectIssue:M,cycleFilter:"current",includeCompletedFilter:!1})]})}const kO=new s2({defaultOptions:{queries:{refetchInterval:5e3,staleTime:2e3}}});ed.createRoot(document.getElementById("root")).render(l.jsx(s_.StrictMode,{children:l.jsx(o2,{client:kO,children:l.jsx(CO,{})})}));
|