nomoreide 0.1.37 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/claude-settings.d.ts +3 -3
- package/dist/core/claude-settings.js +12 -11
- package/dist/core/claude-settings.js.map +1 -1
- package/dist/core/config-store.d.ts +1 -0
- package/dist/core/config-store.js +7 -4
- package/dist/core/config-store.js.map +1 -1
- package/dist/core/git-manager.d.ts +1 -0
- package/dist/core/git-manager.js +13 -1
- package/dist/core/git-manager.js.map +1 -1
- package/dist/core/mcp-auth.d.ts +27 -0
- package/dist/core/mcp-auth.js +90 -0
- package/dist/core/mcp-auth.js.map +1 -0
- package/dist/core/metrics-store.d.ts +37 -0
- package/dist/core/metrics-store.js +74 -0
- package/dist/core/metrics-store.js.map +1 -0
- package/dist/web/client/assets/code-editor-BJd-TJLv.js +28 -0
- package/dist/web/client/assets/index-D84ED51b.js +139 -0
- package/dist/web/client/assets/index-D8bZZCIa.css +1 -0
- package/dist/web/client/index.html +2 -2
- package/dist/web/dashboard.d.ts +1 -1
- package/dist/web/dashboard.js +30 -6
- package/dist/web/dashboard.js.map +1 -1
- package/dist/web/routes/agent-routes.js +13 -4
- package/dist/web/routes/agent-routes.js.map +1 -1
- package/dist/web/routes/context.d.ts +2 -0
- package/dist/web/routes/context.js.map +1 -1
- package/dist/web/routes/git-routes.js +22 -1
- package/dist/web/routes/git-routes.js.map +1 -1
- package/dist/web/routes/index.js +2 -0
- package/dist/web/routes/index.js.map +1 -1
- package/dist/web/routes/metrics-routes.d.ts +3 -0
- package/dist/web/routes/metrics-routes.js +14 -0
- package/dist/web/routes/metrics-routes.js.map +1 -0
- package/dist/web/server.js +5 -0
- package/dist/web/server.js.map +1 -1
- package/package.json +8 -1
- package/dist/web/client/assets/index-BTTWTuoa.css +0 -1
- package/dist/web/client/assets/index-dPRznNOh.js +0 -139
- package/dist/web/client/assets/nomoreide-logo-B2E14b65.png +0 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function i(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(a){if(a.ep)return;a.ep=!0;const l=i(a);fetch(a.href,l)}})();function bT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Um={exports:{}},tc={};var Sx;function vT(){if(Sx)return tc;Sx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(n,a,l){var c=null;if(l!==void 0&&(c=""+l),a.key!==void 0&&(c=""+a.key),"key"in a){l={};for(var h in a)h!=="key"&&(l[h]=a[h])}else l=a;return a=l.ref,{$$typeof:e,type:n,key:c,ref:a!==void 0?a:null,props:l}}return tc.Fragment=t,tc.jsx=i,tc.jsxs=i,tc}var wx;function xT(){return wx||(wx=1,Um.exports=vT()),Um.exports}var u=xT(),Hm={exports:{}},Ue={};var Ex;function yT(){if(Ex)return Ue;Ex=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function x(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function N(O,ee,ue){this.props=O,this.context=ee,this.refs=C,this.updater=ue||y}N.prototype.isReactComponent={},N.prototype.setState=function(O,ee){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,ee,"setState")},N.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function T(){}T.prototype=N.prototype;function D(O,ee,ue){this.props=O,this.context=ee,this.refs=C,this.updater=ue||y}var A=D.prototype=new T;A.constructor=D,w(A,N.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function G(){}var j={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function H(O,ee,ue){var ie=ue.ref;return{$$typeof:e,type:O,key:ee,ref:ie!==void 0?ie:null,props:ue}}function I(O,ee){return H(O.type,ee,O.props)}function W(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function J(O){var ee={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ue){return ee[ue]})}var P=/\/+/g;function te(O,ee){return typeof O=="object"&&O!==null&&O.key!=null?J(""+O.key):ee.toString(36)}function K(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(G,G):(O.status="pending",O.then(function(ee){O.status==="pending"&&(O.status="fulfilled",O.value=ee)},function(ee){O.status==="pending"&&(O.status="rejected",O.reason=ee)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function M(O,ee,ue,ie,le){var me=typeof O;(me==="undefined"||me==="boolean")&&(O=null);var Se=!1;if(O===null)Se=!0;else switch(me){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(O.$$typeof){case e:case t:Se=!0;break;case g:return Se=O._init,M(Se(O._payload),ee,ue,ie,le)}}if(Se)return le=le(O),Se=ie===""?"."+te(O,0):ie,L(le)?(ue="",Se!=null&&(ue=Se.replace(P,"$&/")+"/"),M(le,ee,ue,"",function(nt){return nt})):le!=null&&(W(le)&&(le=I(le,ue+(le.key==null||O&&O.key===le.key?"":(""+le.key).replace(P,"$&/")+"/")+Se)),ee.push(le)),1;Se=0;var ze=ie===""?".":ie+":";if(L(O))for(var Ee=0;Ee<O.length;Ee++)ie=O[Ee],me=ze+te(ie,Ee),Se+=M(ie,ee,ue,me,le);else if(Ee=x(O),typeof Ee=="function")for(O=Ee.call(O),Ee=0;!(ie=O.next()).done;)ie=ie.value,me=ze+te(ie,Ee++),Se+=M(ie,ee,ue,me,le);else if(me==="object"){if(typeof O.then=="function")return M(K(O),ee,ue,ie,le);throw ee=String(O),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return Se}function $(O,ee,ue){if(O==null)return O;var ie=[],le=0;return M(O,ie,"","",function(me){return ee.call(ue,me,le++)}),ie}function F(O){if(O._status===-1){var ee=O._result;ee=ee(),ee.then(function(ue){(O._status===0||O._status===-1)&&(O._status=1,O._result=ue)},function(ue){(O._status===0||O._status===-1)&&(O._status=2,O._result=ue)}),O._status===-1&&(O._status=0,O._result=ee)}if(O._status===1)return O._result.default;throw O._result}var V=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},Y={map:$,forEach:function(O,ee,ue){$(O,function(){ee.apply(this,arguments)},ue)},count:function(O){var ee=0;return $(O,function(){ee++}),ee},toArray:function(O){return $(O,function(ee){return ee})||[]},only:function(O){if(!W(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ue.Activity=b,Ue.Children=Y,Ue.Component=N,Ue.Fragment=i,Ue.Profiler=a,Ue.PureComponent=D,Ue.StrictMode=n,Ue.Suspense=m,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(O){return j.H.useMemoCache(O)}},Ue.cache=function(O){return function(){return O.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(O,ee,ue){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ie=w({},O.props),le=O.key;if(ee!=null)for(me in ee.key!==void 0&&(le=""+ee.key),ee)!R.call(ee,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&ee.ref===void 0||(ie[me]=ee[me]);var me=arguments.length-2;if(me===1)ie.children=ue;else if(1<me){for(var Se=Array(me),ze=0;ze<me;ze++)Se[ze]=arguments[ze+2];ie.children=Se}return H(O.type,le,ie)},Ue.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},Ue.createElement=function(O,ee,ue){var ie,le={},me=null;if(ee!=null)for(ie in ee.key!==void 0&&(me=""+ee.key),ee)R.call(ee,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(le[ie]=ee[ie]);var Se=arguments.length-2;if(Se===1)le.children=ue;else if(1<Se){for(var ze=Array(Se),Ee=0;Ee<Se;Ee++)ze[Ee]=arguments[Ee+2];le.children=ze}if(O&&O.defaultProps)for(ie in Se=O.defaultProps,Se)le[ie]===void 0&&(le[ie]=Se[ie]);return H(O,me,le)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(O){return{$$typeof:h,render:O}},Ue.isValidElement=W,Ue.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:F}},Ue.memo=function(O,ee){return{$$typeof:f,type:O,compare:ee===void 0?null:ee}},Ue.startTransition=function(O){var ee=j.T,ue={};j.T=ue;try{var ie=O(),le=j.S;le!==null&&le(ue,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(G,V)}catch(me){V(me)}finally{ee!==null&&ue.types!==null&&(ee.types=ue.types),j.T=ee}},Ue.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ue.use=function(O){return j.H.use(O)},Ue.useActionState=function(O,ee,ue){return j.H.useActionState(O,ee,ue)},Ue.useCallback=function(O,ee){return j.H.useCallback(O,ee)},Ue.useContext=function(O){return j.H.useContext(O)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(O,ee){return j.H.useDeferredValue(O,ee)},Ue.useEffect=function(O,ee){return j.H.useEffect(O,ee)},Ue.useEffectEvent=function(O){return j.H.useEffectEvent(O)},Ue.useId=function(){return j.H.useId()},Ue.useImperativeHandle=function(O,ee,ue){return j.H.useImperativeHandle(O,ee,ue)},Ue.useInsertionEffect=function(O,ee){return j.H.useInsertionEffect(O,ee)},Ue.useLayoutEffect=function(O,ee){return j.H.useLayoutEffect(O,ee)},Ue.useMemo=function(O,ee){return j.H.useMemo(O,ee)},Ue.useOptimistic=function(O,ee){return j.H.useOptimistic(O,ee)},Ue.useReducer=function(O,ee,ue){return j.H.useReducer(O,ee,ue)},Ue.useRef=function(O){return j.H.useRef(O)},Ue.useState=function(O){return j.H.useState(O)},Ue.useSyncExternalStore=function(O,ee,ue){return j.H.useSyncExternalStore(O,ee,ue)},Ue.useTransition=function(){return j.H.useTransition()},Ue.version="19.2.6",Ue}var Cx;function B0(){return Cx||(Cx=1,Hm.exports=yT()),Hm.exports}var E=B0(),Fm={exports:{}},ic={},$m={exports:{}},Vm={};var kx;function ST(){return kx||(kx=1,(function(e){function t(M,$){var F=M.length;M.push($);e:for(;0<F;){var V=F-1>>>1,Y=M[V];if(0<a(Y,$))M[V]=$,M[F]=Y,F=V;else break e}}function i(M){return M.length===0?null:M[0]}function n(M){if(M.length===0)return null;var $=M[0],F=M.pop();if(F!==$){M[0]=F;e:for(var V=0,Y=M.length,O=Y>>>1;V<O;){var ee=2*(V+1)-1,ue=M[ee],ie=ee+1,le=M[ie];if(0>a(ue,F))ie<Y&&0>a(le,ue)?(M[V]=le,M[ie]=F,V=ie):(M[V]=ue,M[ee]=F,V=ee);else if(ie<Y&&0>a(le,F))M[V]=le,M[ie]=F,V=ie;else break e}}return $}function a(M,$){var F=M.sortIndex-$.sortIndex;return F!==0?F:M.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,h=c.now();e.unstable_now=function(){return c.now()-h}}var m=[],f=[],g=1,b=null,v=3,x=!1,y=!1,w=!1,C=!1,N=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function A(M){for(var $=i(f);$!==null;){if($.callback===null)n(f);else if($.startTime<=M)n(f),$.sortIndex=$.expirationTime,t(m,$);else break;$=i(f)}}function L(M){if(w=!1,A(M),!y)if(i(m)!==null)y=!0,G||(G=!0,J());else{var $=i(f);$!==null&&K(L,$.startTime-M)}}var G=!1,j=-1,R=5,H=-1;function I(){return C?!0:!(e.unstable_now()-H<R)}function W(){if(C=!1,G){var M=e.unstable_now();H=M;var $=!0;try{e:{y=!1,w&&(w=!1,T(j),j=-1),x=!0;var F=v;try{t:{for(A(M),b=i(m);b!==null&&!(b.expirationTime>M&&I());){var V=b.callback;if(typeof V=="function"){b.callback=null,v=b.priorityLevel;var Y=V(b.expirationTime<=M);if(M=e.unstable_now(),typeof Y=="function"){b.callback=Y,A(M),$=!0;break t}b===i(m)&&n(m),A(M)}else n(m);b=i(m)}if(b!==null)$=!0;else{var O=i(f);O!==null&&K(L,O.startTime-M),$=!1}}break e}finally{b=null,v=F,x=!1}$=void 0}}finally{$?J():G=!1}}}var J;if(typeof D=="function")J=function(){D(W)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,te=P.port2;P.port1.onmessage=W,J=function(){te.postMessage(null)}}else J=function(){N(W,0)};function K(M,$){j=N(function(){M(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var F=v;v=$;try{return M()}finally{v=F}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,$){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var F=v;v=M;try{return $()}finally{v=F}},e.unstable_scheduleCallback=function(M,$,F){var V=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?V+F:V):F=V,M){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=F+Y,M={id:g++,callback:$,priorityLevel:M,startTime:F,expirationTime:Y,sortIndex:-1},F>V?(M.sortIndex=F,t(f,M),i(m)===null&&M===i(f)&&(w?(T(j),j=-1):w=!0,K(L,F-V))):(M.sortIndex=Y,t(m,M),y||x||(y=!0,G||(G=!0,J()))),M},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(M){var $=v;return function(){var F=v;v=$;try{return M.apply(this,arguments)}finally{v=F}}}})(Vm)),Vm}var Nx;function wT(){return Nx||(Nx=1,$m.exports=ST()),$m.exports}var qm={exports:{}},ji={};var Tx;function ET(){if(Tx)return ji;Tx=1;var e=B0();function t(m){var f="https://react.dev/errors/"+m;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var n={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(m,f,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:b==null?null:""+b,children:m,containerInfo:f,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,f){if(m==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return ji.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,ji.createPortal=function(m,f){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return l(m,f,null,g)},ji.flushSync=function(m){var f=c.T,g=n.p;try{if(c.T=null,n.p=2,m)return m()}finally{c.T=f,n.p=g,n.d.f()}},ji.preconnect=function(m,f){typeof m=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,n.d.C(m,f))},ji.prefetchDNS=function(m){typeof m=="string"&&n.d.D(m)},ji.preinit=function(m,f){if(typeof m=="string"&&f&&typeof f.as=="string"){var g=f.as,b=h(g,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?n.d.S(m,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:x}):g==="script"&&n.d.X(m,{crossOrigin:b,integrity:v,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},ji.preinitModule=function(m,f){if(typeof m=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=h(f.as,f.crossOrigin);n.d.M(m,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&n.d.M(m)},ji.preload=function(m,f){if(typeof m=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,b=h(g,f.crossOrigin);n.d.L(m,g,{crossOrigin:b,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},ji.preloadModule=function(m,f){if(typeof m=="string")if(f){var g=h(f.as,f.crossOrigin);n.d.m(m,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else n.d.m(m)},ji.requestFormReset=function(m){n.d.r(m)},ji.unstable_batchedUpdates=function(m,f){return m(f)},ji.useFormState=function(m,f,g){return c.H.useFormState(m,f,g)},ji.useFormStatus=function(){return c.H.useHostTransitionStatus()},ji.version="19.2.6",ji}var Ax;function L2(){if(Ax)return qm.exports;Ax=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qm.exports=ET(),qm.exports}var Mx;function CT(){if(Mx)return ic;Mx=1;var e=wT(),t=B0(),i=L2();function n(s){var r="https://react.dev/errors/"+s;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+s+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function l(s){var r=s,o=s;if(s.alternate)for(;r.return;)r=r.return;else{s=r;do r=s,(r.flags&4098)!==0&&(o=r.return),s=r.return;while(s)}return r.tag===3?o:null}function c(s){if(s.tag===13){var r=s.memoizedState;if(r===null&&(s=s.alternate,s!==null&&(r=s.memoizedState)),r!==null)return r.dehydrated}return null}function h(s){if(s.tag===31){var r=s.memoizedState;if(r===null&&(s=s.alternate,s!==null&&(r=s.memoizedState)),r!==null)return r.dehydrated}return null}function m(s){if(l(s)!==s)throw Error(n(188))}function f(s){var r=s.alternate;if(!r){if(r=l(s),r===null)throw Error(n(188));return r!==s?null:s}for(var o=s,d=r;;){var p=o.return;if(p===null)break;var _=p.alternate;if(_===null){if(d=p.return,d!==null){o=d;continue}break}if(p.child===_.child){for(_=p.child;_;){if(_===o)return m(p),s;if(_===d)return m(p),r;_=_.sibling}throw Error(n(188))}if(o.return!==d.return)o=p,d=_;else{for(var S=!1,k=p.child;k;){if(k===o){S=!0,o=p,d=_;break}if(k===d){S=!0,d=p,o=_;break}k=k.sibling}if(!S){for(k=_.child;k;){if(k===o){S=!0,o=_,d=p;break}if(k===d){S=!0,d=_,o=p;break}k=k.sibling}if(!S)throw Error(n(189))}}if(o.alternate!==d)throw Error(n(190))}if(o.tag!==3)throw Error(n(188));return o.stateNode.current===o?s:r}function g(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s;for(s=s.child;s!==null;){if(r=g(s),r!==null)return r;s=s.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),D=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function J(s){return s===null||typeof s!="object"?null:(s=W&&s[W]||s["@@iterator"],typeof s=="function"?s:null)}var P=Symbol.for("react.client.reference");function te(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===P?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case N:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case G:return"SuspenseList";case H:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case y:return"Portal";case D:return s.displayName||"Context";case T:return(s._context.displayName||"Context")+".Consumer";case A:var r=s.render;return s=s.displayName,s||(s=r.displayName||r.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case j:return r=s.displayName||null,r!==null?r:te(s.type)||"Memo";case R:r=s._payload,s=s._init;try{return te(s(r))}catch{}}return null}var K=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},V=[],Y=-1;function O(s){return{current:s}}function ee(s){0>Y||(s.current=V[Y],V[Y]=null,Y--)}function ue(s,r){Y++,V[Y]=s.current,s.current=r}var ie=O(null),le=O(null),me=O(null),Se=O(null);function ze(s,r){switch(ue(me,r),ue(le,s),ue(ie,null),r.nodeType){case 9:case 11:s=(s=r.documentElement)&&(s=s.namespaceURI)?q1(s):0;break;default:if(s=r.tagName,r=r.namespaceURI)r=q1(r),s=K1(r,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}ee(ie),ue(ie,s)}function Ee(){ee(ie),ee(le),ee(me)}function nt(s){s.memoizedState!==null&&ue(Se,s);var r=ie.current,o=K1(r,s.type);r!==o&&(ue(le,s),ue(ie,o))}function lt(s){le.current===s&&(ee(ie),ee(le)),Se.current===s&&(ee(Se),Zl._currentValue=F)}var ct,Be;function Ft(s){if(ct===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);ct=r&&r[1]||"",Be=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ct+s+Be}var Jr=!1;function vn(s,r){if(!s||Jr)return"";Jr=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(r){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(se){var Q=se}Reflect.construct(s,[],oe)}else{try{oe.call()}catch(se){Q=se}s.call(oe.prototype)}}else{try{throw Error()}catch(se){Q=se}(oe=s())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(se){if(se&&Q&&typeof se.stack=="string")return[se.stack,Q.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=d.DetermineComponentFrameRoot(),S=_[0],k=_[1];if(S&&k){var B=S.split(`
|
|
4
|
+
`),Z=k.split(`
|
|
5
|
+
`);for(p=d=0;d<B.length&&!B[d].includes("DetermineComponentFrameRoot");)d++;for(;p<Z.length&&!Z[p].includes("DetermineComponentFrameRoot");)p++;if(d===B.length||p===Z.length)for(d=B.length-1,p=Z.length-1;1<=d&&0<=p&&B[d]!==Z[p];)p--;for(;1<=d&&0<=p;d--,p--)if(B[d]!==Z[p]){if(d!==1||p!==1)do if(d--,p--,0>p||B[d]!==Z[p]){var ne=`
|
|
6
|
+
`+B[d].replace(" at new "," at ");return s.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",s.displayName)),ne}while(1<=d&&0<=p);break}}}finally{Jr=!1,Error.prepareStackTrace=o}return(o=s?s.displayName||s.name:"")?Ft(o):""}function qa(s,r){switch(s.tag){case 26:case 27:case 5:return Ft(s.type);case 16:return Ft("Lazy");case 13:return s.child!==r&&r!==null?Ft("Suspense Fallback"):Ft("Suspense");case 19:return Ft("SuspenseList");case 0:case 15:return vn(s.type,!1);case 11:return vn(s.type.render,!1);case 1:return vn(s.type,!0);case 31:return Ft("Activity");default:return""}}function ea(s){try{var r="",o=null;do r+=qa(s,o),o=s,s=s.return;while(s);return r}catch(d){return`
|
|
7
|
+
Error generating stack: `+d.message+`
|
|
8
|
+
`+d.stack}}var ta=Object.prototype.hasOwnProperty,nr=e.unstable_scheduleCallback,xn=e.unstable_cancelCallback,rl=e.unstable_shouldYield,Ka=e.unstable_requestPaint,Ot=e.unstable_now,yn=e.unstable_getCurrentPriorityLevel,xi=e.unstable_ImmediatePriority,Sn=e.unstable_UserBlockingPriority,wn=e.unstable_NormalPriority,Ga=e.unstable_LowPriority,rr=e.unstable_IdlePriority,al=e.log,Wa=e.unstable_setDisableYieldValue,En=null,fi=null;function ys(s){if(typeof al=="function"&&Wa(s),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(En,s)}catch{}}var yi=Math.clz32?Math.clz32:Ya,ol=Math.log,ia=Math.LN2;function Ya(s){return s>>>=0,s===0?32:31-(ol(s)/ia|0)|0}var it=256,$s=262144,os=4194304;function Ri(s){var r=s&42;if(r!==0)return r;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function z(s,r,o){var d=s.pendingLanes;if(d===0)return 0;var p=0,_=s.suspendedLanes,S=s.pingedLanes;s=s.warmLanes;var k=d&134217727;return k!==0?(d=k&~_,d!==0?p=Ri(d):(S&=k,S!==0?p=Ri(S):o||(o=k&~s,o!==0&&(p=Ri(o))))):(k=d&~_,k!==0?p=Ri(k):S!==0?p=Ri(S):o||(o=d&~s,o!==0&&(p=Ri(o)))),p===0?0:r!==0&&r!==p&&(r&_)===0&&(_=p&-p,o=r&-r,_>=o||_===32&&(o&4194048)!==0)?r:p}function re(s,r){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&r)===0}function be(s,r){switch(s){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ie(){var s=os;return os<<=1,(os&62914560)===0&&(os=4194304),s}function Ct(s){for(var r=[],o=0;31>o;o++)r.push(s);return r}function yt(s,r){s.pendingLanes|=r,r!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Ne(s,r,o,d,p,_){var S=s.pendingLanes;s.pendingLanes=o,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=o,s.entangledLanes&=o,s.errorRecoveryDisabledLanes&=o,s.shellSuspendCounter=0;var k=s.entanglements,B=s.expirationTimes,Z=s.hiddenUpdates;for(o=S&~o;0<o;){var ne=31-yi(o),oe=1<<ne;k[ne]=0,B[ne]=-1;var Q=Z[ne];if(Q!==null)for(Z[ne]=null,ne=0;ne<Q.length;ne++){var se=Q[ne];se!==null&&(se.lane&=-536870913)}o&=~oe}d!==0&&xe(s,d,0),_!==0&&p===0&&s.tag!==0&&(s.suspendedLanes|=_&~(S&~r))}function xe(s,r,o){s.pendingLanes|=r,s.suspendedLanes&=~r;var d=31-yi(r);s.entangledLanes|=r,s.entanglements[d]=s.entanglements[d]|1073741824|o&261930}function Le(s,r){var o=s.entangledLanes|=r;for(s=s.entanglements;o;){var d=31-yi(o),p=1<<d;p&r|s[d]&r&&(s[d]|=r),o&=~p}}function $t(s,r){var o=r&-r;return o=(o&42)!==0?1:Mt(o),(o&(s.suspendedLanes|r))!==0?0:o}function Mt(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Cn(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Xa(){var s=$.p;return s!==0?s:(s=window.event,s===void 0?32:px(s.type))}function Za(s,r){var o=$.p;try{return $.p=s,r()}finally{$.p=o}}var en=Math.random().toString(36).slice(2),Vt="__reactFiber$"+en,Di="__reactProps$"+en,ar="__reactContainer$"+en,ll="__reactEvents$"+en,su="__reactListeners$"+en,Qa="__reactHandles$"+en,nu="__reactResources$"+en,sa="__reactMarker$"+en;function cl(s){delete s[Vt],delete s[Di],delete s[ll],delete s[su],delete s[Qa]}function Pi(s){var r=s[Vt];if(r)return r;for(var o=s.parentNode;o;){if(r=o[ar]||o[Vt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(s=J1(s);s!==null;){if(o=s[Vt])return o;s=J1(s)}return r}s=o,o=s.parentNode}return null}function kn(s){if(s=s[Vt]||s[ar]){var r=s.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return s}return null}function or(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s.stateNode;throw Error(n(33))}function lr(s){var r=s[nu];return r||(r=s[nu]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Yt(s){s[sa]=!0}var ru=new Set,na={};function Nn(s,r){he(s,r),he(s+"Capture",r)}function he(s,r){for(na[s]=r,s=0;s<r.length;s++)ru.add(r[s])}var Me=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ye={},ht={};function qt(s){return ta.call(ht,s)?!0:ta.call(Ye,s)?!1:Me.test(s)?ht[s]=!0:(Ye[s]=!0,!1)}function Oi(s,r,o){if(qt(r))if(o===null)s.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":s.removeAttribute(r);return;case"boolean":var d=r.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){s.removeAttribute(r);return}}s.setAttribute(r,""+o)}}function ls(s,r,o){if(o===null)s.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(r);return}s.setAttribute(r,""+o)}}function Wi(s,r,o,d){if(d===null)s.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttributeNS(r,o,""+d)}}function Et(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function cs(s){var r=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function au(s,r,o){var d=Object.getOwnPropertyDescriptor(s.constructor.prototype,r);if(!s.hasOwnProperty(r)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,_=d.set;return Object.defineProperty(s,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){o=""+S,_.call(this,S)}}),Object.defineProperty(s,r,{enumerable:d.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){s._valueTracker=null,delete s[r]}}}}function Ja(s){if(!s._valueTracker){var r=cs(s)?"checked":"value";s._valueTracker=au(s,r,""+s[r])}}function ul(s){if(!s)return!1;var r=s._valueTracker;if(!r)return!0;var o=r.getValue(),d="";return s&&(d=cs(s)?s.checked?"true":"false":s.value),s=d,s!==o?(r.setValue(s),!0):!1}function eo(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Ih=/[\n"\\]/g;function Yi(s){return s.replace(Ih,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function dl(s,r,o,d,p,_,S,k){s.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?s.type=S:s.removeAttribute("type"),r!=null?S==="number"?(r===0&&s.value===""||s.value!=r)&&(s.value=""+Et(r)):s.value!==""+Et(r)&&(s.value=""+Et(r)):S!=="submit"&&S!=="reset"||s.removeAttribute("value"),r!=null?to(s,S,Et(r)):o!=null?to(s,S,Et(o)):d!=null&&s.removeAttribute("value"),p==null&&_!=null&&(s.defaultChecked=!!_),p!=null&&(s.checked=p&&typeof p!="function"&&typeof p!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?s.name=""+Et(k):s.removeAttribute("name")}function ra(s,r,o,d,p,_,S,k){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),r!=null||o!=null){if(!(_!=="submit"&&_!=="reset"||r!=null)){Ja(s);return}o=o!=null?""+Et(o):"",r=r!=null?""+Et(r):o,k||r===s.value||(s.value=r),s.defaultValue=r}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,s.checked=k?s.checked:!!d,s.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(s.name=S),Ja(s)}function to(s,r,o){r==="number"&&eo(s.ownerDocument)===s||s.defaultValue===""+o||(s.defaultValue=""+o)}function Si(s,r,o,d){if(s=s.options,r){r={};for(var p=0;p<o.length;p++)r["$"+o[p]]=!0;for(o=0;o<s.length;o++)p=r.hasOwnProperty("$"+s[o].value),s[o].selected!==p&&(s[o].selected=p),p&&d&&(s[o].defaultSelected=!0)}else{for(o=""+Et(o),r=null,p=0;p<s.length;p++){if(s[p].value===o){s[p].selected=!0,d&&(s[p].defaultSelected=!0);return}r!==null||s[p].disabled||(r=s[p])}r!==null&&(r.selected=!0)}}function ou(s,r,o){if(r!=null&&(r=""+Et(r),r!==s.value&&(s.value=r),o==null)){s.defaultValue!==r&&(s.defaultValue=r);return}s.defaultValue=o!=null?""+Et(o):""}function io(s,r,o,d){if(r==null){if(d!=null){if(o!=null)throw Error(n(92));if(K(d)){if(1<d.length)throw Error(n(93));d=d[0]}o=d}o==null&&(o=""),r=o}o=Et(r),s.defaultValue=o,d=s.textContent,d===o&&d!==""&&d!==null&&(s.value=d),Ja(s)}function je(s,r){if(r){var o=s.firstChild;if(o&&o===s.lastChild&&o.nodeType===3){o.nodeValue=r;return}}s.textContent=r}var lu=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Xt(s,r,o){var d=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?d?s.setProperty(r,""):r==="float"?s.cssFloat="":s[r]="":d?s.setProperty(r,o):typeof o!="number"||o===0||lu.has(r)?r==="float"?s.cssFloat=o:s[r]=(""+o).trim():s[r]=o+"px"}function ft(s,r,o){if(r!=null&&typeof r!="object")throw Error(n(62));if(s=s.style,o!=null){for(var d in o)!o.hasOwnProperty(d)||r!=null&&r.hasOwnProperty(d)||(d.indexOf("--")===0?s.setProperty(d,""):d==="float"?s.cssFloat="":s[d]="");for(var p in r)d=r[p],r.hasOwnProperty(p)&&o[p]!==d&&Xt(s,p,d)}else for(var _ in r)r.hasOwnProperty(_)&&Xt(s,_,r[_])}function cr(s){if(s.indexOf("-")===-1)return!1;switch(s){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 Tn=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),hl=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ur(s){return hl.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function ge(){}var Te=null;function He(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Qe=null,jt=null;function Ss(s){var r=kn(s);if(r&&(s=r.stateNode)){var o=s[Di]||null;e:switch(s=r.stateNode,r.type){case"input":if(dl(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=s;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Yi(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var d=o[r];if(d!==s&&d.form===s.form){var p=d[Di]||null;if(!p)throw Error(n(90));dl(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<o.length;r++)d=o[r],d.form===s.form&&ul(d)}break e;case"textarea":ou(s,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&Si(s,!!o.multiple,r,!1)}}}var fl=!1;function cu(s,r,o){if(fl)return s(r,o);fl=!0;try{var d=s(r);return d}finally{if(fl=!1,(Qe!==null||jt!==null)&&(Xu(),Qe&&(r=Qe,s=jt,jt=Qe=null,Ss(r),s)))for(r=0;r<s.length;r++)Ss(s[r])}}function ml(s,r){var o=s.stateNode;if(o===null)return null;var d=o[Di]||null;if(d===null)return null;o=d[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(s=s.type,d=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!d;break e;default:s=!1}if(s)return null;if(o&&typeof o!="function")throw Error(n(231,r,typeof o));return o}var An=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ph=!1;if(An)try{var pl={};Object.defineProperty(pl,"passive",{get:function(){Ph=!0}}),window.addEventListener("test",pl,pl),window.removeEventListener("test",pl,pl)}catch{Ph=!1}var dr=null,Uh=null,uu=null;function K_(){if(uu)return uu;var s,r=Uh,o=r.length,d,p="value"in dr?dr.value:dr.textContent,_=p.length;for(s=0;s<o&&r[s]===p[s];s++);var S=o-s;for(d=1;d<=S&&r[o-d]===p[_-d];d++);return uu=p.slice(s,1<d?1-d:void 0)}function du(s){var r=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&r===13&&(s=13)):s=r,s===10&&(s=13),32<=s||s===13?s:0}function hu(){return!0}function G_(){return!1}function Xi(s){function r(o,d,p,_,S){this._reactName=o,this._targetInst=p,this.type=d,this.nativeEvent=_,this.target=S,this.currentTarget=null;for(var k in s)s.hasOwnProperty(k)&&(o=s[k],this[k]=o?o(_):_[k]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?hu:G_,this.isPropagationStopped=G_,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=hu)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=hu)},persist:function(){},isPersistent:hu}),r}var aa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fu=Xi(aa),gl=b({},aa,{view:0,detail:0}),gN=Xi(gl),Hh,Fh,_l,mu=b({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vh,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==_l&&(_l&&s.type==="mousemove"?(Hh=s.screenX-_l.screenX,Fh=s.screenY-_l.screenY):Fh=Hh=0,_l=s),Hh)},movementY:function(s){return"movementY"in s?s.movementY:Fh}}),W_=Xi(mu),_N=b({},mu,{dataTransfer:0}),bN=Xi(_N),vN=b({},gl,{relatedTarget:0}),$h=Xi(vN),xN=b({},aa,{animationName:0,elapsedTime:0,pseudoElement:0}),yN=Xi(xN),SN=b({},aa,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),wN=Xi(SN),EN=b({},aa,{data:0}),Y_=Xi(EN),CN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kN={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"},NN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TN(s){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(s):(s=NN[s])?!!r[s]:!1}function Vh(){return TN}var AN=b({},gl,{key:function(s){if(s.key){var r=CN[s.key]||s.key;if(r!=="Unidentified")return r}return s.type==="keypress"?(s=du(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?kN[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vh,charCode:function(s){return s.type==="keypress"?du(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?du(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),MN=Xi(AN),RN=b({},mu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),X_=Xi(RN),DN=b({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vh}),ON=Xi(DN),jN=b({},aa,{propertyName:0,elapsedTime:0,pseudoElement:0}),LN=Xi(jN),BN=b({},mu,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),zN=Xi(BN),IN=b({},aa,{newState:0,oldState:0}),PN=Xi(IN),UN=[9,13,27,32],qh=An&&"CompositionEvent"in window,bl=null;An&&"documentMode"in document&&(bl=document.documentMode);var HN=An&&"TextEvent"in window&&!bl,Z_=An&&(!qh||bl&&8<bl&&11>=bl),Q_=" ",J_=!1;function eb(s,r){switch(s){case"keyup":return UN.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var so=!1;function FN(s,r){switch(s){case"compositionend":return tb(r);case"keypress":return r.which!==32?null:(J_=!0,Q_);case"textInput":return s=r.data,s===Q_&&J_?null:s;default:return null}}function $N(s,r){if(so)return s==="compositionend"||!qh&&eb(s,r)?(s=K_(),uu=Uh=dr=null,so=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Z_&&r.locale!=="ko"?null:r.data;default:return null}}var VN={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 ib(s){var r=s&&s.nodeName&&s.nodeName.toLowerCase();return r==="input"?!!VN[s.type]:r==="textarea"}function sb(s,r,o,d){Qe?jt?jt.push(d):jt=[d]:Qe=d,r=sd(r,"onChange"),0<r.length&&(o=new fu("onChange","change",null,o,d),s.push({event:o,listeners:r}))}var vl=null,xl=null;function qN(s){P1(s,0)}function pu(s){var r=or(s);if(ul(r))return s}function nb(s,r){if(s==="change")return r}var rb=!1;if(An){var Kh;if(An){var Gh="oninput"in document;if(!Gh){var ab=document.createElement("div");ab.setAttribute("oninput","return;"),Gh=typeof ab.oninput=="function"}Kh=Gh}else Kh=!1;rb=Kh&&(!document.documentMode||9<document.documentMode)}function ob(){vl&&(vl.detachEvent("onpropertychange",lb),xl=vl=null)}function lb(s){if(s.propertyName==="value"&&pu(xl)){var r=[];sb(r,xl,s,He(s)),cu(qN,r)}}function KN(s,r,o){s==="focusin"?(ob(),vl=r,xl=o,vl.attachEvent("onpropertychange",lb)):s==="focusout"&&ob()}function GN(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return pu(xl)}function WN(s,r){if(s==="click")return pu(r)}function YN(s,r){if(s==="input"||s==="change")return pu(r)}function XN(s,r){return s===r&&(s!==0||1/s===1/r)||s!==s&&r!==r}var us=typeof Object.is=="function"?Object.is:XN;function yl(s,r){if(us(s,r))return!0;if(typeof s!="object"||s===null||typeof r!="object"||r===null)return!1;var o=Object.keys(s),d=Object.keys(r);if(o.length!==d.length)return!1;for(d=0;d<o.length;d++){var p=o[d];if(!ta.call(r,p)||!us(s[p],r[p]))return!1}return!0}function cb(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function ub(s,r){var o=cb(s);s=0;for(var d;o;){if(o.nodeType===3){if(d=s+o.textContent.length,s<=r&&d>=r)return{node:o,offset:r-s};s=d}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=cb(o)}}function db(s,r){return s&&r?s===r?!0:s&&s.nodeType===3?!1:r&&r.nodeType===3?db(s,r.parentNode):"contains"in s?s.contains(r):s.compareDocumentPosition?!!(s.compareDocumentPosition(r)&16):!1:!1}function hb(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var r=eo(s.document);r instanceof s.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)s=r.contentWindow;else break;r=eo(s.document)}return r}function Wh(s){var r=s&&s.nodeName&&s.nodeName.toLowerCase();return r&&(r==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||r==="textarea"||s.contentEditable==="true")}var ZN=An&&"documentMode"in document&&11>=document.documentMode,no=null,Yh=null,Sl=null,Xh=!1;function fb(s,r,o){var d=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Xh||no==null||no!==eo(d)||(d=no,"selectionStart"in d&&Wh(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Sl&&yl(Sl,d)||(Sl=d,d=sd(Yh,"onSelect"),0<d.length&&(r=new fu("onSelect","select",null,r,o),s.push({event:r,listeners:d}),r.target=no)))}function oa(s,r){var o={};return o[s.toLowerCase()]=r.toLowerCase(),o["Webkit"+s]="webkit"+r,o["Moz"+s]="moz"+r,o}var ro={animationend:oa("Animation","AnimationEnd"),animationiteration:oa("Animation","AnimationIteration"),animationstart:oa("Animation","AnimationStart"),transitionrun:oa("Transition","TransitionRun"),transitionstart:oa("Transition","TransitionStart"),transitioncancel:oa("Transition","TransitionCancel"),transitionend:oa("Transition","TransitionEnd")},Zh={},mb={};An&&(mb=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function la(s){if(Zh[s])return Zh[s];if(!ro[s])return s;var r=ro[s],o;for(o in r)if(r.hasOwnProperty(o)&&o in mb)return Zh[s]=r[o];return s}var pb=la("animationend"),gb=la("animationiteration"),_b=la("animationstart"),QN=la("transitionrun"),JN=la("transitionstart"),e5=la("transitioncancel"),bb=la("transitionend"),vb=new Map,Qh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Qh.push("scrollEnd");function Vs(s,r){vb.set(s,r),Nn(r,[s])}var gu=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ws=[],ao=0,Jh=0;function _u(){for(var s=ao,r=Jh=ao=0;r<s;){var o=ws[r];ws[r++]=null;var d=ws[r];ws[r++]=null;var p=ws[r];ws[r++]=null;var _=ws[r];if(ws[r++]=null,d!==null&&p!==null){var S=d.pending;S===null?p.next=p:(p.next=S.next,S.next=p),d.pending=p}_!==0&&xb(o,p,_)}}function bu(s,r,o,d){ws[ao++]=s,ws[ao++]=r,ws[ao++]=o,ws[ao++]=d,Jh|=d,s.lanes|=d,s=s.alternate,s!==null&&(s.lanes|=d)}function ef(s,r,o,d){return bu(s,r,o,d),vu(s)}function ca(s,r){return bu(s,null,null,r),vu(s)}function xb(s,r,o){s.lanes|=o;var d=s.alternate;d!==null&&(d.lanes|=o);for(var p=!1,_=s.return;_!==null;)_.childLanes|=o,d=_.alternate,d!==null&&(d.childLanes|=o),_.tag===22&&(s=_.stateNode,s===null||s._visibility&1||(p=!0)),s=_,_=_.return;return s.tag===3?(_=s.stateNode,p&&r!==null&&(p=31-yi(o),s=_.hiddenUpdates,d=s[p],d===null?s[p]=[r]:d.push(r),r.lane=o|536870912),_):null}function vu(s){if(50<Vl)throw Vl=0,um=null,Error(n(185));for(var r=s.return;r!==null;)s=r,r=s.return;return s.tag===3?s.stateNode:null}var oo={};function t5(s,r,o,d){this.tag=s,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ds(s,r,o,d){return new t5(s,r,o,d)}function tf(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Mn(s,r){var o=s.alternate;return o===null?(o=ds(s.tag,r,s.key,s.mode),o.elementType=s.elementType,o.type=s.type,o.stateNode=s.stateNode,o.alternate=s,s.alternate=o):(o.pendingProps=r,o.type=s.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=s.flags&65011712,o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,r=s.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=s.sibling,o.index=s.index,o.ref=s.ref,o.refCleanup=s.refCleanup,o}function yb(s,r){s.flags&=65011714;var o=s.alternate;return o===null?(s.childLanes=0,s.lanes=r,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,r=o.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),s}function xu(s,r,o,d,p,_){var S=0;if(d=s,typeof s=="function")tf(s)&&(S=1);else if(typeof s=="string")S=aT(s,o,ie.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case H:return s=ds(31,o,r,p),s.elementType=H,s.lanes=_,s;case w:return ua(o.children,p,_,r);case C:S=8,p|=24;break;case N:return s=ds(12,o,r,p|2),s.elementType=N,s.lanes=_,s;case L:return s=ds(13,o,r,p),s.elementType=L,s.lanes=_,s;case G:return s=ds(19,o,r,p),s.elementType=G,s.lanes=_,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case D:S=10;break e;case T:S=9;break e;case A:S=11;break e;case j:S=14;break e;case R:S=16,d=null;break e}S=29,o=Error(n(130,s===null?"null":typeof s,"")),d=null}return r=ds(S,o,r,p),r.elementType=s,r.type=d,r.lanes=_,r}function ua(s,r,o,d){return s=ds(7,s,d,r),s.lanes=o,s}function sf(s,r,o){return s=ds(6,s,null,r),s.lanes=o,s}function Sb(s){var r=ds(18,null,null,0);return r.stateNode=s,r}function nf(s,r,o){return r=ds(4,s.children!==null?s.children:[],s.key,r),r.lanes=o,r.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},r}var wb=new WeakMap;function Es(s,r){if(typeof s=="object"&&s!==null){var o=wb.get(s);return o!==void 0?o:(r={value:s,source:r,stack:ea(r)},wb.set(s,r),r)}return{value:s,source:r,stack:ea(r)}}var lo=[],co=0,yu=null,wl=0,Cs=[],ks=0,hr=null,tn=1,sn="";function Rn(s,r){lo[co++]=wl,lo[co++]=yu,yu=s,wl=r}function Eb(s,r,o){Cs[ks++]=tn,Cs[ks++]=sn,Cs[ks++]=hr,hr=s;var d=tn;s=sn;var p=32-yi(d)-1;d&=~(1<<p),o+=1;var _=32-yi(r)+p;if(30<_){var S=p-p%5;_=(d&(1<<S)-1).toString(32),d>>=S,p-=S,tn=1<<32-yi(r)+p|o<<p|d,sn=_+s}else tn=1<<_|o<<p|d,sn=s}function rf(s){s.return!==null&&(Rn(s,1),Eb(s,1,0))}function af(s){for(;s===yu;)yu=lo[--co],lo[co]=null,wl=lo[--co],lo[co]=null;for(;s===hr;)hr=Cs[--ks],Cs[ks]=null,sn=Cs[--ks],Cs[ks]=null,tn=Cs[--ks],Cs[ks]=null}function Cb(s,r){Cs[ks++]=tn,Cs[ks++]=sn,Cs[ks++]=hr,tn=r.id,sn=r.overflow,hr=s}var wi=null,kt=null,tt=!1,fr=null,Ns=!1,of=Error(n(519));function mr(s){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw El(Es(r,s)),of}function kb(s){var r=s.stateNode,o=s.type,d=s.memoizedProps;switch(r[Vt]=s,r[Di]=d,o){case"dialog":Ze("cancel",r),Ze("close",r);break;case"iframe":case"object":case"embed":Ze("load",r);break;case"video":case"audio":for(o=0;o<Kl.length;o++)Ze(Kl[o],r);break;case"source":Ze("error",r);break;case"img":case"image":case"link":Ze("error",r),Ze("load",r);break;case"details":Ze("toggle",r);break;case"input":Ze("invalid",r),ra(r,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ze("invalid",r);break;case"textarea":Ze("invalid",r),io(r,d.value,d.defaultValue,d.children)}o=d.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||d.suppressHydrationWarning===!0||$1(r.textContent,o)?(d.popover!=null&&(Ze("beforetoggle",r),Ze("toggle",r)),d.onScroll!=null&&Ze("scroll",r),d.onScrollEnd!=null&&Ze("scrollend",r),d.onClick!=null&&(r.onclick=ge),r=!0):r=!1,r||mr(s,!0)}function Nb(s){for(wi=s.return;wi;)switch(wi.tag){case 5:case 31:case 13:Ns=!1;return;case 27:case 3:Ns=!0;return;default:wi=wi.return}}function uo(s){if(s!==wi)return!1;if(!tt)return Nb(s),tt=!0,!1;var r=s.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=s.type,o=!(o!=="form"&&o!=="button")||Cm(s.type,s.memoizedProps)),o=!o),o&&kt&&mr(s),Nb(s),r===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));kt=Q1(s)}else if(r===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));kt=Q1(s)}else r===27?(r=kt,Tr(s.type)?(s=Mm,Mm=null,kt=s):kt=r):kt=wi?As(s.stateNode.nextSibling):null;return!0}function da(){kt=wi=null,tt=!1}function lf(){var s=fr;return s!==null&&(es===null?es=s:es.push.apply(es,s),fr=null),s}function El(s){fr===null?fr=[s]:fr.push(s)}var cf=O(null),ha=null,Dn=null;function pr(s,r,o){ue(cf,r._currentValue),r._currentValue=o}function On(s){s._currentValue=cf.current,ee(cf)}function uf(s,r,o){for(;s!==null;){var d=s.alternate;if((s.childLanes&r)!==r?(s.childLanes|=r,d!==null&&(d.childLanes|=r)):d!==null&&(d.childLanes&r)!==r&&(d.childLanes|=r),s===o)break;s=s.return}}function df(s,r,o,d){var p=s.child;for(p!==null&&(p.return=s);p!==null;){var _=p.dependencies;if(_!==null){var S=p.child;_=_.firstContext;e:for(;_!==null;){var k=_;_=p;for(var B=0;B<r.length;B++)if(k.context===r[B]){_.lanes|=o,k=_.alternate,k!==null&&(k.lanes|=o),uf(_.return,o,s),d||(S=null);break e}_=k.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(n(341));S.lanes|=o,_=S.alternate,_!==null&&(_.lanes|=o),uf(S,o,s),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===s){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function ho(s,r,o,d){s=null;for(var p=r,_=!1;p!==null;){if(!_){if((p.flags&524288)!==0)_=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(n(387));if(S=S.memoizedProps,S!==null){var k=p.type;us(p.pendingProps.value,S.value)||(s!==null?s.push(k):s=[k])}}else if(p===Se.current){if(S=p.alternate,S===null)throw Error(n(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(s!==null?s.push(Zl):s=[Zl])}p=p.return}s!==null&&df(r,s,o,d),r.flags|=262144}function Su(s){for(s=s.firstContext;s!==null;){if(!us(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function fa(s){ha=s,Dn=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Ei(s){return Tb(ha,s)}function wu(s,r){return ha===null&&fa(s),Tb(s,r)}function Tb(s,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},Dn===null){if(s===null)throw Error(n(308));Dn=r,s.dependencies={lanes:0,firstContext:r},s.flags|=524288}else Dn=Dn.next=r;return o}var i5=typeof AbortController<"u"?AbortController:function(){var s=[],r=this.signal={aborted:!1,addEventListener:function(o,d){s.push(d)}};this.abort=function(){r.aborted=!0,s.forEach(function(o){return o()})}},s5=e.unstable_scheduleCallback,n5=e.unstable_NormalPriority,Zt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hf(){return{controller:new i5,data:new Map,refCount:0}}function Cl(s){s.refCount--,s.refCount===0&&s5(n5,function(){s.controller.abort()})}var kl=null,ff=0,fo=0,mo=null;function r5(s,r){if(kl===null){var o=kl=[];ff=0,fo=gm(),mo={status:"pending",value:void 0,then:function(d){o.push(d)}}}return ff++,r.then(Ab,Ab),r}function Ab(){if(--ff===0&&kl!==null){mo!==null&&(mo.status="fulfilled");var s=kl;kl=null,fo=0,mo=null;for(var r=0;r<s.length;r++)(0,s[r])()}}function a5(s,r){var o=[],d={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return s.then(function(){d.status="fulfilled",d.value=r;for(var p=0;p<o.length;p++)(0,o[p])(r)},function(p){for(d.status="rejected",d.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),d}var Mb=M.S;M.S=function(s,r){f1=Ot(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r5(s,r),Mb!==null&&Mb(s,r)};var ma=O(null);function mf(){var s=ma.current;return s!==null?s:St.pooledCache}function Eu(s,r){r===null?ue(ma,ma.current):ue(ma,r.pool)}function Rb(){var s=mf();return s===null?null:{parent:Zt._currentValue,pool:s}}var po=Error(n(460)),pf=Error(n(474)),Cu=Error(n(542)),ku={then:function(){}};function Db(s){return s=s.status,s==="fulfilled"||s==="rejected"}function Ob(s,r,o){switch(o=s[o],o===void 0?s.push(r):o!==r&&(r.then(ge,ge),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,Lb(s),s;default:if(typeof r.status=="string")r.then(ge,ge);else{if(s=St,s!==null&&100<s.shellSuspendCounter)throw Error(n(482));s=r,s.status="pending",s.then(function(d){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=d}},function(d){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=d}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,Lb(s),s}throw ga=r,po}}function pa(s){try{var r=s._init;return r(s._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(ga=o,po):o}}var ga=null;function jb(){if(ga===null)throw Error(n(459));var s=ga;return ga=null,s}function Lb(s){if(s===po||s===Cu)throw Error(n(483))}var go=null,Nl=0;function Nu(s){var r=Nl;return Nl+=1,go===null&&(go=[]),Ob(go,s,r)}function Tl(s,r){r=r.props.ref,s.ref=r!==void 0?r:null}function Tu(s,r){throw r.$$typeof===v?Error(n(525)):(s=Object.prototype.toString.call(r),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":s)))}function Bb(s){function r(q,U){if(s){var X=q.deletions;X===null?(q.deletions=[U],q.flags|=16):X.push(U)}}function o(q,U){if(!s)return null;for(;U!==null;)r(q,U),U=U.sibling;return null}function d(q){for(var U=new Map;q!==null;)q.key!==null?U.set(q.key,q):U.set(q.index,q),q=q.sibling;return U}function p(q,U){return q=Mn(q,U),q.index=0,q.sibling=null,q}function _(q,U,X){return q.index=X,s?(X=q.alternate,X!==null?(X=X.index,X<U?(q.flags|=67108866,U):X):(q.flags|=67108866,U)):(q.flags|=1048576,U)}function S(q){return s&&q.alternate===null&&(q.flags|=67108866),q}function k(q,U,X,ae){return U===null||U.tag!==6?(U=sf(X,q.mode,ae),U.return=q,U):(U=p(U,X),U.return=q,U)}function B(q,U,X,ae){var De=X.type;return De===w?ne(q,U,X.props.children,ae,X.key):U!==null&&(U.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===R&&pa(De)===U.type)?(U=p(U,X.props),Tl(U,X),U.return=q,U):(U=xu(X.type,X.key,X.props,null,q.mode,ae),Tl(U,X),U.return=q,U)}function Z(q,U,X,ae){return U===null||U.tag!==4||U.stateNode.containerInfo!==X.containerInfo||U.stateNode.implementation!==X.implementation?(U=nf(X,q.mode,ae),U.return=q,U):(U=p(U,X.children||[]),U.return=q,U)}function ne(q,U,X,ae,De){return U===null||U.tag!==7?(U=ua(X,q.mode,ae,De),U.return=q,U):(U=p(U,X),U.return=q,U)}function oe(q,U,X){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=sf(""+U,q.mode,X),U.return=q,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case x:return X=xu(U.type,U.key,U.props,null,q.mode,X),Tl(X,U),X.return=q,X;case y:return U=nf(U,q.mode,X),U.return=q,U;case R:return U=pa(U),oe(q,U,X)}if(K(U)||J(U))return U=ua(U,q.mode,X,null),U.return=q,U;if(typeof U.then=="function")return oe(q,Nu(U),X);if(U.$$typeof===D)return oe(q,wu(q,U),X);Tu(q,U)}return null}function Q(q,U,X,ae){var De=U!==null?U.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return De!==null?null:k(q,U,""+X,ae);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case x:return X.key===De?B(q,U,X,ae):null;case y:return X.key===De?Z(q,U,X,ae):null;case R:return X=pa(X),Q(q,U,X,ae)}if(K(X)||J(X))return De!==null?null:ne(q,U,X,ae,null);if(typeof X.then=="function")return Q(q,U,Nu(X),ae);if(X.$$typeof===D)return Q(q,U,wu(q,X),ae);Tu(q,X)}return null}function se(q,U,X,ae,De){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return q=q.get(X)||null,k(U,q,""+ae,De);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:return q=q.get(ae.key===null?X:ae.key)||null,B(U,q,ae,De);case y:return q=q.get(ae.key===null?X:ae.key)||null,Z(U,q,ae,De);case R:return ae=pa(ae),se(q,U,X,ae,De)}if(K(ae)||J(ae))return q=q.get(X)||null,ne(U,q,ae,De,null);if(typeof ae.then=="function")return se(q,U,X,Nu(ae),De);if(ae.$$typeof===D)return se(q,U,X,wu(U,ae),De);Tu(U,ae)}return null}function Ce(q,U,X,ae){for(var De=null,rt=null,Ae=U,$e=U=0,et=null;Ae!==null&&$e<X.length;$e++){Ae.index>$e?(et=Ae,Ae=null):et=Ae.sibling;var at=Q(q,Ae,X[$e],ae);if(at===null){Ae===null&&(Ae=et);break}s&&Ae&&at.alternate===null&&r(q,Ae),U=_(at,U,$e),rt===null?De=at:rt.sibling=at,rt=at,Ae=et}if($e===X.length)return o(q,Ae),tt&&Rn(q,$e),De;if(Ae===null){for(;$e<X.length;$e++)Ae=oe(q,X[$e],ae),Ae!==null&&(U=_(Ae,U,$e),rt===null?De=Ae:rt.sibling=Ae,rt=Ae);return tt&&Rn(q,$e),De}for(Ae=d(Ae);$e<X.length;$e++)et=se(Ae,q,$e,X[$e],ae),et!==null&&(s&&et.alternate!==null&&Ae.delete(et.key===null?$e:et.key),U=_(et,U,$e),rt===null?De=et:rt.sibling=et,rt=et);return s&&Ae.forEach(function(Or){return r(q,Or)}),tt&&Rn(q,$e),De}function Oe(q,U,X,ae){if(X==null)throw Error(n(151));for(var De=null,rt=null,Ae=U,$e=U=0,et=null,at=X.next();Ae!==null&&!at.done;$e++,at=X.next()){Ae.index>$e?(et=Ae,Ae=null):et=Ae.sibling;var Or=Q(q,Ae,at.value,ae);if(Or===null){Ae===null&&(Ae=et);break}s&&Ae&&Or.alternate===null&&r(q,Ae),U=_(Or,U,$e),rt===null?De=Or:rt.sibling=Or,rt=Or,Ae=et}if(at.done)return o(q,Ae),tt&&Rn(q,$e),De;if(Ae===null){for(;!at.done;$e++,at=X.next())at=oe(q,at.value,ae),at!==null&&(U=_(at,U,$e),rt===null?De=at:rt.sibling=at,rt=at);return tt&&Rn(q,$e),De}for(Ae=d(Ae);!at.done;$e++,at=X.next())at=se(Ae,q,$e,at.value,ae),at!==null&&(s&&at.alternate!==null&&Ae.delete(at.key===null?$e:at.key),U=_(at,U,$e),rt===null?De=at:rt.sibling=at,rt=at);return s&&Ae.forEach(function(_T){return r(q,_T)}),tt&&Rn(q,$e),De}function vt(q,U,X,ae){if(typeof X=="object"&&X!==null&&X.type===w&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case x:e:{for(var De=X.key;U!==null;){if(U.key===De){if(De=X.type,De===w){if(U.tag===7){o(q,U.sibling),ae=p(U,X.props.children),ae.return=q,q=ae;break e}}else if(U.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===R&&pa(De)===U.type){o(q,U.sibling),ae=p(U,X.props),Tl(ae,X),ae.return=q,q=ae;break e}o(q,U);break}else r(q,U);U=U.sibling}X.type===w?(ae=ua(X.props.children,q.mode,ae,X.key),ae.return=q,q=ae):(ae=xu(X.type,X.key,X.props,null,q.mode,ae),Tl(ae,X),ae.return=q,q=ae)}return S(q);case y:e:{for(De=X.key;U!==null;){if(U.key===De)if(U.tag===4&&U.stateNode.containerInfo===X.containerInfo&&U.stateNode.implementation===X.implementation){o(q,U.sibling),ae=p(U,X.children||[]),ae.return=q,q=ae;break e}else{o(q,U);break}else r(q,U);U=U.sibling}ae=nf(X,q.mode,ae),ae.return=q,q=ae}return S(q);case R:return X=pa(X),vt(q,U,X,ae)}if(K(X))return Ce(q,U,X,ae);if(J(X)){if(De=J(X),typeof De!="function")throw Error(n(150));return X=De.call(X),Oe(q,U,X,ae)}if(typeof X.then=="function")return vt(q,U,Nu(X),ae);if(X.$$typeof===D)return vt(q,U,wu(q,X),ae);Tu(q,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,U!==null&&U.tag===6?(o(q,U.sibling),ae=p(U,X),ae.return=q,q=ae):(o(q,U),ae=sf(X,q.mode,ae),ae.return=q,q=ae),S(q)):o(q,U)}return function(q,U,X,ae){try{Nl=0;var De=vt(q,U,X,ae);return go=null,De}catch(Ae){if(Ae===po||Ae===Cu)throw Ae;var rt=ds(29,Ae,null,q.mode);return rt.lanes=ae,rt.return=q,rt}}}var _a=Bb(!0),zb=Bb(!1),gr=!1;function gf(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _f(s,r){s=s.updateQueue,r.updateQueue===s&&(r.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function _r(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function br(s,r,o){var d=s.updateQueue;if(d===null)return null;if(d=d.shared,(ut&2)!==0){var p=d.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),d.pending=r,r=vu(s),xb(s,null,o),r}return bu(s,d,r,o),vu(s)}function Al(s,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var d=r.lanes;d&=s.pendingLanes,o|=d,r.lanes=o,Le(s,o)}}function bf(s,r){var o=s.updateQueue,d=s.alternate;if(d!==null&&(d=d.updateQueue,o===d)){var p=null,_=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};_===null?p=_=S:_=_.next=S,o=o.next}while(o!==null);_===null?p=_=r:_=_.next=r}else p=_=r;o={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:_,shared:d.shared,callbacks:d.callbacks},s.updateQueue=o;return}s=o.lastBaseUpdate,s===null?o.firstBaseUpdate=r:s.next=r,o.lastBaseUpdate=r}var vf=!1;function Ml(){if(vf){var s=mo;if(s!==null)throw s}}function Rl(s,r,o,d){vf=!1;var p=s.updateQueue;gr=!1;var _=p.firstBaseUpdate,S=p.lastBaseUpdate,k=p.shared.pending;if(k!==null){p.shared.pending=null;var B=k,Z=B.next;B.next=null,S===null?_=Z:S.next=Z,S=B;var ne=s.alternate;ne!==null&&(ne=ne.updateQueue,k=ne.lastBaseUpdate,k!==S&&(k===null?ne.firstBaseUpdate=Z:k.next=Z,ne.lastBaseUpdate=B))}if(_!==null){var oe=p.baseState;S=0,ne=Z=B=null,k=_;do{var Q=k.lane&-536870913,se=Q!==k.lane;if(se?(Je&Q)===Q:(d&Q)===Q){Q!==0&&Q===fo&&(vf=!0),ne!==null&&(ne=ne.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ce=s,Oe=k;Q=r;var vt=o;switch(Oe.tag){case 1:if(Ce=Oe.payload,typeof Ce=="function"){oe=Ce.call(vt,oe,Q);break e}oe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Oe.payload,Q=typeof Ce=="function"?Ce.call(vt,oe,Q):Ce,Q==null)break e;oe=b({},oe,Q);break e;case 2:gr=!0}}Q=k.callback,Q!==null&&(s.flags|=64,se&&(s.flags|=8192),se=p.callbacks,se===null?p.callbacks=[Q]:se.push(Q))}else se={lane:Q,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ne===null?(Z=ne=se,B=oe):ne=ne.next=se,S|=Q;if(k=k.next,k===null){if(k=p.shared.pending,k===null)break;se=k,k=se.next,se.next=null,p.lastBaseUpdate=se,p.shared.pending=null}}while(!0);ne===null&&(B=oe),p.baseState=B,p.firstBaseUpdate=Z,p.lastBaseUpdate=ne,_===null&&(p.shared.lanes=0),wr|=S,s.lanes=S,s.memoizedState=oe}}function Ib(s,r){if(typeof s!="function")throw Error(n(191,s));s.call(r)}function Pb(s,r){var o=s.callbacks;if(o!==null)for(s.callbacks=null,s=0;s<o.length;s++)Ib(o[s],r)}var _o=O(null),Au=O(0);function Ub(s,r){s=Fn,ue(Au,s),ue(_o,r),Fn=s|r.baseLanes}function xf(){ue(Au,Fn),ue(_o,_o.current)}function yf(){Fn=Au.current,ee(_o),ee(Au)}var hs=O(null),Ts=null;function vr(s){var r=s.alternate;ue(Kt,Kt.current&1),ue(hs,s),Ts===null&&(r===null||_o.current!==null||r.memoizedState!==null)&&(Ts=s)}function Sf(s){ue(Kt,Kt.current),ue(hs,s),Ts===null&&(Ts=s)}function Hb(s){s.tag===22?(ue(Kt,Kt.current),ue(hs,s),Ts===null&&(Ts=s)):xr()}function xr(){ue(Kt,Kt.current),ue(hs,hs.current)}function fs(s){ee(hs),Ts===s&&(Ts=null),ee(Kt)}var Kt=O(0);function Mu(s){for(var r=s;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Tm(o)||Am(o)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var jn=0,Fe=null,_t=null,Qt=null,Ru=!1,bo=!1,ba=!1,Du=0,Dl=0,vo=null,o5=0;function zt(){throw Error(n(321))}function wf(s,r){if(r===null)return!1;for(var o=0;o<r.length&&o<s.length;o++)if(!us(s[o],r[o]))return!1;return!0}function Ef(s,r,o,d,p,_){return jn=_,Fe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,M.H=s===null||s.memoizedState===null?Ev:Pf,ba=!1,_=o(d,p),ba=!1,bo&&(_=$b(r,o,d,p)),Fb(s),_}function Fb(s){M.H=Ll;var r=_t!==null&&_t.next!==null;if(jn=0,Qt=_t=Fe=null,Ru=!1,Dl=0,vo=null,r)throw Error(n(300));s===null||Jt||(s=s.dependencies,s!==null&&Su(s)&&(Jt=!0))}function $b(s,r,o,d){Fe=s;var p=0;do{if(bo&&(vo=null),Dl=0,bo=!1,25<=p)throw Error(n(301));if(p+=1,Qt=_t=null,s.updateQueue!=null){var _=s.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}M.H=Cv,_=r(o,d)}while(bo);return _}function l5(){var s=M.H,r=s.useState()[0];return r=typeof r.then=="function"?Ol(r):r,s=s.useState()[0],(_t!==null?_t.memoizedState:null)!==s&&(Fe.flags|=1024),r}function Cf(){var s=Du!==0;return Du=0,s}function kf(s,r,o){r.updateQueue=s.updateQueue,r.flags&=-2053,s.lanes&=~o}function Nf(s){if(Ru){for(s=s.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Ru=!1}jn=0,Qt=_t=Fe=null,bo=!1,Dl=Du=0,vo=null}function Ui(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Fe.memoizedState=Qt=s:Qt=Qt.next=s,Qt}function Gt(){if(_t===null){var s=Fe.alternate;s=s!==null?s.memoizedState:null}else s=_t.next;var r=Qt===null?Fe.memoizedState:Qt.next;if(r!==null)Qt=r,_t=s;else{if(s===null)throw Fe.alternate===null?Error(n(467)):Error(n(310));_t=s,s={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},Qt===null?Fe.memoizedState=Qt=s:Qt=Qt.next=s}return Qt}function Ou(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ol(s){var r=Dl;return Dl+=1,vo===null&&(vo=[]),s=Ob(vo,s,r),r=Fe,(Qt===null?r.memoizedState:Qt.next)===null&&(r=r.alternate,M.H=r===null||r.memoizedState===null?Ev:Pf),s}function ju(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Ol(s);if(s.$$typeof===D)return Ei(s)}throw Error(n(438,String(s)))}function Tf(s){var r=null,o=Fe.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var d=Fe.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(r={data:d.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=Ou(),Fe.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(s),d=0;d<s;d++)o[d]=I;return r.index++,o}function Ln(s,r){return typeof r=="function"?r(s):r}function Lu(s){var r=Gt();return Af(r,_t,s)}function Af(s,r,o){var d=s.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var p=s.baseQueue,_=d.pending;if(_!==null){if(p!==null){var S=p.next;p.next=_.next,_.next=S}r.baseQueue=p=_,d.pending=null}if(_=s.baseState,p===null)s.memoizedState=_;else{r=p.next;var k=S=null,B=null,Z=r,ne=!1;do{var oe=Z.lane&-536870913;if(oe!==Z.lane?(Je&oe)===oe:(jn&oe)===oe){var Q=Z.revertLane;if(Q===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),oe===fo&&(ne=!0);else if((jn&Q)===Q){Z=Z.next,Q===fo&&(ne=!0);continue}else oe={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},B===null?(k=B=oe,S=_):B=B.next=oe,Fe.lanes|=Q,wr|=Q;oe=Z.action,ba&&o(_,oe),_=Z.hasEagerState?Z.eagerState:o(_,oe)}else Q={lane:oe,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},B===null?(k=B=Q,S=_):B=B.next=Q,Fe.lanes|=oe,wr|=oe;Z=Z.next}while(Z!==null&&Z!==r);if(B===null?S=_:B.next=k,!us(_,s.memoizedState)&&(Jt=!0,ne&&(o=mo,o!==null)))throw o;s.memoizedState=_,s.baseState=S,s.baseQueue=B,d.lastRenderedState=_}return p===null&&(d.lanes=0),[s.memoizedState,d.dispatch]}function Mf(s){var r=Gt(),o=r.queue;if(o===null)throw Error(n(311));o.lastRenderedReducer=s;var d=o.dispatch,p=o.pending,_=r.memoizedState;if(p!==null){o.pending=null;var S=p=p.next;do _=s(_,S.action),S=S.next;while(S!==p);us(_,r.memoizedState)||(Jt=!0),r.memoizedState=_,r.baseQueue===null&&(r.baseState=_),o.lastRenderedState=_}return[_,d]}function Vb(s,r,o){var d=Fe,p=Gt(),_=tt;if(_){if(o===void 0)throw Error(n(407));o=o()}else o=r();var S=!us((_t||p).memoizedState,o);if(S&&(p.memoizedState=o,Jt=!0),p=p.queue,Of(Gb.bind(null,d,p,s),[s]),p.getSnapshot!==r||S||Qt!==null&&Qt.memoizedState.tag&1){if(d.flags|=2048,xo(9,{destroy:void 0},Kb.bind(null,d,p,o,r),null),St===null)throw Error(n(349));_||(jn&127)!==0||qb(d,r,o)}return o}function qb(s,r,o){s.flags|=16384,s={getSnapshot:r,value:o},r=Fe.updateQueue,r===null?(r=Ou(),Fe.updateQueue=r,r.stores=[s]):(o=r.stores,o===null?r.stores=[s]:o.push(s))}function Kb(s,r,o,d){r.value=o,r.getSnapshot=d,Wb(r)&&Yb(s)}function Gb(s,r,o){return o(function(){Wb(r)&&Yb(s)})}function Wb(s){var r=s.getSnapshot;s=s.value;try{var o=r();return!us(s,o)}catch{return!0}}function Yb(s){var r=ca(s,2);r!==null&&ts(r,s,2)}function Rf(s){var r=Ui();if(typeof s=="function"){var o=s;if(s=o(),ba){ys(!0);try{o()}finally{ys(!1)}}}return r.memoizedState=r.baseState=s,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ln,lastRenderedState:s},r}function Xb(s,r,o,d){return s.baseState=o,Af(s,_t,typeof d=="function"?d:Ln)}function c5(s,r,o,d,p){if(Iu(s))throw Error(n(485));if(s=r.action,s!==null){var _={payload:p,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){_.listeners.push(S)}};M.T!==null?o(!0):_.isTransition=!1,d(_),o=r.pending,o===null?(_.next=r.pending=_,Zb(r,_)):(_.next=o.next,r.pending=o.next=_)}}function Zb(s,r){var o=r.action,d=r.payload,p=s.state;if(r.isTransition){var _=M.T,S={};M.T=S;try{var k=o(p,d),B=M.S;B!==null&&B(S,k),Qb(s,r,k)}catch(Z){Df(s,r,Z)}finally{_!==null&&S.types!==null&&(_.types=S.types),M.T=_}}else try{_=o(p,d),Qb(s,r,_)}catch(Z){Df(s,r,Z)}}function Qb(s,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(d){Jb(s,r,d)},function(d){return Df(s,r,d)}):Jb(s,r,o)}function Jb(s,r,o){r.status="fulfilled",r.value=o,ev(r),s.state=o,r=s.pending,r!==null&&(o=r.next,o===r?s.pending=null:(o=o.next,r.next=o,Zb(s,o)))}function Df(s,r,o){var d=s.pending;if(s.pending=null,d!==null){d=d.next;do r.status="rejected",r.reason=o,ev(r),r=r.next;while(r!==d)}s.action=null}function ev(s){s=s.listeners;for(var r=0;r<s.length;r++)(0,s[r])()}function tv(s,r){return r}function iv(s,r){if(tt){var o=St.formState;if(o!==null){e:{var d=Fe;if(tt){if(kt){t:{for(var p=kt,_=Ns;p.nodeType!==8;){if(!_){p=null;break t}if(p=As(p.nextSibling),p===null){p=null;break t}}_=p.data,p=_==="F!"||_==="F"?p:null}if(p){kt=As(p.nextSibling),d=p.data==="F!";break e}}mr(d)}d=!1}d&&(r=o[0])}}return o=Ui(),o.memoizedState=o.baseState=r,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tv,lastRenderedState:r},o.queue=d,o=yv.bind(null,Fe,d),d.dispatch=o,d=Rf(!1),_=If.bind(null,Fe,!1,d.queue),d=Ui(),p={state:r,dispatch:null,action:s,pending:null},d.queue=p,o=c5.bind(null,Fe,p,_,o),p.dispatch=o,d.memoizedState=s,[r,o,!1]}function sv(s){var r=Gt();return nv(r,_t,s)}function nv(s,r,o){if(r=Af(s,r,tv)[0],s=Lu(Ln)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var d=Ol(r)}catch(S){throw S===po?Cu:S}else d=r;r=Gt();var p=r.queue,_=p.dispatch;return o!==r.memoizedState&&(Fe.flags|=2048,xo(9,{destroy:void 0},u5.bind(null,p,o),null)),[d,_,s]}function u5(s,r){s.action=r}function rv(s){var r=Gt(),o=_t;if(o!==null)return nv(r,o,s);Gt(),r=r.memoizedState,o=Gt();var d=o.queue.dispatch;return o.memoizedState=s,[r,d,!1]}function xo(s,r,o,d){return s={tag:s,create:o,deps:d,inst:r,next:null},r=Fe.updateQueue,r===null&&(r=Ou(),Fe.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=s.next=s:(d=o.next,o.next=s,s.next=d,r.lastEffect=s),s}function av(){return Gt().memoizedState}function Bu(s,r,o,d){var p=Ui();Fe.flags|=s,p.memoizedState=xo(1|r,{destroy:void 0},o,d===void 0?null:d)}function zu(s,r,o,d){var p=Gt();d=d===void 0?null:d;var _=p.memoizedState.inst;_t!==null&&d!==null&&wf(d,_t.memoizedState.deps)?p.memoizedState=xo(r,_,o,d):(Fe.flags|=s,p.memoizedState=xo(1|r,_,o,d))}function ov(s,r){Bu(8390656,8,s,r)}function Of(s,r){zu(2048,8,s,r)}function d5(s){Fe.flags|=4;var r=Fe.updateQueue;if(r===null)r=Ou(),Fe.updateQueue=r,r.events=[s];else{var o=r.events;o===null?r.events=[s]:o.push(s)}}function lv(s){var r=Gt().memoizedState;return d5({ref:r,nextImpl:s}),function(){if((ut&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function cv(s,r){return zu(4,2,s,r)}function uv(s,r){return zu(4,4,s,r)}function dv(s,r){if(typeof r=="function"){s=s();var o=r(s);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return s=s(),r.current=s,function(){r.current=null}}function hv(s,r,o){o=o!=null?o.concat([s]):null,zu(4,4,dv.bind(null,r,s),o)}function jf(){}function fv(s,r){var o=Gt();r=r===void 0?null:r;var d=o.memoizedState;return r!==null&&wf(r,d[1])?d[0]:(o.memoizedState=[s,r],s)}function mv(s,r){var o=Gt();r=r===void 0?null:r;var d=o.memoizedState;if(r!==null&&wf(r,d[1]))return d[0];if(d=s(),ba){ys(!0);try{s()}finally{ys(!1)}}return o.memoizedState=[d,r],d}function Lf(s,r,o){return o===void 0||(jn&1073741824)!==0&&(Je&261930)===0?s.memoizedState=r:(s.memoizedState=o,s=p1(),Fe.lanes|=s,wr|=s,o)}function pv(s,r,o,d){return us(o,r)?o:_o.current!==null?(s=Lf(s,o,d),us(s,r)||(Jt=!0),s):(jn&42)===0||(jn&1073741824)!==0&&(Je&261930)===0?(Jt=!0,s.memoizedState=o):(s=p1(),Fe.lanes|=s,wr|=s,r)}function gv(s,r,o,d,p){var _=$.p;$.p=_!==0&&8>_?_:8;var S=M.T,k={};M.T=k,If(s,!1,r,o);try{var B=p(),Z=M.S;if(Z!==null&&Z(k,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ne=a5(B,d);jl(s,r,ne,gs(s))}else jl(s,r,d,gs(s))}catch(oe){jl(s,r,{then:function(){},status:"rejected",reason:oe},gs())}finally{$.p=_,S!==null&&k.types!==null&&(S.types=k.types),M.T=S}}function h5(){}function Bf(s,r,o,d){if(s.tag!==5)throw Error(n(476));var p=_v(s).queue;gv(s,p,r,F,o===null?h5:function(){return bv(s),o(d)})}function _v(s){var r=s.memoizedState;if(r!==null)return r;r={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ln,lastRenderedState:F},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ln,lastRenderedState:o},next:null},s.memoizedState=r,s=s.alternate,s!==null&&(s.memoizedState=r),r}function bv(s){var r=_v(s);r.next===null&&(r=s.alternate.memoizedState),jl(s,r.next.queue,{},gs())}function zf(){return Ei(Zl)}function vv(){return Gt().memoizedState}function xv(){return Gt().memoizedState}function f5(s){for(var r=s.return;r!==null;){switch(r.tag){case 24:case 3:var o=gs();s=_r(o);var d=br(r,s,o);d!==null&&(ts(d,r,o),Al(d,r,o)),r={cache:hf()},s.payload=r;return}r=r.return}}function m5(s,r,o){var d=gs();o={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Iu(s)?Sv(r,o):(o=ef(s,r,o,d),o!==null&&(ts(o,s,d),wv(o,r,d)))}function yv(s,r,o){var d=gs();jl(s,r,o,d)}function jl(s,r,o,d){var p={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Iu(s))Sv(r,p);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=r.lastRenderedReducer,_!==null))try{var S=r.lastRenderedState,k=_(S,o);if(p.hasEagerState=!0,p.eagerState=k,us(k,S))return bu(s,r,p,0),St===null&&_u(),!1}catch{}if(o=ef(s,r,p,d),o!==null)return ts(o,s,d),wv(o,r,d),!0}return!1}function If(s,r,o,d){if(d={lane:2,revertLane:gm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Iu(s)){if(r)throw Error(n(479))}else r=ef(s,o,d,2),r!==null&&ts(r,s,2)}function Iu(s){var r=s.alternate;return s===Fe||r!==null&&r===Fe}function Sv(s,r){bo=Ru=!0;var o=s.pending;o===null?r.next=r:(r.next=o.next,o.next=r),s.pending=r}function wv(s,r,o){if((o&4194048)!==0){var d=r.lanes;d&=s.pendingLanes,o|=d,r.lanes=o,Le(s,o)}}var Ll={readContext:Ei,use:ju,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};Ll.useEffectEvent=zt;var Ev={readContext:Ei,use:ju,useCallback:function(s,r){return Ui().memoizedState=[s,r===void 0?null:r],s},useContext:Ei,useEffect:ov,useImperativeHandle:function(s,r,o){o=o!=null?o.concat([s]):null,Bu(4194308,4,dv.bind(null,r,s),o)},useLayoutEffect:function(s,r){return Bu(4194308,4,s,r)},useInsertionEffect:function(s,r){Bu(4,2,s,r)},useMemo:function(s,r){var o=Ui();r=r===void 0?null:r;var d=s();if(ba){ys(!0);try{s()}finally{ys(!1)}}return o.memoizedState=[d,r],d},useReducer:function(s,r,o){var d=Ui();if(o!==void 0){var p=o(r);if(ba){ys(!0);try{o(r)}finally{ys(!1)}}}else p=r;return d.memoizedState=d.baseState=p,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:p},d.queue=s,s=s.dispatch=m5.bind(null,Fe,s),[d.memoizedState,s]},useRef:function(s){var r=Ui();return s={current:s},r.memoizedState=s},useState:function(s){s=Rf(s);var r=s.queue,o=yv.bind(null,Fe,r);return r.dispatch=o,[s.memoizedState,o]},useDebugValue:jf,useDeferredValue:function(s,r){var o=Ui();return Lf(o,s,r)},useTransition:function(){var s=Rf(!1);return s=gv.bind(null,Fe,s.queue,!0,!1),Ui().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,r,o){var d=Fe,p=Ui();if(tt){if(o===void 0)throw Error(n(407));o=o()}else{if(o=r(),St===null)throw Error(n(349));(Je&127)!==0||qb(d,r,o)}p.memoizedState=o;var _={value:o,getSnapshot:r};return p.queue=_,ov(Gb.bind(null,d,_,s),[s]),d.flags|=2048,xo(9,{destroy:void 0},Kb.bind(null,d,_,o,r),null),o},useId:function(){var s=Ui(),r=St.identifierPrefix;if(tt){var o=sn,d=tn;o=(d&~(1<<32-yi(d)-1)).toString(32)+o,r="_"+r+"R_"+o,o=Du++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=o5++,r="_"+r+"r_"+o.toString(32)+"_";return s.memoizedState=r},useHostTransitionStatus:zf,useFormState:iv,useActionState:iv,useOptimistic:function(s){var r=Ui();r.memoizedState=r.baseState=s;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=If.bind(null,Fe,!0,o),o.dispatch=r,[s,r]},useMemoCache:Tf,useCacheRefresh:function(){return Ui().memoizedState=f5.bind(null,Fe)},useEffectEvent:function(s){var r=Ui(),o={impl:s};return r.memoizedState=o,function(){if((ut&2)!==0)throw Error(n(440));return o.impl.apply(void 0,arguments)}}},Pf={readContext:Ei,use:ju,useCallback:fv,useContext:Ei,useEffect:Of,useImperativeHandle:hv,useInsertionEffect:cv,useLayoutEffect:uv,useMemo:mv,useReducer:Lu,useRef:av,useState:function(){return Lu(Ln)},useDebugValue:jf,useDeferredValue:function(s,r){var o=Gt();return pv(o,_t.memoizedState,s,r)},useTransition:function(){var s=Lu(Ln)[0],r=Gt().memoizedState;return[typeof s=="boolean"?s:Ol(s),r]},useSyncExternalStore:Vb,useId:vv,useHostTransitionStatus:zf,useFormState:sv,useActionState:sv,useOptimistic:function(s,r){var o=Gt();return Xb(o,_t,s,r)},useMemoCache:Tf,useCacheRefresh:xv};Pf.useEffectEvent=lv;var Cv={readContext:Ei,use:ju,useCallback:fv,useContext:Ei,useEffect:Of,useImperativeHandle:hv,useInsertionEffect:cv,useLayoutEffect:uv,useMemo:mv,useReducer:Mf,useRef:av,useState:function(){return Mf(Ln)},useDebugValue:jf,useDeferredValue:function(s,r){var o=Gt();return _t===null?Lf(o,s,r):pv(o,_t.memoizedState,s,r)},useTransition:function(){var s=Mf(Ln)[0],r=Gt().memoizedState;return[typeof s=="boolean"?s:Ol(s),r]},useSyncExternalStore:Vb,useId:vv,useHostTransitionStatus:zf,useFormState:rv,useActionState:rv,useOptimistic:function(s,r){var o=Gt();return _t!==null?Xb(o,_t,s,r):(o.baseState=s,[s,o.queue.dispatch])},useMemoCache:Tf,useCacheRefresh:xv};Cv.useEffectEvent=lv;function Uf(s,r,o,d){r=s.memoizedState,o=o(d,r),o=o==null?r:b({},r,o),s.memoizedState=o,s.lanes===0&&(s.updateQueue.baseState=o)}var Hf={enqueueSetState:function(s,r,o){s=s._reactInternals;var d=gs(),p=_r(d);p.payload=r,o!=null&&(p.callback=o),r=br(s,p,d),r!==null&&(ts(r,s,d),Al(r,s,d))},enqueueReplaceState:function(s,r,o){s=s._reactInternals;var d=gs(),p=_r(d);p.tag=1,p.payload=r,o!=null&&(p.callback=o),r=br(s,p,d),r!==null&&(ts(r,s,d),Al(r,s,d))},enqueueForceUpdate:function(s,r){s=s._reactInternals;var o=gs(),d=_r(o);d.tag=2,r!=null&&(d.callback=r),r=br(s,d,o),r!==null&&(ts(r,s,o),Al(r,s,o))}};function kv(s,r,o,d,p,_,S){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(d,_,S):r.prototype&&r.prototype.isPureReactComponent?!yl(o,d)||!yl(p,_):!0}function Nv(s,r,o,d){s=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,d),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,d),r.state!==s&&Hf.enqueueReplaceState(r,r.state,null)}function va(s,r){var o=r;if("ref"in r){o={};for(var d in r)d!=="ref"&&(o[d]=r[d])}if(s=s.defaultProps){o===r&&(o=b({},o));for(var p in s)o[p]===void 0&&(o[p]=s[p])}return o}function Tv(s){gu(s)}function Av(s){console.error(s)}function Mv(s){gu(s)}function Pu(s,r){try{var o=s.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(d){setTimeout(function(){throw d})}}function Rv(s,r,o){try{var d=s.onCaughtError;d(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Ff(s,r,o){return o=_r(o),o.tag=3,o.payload={element:null},o.callback=function(){Pu(s,r)},o}function Dv(s){return s=_r(s),s.tag=3,s}function Ov(s,r,o,d){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var _=d.value;s.payload=function(){return p(_)},s.callback=function(){Rv(r,o,d)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(s.callback=function(){Rv(r,o,d),typeof p!="function"&&(Er===null?Er=new Set([this]):Er.add(this));var k=d.stack;this.componentDidCatch(d.value,{componentStack:k!==null?k:""})})}function p5(s,r,o,d,p){if(o.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(r=o.alternate,r!==null&&ho(r,o,p,!0),o=hs.current,o!==null){switch(o.tag){case 31:case 13:return Ts===null?Zu():o.alternate===null&&It===0&&(It=3),o.flags&=-257,o.flags|=65536,o.lanes=p,d===ku?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([d]):r.add(d),fm(s,d,p)),!1;case 22:return o.flags|=65536,d===ku?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([d])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([d]):o.add(d)),fm(s,d,p)),!1}throw Error(n(435,o.tag))}return fm(s,d,p),Zu(),!1}if(tt)return r=hs.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,d!==of&&(s=Error(n(422),{cause:d}),El(Es(s,o)))):(d!==of&&(r=Error(n(423),{cause:d}),El(Es(r,o))),s=s.current.alternate,s.flags|=65536,p&=-p,s.lanes|=p,d=Es(d,o),p=Ff(s.stateNode,d,p),bf(s,p),It!==4&&(It=2)),!1;var _=Error(n(520),{cause:d});if(_=Es(_,o),$l===null?$l=[_]:$l.push(_),It!==4&&(It=2),r===null)return!0;d=Es(d,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,s=p&-p,o.lanes|=s,s=Ff(o.stateNode,d,s),bf(o,s),!1;case 1:if(r=o.type,_=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Er===null||!Er.has(_))))return o.flags|=65536,p&=-p,o.lanes|=p,p=Dv(p),Ov(p,s,o,d),bf(o,p),!1}o=o.return}while(o!==null);return!1}var $f=Error(n(461)),Jt=!1;function Ci(s,r,o,d){r.child=s===null?zb(r,null,o,d):_a(r,s.child,o,d)}function jv(s,r,o,d,p){o=o.render;var _=r.ref;if("ref"in d){var S={};for(var k in d)k!=="ref"&&(S[k]=d[k])}else S=d;return fa(r),d=Ef(s,r,o,S,_,p),k=Cf(),s!==null&&!Jt?(kf(s,r,p),Bn(s,r,p)):(tt&&k&&rf(r),r.flags|=1,Ci(s,r,d,p),r.child)}function Lv(s,r,o,d,p){if(s===null){var _=o.type;return typeof _=="function"&&!tf(_)&&_.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=_,Bv(s,r,_,d,p)):(s=xu(o.type,null,d,r,r.mode,p),s.ref=r.ref,s.return=r,r.child=s)}if(_=s.child,!Zf(s,p)){var S=_.memoizedProps;if(o=o.compare,o=o!==null?o:yl,o(S,d)&&s.ref===r.ref)return Bn(s,r,p)}return r.flags|=1,s=Mn(_,d),s.ref=r.ref,s.return=r,r.child=s}function Bv(s,r,o,d,p){if(s!==null){var _=s.memoizedProps;if(yl(_,d)&&s.ref===r.ref)if(Jt=!1,r.pendingProps=d=_,Zf(s,p))(s.flags&131072)!==0&&(Jt=!0);else return r.lanes=s.lanes,Bn(s,r,p)}return Vf(s,r,o,d,p)}function zv(s,r,o,d){var p=d.children,_=s!==null?s.memoizedState:null;if(s===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((r.flags&128)!==0){if(_=_!==null?_.baseLanes|o:o,s!==null){for(d=r.child=s.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~_}else d=0,r.child=null;return Iv(s,r,_,o,d)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},s!==null&&Eu(r,_!==null?_.cachePool:null),_!==null?Ub(r,_):xf(),Hb(r);else return d=r.lanes=536870912,Iv(s,r,_!==null?_.baseLanes|o:o,o,d)}else _!==null?(Eu(r,_.cachePool),Ub(r,_),xr(),r.memoizedState=null):(s!==null&&Eu(r,null),xf(),xr());return Ci(s,r,p,o),r.child}function Bl(s,r){return s!==null&&s.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Iv(s,r,o,d,p){var _=mf();return _=_===null?null:{parent:Zt._currentValue,pool:_},r.memoizedState={baseLanes:o,cachePool:_},s!==null&&Eu(r,null),xf(),Hb(r),s!==null&&ho(s,r,d,!0),r.childLanes=p,null}function Uu(s,r){return r=Fu({mode:r.mode,children:r.children},s.mode),r.ref=s.ref,s.child=r,r.return=s,r}function Pv(s,r,o){return _a(r,s.child,null,o),s=Uu(r,r.pendingProps),s.flags|=2,fs(r),r.memoizedState=null,s}function g5(s,r,o){var d=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,s===null){if(tt){if(d.mode==="hidden")return s=Uu(r,d),r.lanes=536870912,Bl(null,s);if(Sf(r),(s=kt)?(s=Z1(s,Ns),s=s!==null&&s.data==="&"?s:null,s!==null&&(r.memoizedState={dehydrated:s,treeContext:hr!==null?{id:tn,overflow:sn}:null,retryLane:536870912,hydrationErrors:null},o=Sb(s),o.return=r,r.child=o,wi=r,kt=null)):s=null,s===null)throw mr(r);return r.lanes=536870912,null}return Uu(r,d)}var _=s.memoizedState;if(_!==null){var S=_.dehydrated;if(Sf(r),p)if(r.flags&256)r.flags&=-257,r=Pv(s,r,o);else if(r.memoizedState!==null)r.child=s.child,r.flags|=128,r=null;else throw Error(n(558));else if(Jt||ho(s,r,o,!1),p=(o&s.childLanes)!==0,Jt||p){if(d=St,d!==null&&(S=$t(d,o),S!==0&&S!==_.retryLane))throw _.retryLane=S,ca(s,S),ts(d,s,S),$f;Zu(),r=Pv(s,r,o)}else s=_.treeContext,kt=As(S.nextSibling),wi=r,tt=!0,fr=null,Ns=!1,s!==null&&Cb(r,s),r=Uu(r,d),r.flags|=4096;return r}return s=Mn(s.child,{mode:d.mode,children:d.children}),s.ref=r.ref,r.child=s,s.return=r,s}function Hu(s,r){var o=r.ref;if(o===null)s!==null&&s.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(n(284));(s===null||s.ref!==o)&&(r.flags|=4194816)}}function Vf(s,r,o,d,p){return fa(r),o=Ef(s,r,o,d,void 0,p),d=Cf(),s!==null&&!Jt?(kf(s,r,p),Bn(s,r,p)):(tt&&d&&rf(r),r.flags|=1,Ci(s,r,o,p),r.child)}function Uv(s,r,o,d,p,_){return fa(r),r.updateQueue=null,o=$b(r,d,o,p),Fb(s),d=Cf(),s!==null&&!Jt?(kf(s,r,_),Bn(s,r,_)):(tt&&d&&rf(r),r.flags|=1,Ci(s,r,o,_),r.child)}function Hv(s,r,o,d,p){if(fa(r),r.stateNode===null){var _=oo,S=o.contextType;typeof S=="object"&&S!==null&&(_=Ei(S)),_=new o(d,_),r.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Hf,r.stateNode=_,_._reactInternals=r,_=r.stateNode,_.props=d,_.state=r.memoizedState,_.refs={},gf(r),S=o.contextType,_.context=typeof S=="object"&&S!==null?Ei(S):oo,_.state=r.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(Uf(r,o,S,d),_.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(S=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),S!==_.state&&Hf.enqueueReplaceState(_,_.state,null),Rl(r,d,_,p),Ml(),_.state=r.memoizedState),typeof _.componentDidMount=="function"&&(r.flags|=4194308),d=!0}else if(s===null){_=r.stateNode;var k=r.memoizedProps,B=va(o,k);_.props=B;var Z=_.context,ne=o.contextType;S=oo,typeof ne=="object"&&ne!==null&&(S=Ei(ne));var oe=o.getDerivedStateFromProps;ne=typeof oe=="function"||typeof _.getSnapshotBeforeUpdate=="function",k=r.pendingProps!==k,ne||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(k||Z!==S)&&Nv(r,_,d,S),gr=!1;var Q=r.memoizedState;_.state=Q,Rl(r,d,_,p),Ml(),Z=r.memoizedState,k||Q!==Z||gr?(typeof oe=="function"&&(Uf(r,o,oe,d),Z=r.memoizedState),(B=gr||kv(r,o,B,d,Q,Z,S))?(ne||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(r.flags|=4194308)):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=Z),_.props=d,_.state=Z,_.context=S,d=B):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{_=r.stateNode,_f(s,r),S=r.memoizedProps,ne=va(o,S),_.props=ne,oe=r.pendingProps,Q=_.context,Z=o.contextType,B=oo,typeof Z=="object"&&Z!==null&&(B=Ei(Z)),k=o.getDerivedStateFromProps,(Z=typeof k=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(S!==oe||Q!==B)&&Nv(r,_,d,B),gr=!1,Q=r.memoizedState,_.state=Q,Rl(r,d,_,p),Ml();var se=r.memoizedState;S!==oe||Q!==se||gr||s!==null&&s.dependencies!==null&&Su(s.dependencies)?(typeof k=="function"&&(Uf(r,o,k,d),se=r.memoizedState),(ne=gr||kv(r,o,ne,d,Q,se,B)||s!==null&&s.dependencies!==null&&Su(s.dependencies))?(Z||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(d,se,B),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(d,se,B)),typeof _.componentDidUpdate=="function"&&(r.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof _.componentDidUpdate!="function"||S===s.memoizedProps&&Q===s.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||S===s.memoizedProps&&Q===s.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=se),_.props=d,_.state=se,_.context=B,d=ne):(typeof _.componentDidUpdate!="function"||S===s.memoizedProps&&Q===s.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||S===s.memoizedProps&&Q===s.memoizedState||(r.flags|=1024),d=!1)}return _=d,Hu(s,r),d=(r.flags&128)!==0,_||d?(_=r.stateNode,o=d&&typeof o.getDerivedStateFromError!="function"?null:_.render(),r.flags|=1,s!==null&&d?(r.child=_a(r,s.child,null,p),r.child=_a(r,null,o,p)):Ci(s,r,o,p),r.memoizedState=_.state,s=r.child):s=Bn(s,r,p),s}function Fv(s,r,o,d){return da(),r.flags|=256,Ci(s,r,o,d),r.child}var qf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kf(s){return{baseLanes:s,cachePool:Rb()}}function Gf(s,r,o){return s=s!==null?s.childLanes&~o:0,r&&(s|=ps),s}function $v(s,r,o){var d=r.pendingProps,p=!1,_=(r.flags&128)!==0,S;if((S=_)||(S=s!==null&&s.memoizedState===null?!1:(Kt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,s===null){if(tt){if(p?vr(r):xr(),(s=kt)?(s=Z1(s,Ns),s=s!==null&&s.data!=="&"?s:null,s!==null&&(r.memoizedState={dehydrated:s,treeContext:hr!==null?{id:tn,overflow:sn}:null,retryLane:536870912,hydrationErrors:null},o=Sb(s),o.return=r,r.child=o,wi=r,kt=null)):s=null,s===null)throw mr(r);return Am(s)?r.lanes=32:r.lanes=536870912,null}var k=d.children;return d=d.fallback,p?(xr(),p=r.mode,k=Fu({mode:"hidden",children:k},p),d=ua(d,p,o,null),k.return=r,d.return=r,k.sibling=d,r.child=k,d=r.child,d.memoizedState=Kf(o),d.childLanes=Gf(s,S,o),r.memoizedState=qf,Bl(null,d)):(vr(r),Wf(r,k))}var B=s.memoizedState;if(B!==null&&(k=B.dehydrated,k!==null)){if(_)r.flags&256?(vr(r),r.flags&=-257,r=Yf(s,r,o)):r.memoizedState!==null?(xr(),r.child=s.child,r.flags|=128,r=null):(xr(),k=d.fallback,p=r.mode,d=Fu({mode:"visible",children:d.children},p),k=ua(k,p,o,null),k.flags|=2,d.return=r,k.return=r,d.sibling=k,r.child=d,_a(r,s.child,null,o),d=r.child,d.memoizedState=Kf(o),d.childLanes=Gf(s,S,o),r.memoizedState=qf,r=Bl(null,d));else if(vr(r),Am(k)){if(S=k.nextSibling&&k.nextSibling.dataset,S)var Z=S.dgst;S=Z,d=Error(n(419)),d.stack="",d.digest=S,El({value:d,source:null,stack:null}),r=Yf(s,r,o)}else if(Jt||ho(s,r,o,!1),S=(o&s.childLanes)!==0,Jt||S){if(S=St,S!==null&&(d=$t(S,o),d!==0&&d!==B.retryLane))throw B.retryLane=d,ca(s,d),ts(S,s,d),$f;Tm(k)||Zu(),r=Yf(s,r,o)}else Tm(k)?(r.flags|=192,r.child=s.child,r=null):(s=B.treeContext,kt=As(k.nextSibling),wi=r,tt=!0,fr=null,Ns=!1,s!==null&&Cb(r,s),r=Wf(r,d.children),r.flags|=4096);return r}return p?(xr(),k=d.fallback,p=r.mode,B=s.child,Z=B.sibling,d=Mn(B,{mode:"hidden",children:d.children}),d.subtreeFlags=B.subtreeFlags&65011712,Z!==null?k=Mn(Z,k):(k=ua(k,p,o,null),k.flags|=2),k.return=r,d.return=r,d.sibling=k,r.child=d,Bl(null,d),d=r.child,k=s.child.memoizedState,k===null?k=Kf(o):(p=k.cachePool,p!==null?(B=Zt._currentValue,p=p.parent!==B?{parent:B,pool:B}:p):p=Rb(),k={baseLanes:k.baseLanes|o,cachePool:p}),d.memoizedState=k,d.childLanes=Gf(s,S,o),r.memoizedState=qf,Bl(s.child,d)):(vr(r),o=s.child,s=o.sibling,o=Mn(o,{mode:"visible",children:d.children}),o.return=r,o.sibling=null,s!==null&&(S=r.deletions,S===null?(r.deletions=[s],r.flags|=16):S.push(s)),r.child=o,r.memoizedState=null,o)}function Wf(s,r){return r=Fu({mode:"visible",children:r},s.mode),r.return=s,s.child=r}function Fu(s,r){return s=ds(22,s,null,r),s.lanes=0,s}function Yf(s,r,o){return _a(r,s.child,null,o),s=Wf(r,r.pendingProps.children),s.flags|=2,r.memoizedState=null,s}function Vv(s,r,o){s.lanes|=r;var d=s.alternate;d!==null&&(d.lanes|=r),uf(s.return,r,o)}function Xf(s,r,o,d,p,_){var S=s.memoizedState;S===null?s.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:o,tailMode:p,treeForkCount:_}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=o,S.tailMode=p,S.treeForkCount=_)}function qv(s,r,o){var d=r.pendingProps,p=d.revealOrder,_=d.tail;d=d.children;var S=Kt.current,k=(S&2)!==0;if(k?(S=S&1|2,r.flags|=128):S&=1,ue(Kt,S),Ci(s,r,d,o),d=tt?wl:0,!k&&s!==null&&(s.flags&128)!==0)e:for(s=r.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Vv(s,o,r);else if(s.tag===19)Vv(s,o,r);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(p){case"forwards":for(o=r.child,p=null;o!==null;)s=o.alternate,s!==null&&Mu(s)===null&&(p=o),o=o.sibling;o=p,o===null?(p=r.child,r.child=null):(p=o.sibling,o.sibling=null),Xf(r,!1,p,o,_,d);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=r.child,r.child=null;p!==null;){if(s=p.alternate,s!==null&&Mu(s)===null){r.child=p;break}s=p.sibling,p.sibling=o,o=p,p=s}Xf(r,!0,o,null,_,d);break;case"together":Xf(r,!1,null,null,void 0,d);break;default:r.memoizedState=null}return r.child}function Bn(s,r,o){if(s!==null&&(r.dependencies=s.dependencies),wr|=r.lanes,(o&r.childLanes)===0)if(s!==null){if(ho(s,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(s!==null&&r.child!==s.child)throw Error(n(153));if(r.child!==null){for(s=r.child,o=Mn(s,s.pendingProps),r.child=o,o.return=r;s.sibling!==null;)s=s.sibling,o=o.sibling=Mn(s,s.pendingProps),o.return=r;o.sibling=null}return r.child}function Zf(s,r){return(s.lanes&r)!==0?!0:(s=s.dependencies,!!(s!==null&&Su(s)))}function _5(s,r,o){switch(r.tag){case 3:ze(r,r.stateNode.containerInfo),pr(r,Zt,s.memoizedState.cache),da();break;case 27:case 5:nt(r);break;case 4:ze(r,r.stateNode.containerInfo);break;case 10:pr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Sf(r),null;break;case 13:var d=r.memoizedState;if(d!==null)return d.dehydrated!==null?(vr(r),r.flags|=128,null):(o&r.child.childLanes)!==0?$v(s,r,o):(vr(r),s=Bn(s,r,o),s!==null?s.sibling:null);vr(r);break;case 19:var p=(s.flags&128)!==0;if(d=(o&r.childLanes)!==0,d||(ho(s,r,o,!1),d=(o&r.childLanes)!==0),p){if(d)return qv(s,r,o);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ue(Kt,Kt.current),d)break;return null;case 22:return r.lanes=0,zv(s,r,o,r.pendingProps);case 24:pr(r,Zt,s.memoizedState.cache)}return Bn(s,r,o)}function Kv(s,r,o){if(s!==null)if(s.memoizedProps!==r.pendingProps)Jt=!0;else{if(!Zf(s,o)&&(r.flags&128)===0)return Jt=!1,_5(s,r,o);Jt=(s.flags&131072)!==0}else Jt=!1,tt&&(r.flags&1048576)!==0&&Eb(r,wl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var d=r.pendingProps;if(s=pa(r.elementType),r.type=s,typeof s=="function")tf(s)?(d=va(s,d),r.tag=1,r=Hv(null,r,s,d,o)):(r.tag=0,r=Vf(null,r,s,d,o));else{if(s!=null){var p=s.$$typeof;if(p===A){r.tag=11,r=jv(null,r,s,d,o);break e}else if(p===j){r.tag=14,r=Lv(null,r,s,d,o);break e}}throw r=te(s)||s,Error(n(306,r,""))}}return r;case 0:return Vf(s,r,r.type,r.pendingProps,o);case 1:return d=r.type,p=va(d,r.pendingProps),Hv(s,r,d,p,o);case 3:e:{if(ze(r,r.stateNode.containerInfo),s===null)throw Error(n(387));d=r.pendingProps;var _=r.memoizedState;p=_.element,_f(s,r),Rl(r,d,null,o);var S=r.memoizedState;if(d=S.cache,pr(r,Zt,d),d!==_.cache&&df(r,[Zt],o,!0),Ml(),d=S.element,_.isDehydrated)if(_={element:d,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){r=Fv(s,r,d,o);break e}else if(d!==p){p=Es(Error(n(424)),r),El(p),r=Fv(s,r,d,o);break e}else for(s=r.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,kt=As(s.firstChild),wi=r,tt=!0,fr=null,Ns=!0,o=zb(r,null,d,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(da(),d===p){r=Bn(s,r,o);break e}Ci(s,r,d,o)}r=r.child}return r;case 26:return Hu(s,r),s===null?(o=sx(r.type,null,r.pendingProps,null))?r.memoizedState=o:tt||(o=r.type,s=r.pendingProps,d=nd(me.current).createElement(o),d[Vt]=r,d[Di]=s,ki(d,o,s),Yt(d),r.stateNode=d):r.memoizedState=sx(r.type,s.memoizedProps,r.pendingProps,s.memoizedState),null;case 27:return nt(r),s===null&&tt&&(d=r.stateNode=ex(r.type,r.pendingProps,me.current),wi=r,Ns=!0,p=kt,Tr(r.type)?(Mm=p,kt=As(d.firstChild)):kt=p),Ci(s,r,r.pendingProps.children,o),Hu(s,r),s===null&&(r.flags|=4194304),r.child;case 5:return s===null&&tt&&((p=d=kt)&&(d=G5(d,r.type,r.pendingProps,Ns),d!==null?(r.stateNode=d,wi=r,kt=As(d.firstChild),Ns=!1,p=!0):p=!1),p||mr(r)),nt(r),p=r.type,_=r.pendingProps,S=s!==null?s.memoizedProps:null,d=_.children,Cm(p,_)?d=null:S!==null&&Cm(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=Ef(s,r,l5,null,null,o),Zl._currentValue=p),Hu(s,r),Ci(s,r,d,o),r.child;case 6:return s===null&&tt&&((s=o=kt)&&(o=W5(o,r.pendingProps,Ns),o!==null?(r.stateNode=o,wi=r,kt=null,s=!0):s=!1),s||mr(r)),null;case 13:return $v(s,r,o);case 4:return ze(r,r.stateNode.containerInfo),d=r.pendingProps,s===null?r.child=_a(r,null,d,o):Ci(s,r,d,o),r.child;case 11:return jv(s,r,r.type,r.pendingProps,o);case 7:return Ci(s,r,r.pendingProps,o),r.child;case 8:return Ci(s,r,r.pendingProps.children,o),r.child;case 12:return Ci(s,r,r.pendingProps.children,o),r.child;case 10:return d=r.pendingProps,pr(r,r.type,d.value),Ci(s,r,d.children,o),r.child;case 9:return p=r.type._context,d=r.pendingProps.children,fa(r),p=Ei(p),d=d(p),r.flags|=1,Ci(s,r,d,o),r.child;case 14:return Lv(s,r,r.type,r.pendingProps,o);case 15:return Bv(s,r,r.type,r.pendingProps,o);case 19:return qv(s,r,o);case 31:return g5(s,r,o);case 22:return zv(s,r,o,r.pendingProps);case 24:return fa(r),d=Ei(Zt),s===null?(p=mf(),p===null&&(p=St,_=hf(),p.pooledCache=_,_.refCount++,_!==null&&(p.pooledCacheLanes|=o),p=_),r.memoizedState={parent:d,cache:p},gf(r),pr(r,Zt,p)):((s.lanes&o)!==0&&(_f(s,r),Rl(r,null,null,o),Ml()),p=s.memoizedState,_=r.memoizedState,p.parent!==d?(p={parent:d,cache:d},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),pr(r,Zt,d)):(d=_.cache,pr(r,Zt,d),d!==p.cache&&df(r,[Zt],o,!0))),Ci(s,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function zn(s){s.flags|=4}function Qf(s,r,o,d,p){if((r=(s.mode&32)!==0)&&(r=!1),r){if(s.flags|=16777216,(p&335544128)===p)if(s.stateNode.complete)s.flags|=8192;else if(v1())s.flags|=8192;else throw ga=ku,pf}else s.flags&=-16777217}function Gv(s,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!lx(r))if(v1())s.flags|=8192;else throw ga=ku,pf}function $u(s,r){r!==null&&(s.flags|=4),s.flags&16384&&(r=s.tag!==22?Ie():536870912,s.lanes|=r,Eo|=r)}function zl(s,r){if(!tt)switch(s.tailMode){case"hidden":r=s.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?s.tail=null:o.sibling=null;break;case"collapsed":o=s.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?r||s.tail===null?s.tail=null:s.tail.sibling=null:d.sibling=null}}function Nt(s){var r=s.alternate!==null&&s.alternate.child===s.child,o=0,d=0;if(r)for(var p=s.child;p!==null;)o|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=s,p=p.sibling;else for(p=s.child;p!==null;)o|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=s,p=p.sibling;return s.subtreeFlags|=d,s.childLanes=o,r}function b5(s,r,o){var d=r.pendingProps;switch(af(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(r),null;case 1:return Nt(r),null;case 3:return o=r.stateNode,d=null,s!==null&&(d=s.memoizedState.cache),r.memoizedState.cache!==d&&(r.flags|=2048),On(Zt),Ee(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(s===null||s.child===null)&&(uo(r)?zn(r):s===null||s.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,lf())),Nt(r),null;case 26:var p=r.type,_=r.memoizedState;return s===null?(zn(r),_!==null?(Nt(r),Gv(r,_)):(Nt(r),Qf(r,p,null,d,o))):_?_!==s.memoizedState?(zn(r),Nt(r),Gv(r,_)):(Nt(r),r.flags&=-16777217):(s=s.memoizedProps,s!==d&&zn(r),Nt(r),Qf(r,p,s,d,o)),null;case 27:if(lt(r),o=me.current,p=r.type,s!==null&&r.stateNode!=null)s.memoizedProps!==d&&zn(r);else{if(!d){if(r.stateNode===null)throw Error(n(166));return Nt(r),null}s=ie.current,uo(r)?kb(r):(s=ex(p,d,o),r.stateNode=s,zn(r))}return Nt(r),null;case 5:if(lt(r),p=r.type,s!==null&&r.stateNode!=null)s.memoizedProps!==d&&zn(r);else{if(!d){if(r.stateNode===null)throw Error(n(166));return Nt(r),null}if(_=ie.current,uo(r))kb(r);else{var S=nd(me.current);switch(_){case 1:_=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:_=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":_=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":_=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":_=S.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?_.multiple=!0:d.size&&(_.size=d.size);break;default:_=typeof d.is=="string"?S.createElement(p,{is:d.is}):S.createElement(p)}}_[Vt]=r,_[Di]=d;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)_.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=_;e:switch(ki(_,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&zn(r)}}return Nt(r),Qf(r,r.type,s===null?null:s.memoizedProps,r.pendingProps,o),null;case 6:if(s&&r.stateNode!=null)s.memoizedProps!==d&&zn(r);else{if(typeof d!="string"&&r.stateNode===null)throw Error(n(166));if(s=me.current,uo(r)){if(s=r.stateNode,o=r.memoizedProps,d=null,p=wi,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}s[Vt]=r,s=!!(s.nodeValue===o||d!==null&&d.suppressHydrationWarning===!0||$1(s.nodeValue,o)),s||mr(r,!0)}else s=nd(s).createTextNode(d),s[Vt]=r,r.stateNode=s}return Nt(r),null;case 31:if(o=r.memoizedState,s===null||s.memoizedState!==null){if(d=uo(r),o!==null){if(s===null){if(!d)throw Error(n(318));if(s=r.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(557));s[Vt]=r}else da(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nt(r),s=!1}else o=lf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=o),s=!0;if(!s)return r.flags&256?(fs(r),r):(fs(r),null);if((r.flags&128)!==0)throw Error(n(558))}return Nt(r),null;case 13:if(d=r.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(p=uo(r),d!==null&&d.dehydrated!==null){if(s===null){if(!p)throw Error(n(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(n(317));p[Vt]=r}else da(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nt(r),p=!1}else p=lf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(fs(r),r):(fs(r),null)}return fs(r),(r.flags&128)!==0?(r.lanes=o,r):(o=d!==null,s=s!==null&&s.memoizedState!==null,o&&(d=r.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),_=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(_=d.memoizedState.cachePool.pool),_!==p&&(d.flags|=2048)),o!==s&&o&&(r.child.flags|=8192),$u(r,r.updateQueue),Nt(r),null);case 4:return Ee(),s===null&&xm(r.stateNode.containerInfo),Nt(r),null;case 10:return On(r.type),Nt(r),null;case 19:if(ee(Kt),d=r.memoizedState,d===null)return Nt(r),null;if(p=(r.flags&128)!==0,_=d.rendering,_===null)if(p)zl(d,!1);else{if(It!==0||s!==null&&(s.flags&128)!==0)for(s=r.child;s!==null;){if(_=Mu(s),_!==null){for(r.flags|=128,zl(d,!1),s=_.updateQueue,r.updateQueue=s,$u(r,s),r.subtreeFlags=0,s=o,o=r.child;o!==null;)yb(o,s),o=o.sibling;return ue(Kt,Kt.current&1|2),tt&&Rn(r,d.treeForkCount),r.child}s=s.sibling}d.tail!==null&&Ot()>Wu&&(r.flags|=128,p=!0,zl(d,!1),r.lanes=4194304)}else{if(!p)if(s=Mu(_),s!==null){if(r.flags|=128,p=!0,s=s.updateQueue,r.updateQueue=s,$u(r,s),zl(d,!0),d.tail===null&&d.tailMode==="hidden"&&!_.alternate&&!tt)return Nt(r),null}else 2*Ot()-d.renderingStartTime>Wu&&o!==536870912&&(r.flags|=128,p=!0,zl(d,!1),r.lanes=4194304);d.isBackwards?(_.sibling=r.child,r.child=_):(s=d.last,s!==null?s.sibling=_:r.child=_,d.last=_)}return d.tail!==null?(s=d.tail,d.rendering=s,d.tail=s.sibling,d.renderingStartTime=Ot(),s.sibling=null,o=Kt.current,ue(Kt,p?o&1|2:o&1),tt&&Rn(r,d.treeForkCount),s):(Nt(r),null);case 22:case 23:return fs(r),yf(),d=r.memoizedState!==null,s!==null?s.memoizedState!==null!==d&&(r.flags|=8192):d&&(r.flags|=8192),d?(o&536870912)!==0&&(r.flags&128)===0&&(Nt(r),r.subtreeFlags&6&&(r.flags|=8192)):Nt(r),o=r.updateQueue,o!==null&&$u(r,o.retryQueue),o=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==o&&(r.flags|=2048),s!==null&&ee(ma),null;case 24:return o=null,s!==null&&(o=s.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),On(Zt),Nt(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function v5(s,r){switch(af(r),r.tag){case 1:return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 3:return On(Zt),Ee(),s=r.flags,(s&65536)!==0&&(s&128)===0?(r.flags=s&-65537|128,r):null;case 26:case 27:case 5:return lt(r),null;case 31:if(r.memoizedState!==null){if(fs(r),r.alternate===null)throw Error(n(340));da()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 13:if(fs(r),s=r.memoizedState,s!==null&&s.dehydrated!==null){if(r.alternate===null)throw Error(n(340));da()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 19:return ee(Kt),null;case 4:return Ee(),null;case 10:return On(r.type),null;case 22:case 23:return fs(r),yf(),s!==null&&ee(ma),s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 24:return On(Zt),null;case 25:return null;default:return null}}function Wv(s,r){switch(af(r),r.tag){case 3:On(Zt),Ee();break;case 26:case 27:case 5:lt(r);break;case 4:Ee();break;case 31:r.memoizedState!==null&&fs(r);break;case 13:fs(r);break;case 19:ee(Kt);break;case 10:On(r.type);break;case 22:case 23:fs(r),yf(),s!==null&&ee(ma);break;case 24:On(Zt)}}function Il(s,r){try{var o=r.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var p=d.next;o=p;do{if((o.tag&s)===s){d=void 0;var _=o.create,S=o.inst;d=_(),S.destroy=d}o=o.next}while(o!==p)}}catch(k){pt(r,r.return,k)}}function yr(s,r,o){try{var d=r.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var _=p.next;d=_;do{if((d.tag&s)===s){var S=d.inst,k=S.destroy;if(k!==void 0){S.destroy=void 0,p=r;var B=o,Z=k;try{Z()}catch(ne){pt(p,B,ne)}}}d=d.next}while(d!==_)}}catch(ne){pt(r,r.return,ne)}}function Yv(s){var r=s.updateQueue;if(r!==null){var o=s.stateNode;try{Pb(r,o)}catch(d){pt(s,s.return,d)}}}function Xv(s,r,o){o.props=va(s.type,s.memoizedProps),o.state=s.memoizedState;try{o.componentWillUnmount()}catch(d){pt(s,r,d)}}function Pl(s,r){try{var o=s.ref;if(o!==null){switch(s.tag){case 26:case 27:case 5:var d=s.stateNode;break;case 30:d=s.stateNode;break;default:d=s.stateNode}typeof o=="function"?s.refCleanup=o(d):o.current=d}}catch(p){pt(s,r,p)}}function nn(s,r){var o=s.ref,d=s.refCleanup;if(o!==null)if(typeof d=="function")try{d()}catch(p){pt(s,r,p)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){pt(s,r,p)}else o.current=null}function Zv(s){var r=s.type,o=s.memoizedProps,d=s.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&d.focus();break e;case"img":o.src?d.src=o.src:o.srcSet&&(d.srcset=o.srcSet)}}catch(p){pt(s,s.return,p)}}function Jf(s,r,o){try{var d=s.stateNode;H5(d,s.type,o,r),d[Di]=r}catch(p){pt(s,s.return,p)}}function Qv(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Tr(s.type)||s.tag===4}function em(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Qv(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Tr(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function tm(s,r,o){var d=s.tag;if(d===5||d===6)s=s.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(s,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(s),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=ge));else if(d!==4&&(d===27&&Tr(s.type)&&(o=s.stateNode,r=null),s=s.child,s!==null))for(tm(s,r,o),s=s.sibling;s!==null;)tm(s,r,o),s=s.sibling}function Vu(s,r,o){var d=s.tag;if(d===5||d===6)s=s.stateNode,r?o.insertBefore(s,r):o.appendChild(s);else if(d!==4&&(d===27&&Tr(s.type)&&(o=s.stateNode),s=s.child,s!==null))for(Vu(s,r,o),s=s.sibling;s!==null;)Vu(s,r,o),s=s.sibling}function Jv(s){var r=s.stateNode,o=s.memoizedProps;try{for(var d=s.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);ki(r,d,o),r[Vt]=s,r[Di]=o}catch(_){pt(s,s.return,_)}}var In=!1,ei=!1,im=!1,e1=typeof WeakSet=="function"?WeakSet:Set,mi=null;function x5(s,r){if(s=s.containerInfo,wm=dd,s=hb(s),Wh(s)){if("selectionStart"in s)var o={start:s.selectionStart,end:s.selectionEnd};else e:{o=(o=s.ownerDocument)&&o.defaultView||window;var d=o.getSelection&&o.getSelection();if(d&&d.rangeCount!==0){o=d.anchorNode;var p=d.anchorOffset,_=d.focusNode;d=d.focusOffset;try{o.nodeType,_.nodeType}catch{o=null;break e}var S=0,k=-1,B=-1,Z=0,ne=0,oe=s,Q=null;t:for(;;){for(var se;oe!==o||p!==0&&oe.nodeType!==3||(k=S+p),oe!==_||d!==0&&oe.nodeType!==3||(B=S+d),oe.nodeType===3&&(S+=oe.nodeValue.length),(se=oe.firstChild)!==null;)Q=oe,oe=se;for(;;){if(oe===s)break t;if(Q===o&&++Z===p&&(k=S),Q===_&&++ne===d&&(B=S),(se=oe.nextSibling)!==null)break;oe=Q,Q=oe.parentNode}oe=se}o=k===-1||B===-1?null:{start:k,end:B}}else o=null}o=o||{start:0,end:0}}else o=null;for(Em={focusedElem:s,selectionRange:o},dd=!1,mi=r;mi!==null;)if(r=mi,s=r.child,(r.subtreeFlags&1028)!==0&&s!==null)s.return=r,mi=s;else for(;mi!==null;){switch(r=mi,_=r.alternate,s=r.flags,r.tag){case 0:if((s&4)!==0&&(s=r.updateQueue,s=s!==null?s.events:null,s!==null))for(o=0;o<s.length;o++)p=s[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&_!==null){s=void 0,o=r,p=_.memoizedProps,_=_.memoizedState,d=o.stateNode;try{var Ce=va(o.type,p);s=d.getSnapshotBeforeUpdate(Ce,_),d.__reactInternalSnapshotBeforeUpdate=s}catch(Oe){pt(o,o.return,Oe)}}break;case 3:if((s&1024)!==0){if(s=r.stateNode.containerInfo,o=s.nodeType,o===9)Nm(s);else if(o===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Nm(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(n(163))}if(s=r.sibling,s!==null){s.return=r.return,mi=s;break}mi=r.return}}function t1(s,r,o){var d=o.flags;switch(o.tag){case 0:case 11:case 15:Un(s,o),d&4&&Il(5,o);break;case 1:if(Un(s,o),d&4)if(s=o.stateNode,r===null)try{s.componentDidMount()}catch(S){pt(o,o.return,S)}else{var p=va(o.type,r.memoizedProps);r=r.memoizedState;try{s.componentDidUpdate(p,r,s.__reactInternalSnapshotBeforeUpdate)}catch(S){pt(o,o.return,S)}}d&64&&Yv(o),d&512&&Pl(o,o.return);break;case 3:if(Un(s,o),d&64&&(s=o.updateQueue,s!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{Pb(s,r)}catch(S){pt(o,o.return,S)}}break;case 27:r===null&&d&4&&Jv(o);case 26:case 5:Un(s,o),r===null&&d&4&&Zv(o),d&512&&Pl(o,o.return);break;case 12:Un(s,o);break;case 31:Un(s,o),d&4&&n1(s,o);break;case 13:Un(s,o),d&4&&r1(s,o),d&64&&(s=o.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(o=A5.bind(null,o),Y5(s,o))));break;case 22:if(d=o.memoizedState!==null||In,!d){r=r!==null&&r.memoizedState!==null||ei,p=In;var _=ei;In=d,(ei=r)&&!_?Hn(s,o,(o.subtreeFlags&8772)!==0):Un(s,o),In=p,ei=_}break;case 30:break;default:Un(s,o)}}function i1(s){var r=s.alternate;r!==null&&(s.alternate=null,i1(r)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(r=s.stateNode,r!==null&&cl(r)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Rt=null,Zi=!1;function Pn(s,r,o){for(o=o.child;o!==null;)s1(s,r,o),o=o.sibling}function s1(s,r,o){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(En,o)}catch{}switch(o.tag){case 26:ei||nn(o,r),Pn(s,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ei||nn(o,r);var d=Rt,p=Zi;Tr(o.type)&&(Rt=o.stateNode,Zi=!1),Pn(s,r,o),Wl(o.stateNode),Rt=d,Zi=p;break;case 5:ei||nn(o,r);case 6:if(d=Rt,p=Zi,Rt=null,Pn(s,r,o),Rt=d,Zi=p,Rt!==null)if(Zi)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(o.stateNode)}catch(_){pt(o,r,_)}else try{Rt.removeChild(o.stateNode)}catch(_){pt(o,r,_)}break;case 18:Rt!==null&&(Zi?(s=Rt,Y1(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,o.stateNode),Do(s)):Y1(Rt,o.stateNode));break;case 4:d=Rt,p=Zi,Rt=o.stateNode.containerInfo,Zi=!0,Pn(s,r,o),Rt=d,Zi=p;break;case 0:case 11:case 14:case 15:yr(2,o,r),ei||yr(4,o,r),Pn(s,r,o);break;case 1:ei||(nn(o,r),d=o.stateNode,typeof d.componentWillUnmount=="function"&&Xv(o,r,d)),Pn(s,r,o);break;case 21:Pn(s,r,o);break;case 22:ei=(d=ei)||o.memoizedState!==null,Pn(s,r,o),ei=d;break;default:Pn(s,r,o)}}function n1(s,r){if(r.memoizedState===null&&(s=r.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Do(s)}catch(o){pt(r,r.return,o)}}}function r1(s,r){if(r.memoizedState===null&&(s=r.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Do(s)}catch(o){pt(r,r.return,o)}}function y5(s){switch(s.tag){case 31:case 13:case 19:var r=s.stateNode;return r===null&&(r=s.stateNode=new e1),r;case 22:return s=s.stateNode,r=s._retryCache,r===null&&(r=s._retryCache=new e1),r;default:throw Error(n(435,s.tag))}}function qu(s,r){var o=y5(s);r.forEach(function(d){if(!o.has(d)){o.add(d);var p=M5.bind(null,s,d);d.then(p,p)}})}function Qi(s,r){var o=r.deletions;if(o!==null)for(var d=0;d<o.length;d++){var p=o[d],_=s,S=r,k=S;e:for(;k!==null;){switch(k.tag){case 27:if(Tr(k.type)){Rt=k.stateNode,Zi=!1;break e}break;case 5:Rt=k.stateNode,Zi=!1;break e;case 3:case 4:Rt=k.stateNode.containerInfo,Zi=!0;break e}k=k.return}if(Rt===null)throw Error(n(160));s1(_,S,p),Rt=null,Zi=!1,_=p.alternate,_!==null&&(_.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)a1(r,s),r=r.sibling}var qs=null;function a1(s,r){var o=s.alternate,d=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Qi(r,s),Ji(s),d&4&&(yr(3,s,s.return),Il(3,s),yr(5,s,s.return));break;case 1:Qi(r,s),Ji(s),d&512&&(ei||o===null||nn(o,o.return)),d&64&&In&&(s=s.updateQueue,s!==null&&(d=s.callbacks,d!==null&&(o=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=o===null?d:o.concat(d))));break;case 26:var p=qs;if(Qi(r,s),Ji(s),d&512&&(ei||o===null||nn(o,o.return)),d&4){var _=o!==null?o.memoizedState:null;if(d=s.memoizedState,o===null)if(d===null)if(s.stateNode===null){e:{d=s.type,o=s.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":_=p.getElementsByTagName("title")[0],(!_||_[sa]||_[Vt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=p.createElement(d),p.head.insertBefore(_,p.querySelector("head > title"))),ki(_,d,o),_[Vt]=s,Yt(_),d=_;break e;case"link":var S=ax("link","href",p).get(d+(o.href||""));if(S){for(var k=0;k<S.length;k++)if(_=S[k],_.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&_.getAttribute("rel")===(o.rel==null?null:o.rel)&&_.getAttribute("title")===(o.title==null?null:o.title)&&_.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(k,1);break t}}_=p.createElement(d),ki(_,d,o),p.head.appendChild(_);break;case"meta":if(S=ax("meta","content",p).get(d+(o.content||""))){for(k=0;k<S.length;k++)if(_=S[k],_.getAttribute("content")===(o.content==null?null:""+o.content)&&_.getAttribute("name")===(o.name==null?null:o.name)&&_.getAttribute("property")===(o.property==null?null:o.property)&&_.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&_.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(k,1);break t}}_=p.createElement(d),ki(_,d,o),p.head.appendChild(_);break;default:throw Error(n(468,d))}_[Vt]=s,Yt(_),d=_}s.stateNode=d}else ox(p,s.type,s.stateNode);else s.stateNode=rx(p,d,s.memoizedProps);else _!==d?(_===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):_.count--,d===null?ox(p,s.type,s.stateNode):rx(p,d,s.memoizedProps)):d===null&&s.stateNode!==null&&Jf(s,s.memoizedProps,o.memoizedProps)}break;case 27:Qi(r,s),Ji(s),d&512&&(ei||o===null||nn(o,o.return)),o!==null&&d&4&&Jf(s,s.memoizedProps,o.memoizedProps);break;case 5:if(Qi(r,s),Ji(s),d&512&&(ei||o===null||nn(o,o.return)),s.flags&32){p=s.stateNode;try{je(p,"")}catch(Ce){pt(s,s.return,Ce)}}d&4&&s.stateNode!=null&&(p=s.memoizedProps,Jf(s,p,o!==null?o.memoizedProps:p)),d&1024&&(im=!0);break;case 6:if(Qi(r,s),Ji(s),d&4){if(s.stateNode===null)throw Error(n(162));d=s.memoizedProps,o=s.stateNode;try{o.nodeValue=d}catch(Ce){pt(s,s.return,Ce)}}break;case 3:if(od=null,p=qs,qs=rd(r.containerInfo),Qi(r,s),qs=p,Ji(s),d&4&&o!==null&&o.memoizedState.isDehydrated)try{Do(r.containerInfo)}catch(Ce){pt(s,s.return,Ce)}im&&(im=!1,o1(s));break;case 4:d=qs,qs=rd(s.stateNode.containerInfo),Qi(r,s),Ji(s),qs=d;break;case 12:Qi(r,s),Ji(s);break;case 31:Qi(r,s),Ji(s),d&4&&(d=s.updateQueue,d!==null&&(s.updateQueue=null,qu(s,d)));break;case 13:Qi(r,s),Ji(s),s.child.flags&8192&&s.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Gu=Ot()),d&4&&(d=s.updateQueue,d!==null&&(s.updateQueue=null,qu(s,d)));break;case 22:p=s.memoizedState!==null;var B=o!==null&&o.memoizedState!==null,Z=In,ne=ei;if(In=Z||p,ei=ne||B,Qi(r,s),ei=ne,In=Z,Ji(s),d&8192)e:for(r=s.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(o===null||B||In||ei||xa(s)),o=null,r=s;;){if(r.tag===5||r.tag===26){if(o===null){B=o=r;try{if(_=B.stateNode,p)S=_.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{k=B.stateNode;var oe=B.memoizedProps.style,Q=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;k.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Ce){pt(B,B.return,Ce)}}}else if(r.tag===6){if(o===null){B=r;try{B.stateNode.nodeValue=p?"":B.memoizedProps}catch(Ce){pt(B,B.return,Ce)}}}else if(r.tag===18){if(o===null){B=r;try{var se=B.stateNode;p?X1(se,!0):X1(B.stateNode,!1)}catch(Ce){pt(B,B.return,Ce)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===s)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}d&4&&(d=s.updateQueue,d!==null&&(o=d.retryQueue,o!==null&&(d.retryQueue=null,qu(s,o))));break;case 19:Qi(r,s),Ji(s),d&4&&(d=s.updateQueue,d!==null&&(s.updateQueue=null,qu(s,d)));break;case 30:break;case 21:break;default:Qi(r,s),Ji(s)}}function Ji(s){var r=s.flags;if(r&2){try{for(var o,d=s.return;d!==null;){if(Qv(d)){o=d;break}d=d.return}if(o==null)throw Error(n(160));switch(o.tag){case 27:var p=o.stateNode,_=em(s);Vu(s,_,p);break;case 5:var S=o.stateNode;o.flags&32&&(je(S,""),o.flags&=-33);var k=em(s);Vu(s,k,S);break;case 3:case 4:var B=o.stateNode.containerInfo,Z=em(s);tm(s,Z,B);break;default:throw Error(n(161))}}catch(ne){pt(s,s.return,ne)}s.flags&=-3}r&4096&&(s.flags&=-4097)}function o1(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var r=s;o1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),s=s.sibling}}function Un(s,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)t1(s,r.alternate,r),r=r.sibling}function xa(s){for(s=s.child;s!==null;){var r=s;switch(r.tag){case 0:case 11:case 14:case 15:yr(4,r,r.return),xa(r);break;case 1:nn(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&Xv(r,r.return,o),xa(r);break;case 27:Wl(r.stateNode);case 26:case 5:nn(r,r.return),xa(r);break;case 22:r.memoizedState===null&&xa(r);break;case 30:xa(r);break;default:xa(r)}s=s.sibling}}function Hn(s,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var d=r.alternate,p=s,_=r,S=_.flags;switch(_.tag){case 0:case 11:case 15:Hn(p,_,o),Il(4,_);break;case 1:if(Hn(p,_,o),d=_,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Z){pt(d,d.return,Z)}if(d=_,p=d.updateQueue,p!==null){var k=d.stateNode;try{var B=p.shared.hiddenCallbacks;if(B!==null)for(p.shared.hiddenCallbacks=null,p=0;p<B.length;p++)Ib(B[p],k)}catch(Z){pt(d,d.return,Z)}}o&&S&64&&Yv(_),Pl(_,_.return);break;case 27:Jv(_);case 26:case 5:Hn(p,_,o),o&&d===null&&S&4&&Zv(_),Pl(_,_.return);break;case 12:Hn(p,_,o);break;case 31:Hn(p,_,o),o&&S&4&&n1(p,_);break;case 13:Hn(p,_,o),o&&S&4&&r1(p,_);break;case 22:_.memoizedState===null&&Hn(p,_,o),Pl(_,_.return);break;case 30:break;default:Hn(p,_,o)}r=r.sibling}}function sm(s,r){var o=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==o&&(s!=null&&s.refCount++,o!=null&&Cl(o))}function nm(s,r){s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&Cl(s))}function Ks(s,r,o,d){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)l1(s,r,o,d),r=r.sibling}function l1(s,r,o,d){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Ks(s,r,o,d),p&2048&&Il(9,r);break;case 1:Ks(s,r,o,d);break;case 3:Ks(s,r,o,d),p&2048&&(s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&Cl(s)));break;case 12:if(p&2048){Ks(s,r,o,d),s=r.stateNode;try{var _=r.memoizedProps,S=_.id,k=_.onPostCommit;typeof k=="function"&&k(S,r.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(B){pt(r,r.return,B)}}else Ks(s,r,o,d);break;case 31:Ks(s,r,o,d);break;case 13:Ks(s,r,o,d);break;case 23:break;case 22:_=r.stateNode,S=r.alternate,r.memoizedState!==null?_._visibility&2?Ks(s,r,o,d):Ul(s,r):_._visibility&2?Ks(s,r,o,d):(_._visibility|=2,yo(s,r,o,d,(r.subtreeFlags&10256)!==0||!1)),p&2048&&sm(S,r);break;case 24:Ks(s,r,o,d),p&2048&&nm(r.alternate,r);break;default:Ks(s,r,o,d)}}function yo(s,r,o,d,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var _=s,S=r,k=o,B=d,Z=S.flags;switch(S.tag){case 0:case 11:case 15:yo(_,S,k,B,p),Il(8,S);break;case 23:break;case 22:var ne=S.stateNode;S.memoizedState!==null?ne._visibility&2?yo(_,S,k,B,p):Ul(_,S):(ne._visibility|=2,yo(_,S,k,B,p)),p&&Z&2048&&sm(S.alternate,S);break;case 24:yo(_,S,k,B,p),p&&Z&2048&&nm(S.alternate,S);break;default:yo(_,S,k,B,p)}r=r.sibling}}function Ul(s,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=s,d=r,p=d.flags;switch(d.tag){case 22:Ul(o,d),p&2048&&sm(d.alternate,d);break;case 24:Ul(o,d),p&2048&&nm(d.alternate,d);break;default:Ul(o,d)}r=r.sibling}}var Hl=8192;function So(s,r,o){if(s.subtreeFlags&Hl)for(s=s.child;s!==null;)c1(s,r,o),s=s.sibling}function c1(s,r,o){switch(s.tag){case 26:So(s,r,o),s.flags&Hl&&s.memoizedState!==null&&oT(o,qs,s.memoizedState,s.memoizedProps);break;case 5:So(s,r,o);break;case 3:case 4:var d=qs;qs=rd(s.stateNode.containerInfo),So(s,r,o),qs=d;break;case 22:s.memoizedState===null&&(d=s.alternate,d!==null&&d.memoizedState!==null?(d=Hl,Hl=16777216,So(s,r,o),Hl=d):So(s,r,o));break;default:So(s,r,o)}}function u1(s){var r=s.alternate;if(r!==null&&(s=r.child,s!==null)){r.child=null;do r=s.sibling,s.sibling=null,s=r;while(s!==null)}}function Fl(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var d=r[o];mi=d,h1(d,s)}u1(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)d1(s),s=s.sibling}function d1(s){switch(s.tag){case 0:case 11:case 15:Fl(s),s.flags&2048&&yr(9,s,s.return);break;case 3:Fl(s);break;case 12:Fl(s);break;case 22:var r=s.stateNode;s.memoizedState!==null&&r._visibility&2&&(s.return===null||s.return.tag!==13)?(r._visibility&=-3,Ku(s)):Fl(s);break;default:Fl(s)}}function Ku(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var d=r[o];mi=d,h1(d,s)}u1(s)}for(s=s.child;s!==null;){switch(r=s,r.tag){case 0:case 11:case 15:yr(8,r,r.return),Ku(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Ku(r));break;default:Ku(r)}s=s.sibling}}function h1(s,r){for(;mi!==null;){var o=mi;switch(o.tag){case 0:case 11:case 15:yr(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var d=o.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Cl(o.memoizedState.cache)}if(d=o.child,d!==null)d.return=o,mi=d;else e:for(o=s;mi!==null;){d=mi;var p=d.sibling,_=d.return;if(i1(d),d===o){mi=null;break e}if(p!==null){p.return=_,mi=p;break e}mi=_}}}var S5={getCacheForType:function(s){var r=Ei(Zt),o=r.data.get(s);return o===void 0&&(o=s(),r.data.set(s,o)),o},cacheSignal:function(){return Ei(Zt).controller.signal}},w5=typeof WeakMap=="function"?WeakMap:Map,ut=0,St=null,Xe=null,Je=0,mt=0,ms=null,Sr=!1,wo=!1,rm=!1,Fn=0,It=0,wr=0,ya=0,am=0,ps=0,Eo=0,$l=null,es=null,om=!1,Gu=0,f1=0,Wu=1/0,Yu=null,Er=null,ai=0,Cr=null,Co=null,$n=0,lm=0,cm=null,m1=null,Vl=0,um=null;function gs(){return(ut&2)!==0&&Je!==0?Je&-Je:M.T!==null?gm():Xa()}function p1(){if(ps===0)if((Je&536870912)===0||tt){var s=$s;$s<<=1,($s&3932160)===0&&($s=262144),ps=s}else ps=536870912;return s=hs.current,s!==null&&(s.flags|=32),ps}function ts(s,r,o){(s===St&&(mt===2||mt===9)||s.cancelPendingCommit!==null)&&(ko(s,0),kr(s,Je,ps,!1)),yt(s,o),((ut&2)===0||s!==St)&&(s===St&&((ut&2)===0&&(ya|=o),It===4&&kr(s,Je,ps,!1)),rn(s))}function g1(s,r,o){if((ut&6)!==0)throw Error(n(327));var d=!o&&(r&127)===0&&(r&s.expiredLanes)===0||re(s,r),p=d?k5(s,r):hm(s,r,!0),_=d;do{if(p===0){wo&&!d&&kr(s,r,0,!1);break}else{if(o=s.current.alternate,_&&!E5(o)){p=hm(s,r,!1),_=!1;continue}if(p===2){if(_=r,s.errorRecoveryDisabledLanes&_)var S=0;else S=s.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var k=s;p=$l;var B=k.current.memoizedState.isDehydrated;if(B&&(ko(k,S).flags|=256),S=hm(k,S,!1),S!==2){if(rm&&!B){k.errorRecoveryDisabledLanes|=_,ya|=_,p=4;break e}_=es,es=p,_!==null&&(es===null?es=_:es.push.apply(es,_))}p=S}if(_=!1,p!==2)continue}}if(p===1){ko(s,0),kr(s,r,0,!0);break}e:{switch(d=s,_=p,_){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:kr(d,r,ps,!Sr);break e;case 2:es=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(p=Gu+300-Ot(),10<p)){if(kr(d,r,ps,!Sr),z(d,0,!0)!==0)break e;$n=r,d.timeoutHandle=G1(_1.bind(null,d,o,es,Yu,om,r,ps,ya,Eo,Sr,_,"Throttled",-0,0),p);break e}_1(d,o,es,Yu,om,r,ps,ya,Eo,Sr,_,null,-0,0)}}break}while(!0);rn(s)}function _1(s,r,o,d,p,_,S,k,B,Z,ne,oe,Q,se){if(s.timeoutHandle=-1,oe=r.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ge},c1(r,_,oe);var Ce=(_&62914560)===_?Gu-Ot():(_&4194048)===_?f1-Ot():0;if(Ce=lT(oe,Ce),Ce!==null){$n=_,s.cancelPendingCommit=Ce(C1.bind(null,s,r,_,o,d,p,S,k,B,ne,oe,null,Q,se)),kr(s,_,S,!Z);return}}C1(s,r,_,o,d,p,S,k,B)}function E5(s){for(var r=s;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var d=0;d<o.length;d++){var p=o[d],_=p.getSnapshot;p=p.value;try{if(!us(_(),p))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function kr(s,r,o,d){r&=~am,r&=~ya,s.suspendedLanes|=r,s.pingedLanes&=~r,d&&(s.warmLanes|=r),d=s.expirationTimes;for(var p=r;0<p;){var _=31-yi(p),S=1<<_;d[_]=-1,p&=~S}o!==0&&xe(s,o,r)}function Xu(){return(ut&6)===0?(ql(0),!1):!0}function dm(){if(Xe!==null){if(mt===0)var s=Xe.return;else s=Xe,Dn=ha=null,Nf(s),go=null,Nl=0,s=Xe;for(;s!==null;)Wv(s.alternate,s),s=s.return;Xe=null}}function ko(s,r){var o=s.timeoutHandle;o!==-1&&(s.timeoutHandle=-1,V5(o)),o=s.cancelPendingCommit,o!==null&&(s.cancelPendingCommit=null,o()),$n=0,dm(),St=s,Xe=o=Mn(s.current,null),Je=r,mt=0,ms=null,Sr=!1,wo=re(s,r),rm=!1,Eo=ps=am=ya=wr=It=0,es=$l=null,om=!1,(r&8)!==0&&(r|=r&32);var d=s.entangledLanes;if(d!==0)for(s=s.entanglements,d&=r;0<d;){var p=31-yi(d),_=1<<p;r|=s[p],d&=~_}return Fn=r,_u(),o}function b1(s,r){Fe=null,M.H=Ll,r===po||r===Cu?(r=jb(),mt=3):r===pf?(r=jb(),mt=4):mt=r===$f?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ms=r,Xe===null&&(It=1,Pu(s,Es(r,s.current)))}function v1(){var s=hs.current;return s===null?!0:(Je&4194048)===Je?Ts===null:(Je&62914560)===Je||(Je&536870912)!==0?s===Ts:!1}function x1(){var s=M.H;return M.H=Ll,s===null?Ll:s}function y1(){var s=M.A;return M.A=S5,s}function Zu(){It=4,Sr||(Je&4194048)!==Je&&hs.current!==null||(wo=!0),(wr&134217727)===0&&(ya&134217727)===0||St===null||kr(St,Je,ps,!1)}function hm(s,r,o){var d=ut;ut|=2;var p=x1(),_=y1();(St!==s||Je!==r)&&(Yu=null,ko(s,r)),r=!1;var S=It;e:do try{if(mt!==0&&Xe!==null){var k=Xe,B=ms;switch(mt){case 8:dm(),S=6;break e;case 3:case 2:case 9:case 6:hs.current===null&&(r=!0);var Z=mt;if(mt=0,ms=null,No(s,k,B,Z),o&&wo){S=0;break e}break;default:Z=mt,mt=0,ms=null,No(s,k,B,Z)}}C5(),S=It;break}catch(ne){b1(s,ne)}while(!0);return r&&s.shellSuspendCounter++,Dn=ha=null,ut=d,M.H=p,M.A=_,Xe===null&&(St=null,Je=0,_u()),S}function C5(){for(;Xe!==null;)S1(Xe)}function k5(s,r){var o=ut;ut|=2;var d=x1(),p=y1();St!==s||Je!==r?(Yu=null,Wu=Ot()+500,ko(s,r)):wo=re(s,r);e:do try{if(mt!==0&&Xe!==null){r=Xe;var _=ms;t:switch(mt){case 1:mt=0,ms=null,No(s,r,_,1);break;case 2:case 9:if(Db(_)){mt=0,ms=null,w1(r);break}r=function(){mt!==2&&mt!==9||St!==s||(mt=7),rn(s)},_.then(r,r);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:Db(_)?(mt=0,ms=null,w1(r)):(mt=0,ms=null,No(s,r,_,7));break;case 5:var S=null;switch(Xe.tag){case 26:S=Xe.memoizedState;case 5:case 27:var k=Xe;if(S?lx(S):k.stateNode.complete){mt=0,ms=null;var B=k.sibling;if(B!==null)Xe=B;else{var Z=k.return;Z!==null?(Xe=Z,Qu(Z)):Xe=null}break t}}mt=0,ms=null,No(s,r,_,5);break;case 6:mt=0,ms=null,No(s,r,_,6);break;case 8:dm(),It=6;break e;default:throw Error(n(462))}}N5();break}catch(ne){b1(s,ne)}while(!0);return Dn=ha=null,M.H=d,M.A=p,ut=o,Xe!==null?0:(St=null,Je=0,_u(),It)}function N5(){for(;Xe!==null&&!rl();)S1(Xe)}function S1(s){var r=Kv(s.alternate,s,Fn);s.memoizedProps=s.pendingProps,r===null?Qu(s):Xe=r}function w1(s){var r=s,o=r.alternate;switch(r.tag){case 15:case 0:r=Uv(o,r,r.pendingProps,r.type,void 0,Je);break;case 11:r=Uv(o,r,r.pendingProps,r.type.render,r.ref,Je);break;case 5:Nf(r);default:Wv(o,r),r=Xe=yb(r,Fn),r=Kv(o,r,Fn)}s.memoizedProps=s.pendingProps,r===null?Qu(s):Xe=r}function No(s,r,o,d){Dn=ha=null,Nf(r),go=null,Nl=0;var p=r.return;try{if(p5(s,p,r,o,Je)){It=1,Pu(s,Es(o,s.current)),Xe=null;return}}catch(_){if(p!==null)throw Xe=p,_;It=1,Pu(s,Es(o,s.current)),Xe=null;return}r.flags&32768?(tt||d===1?s=!0:wo||(Je&536870912)!==0?s=!1:(Sr=s=!0,(d===2||d===9||d===3||d===6)&&(d=hs.current,d!==null&&d.tag===13&&(d.flags|=16384))),E1(r,s)):Qu(r)}function Qu(s){var r=s;do{if((r.flags&32768)!==0){E1(r,Sr);return}s=r.return;var o=b5(r.alternate,r,Fn);if(o!==null){Xe=o;return}if(r=r.sibling,r!==null){Xe=r;return}Xe=r=s}while(r!==null);It===0&&(It=5)}function E1(s,r){do{var o=v5(s.alternate,s);if(o!==null){o.flags&=32767,Xe=o;return}if(o=s.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(s=s.sibling,s!==null)){Xe=s;return}Xe=s=o}while(s!==null);It=6,Xe=null}function C1(s,r,o,d,p,_,S,k,B){s.cancelPendingCommit=null;do Ju();while(ai!==0);if((ut&6)!==0)throw Error(n(327));if(r!==null){if(r===s.current)throw Error(n(177));if(_=r.lanes|r.childLanes,_|=Jh,Ne(s,o,_,S,k,B),s===St&&(Xe=St=null,Je=0),Co=r,Cr=s,$n=o,lm=_,cm=p,m1=d,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,R5(wn,function(){return M1(),null})):(s.callbackNode=null,s.callbackPriority=0),d=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||d){d=M.T,M.T=null,p=$.p,$.p=2,S=ut,ut|=4;try{x5(s,r,o)}finally{ut=S,$.p=p,M.T=d}}ai=1,k1(),N1(),T1()}}function k1(){if(ai===1){ai=0;var s=Cr,r=Co,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=M.T,M.T=null;var d=$.p;$.p=2;var p=ut;ut|=4;try{a1(r,s);var _=Em,S=hb(s.containerInfo),k=_.focusedElem,B=_.selectionRange;if(S!==k&&k&&k.ownerDocument&&db(k.ownerDocument.documentElement,k)){if(B!==null&&Wh(k)){var Z=B.start,ne=B.end;if(ne===void 0&&(ne=Z),"selectionStart"in k)k.selectionStart=Z,k.selectionEnd=Math.min(ne,k.value.length);else{var oe=k.ownerDocument||document,Q=oe&&oe.defaultView||window;if(Q.getSelection){var se=Q.getSelection(),Ce=k.textContent.length,Oe=Math.min(B.start,Ce),vt=B.end===void 0?Oe:Math.min(B.end,Ce);!se.extend&&Oe>vt&&(S=vt,vt=Oe,Oe=S);var q=ub(k,Oe),U=ub(k,vt);if(q&&U&&(se.rangeCount!==1||se.anchorNode!==q.node||se.anchorOffset!==q.offset||se.focusNode!==U.node||se.focusOffset!==U.offset)){var X=oe.createRange();X.setStart(q.node,q.offset),se.removeAllRanges(),Oe>vt?(se.addRange(X),se.extend(U.node,U.offset)):(X.setEnd(U.node,U.offset),se.addRange(X))}}}}for(oe=[],se=k;se=se.parentNode;)se.nodeType===1&&oe.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<oe.length;k++){var ae=oe[k];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}dd=!!wm,Em=wm=null}finally{ut=p,$.p=d,M.T=o}}s.current=r,ai=2}}function N1(){if(ai===2){ai=0;var s=Cr,r=Co,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=M.T,M.T=null;var d=$.p;$.p=2;var p=ut;ut|=4;try{t1(s,r.alternate,r)}finally{ut=p,$.p=d,M.T=o}}ai=3}}function T1(){if(ai===4||ai===3){ai=0,Ka();var s=Cr,r=Co,o=$n,d=m1;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?ai=5:(ai=0,Co=Cr=null,A1(s,s.pendingLanes));var p=s.pendingLanes;if(p===0&&(Er=null),Cn(o),r=r.stateNode,fi&&typeof fi.onCommitFiberRoot=="function")try{fi.onCommitFiberRoot(En,r,void 0,(r.current.flags&128)===128)}catch{}if(d!==null){r=M.T,p=$.p,$.p=2,M.T=null;try{for(var _=s.onRecoverableError,S=0;S<d.length;S++){var k=d[S];_(k.value,{componentStack:k.stack})}}finally{M.T=r,$.p=p}}($n&3)!==0&&Ju(),rn(s),p=s.pendingLanes,(o&261930)!==0&&(p&42)!==0?s===um?Vl++:(Vl=0,um=s):Vl=0,ql(0)}}function A1(s,r){(s.pooledCacheLanes&=r)===0&&(r=s.pooledCache,r!=null&&(s.pooledCache=null,Cl(r)))}function Ju(){return k1(),N1(),T1(),M1()}function M1(){if(ai!==5)return!1;var s=Cr,r=lm;lm=0;var o=Cn($n),d=M.T,p=$.p;try{$.p=32>o?32:o,M.T=null,o=cm,cm=null;var _=Cr,S=$n;if(ai=0,Co=Cr=null,$n=0,(ut&6)!==0)throw Error(n(331));var k=ut;if(ut|=4,d1(_.current),l1(_,_.current,S,o),ut=k,ql(0,!1),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(En,_)}catch{}return!0}finally{$.p=p,M.T=d,A1(s,r)}}function R1(s,r,o){r=Es(o,r),r=Ff(s.stateNode,r,2),s=br(s,r,2),s!==null&&(yt(s,2),rn(s))}function pt(s,r,o){if(s.tag===3)R1(s,s,o);else for(;r!==null;){if(r.tag===3){R1(r,s,o);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Er===null||!Er.has(d))){s=Es(o,s),o=Dv(2),d=br(r,o,2),d!==null&&(Ov(o,d,r,s),yt(d,2),rn(d));break}}r=r.return}}function fm(s,r,o){var d=s.pingCache;if(d===null){d=s.pingCache=new w5;var p=new Set;d.set(r,p)}else p=d.get(r),p===void 0&&(p=new Set,d.set(r,p));p.has(o)||(rm=!0,p.add(o),s=T5.bind(null,s,r,o),r.then(s,s))}function T5(s,r,o){var d=s.pingCache;d!==null&&d.delete(r),s.pingedLanes|=s.suspendedLanes&o,s.warmLanes&=~o,St===s&&(Je&o)===o&&(It===4||It===3&&(Je&62914560)===Je&&300>Ot()-Gu?(ut&2)===0&&ko(s,0):am|=o,Eo===Je&&(Eo=0)),rn(s)}function D1(s,r){r===0&&(r=Ie()),s=ca(s,r),s!==null&&(yt(s,r),rn(s))}function A5(s){var r=s.memoizedState,o=0;r!==null&&(o=r.retryLane),D1(s,o)}function M5(s,r){var o=0;switch(s.tag){case 31:case 13:var d=s.stateNode,p=s.memoizedState;p!==null&&(o=p.retryLane);break;case 19:d=s.stateNode;break;case 22:d=s.stateNode._retryCache;break;default:throw Error(n(314))}d!==null&&d.delete(r),D1(s,o)}function R5(s,r){return nr(s,r)}var ed=null,To=null,mm=!1,td=!1,pm=!1,Nr=0;function rn(s){s!==To&&s.next===null&&(To===null?ed=To=s:To=To.next=s),td=!0,mm||(mm=!0,O5())}function ql(s,r){if(!pm&&td){pm=!0;do for(var o=!1,d=ed;d!==null;){if(s!==0){var p=d.pendingLanes;if(p===0)var _=0;else{var S=d.suspendedLanes,k=d.pingedLanes;_=(1<<31-yi(42|s)+1)-1,_&=p&~(S&~k),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(o=!0,B1(d,_))}else _=Je,_=z(d,d===St?_:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(_&3)===0||re(d,_)||(o=!0,B1(d,_));d=d.next}while(o);pm=!1}}function D5(){O1()}function O1(){td=mm=!1;var s=0;Nr!==0&&$5()&&(s=Nr);for(var r=Ot(),o=null,d=ed;d!==null;){var p=d.next,_=j1(d,r);_===0?(d.next=null,o===null?ed=p:o.next=p,p===null&&(To=o)):(o=d,(s!==0||(_&3)!==0)&&(td=!0)),d=p}ai!==0&&ai!==5||ql(s),Nr!==0&&(Nr=0)}function j1(s,r){for(var o=s.suspendedLanes,d=s.pingedLanes,p=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var S=31-yi(_),k=1<<S,B=p[S];B===-1?((k&o)===0||(k&d)!==0)&&(p[S]=be(k,r)):B<=r&&(s.expiredLanes|=k),_&=~k}if(r=St,o=Je,o=z(s,s===r?o:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),d=s.callbackNode,o===0||s===r&&(mt===2||mt===9)||s.cancelPendingCommit!==null)return d!==null&&d!==null&&xn(d),s.callbackNode=null,s.callbackPriority=0;if((o&3)===0||re(s,o)){if(r=o&-o,r===s.callbackPriority)return r;switch(d!==null&&xn(d),Cn(o)){case 2:case 8:o=Sn;break;case 32:o=wn;break;case 268435456:o=rr;break;default:o=wn}return d=L1.bind(null,s),o=nr(o,d),s.callbackPriority=r,s.callbackNode=o,r}return d!==null&&d!==null&&xn(d),s.callbackPriority=2,s.callbackNode=null,2}function L1(s,r){if(ai!==0&&ai!==5)return s.callbackNode=null,s.callbackPriority=0,null;var o=s.callbackNode;if(Ju()&&s.callbackNode!==o)return null;var d=Je;return d=z(s,s===St?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),d===0?null:(g1(s,d,r),j1(s,Ot()),s.callbackNode!=null&&s.callbackNode===o?L1.bind(null,s):null)}function B1(s,r){if(Ju())return null;g1(s,r,!0)}function O5(){q5(function(){(ut&6)!==0?nr(xi,D5):O1()})}function gm(){if(Nr===0){var s=fo;s===0&&(s=it,it<<=1,(it&261888)===0&&(it=256)),Nr=s}return Nr}function z1(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:ur(""+s)}function I1(s,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,s.id&&o.setAttribute("form",s.id),r.parentNode.insertBefore(o,r),s=new FormData(s),o.parentNode.removeChild(o),s}function j5(s,r,o,d,p){if(r==="submit"&&o&&o.stateNode===p){var _=z1((p[Di]||null).action),S=d.submitter;S&&(r=(r=S[Di]||null)?z1(r.formAction):S.getAttribute("formAction"),r!==null&&(_=r,S=null));var k=new fu("action","action",null,d,p);s.push({event:k,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Nr!==0){var B=S?I1(p,S):new FormData(p);Bf(o,{pending:!0,data:B,method:p.method,action:_},null,B)}}else typeof _=="function"&&(k.preventDefault(),B=S?I1(p,S):new FormData(p),Bf(o,{pending:!0,data:B,method:p.method,action:_},_,B))},currentTarget:p}]})}}for(var _m=0;_m<Qh.length;_m++){var bm=Qh[_m],L5=bm.toLowerCase(),B5=bm[0].toUpperCase()+bm.slice(1);Vs(L5,"on"+B5)}Vs(pb,"onAnimationEnd"),Vs(gb,"onAnimationIteration"),Vs(_b,"onAnimationStart"),Vs("dblclick","onDoubleClick"),Vs("focusin","onFocus"),Vs("focusout","onBlur"),Vs(QN,"onTransitionRun"),Vs(JN,"onTransitionStart"),Vs(e5,"onTransitionCancel"),Vs(bb,"onTransitionEnd"),he("onMouseEnter",["mouseout","mouseover"]),he("onMouseLeave",["mouseout","mouseover"]),he("onPointerEnter",["pointerout","pointerover"]),he("onPointerLeave",["pointerout","pointerover"]),Nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Nn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Kl="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(" "),z5=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Kl));function P1(s,r){r=(r&4)!==0;for(var o=0;o<s.length;o++){var d=s[o],p=d.event;d=d.listeners;e:{var _=void 0;if(r)for(var S=d.length-1;0<=S;S--){var k=d[S],B=k.instance,Z=k.currentTarget;if(k=k.listener,B!==_&&p.isPropagationStopped())break e;_=k,p.currentTarget=Z;try{_(p)}catch(ne){gu(ne)}p.currentTarget=null,_=B}else for(S=0;S<d.length;S++){if(k=d[S],B=k.instance,Z=k.currentTarget,k=k.listener,B!==_&&p.isPropagationStopped())break e;_=k,p.currentTarget=Z;try{_(p)}catch(ne){gu(ne)}p.currentTarget=null,_=B}}}}function Ze(s,r){var o=r[ll];o===void 0&&(o=r[ll]=new Set);var d=s+"__bubble";o.has(d)||(U1(r,s,2,!1),o.add(d))}function vm(s,r,o){var d=0;r&&(d|=4),U1(o,s,d,r)}var id="_reactListening"+Math.random().toString(36).slice(2);function xm(s){if(!s[id]){s[id]=!0,ru.forEach(function(o){o!=="selectionchange"&&(z5.has(o)||vm(o,!1,s),vm(o,!0,s))});var r=s.nodeType===9?s:s.ownerDocument;r===null||r[id]||(r[id]=!0,vm("selectionchange",!1,r))}}function U1(s,r,o,d){switch(px(r)){case 2:var p=dT;break;case 8:p=hT;break;default:p=Lm}o=p.bind(null,r,o,s),p=void 0,!Ph||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),d?p!==void 0?s.addEventListener(r,o,{capture:!0,passive:p}):s.addEventListener(r,o,!0):p!==void 0?s.addEventListener(r,o,{passive:p}):s.addEventListener(r,o,!1)}function ym(s,r,o,d,p){var _=d;if((r&1)===0&&(r&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var k=d.stateNode.containerInfo;if(k===p)break;if(S===4)for(S=d.return;S!==null;){var B=S.tag;if((B===3||B===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;k!==null;){if(S=Pi(k),S===null)return;if(B=S.tag,B===5||B===6||B===26||B===27){d=_=S;continue e}k=k.parentNode}}d=d.return}cu(function(){var Z=_,ne=He(o),oe=[];e:{var Q=vb.get(s);if(Q!==void 0){var se=fu,Ce=s;switch(s){case"keypress":if(du(o)===0)break e;case"keydown":case"keyup":se=MN;break;case"focusin":Ce="focus",se=$h;break;case"focusout":Ce="blur",se=$h;break;case"beforeblur":case"afterblur":se=$h;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=W_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=bN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=ON;break;case pb:case gb:case _b:se=yN;break;case bb:se=LN;break;case"scroll":case"scrollend":se=gN;break;case"wheel":se=zN;break;case"copy":case"cut":case"paste":se=wN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=X_;break;case"toggle":case"beforetoggle":se=PN}var Oe=(r&4)!==0,vt=!Oe&&(s==="scroll"||s==="scrollend"),q=Oe?Q!==null?Q+"Capture":null:Q;Oe=[];for(var U=Z,X;U!==null;){var ae=U;if(X=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||X===null||q===null||(ae=ml(U,q),ae!=null&&Oe.push(Gl(U,ae,X))),vt)break;U=U.return}0<Oe.length&&(Q=new se(Q,Ce,null,o,ne),oe.push({event:Q,listeners:Oe}))}}if((r&7)===0){e:{if(Q=s==="mouseover"||s==="pointerover",se=s==="mouseout"||s==="pointerout",Q&&o!==Te&&(Ce=o.relatedTarget||o.fromElement)&&(Pi(Ce)||Ce[ar]))break e;if((se||Q)&&(Q=ne.window===ne?ne:(Q=ne.ownerDocument)?Q.defaultView||Q.parentWindow:window,se?(Ce=o.relatedTarget||o.toElement,se=Z,Ce=Ce?Pi(Ce):null,Ce!==null&&(vt=l(Ce),Oe=Ce.tag,Ce!==vt||Oe!==5&&Oe!==27&&Oe!==6)&&(Ce=null)):(se=null,Ce=Z),se!==Ce)){if(Oe=W_,ae="onMouseLeave",q="onMouseEnter",U="mouse",(s==="pointerout"||s==="pointerover")&&(Oe=X_,ae="onPointerLeave",q="onPointerEnter",U="pointer"),vt=se==null?Q:or(se),X=Ce==null?Q:or(Ce),Q=new Oe(ae,U+"leave",se,o,ne),Q.target=vt,Q.relatedTarget=X,ae=null,Pi(ne)===Z&&(Oe=new Oe(q,U+"enter",Ce,o,ne),Oe.target=X,Oe.relatedTarget=vt,ae=Oe),vt=ae,se&&Ce)t:{for(Oe=I5,q=se,U=Ce,X=0,ae=q;ae;ae=Oe(ae))X++;ae=0;for(var De=U;De;De=Oe(De))ae++;for(;0<X-ae;)q=Oe(q),X--;for(;0<ae-X;)U=Oe(U),ae--;for(;X--;){if(q===U||U!==null&&q===U.alternate){Oe=q;break t}q=Oe(q),U=Oe(U)}Oe=null}else Oe=null;se!==null&&H1(oe,Q,se,Oe,!1),Ce!==null&&vt!==null&&H1(oe,vt,Ce,Oe,!0)}}e:{if(Q=Z?or(Z):window,se=Q.nodeName&&Q.nodeName.toLowerCase(),se==="select"||se==="input"&&Q.type==="file")var rt=nb;else if(ib(Q))if(rb)rt=YN;else{rt=GN;var Ae=KN}else se=Q.nodeName,!se||se.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?Z&&cr(Z.elementType)&&(rt=nb):rt=WN;if(rt&&(rt=rt(s,Z))){sb(oe,rt,o,ne);break e}Ae&&Ae(s,Q,Z),s==="focusout"&&Z&&Q.type==="number"&&Z.memoizedProps.value!=null&&to(Q,"number",Q.value)}switch(Ae=Z?or(Z):window,s){case"focusin":(ib(Ae)||Ae.contentEditable==="true")&&(no=Ae,Yh=Z,Sl=null);break;case"focusout":Sl=Yh=no=null;break;case"mousedown":Xh=!0;break;case"contextmenu":case"mouseup":case"dragend":Xh=!1,fb(oe,o,ne);break;case"selectionchange":if(ZN)break;case"keydown":case"keyup":fb(oe,o,ne)}var $e;if(qh)e:{switch(s){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else so?eb(s,o)&&(et="onCompositionEnd"):s==="keydown"&&o.keyCode===229&&(et="onCompositionStart");et&&(Z_&&o.locale!=="ko"&&(so||et!=="onCompositionStart"?et==="onCompositionEnd"&&so&&($e=K_()):(dr=ne,Uh="value"in dr?dr.value:dr.textContent,so=!0)),Ae=sd(Z,et),0<Ae.length&&(et=new Y_(et,s,null,o,ne),oe.push({event:et,listeners:Ae}),$e?et.data=$e:($e=tb(o),$e!==null&&(et.data=$e)))),($e=HN?FN(s,o):$N(s,o))&&(et=sd(Z,"onBeforeInput"),0<et.length&&(Ae=new Y_("onBeforeInput","beforeinput",null,o,ne),oe.push({event:Ae,listeners:et}),Ae.data=$e)),j5(oe,s,Z,o,ne)}P1(oe,r)})}function Gl(s,r,o){return{instance:s,listener:r,currentTarget:o}}function sd(s,r){for(var o=r+"Capture",d=[];s!==null;){var p=s,_=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||_===null||(p=ml(s,o),p!=null&&d.unshift(Gl(s,p,_)),p=ml(s,r),p!=null&&d.push(Gl(s,p,_))),s.tag===3)return d;s=s.return}return[]}function I5(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function H1(s,r,o,d,p){for(var _=r._reactName,S=[];o!==null&&o!==d;){var k=o,B=k.alternate,Z=k.stateNode;if(k=k.tag,B!==null&&B===d)break;k!==5&&k!==26&&k!==27||Z===null||(B=Z,p?(Z=ml(o,_),Z!=null&&S.unshift(Gl(o,Z,B))):p||(Z=ml(o,_),Z!=null&&S.push(Gl(o,Z,B)))),o=o.return}S.length!==0&&s.push({event:r,listeners:S})}var P5=/\r\n?/g,U5=/\u0000|\uFFFD/g;function F1(s){return(typeof s=="string"?s:""+s).replace(P5,`
|
|
9
|
+
`).replace(U5,"")}function $1(s,r){return r=F1(r),F1(s)===r}function bt(s,r,o,d,p,_){switch(o){case"children":typeof d=="string"?r==="body"||r==="textarea"&&d===""||je(s,d):(typeof d=="number"||typeof d=="bigint")&&r!=="body"&&je(s,""+d);break;case"className":ls(s,"class",d);break;case"tabIndex":ls(s,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":ls(s,o,d);break;case"style":ft(s,d,_);break;case"data":if(r!=="object"){ls(s,"data",d);break}case"src":case"href":if(d===""&&(r!=="a"||o!=="href")){s.removeAttribute(o);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){s.removeAttribute(o);break}d=ur(""+d),s.setAttribute(o,d);break;case"action":case"formAction":if(typeof d=="function"){s.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(o==="formAction"?(r!=="input"&&bt(s,r,"name",p.name,p,null),bt(s,r,"formEncType",p.formEncType,p,null),bt(s,r,"formMethod",p.formMethod,p,null),bt(s,r,"formTarget",p.formTarget,p,null)):(bt(s,r,"encType",p.encType,p,null),bt(s,r,"method",p.method,p,null),bt(s,r,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){s.removeAttribute(o);break}d=ur(""+d),s.setAttribute(o,d);break;case"onClick":d!=null&&(s.onclick=ge);break;case"onScroll":d!=null&&Ze("scroll",s);break;case"onScrollEnd":d!=null&&Ze("scrollend",s);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(n(61));if(o=d.__html,o!=null){if(p.children!=null)throw Error(n(60));s.innerHTML=o}}break;case"multiple":s.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":s.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){s.removeAttribute("xlink:href");break}o=ur(""+d),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(o,""+d):s.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(o,""):s.removeAttribute(o);break;case"capture":case"download":d===!0?s.setAttribute(o,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(o,d):s.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?s.setAttribute(o,d):s.removeAttribute(o);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?s.removeAttribute(o):s.setAttribute(o,d);break;case"popover":Ze("beforetoggle",s),Ze("toggle",s),Oi(s,"popover",d);break;case"xlinkActuate":Wi(s,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Wi(s,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Wi(s,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Wi(s,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Wi(s,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Wi(s,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Wi(s,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Wi(s,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Wi(s,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Oi(s,"is",d);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Tn.get(o)||o,Oi(s,o,d))}}function Sm(s,r,o,d,p,_){switch(o){case"style":ft(s,d,_);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(n(61));if(o=d.__html,o!=null){if(p.children!=null)throw Error(n(60));s.innerHTML=o}}break;case"children":typeof d=="string"?je(s,d):(typeof d=="number"||typeof d=="bigint")&&je(s,""+d);break;case"onScroll":d!=null&&Ze("scroll",s);break;case"onScrollEnd":d!=null&&Ze("scrollend",s);break;case"onClick":d!=null&&(s.onclick=ge);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!na.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),r=o.slice(2,p?o.length-7:void 0),_=s[Di]||null,_=_!=null?_[o]:null,typeof _=="function"&&s.removeEventListener(r,_,p),typeof d=="function")){typeof _!="function"&&_!==null&&(o in s?s[o]=null:s.hasAttribute(o)&&s.removeAttribute(o)),s.addEventListener(r,d,p);break e}o in s?s[o]=d:d===!0?s.setAttribute(o,""):Oi(s,o,d)}}}function ki(s,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",s),Ze("load",s);var d=!1,p=!1,_;for(_ in o)if(o.hasOwnProperty(_)){var S=o[_];if(S!=null)switch(_){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:bt(s,r,_,S,o,null)}}p&&bt(s,r,"srcSet",o.srcSet,o,null),d&&bt(s,r,"src",o.src,o,null);return;case"input":Ze("invalid",s);var k=_=S=p=null,B=null,Z=null;for(d in o)if(o.hasOwnProperty(d)){var ne=o[d];if(ne!=null)switch(d){case"name":p=ne;break;case"type":S=ne;break;case"checked":B=ne;break;case"defaultChecked":Z=ne;break;case"value":_=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(n(137,r));break;default:bt(s,r,d,ne,o,null)}}ra(s,_,k,B,Z,S,p,!1);return;case"select":Ze("invalid",s),d=S=_=null;for(p in o)if(o.hasOwnProperty(p)&&(k=o[p],k!=null))switch(p){case"value":_=k;break;case"defaultValue":S=k;break;case"multiple":d=k;default:bt(s,r,p,k,o,null)}r=_,o=S,s.multiple=!!d,r!=null?Si(s,!!d,r,!1):o!=null&&Si(s,!!d,o,!0);return;case"textarea":Ze("invalid",s),_=p=d=null;for(S in o)if(o.hasOwnProperty(S)&&(k=o[S],k!=null))switch(S){case"value":d=k;break;case"defaultValue":p=k;break;case"children":_=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(n(91));break;default:bt(s,r,S,k,o,null)}io(s,d,p,_);return;case"option":for(B in o)o.hasOwnProperty(B)&&(d=o[B],d!=null)&&(B==="selected"?s.selected=d&&typeof d!="function"&&typeof d!="symbol":bt(s,r,B,d,o,null));return;case"dialog":Ze("beforetoggle",s),Ze("toggle",s),Ze("cancel",s),Ze("close",s);break;case"iframe":case"object":Ze("load",s);break;case"video":case"audio":for(d=0;d<Kl.length;d++)Ze(Kl[d],s);break;case"image":Ze("error",s),Ze("load",s);break;case"details":Ze("toggle",s);break;case"embed":case"source":case"link":Ze("error",s),Ze("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Z in o)if(o.hasOwnProperty(Z)&&(d=o[Z],d!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:bt(s,r,Z,d,o,null)}return;default:if(cr(r)){for(ne in o)o.hasOwnProperty(ne)&&(d=o[ne],d!==void 0&&Sm(s,r,ne,d,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(d=o[k],d!=null&&bt(s,r,k,d,o,null))}function H5(s,r,o,d){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,_=null,S=null,k=null,B=null,Z=null,ne=null;for(se in o){var oe=o[se];if(o.hasOwnProperty(se)&&oe!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":B=oe;default:d.hasOwnProperty(se)||bt(s,r,se,null,d,oe)}}for(var Q in d){var se=d[Q];if(oe=o[Q],d.hasOwnProperty(Q)&&(se!=null||oe!=null))switch(Q){case"type":_=se;break;case"name":p=se;break;case"checked":Z=se;break;case"defaultChecked":ne=se;break;case"value":S=se;break;case"defaultValue":k=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(n(137,r));break;default:se!==oe&&bt(s,r,Q,se,d,oe)}}dl(s,S,k,B,Z,ne,_,p);return;case"select":se=S=k=Q=null;for(_ in o)if(B=o[_],o.hasOwnProperty(_)&&B!=null)switch(_){case"value":break;case"multiple":se=B;default:d.hasOwnProperty(_)||bt(s,r,_,null,d,B)}for(p in d)if(_=d[p],B=o[p],d.hasOwnProperty(p)&&(_!=null||B!=null))switch(p){case"value":Q=_;break;case"defaultValue":k=_;break;case"multiple":S=_;default:_!==B&&bt(s,r,p,_,d,B)}r=k,o=S,d=se,Q!=null?Si(s,!!o,Q,!1):!!d!=!!o&&(r!=null?Si(s,!!o,r,!0):Si(s,!!o,o?[]:"",!1));return;case"textarea":se=Q=null;for(k in o)if(p=o[k],o.hasOwnProperty(k)&&p!=null&&!d.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:bt(s,r,k,null,d,p)}for(S in d)if(p=d[S],_=o[S],d.hasOwnProperty(S)&&(p!=null||_!=null))switch(S){case"value":Q=p;break;case"defaultValue":se=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(n(91));break;default:p!==_&&bt(s,r,S,p,d,_)}ou(s,Q,se);return;case"option":for(var Ce in o)Q=o[Ce],o.hasOwnProperty(Ce)&&Q!=null&&!d.hasOwnProperty(Ce)&&(Ce==="selected"?s.selected=!1:bt(s,r,Ce,null,d,Q));for(B in d)Q=d[B],se=o[B],d.hasOwnProperty(B)&&Q!==se&&(Q!=null||se!=null)&&(B==="selected"?s.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":bt(s,r,B,Q,d,se));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in o)Q=o[Oe],o.hasOwnProperty(Oe)&&Q!=null&&!d.hasOwnProperty(Oe)&&bt(s,r,Oe,null,d,Q);for(Z in d)if(Q=d[Z],se=o[Z],d.hasOwnProperty(Z)&&Q!==se&&(Q!=null||se!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(n(137,r));break;default:bt(s,r,Z,Q,d,se)}return;default:if(cr(r)){for(var vt in o)Q=o[vt],o.hasOwnProperty(vt)&&Q!==void 0&&!d.hasOwnProperty(vt)&&Sm(s,r,vt,void 0,d,Q);for(ne in d)Q=d[ne],se=o[ne],!d.hasOwnProperty(ne)||Q===se||Q===void 0&&se===void 0||Sm(s,r,ne,Q,d,se);return}}for(var q in o)Q=o[q],o.hasOwnProperty(q)&&Q!=null&&!d.hasOwnProperty(q)&&bt(s,r,q,null,d,Q);for(oe in d)Q=d[oe],se=o[oe],!d.hasOwnProperty(oe)||Q===se||Q==null&&se==null||bt(s,r,oe,Q,d,se)}function V1(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function F5(){if(typeof performance.getEntriesByType=="function"){for(var s=0,r=0,o=performance.getEntriesByType("resource"),d=0;d<o.length;d++){var p=o[d],_=p.transferSize,S=p.initiatorType,k=p.duration;if(_&&k&&V1(S)){for(S=0,k=p.responseEnd,d+=1;d<o.length;d++){var B=o[d],Z=B.startTime;if(Z>k)break;var ne=B.transferSize,oe=B.initiatorType;ne&&V1(oe)&&(B=B.responseEnd,S+=ne*(B<k?1:(k-Z)/(B-Z)))}if(--d,r+=8*(_+S)/(p.duration/1e3),s++,10<s)break}}if(0<s)return r/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var wm=null,Em=null;function nd(s){return s.nodeType===9?s:s.ownerDocument}function q1(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function K1(s,r){if(s===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&r==="foreignObject"?0:s}function Cm(s,r){return s==="textarea"||s==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var km=null;function $5(){var s=window.event;return s&&s.type==="popstate"?s===km?!1:(km=s,!0):(km=null,!1)}var G1=typeof setTimeout=="function"?setTimeout:void 0,V5=typeof clearTimeout=="function"?clearTimeout:void 0,W1=typeof Promise=="function"?Promise:void 0,q5=typeof queueMicrotask=="function"?queueMicrotask:typeof W1<"u"?function(s){return W1.resolve(null).then(s).catch(K5)}:G1;function K5(s){setTimeout(function(){throw s})}function Tr(s){return s==="head"}function Y1(s,r){var o=r,d=0;do{var p=o.nextSibling;if(s.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(d===0){s.removeChild(p),Do(r);return}d--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")d++;else if(o==="html")Wl(s.ownerDocument.documentElement);else if(o==="head"){o=s.ownerDocument.head,Wl(o);for(var _=o.firstChild;_;){var S=_.nextSibling,k=_.nodeName;_[sa]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&_.rel.toLowerCase()==="stylesheet"||o.removeChild(_),_=S}}else o==="body"&&Wl(s.ownerDocument.body);o=p}while(o);Do(r)}function X1(s,r){var o=s;s=0;do{var d=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),d&&d.nodeType===8)if(o=d.data,o==="/$"){if(s===0)break;s--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||s++;o=d}while(o)}function Nm(s){var r=s.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Nm(o),cl(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}s.removeChild(o)}}function G5(s,r,o,d){for(;s.nodeType===1;){var p=o;if(s.nodeName.toLowerCase()!==r.toLowerCase()){if(!d&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(d){if(!s[sa])switch(r){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(_=s.getAttribute("rel"),_==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(_!==p.rel||s.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||s.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||s.getAttribute("title")!==(p.title==null?null:p.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(_=s.getAttribute("src"),(_!==(p.src==null?null:p.src)||s.getAttribute("type")!==(p.type==null?null:p.type)||s.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&_&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(r==="input"&&s.type==="hidden"){var _=p.name==null?null:""+p.name;if(p.type==="hidden"&&s.getAttribute("name")===_)return s}else return s;if(s=As(s.nextSibling),s===null)break}return null}function W5(s,r,o){if(r==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=As(s.nextSibling),s===null))return null;return s}function Z1(s,r){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!r||(s=As(s.nextSibling),s===null))return null;return s}function Tm(s){return s.data==="$?"||s.data==="$~"}function Am(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function Y5(s,r){var o=s.ownerDocument;if(s.data==="$~")s._reactRetry=r;else if(s.data!=="$?"||o.readyState!=="loading")r();else{var d=function(){r(),o.removeEventListener("DOMContentLoaded",d)};o.addEventListener("DOMContentLoaded",d),s._reactRetry=d}}function As(s){for(;s!=null;s=s.nextSibling){var r=s.nodeType;if(r===1||r===3)break;if(r===8){if(r=s.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return s}var Mm=null;function Q1(s){s=s.nextSibling;for(var r=0;s;){if(s.nodeType===8){var o=s.data;if(o==="/$"||o==="/&"){if(r===0)return As(s.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}s=s.nextSibling}return null}function J1(s){s=s.previousSibling;for(var r=0;s;){if(s.nodeType===8){var o=s.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return s;r--}else o!=="/$"&&o!=="/&"||r++}s=s.previousSibling}return null}function ex(s,r,o){switch(r=nd(o),s){case"html":if(s=r.documentElement,!s)throw Error(n(452));return s;case"head":if(s=r.head,!s)throw Error(n(453));return s;case"body":if(s=r.body,!s)throw Error(n(454));return s;default:throw Error(n(451))}}function Wl(s){for(var r=s.attributes;r.length;)s.removeAttributeNode(r[0]);cl(s)}var Ms=new Map,tx=new Set;function rd(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Vn=$.d;$.d={f:X5,r:Z5,D:Q5,C:J5,L:eT,m:tT,X:sT,S:iT,M:nT};function X5(){var s=Vn.f(),r=Xu();return s||r}function Z5(s){var r=kn(s);r!==null&&r.tag===5&&r.type==="form"?bv(r):Vn.r(s)}var Ao=typeof document>"u"?null:document;function ix(s,r,o){var d=Ao;if(d&&typeof r=="string"&&r){var p=Yi(r);p='link[rel="'+s+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),tx.has(p)||(tx.add(p),s={rel:s,crossOrigin:o,href:r},d.querySelector(p)===null&&(r=d.createElement("link"),ki(r,"link",s),Yt(r),d.head.appendChild(r)))}}function Q5(s){Vn.D(s),ix("dns-prefetch",s,null)}function J5(s,r){Vn.C(s,r),ix("preconnect",s,r)}function eT(s,r,o){Vn.L(s,r,o);var d=Ao;if(d&&s&&r){var p='link[rel="preload"][as="'+Yi(r)+'"]';r==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Yi(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Yi(o.imageSizes)+'"]')):p+='[href="'+Yi(s)+'"]';var _=p;switch(r){case"style":_=Mo(s);break;case"script":_=Ro(s)}Ms.has(_)||(s=b({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:s,as:r},o),Ms.set(_,s),d.querySelector(p)!==null||r==="style"&&d.querySelector(Yl(_))||r==="script"&&d.querySelector(Xl(_))||(r=d.createElement("link"),ki(r,"link",s),Yt(r),d.head.appendChild(r)))}}function tT(s,r){Vn.m(s,r);var o=Ao;if(o&&s){var d=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Yi(d)+'"][href="'+Yi(s)+'"]',_=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Ro(s)}if(!Ms.has(_)&&(s=b({rel:"modulepreload",href:s},r),Ms.set(_,s),o.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Xl(_)))return}d=o.createElement("link"),ki(d,"link",s),Yt(d),o.head.appendChild(d)}}}function iT(s,r,o){Vn.S(s,r,o);var d=Ao;if(d&&s){var p=lr(d).hoistableStyles,_=Mo(s);r=r||"default";var S=p.get(_);if(!S){var k={loading:0,preload:null};if(S=d.querySelector(Yl(_)))k.loading=5;else{s=b({rel:"stylesheet",href:s,"data-precedence":r},o),(o=Ms.get(_))&&Rm(s,o);var B=S=d.createElement("link");Yt(B),ki(B,"link",s),B._p=new Promise(function(Z,ne){B.onload=Z,B.onerror=ne}),B.addEventListener("load",function(){k.loading|=1}),B.addEventListener("error",function(){k.loading|=2}),k.loading|=4,ad(S,r,d)}S={type:"stylesheet",instance:S,count:1,state:k},p.set(_,S)}}}function sT(s,r){Vn.X(s,r);var o=Ao;if(o&&s){var d=lr(o).hoistableScripts,p=Ro(s),_=d.get(p);_||(_=o.querySelector(Xl(p)),_||(s=b({src:s,async:!0},r),(r=Ms.get(p))&&Dm(s,r),_=o.createElement("script"),Yt(_),ki(_,"link",s),o.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},d.set(p,_))}}function nT(s,r){Vn.M(s,r);var o=Ao;if(o&&s){var d=lr(o).hoistableScripts,p=Ro(s),_=d.get(p);_||(_=o.querySelector(Xl(p)),_||(s=b({src:s,async:!0,type:"module"},r),(r=Ms.get(p))&&Dm(s,r),_=o.createElement("script"),Yt(_),ki(_,"link",s),o.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},d.set(p,_))}}function sx(s,r,o,d){var p=(p=me.current)?rd(p):null;if(!p)throw Error(n(446));switch(s){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=Mo(o.href),o=lr(p).hoistableStyles,d=o.get(r),d||(d={type:"style",instance:null,count:0,state:null},o.set(r,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){s=Mo(o.href);var _=lr(p).hoistableStyles,S=_.get(s);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,S),(_=p.querySelector(Yl(s)))&&!_._p&&(S.instance=_,S.state.loading=5),Ms.has(s)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Ms.set(s,o),_||rT(p,s,o,S.state))),r&&d===null)throw Error(n(528,""));return S}if(r&&d!==null)throw Error(n(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Ro(o),o=lr(p).hoistableScripts,d=o.get(r),d||(d={type:"script",instance:null,count:0,state:null},o.set(r,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,s))}}function Mo(s){return'href="'+Yi(s)+'"'}function Yl(s){return'link[rel="stylesheet"]['+s+"]"}function nx(s){return b({},s,{"data-precedence":s.precedence,precedence:null})}function rT(s,r,o,d){s.querySelector('link[rel="preload"][as="style"]['+r+"]")?d.loading=1:(r=s.createElement("link"),d.preload=r,r.addEventListener("load",function(){return d.loading|=1}),r.addEventListener("error",function(){return d.loading|=2}),ki(r,"link",o),Yt(r),s.head.appendChild(r))}function Ro(s){return'[src="'+Yi(s)+'"]'}function Xl(s){return"script[async]"+s}function rx(s,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var d=s.querySelector('style[data-href~="'+Yi(o.href)+'"]');if(d)return r.instance=d,Yt(d),d;var p=b({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return d=(s.ownerDocument||s).createElement("style"),Yt(d),ki(d,"style",p),ad(d,o.precedence,s),r.instance=d;case"stylesheet":p=Mo(o.href);var _=s.querySelector(Yl(p));if(_)return r.state.loading|=4,r.instance=_,Yt(_),_;d=nx(o),(p=Ms.get(p))&&Rm(d,p),_=(s.ownerDocument||s).createElement("link"),Yt(_);var S=_;return S._p=new Promise(function(k,B){S.onload=k,S.onerror=B}),ki(_,"link",d),r.state.loading|=4,ad(_,o.precedence,s),r.instance=_;case"script":return _=Ro(o.src),(p=s.querySelector(Xl(_)))?(r.instance=p,Yt(p),p):(d=o,(p=Ms.get(_))&&(d=b({},o),Dm(d,p)),s=s.ownerDocument||s,p=s.createElement("script"),Yt(p),ki(p,"link",d),s.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(n(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(d=r.instance,r.state.loading|=4,ad(d,o.precedence,s));return r.instance}function ad(s,r,o){for(var d=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,_=p,S=0;S<d.length;S++){var k=d[S];if(k.dataset.precedence===r)_=k;else if(_!==p)break}_?_.parentNode.insertBefore(s,_.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(s,r.firstChild))}function Rm(s,r){s.crossOrigin==null&&(s.crossOrigin=r.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=r.referrerPolicy),s.title==null&&(s.title=r.title)}function Dm(s,r){s.crossOrigin==null&&(s.crossOrigin=r.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=r.referrerPolicy),s.integrity==null&&(s.integrity=r.integrity)}var od=null;function ax(s,r,o){if(od===null){var d=new Map,p=od=new Map;p.set(o,d)}else p=od,d=p.get(o),d||(d=new Map,p.set(o,d));if(d.has(s))return d;for(d.set(s,null),o=o.getElementsByTagName(s),p=0;p<o.length;p++){var _=o[p];if(!(_[sa]||_[Vt]||s==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var S=_.getAttribute(r)||"";S=s+S;var k=d.get(S);k?k.push(_):d.set(S,[_])}}return d}function ox(s,r,o){s=s.ownerDocument||s,s.head.insertBefore(o,r==="title"?s.querySelector("head > title"):null)}function aT(s,r,o){if(o===1||r.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(s=r.disabled,typeof r.precedence=="string"&&s==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function lx(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function oT(s,r,o,d){if(o.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=Mo(d.href),_=r.querySelector(Yl(p));if(_){r=_._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(s.count++,s=ld.bind(s),r.then(s,s)),o.state.loading|=4,o.instance=_,Yt(_);return}_=r.ownerDocument||r,d=nx(d),(p=Ms.get(p))&&Rm(d,p),_=_.createElement("link"),Yt(_);var S=_;S._p=new Promise(function(k,B){S.onload=k,S.onerror=B}),ki(_,"link",d),o.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(s.count++,o=ld.bind(s),r.addEventListener("load",o),r.addEventListener("error",o))}}var Om=0;function lT(s,r){return s.stylesheets&&s.count===0&&ud(s,s.stylesheets),0<s.count||0<s.imgCount?function(o){var d=setTimeout(function(){if(s.stylesheets&&ud(s,s.stylesheets),s.unsuspend){var _=s.unsuspend;s.unsuspend=null,_()}},6e4+r);0<s.imgBytes&&Om===0&&(Om=62500*F5());var p=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&ud(s,s.stylesheets),s.unsuspend)){var _=s.unsuspend;s.unsuspend=null,_()}},(s.imgBytes>Om?50:800)+r);return s.unsuspend=o,function(){s.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function ld(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ud(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var cd=null;function ud(s,r){s.stylesheets=null,s.unsuspend!==null&&(s.count++,cd=new Map,r.forEach(cT,s),cd=null,ld.call(s))}function cT(s,r){if(!(r.state.loading&4)){var o=cd.get(s);if(o)var d=o.get(null);else{o=new Map,cd.set(s,o);for(var p=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<p.length;_++){var S=p[_];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),d=S)}d&&o.set(null,d)}p=r.instance,S=p.getAttribute("data-precedence"),_=o.get(S)||d,_===d&&o.set(null,p),o.set(S,p),this.count++,d=ld.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),_?_.parentNode.insertBefore(p,_.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(p,s.firstChild)),r.state.loading|=4}}var Zl={$$typeof:D,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function uT(s,r,o,d,p,_,S,k,B){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ct(0),this.hiddenUpdates=Ct(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=_,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function cx(s,r,o,d,p,_,S,k,B,Z,ne,oe){return s=new uT(s,r,o,S,B,Z,ne,oe,k),r=1,_===!0&&(r|=24),_=ds(3,null,null,r),s.current=_,_.stateNode=s,r=hf(),r.refCount++,s.pooledCache=r,r.refCount++,_.memoizedState={element:d,isDehydrated:o,cache:r},gf(_),s}function ux(s){return s?(s=oo,s):oo}function dx(s,r,o,d,p,_){p=ux(p),d.context===null?d.context=p:d.pendingContext=p,d=_r(r),d.payload={element:o},_=_===void 0?null:_,_!==null&&(d.callback=_),o=br(s,d,r),o!==null&&(ts(o,s,r),Al(o,s,r))}function hx(s,r){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var o=s.retryLane;s.retryLane=o!==0&&o<r?o:r}}function jm(s,r){hx(s,r),(s=s.alternate)&&hx(s,r)}function fx(s){if(s.tag===13||s.tag===31){var r=ca(s,67108864);r!==null&&ts(r,s,67108864),jm(s,67108864)}}function mx(s){if(s.tag===13||s.tag===31){var r=gs();r=Mt(r);var o=ca(s,r);o!==null&&ts(o,s,r),jm(s,r)}}var dd=!0;function dT(s,r,o,d){var p=M.T;M.T=null;var _=$.p;try{$.p=2,Lm(s,r,o,d)}finally{$.p=_,M.T=p}}function hT(s,r,o,d){var p=M.T;M.T=null;var _=$.p;try{$.p=8,Lm(s,r,o,d)}finally{$.p=_,M.T=p}}function Lm(s,r,o,d){if(dd){var p=Bm(d);if(p===null)ym(s,r,d,hd,o),gx(s,d);else if(mT(p,s,r,o,d))d.stopPropagation();else if(gx(s,d),r&4&&-1<fT.indexOf(s)){for(;p!==null;){var _=kn(p);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var S=Ri(_.pendingLanes);if(S!==0){var k=_;for(k.pendingLanes|=2,k.entangledLanes|=2;S;){var B=1<<31-yi(S);k.entanglements[1]|=B,S&=~B}rn(_),(ut&6)===0&&(Wu=Ot()+500,ql(0))}}break;case 31:case 13:k=ca(_,2),k!==null&&ts(k,_,2),Xu(),jm(_,2)}if(_=Bm(d),_===null&&ym(s,r,d,hd,o),_===p)break;p=_}p!==null&&d.stopPropagation()}else ym(s,r,d,null,o)}}function Bm(s){return s=He(s),zm(s)}var hd=null;function zm(s){if(hd=null,s=Pi(s),s!==null){var r=l(s);if(r===null)s=null;else{var o=r.tag;if(o===13){if(s=c(r),s!==null)return s;s=null}else if(o===31){if(s=h(r),s!==null)return s;s=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;s=null}else r!==s&&(s=null)}}return hd=s,null}function px(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(yn()){case xi:return 2;case Sn:return 8;case wn:case Ga:return 32;case rr:return 268435456;default:return 32}default:return 32}}var Im=!1,Ar=null,Mr=null,Rr=null,Ql=new Map,Jl=new Map,Dr=[],fT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function gx(s,r){switch(s){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Rr=null;break;case"pointerover":case"pointerout":Ql.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jl.delete(r.pointerId)}}function ec(s,r,o,d,p,_){return s===null||s.nativeEvent!==_?(s={blockedOn:r,domEventName:o,eventSystemFlags:d,nativeEvent:_,targetContainers:[p]},r!==null&&(r=kn(r),r!==null&&fx(r)),s):(s.eventSystemFlags|=d,r=s.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),s)}function mT(s,r,o,d,p){switch(r){case"focusin":return Ar=ec(Ar,s,r,o,d,p),!0;case"dragenter":return Mr=ec(Mr,s,r,o,d,p),!0;case"mouseover":return Rr=ec(Rr,s,r,o,d,p),!0;case"pointerover":var _=p.pointerId;return Ql.set(_,ec(Ql.get(_)||null,s,r,o,d,p)),!0;case"gotpointercapture":return _=p.pointerId,Jl.set(_,ec(Jl.get(_)||null,s,r,o,d,p)),!0}return!1}function _x(s){var r=Pi(s.target);if(r!==null){var o=l(r);if(o!==null){if(r=o.tag,r===13){if(r=c(o),r!==null){s.blockedOn=r,Za(s.priority,function(){mx(o)});return}}else if(r===31){if(r=h(o),r!==null){s.blockedOn=r,Za(s.priority,function(){mx(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){s.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}s.blockedOn=null}function fd(s){if(s.blockedOn!==null)return!1;for(var r=s.targetContainers;0<r.length;){var o=Bm(s.nativeEvent);if(o===null){o=s.nativeEvent;var d=new o.constructor(o.type,o);Te=d,o.target.dispatchEvent(d),Te=null}else return r=kn(o),r!==null&&fx(r),s.blockedOn=o,!1;r.shift()}return!0}function bx(s,r,o){fd(s)&&o.delete(r)}function pT(){Im=!1,Ar!==null&&fd(Ar)&&(Ar=null),Mr!==null&&fd(Mr)&&(Mr=null),Rr!==null&&fd(Rr)&&(Rr=null),Ql.forEach(bx),Jl.forEach(bx)}function md(s,r){s.blockedOn===r&&(s.blockedOn=null,Im||(Im=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pT)))}var pd=null;function vx(s){pd!==s&&(pd=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){pd===s&&(pd=null);for(var r=0;r<s.length;r+=3){var o=s[r],d=s[r+1],p=s[r+2];if(typeof d!="function"){if(zm(d||o)===null)continue;break}var _=kn(o);_!==null&&(s.splice(r,3),r-=3,Bf(_,{pending:!0,data:p,method:o.method,action:d},d,p))}}))}function Do(s){function r(B){return md(B,s)}Ar!==null&&md(Ar,s),Mr!==null&&md(Mr,s),Rr!==null&&md(Rr,s),Ql.forEach(r),Jl.forEach(r);for(var o=0;o<Dr.length;o++){var d=Dr[o];d.blockedOn===s&&(d.blockedOn=null)}for(;0<Dr.length&&(o=Dr[0],o.blockedOn===null);)_x(o),o.blockedOn===null&&Dr.shift();if(o=(s.ownerDocument||s).$$reactFormReplay,o!=null)for(d=0;d<o.length;d+=3){var p=o[d],_=o[d+1],S=p[Di]||null;if(typeof _=="function")S||vx(o);else if(S){var k=null;if(_&&_.hasAttribute("formAction")){if(p=_,S=_[Di]||null)k=S.formAction;else if(zm(p)!==null)continue}else k=S.action;typeof k=="function"?o[d+1]=k:(o.splice(d,3),d-=3),vx(o)}}}function xx(){function s(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),d||setTimeout(o,20)}function o(){if(!d&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){d=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Pm(s){this._internalRoot=s}gd.prototype.render=Pm.prototype.render=function(s){var r=this._internalRoot;if(r===null)throw Error(n(409));var o=r.current,d=gs();dx(o,d,s,r,null,null)},gd.prototype.unmount=Pm.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var r=s.containerInfo;dx(s.current,2,null,s,null,null),Xu(),r[ar]=null}};function gd(s){this._internalRoot=s}gd.prototype.unstable_scheduleHydration=function(s){if(s){var r=Xa();s={blockedOn:null,target:s,priority:r};for(var o=0;o<Dr.length&&r!==0&&r<Dr[o].priority;o++);Dr.splice(o,0,s),o===0&&_x(s)}};var yx=t.version;if(yx!=="19.2.6")throw Error(n(527,yx,"19.2.6"));$.findDOMNode=function(s){var r=s._reactInternals;if(r===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=f(r),s=s!==null?g(s):null,s=s===null?null:s.stateNode,s};var gT={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_d.isDisabled&&_d.supportsFiber)try{En=_d.inject(gT),fi=_d}catch{}}return ic.createRoot=function(s,r){if(!a(s))throw Error(n(299));var o=!1,d="",p=Tv,_=Av,S=Mv;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(_=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=cx(s,1,!1,null,null,o,d,null,p,_,S,xx),s[ar]=r.current,xm(s),new Pm(r)},ic.hydrateRoot=function(s,r,o){if(!a(s))throw Error(n(299));var d=!1,p="",_=Tv,S=Av,k=Mv,B=null;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(_=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.formState!==void 0&&(B=o.formState)),r=cx(s,1,!0,r,o??null,d,p,B,_,S,k,xx),r.context=ux(null),o=r.current,d=gs(),d=Mt(d),p=_r(d),p.callback=null,br(o,p,d),o=d,r.current.lanes=o,yt(r,o),rn(r),s[ar]=r.current,xm(s),new gd(r)},ic.version="19.2.6",ic}var Rx;function kT(){if(Rx)return Fm.exports;Rx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Fm.exports=CT(),Fm.exports}var B2=kT();const z2=(...e)=>e.filter((t,i,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===i).join(" ").trim();const NT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const TT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,n)=>n?n.toUpperCase():i.toLowerCase());const Dx=e=>{const t=TT(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Km={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"};const AT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},MT=E.createContext({}),RT=()=>E.useContext(MT),DT=E.forwardRef(({color:e,size:t,strokeWidth:i,absoluteStrokeWidth:n,className:a="",children:l,iconNode:c,...h},m)=>{const{size:f=24,strokeWidth:g=2,absoluteStrokeWidth:b=!1,color:v="currentColor",className:x=""}=RT()??{},y=n??b?Number(i??g)*24/Number(t??f):i??g;return E.createElement("svg",{ref:m,...Km,width:t??f??Km.width,height:t??f??Km.height,stroke:e??v,strokeWidth:y,className:z2("lucide",x,a),...!l&&!AT(h)&&{"aria-hidden":"true"},...h},[...c.map(([w,C])=>E.createElement(w,C)),...Array.isArray(l)?l:[l]])});const _e=(e,t)=>{const i=E.forwardRef(({className:n,...a},l)=>E.createElement(DT,{ref:l,iconNode:t,className:z2(`lucide-${NT(Dx(e))}`,`lucide-${e}`,n),...a}));return i.displayName=Dx(e),i};const OT=[["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"}]],Go=_e("activity",OT);const jT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],LT=_e("arrow-down",jT);const BT=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],zT=_e("arrow-up",BT);const IT=[["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"}]],Tc=_e("bot",IT);const PT=[["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"}]],I2=_e("box",PT);const UT=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],P2=_e("brain",UT);const HT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Qo=_e("check",HT);const FT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qs=_e("chevron-down",FT);const $T=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],VT=_e("chevron-left",$T);const qT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yr=_e("chevron-right",qT);const KT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],z0=_e("chevron-up",KT);const GT=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],WT=_e("clipboard-copy",GT);const YT=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],U2=_e("code-xml",YT);const XT=[["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"}]],H2=_e("copy",XT);const ZT=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],QT=_e("corner-down-left",ZT);const JT=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],eA=_e("corner-down-right",JT);const tA=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],iA=_e("cpu",tA);const sA=[["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"}]],za=_e("database",sA);const nA=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],rA=_e("download",nA);const aA=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],oA=_e("earth",aA);const lA=[["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"}]],F2=_e("external-link",lA);const cA=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],$2=_e("eye-off",cA);const uA=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],I0=_e("eye",uA);const dA=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],hA=_e("file-code-corner",dA);const fA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],V2=_e("file-exclamation-point",fA);const mA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],pA=_e("file-text",mA);const gA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],q2=_e("file",gA);const _A=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],bA=_e("flask-conical",_A);const vA=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],xA=_e("folder-git-2",vA);const yA=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],wh=_e("folder-open",yA);const SA=[["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"}]],wA=_e("folder-plus",SA);const EA=[["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"}]],Ha=_e("folder",EA);const CA=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],kA=_e("funnel",CA);const NA=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],K2=_e("gauge",NA);const TA=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Ac=_e("git-branch",TA);const AA=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 9v12",key:"1sc30k"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v3",key:"1jb6z3"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]],MA=_e("git-pull-request-create",AA);const RA=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],DA=_e("heart",RA);const OA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],jA=_e("image",OA);const LA=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],pg=_e("inbox",LA);const BA=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],zA=_e("key-round",BA);const IA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],as=_e("loader-circle",IA);const PA=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],UA=_e("lock-keyhole",PA);const HA=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],G2=_e("maximize-2",HA);const FA=[["path",{d:"M12 12v-2",key:"fwoke6"}],["path",{d:"M12 18v-2",key:"qj6yno"}],["path",{d:"M16 12v-2",key:"heuere"}],["path",{d:"M16 18v-2",key:"s1ct0w"}],["path",{d:"M2 11h1.5",key:"15p63e"}],["path",{d:"M20 18v-2",key:"12ehxp"}],["path",{d:"M20.5 11H22",key:"khsy7a"}],["path",{d:"M4 18v-2",key:"1c3oqr"}],["path",{d:"M8 12v-2",key:"1mwtfd"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["rect",{x:"2",y:"6",width:"20",height:"10",rx:"2",key:"1qcswk"}]],$A=_e("memory-stick",FA);const VA=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],W2=_e("minimize-2",VA);const qA=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],KA=_e("moon",qA);const GA=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],WA=_e("network",GA);const YA=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],XA=_e("package",YA);const ZA=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],QA=_e("palette",ZA);const JA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],e4=_e("panel-left-close",JA);const t4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],i4=_e("panel-left-open",t4);const s4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],n4=_e("panel-left",s4);const r4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],a4=_e("panel-top",r4);const o4=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],l4=_e("paperclip",o4);const c4=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Mc=_e("pencil",c4);const u4=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Y2=_e("play",u4);const d4=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],X2=_e("plug",d4);const h4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zs=_e("plus",h4);const f4=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],m4=_e("radio",f4);const p4=[["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"}]],Eh=_e("refresh-cw",p4);const g4=[["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"}]],Z2=_e("rotate-ccw",g4);const _4=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],P0=_e("save",_4);const b4=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Q2=_e("scroll-text",b4);const v4=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],x4=_e("search",v4);const y4=[["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"}]],S4=_e("server",y4);const w4=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],E4=_e("settings-2",w4);const C4=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],k4=_e("shield-alert",C4);const N4=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],J2=_e("sparkles",N4);const T4=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],A4=_e("square-terminal",T4);const M4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ch=_e("square",M4);const R4=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],D4=_e("sun",R4);const O4=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],j4=_e("table-2",O4);const L4=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],eE=_e("terminal",L4);const B4=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],qc=_e("trash-2",B4);const z4=[["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"}]],I4=_e("triangle-alert",z4);const P4=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],U4=_e("wand-sparkles",P4);const H4=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],F4=_e("wrench",H4);const $4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Js=_e("x",$4);const V4=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],q4=_e("zap",V4);class tE extends Error{conflict;constructor(t,i){super(t),this.name="PortConflictResponseError",this.conflict=i}}async function We(e,t){const i=await fetch(e,t),n=await i.json().catch(()=>{});if(!i.ok)throw i.status===409&&n?.conflict?.code==="PORT_IN_USE"?new tE(n?.error||"Port already in use",n.conflict):new Error(n?.error||i.statusText);return n}async function rs(e,t){const i=new URLSearchParams;for(const[n,a]of Object.entries(t))a!==void 0&&String(a).trim()&&i.set(n,String(a));await We(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function Kc(e,t){const i=new URLSearchParams;for(const[n,a]of Object.entries(t))a!==void 0&&String(a).trim()&&i.set(n,String(a));return We(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function K4(){return(await We("/api/agent")).agent}async function G4(e){return(await We(`/api/agent/mcp-status?agent=${encodeURIComponent(e)}`)).statuses}async function W4(){return(await We("/api/agent/usage")).usage}async function Y4(){return(await We("/api/agent/claude-settings")).settings}async function X4(e){return(await We("/api/agent/claude-settings",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})).settings}async function Z4(){const e=await We("/api/agent/chat/status");return{configured:e.configured,approvals:e.approvals,provider:e.provider}}async function Q4(e,t,i){await We("/api/agent/chat/approve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:e,requestId:t,decision:i})})}async function J4(e,t,i,n){const a=await fetch("/api/agent/chat",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({message:e,resumeSessionId:t}),signal:n});if(!a.ok||!a.body){const m=await a.json().catch(()=>{});throw new Error(m?.error||a.statusText||"Agent request failed")}const l=a.body.getReader(),c=new TextDecoder;let h="";for(;;){const{done:m,value:f}=await l.read();if(m)break;h+=c.decode(f,{stream:!0});let g=h.indexOf(`
|
|
10
|
+
|
|
11
|
+
`);for(;g!==-1;){const b=h.slice(0,g);h=h.slice(g+2);const v=b.split(`
|
|
12
|
+
`).find(x=>x.startsWith("data:"));if(v){const x=v.slice(5).trim();if(x)try{i(JSON.parse(x))}catch{}}g=h.indexOf(`
|
|
13
|
+
|
|
14
|
+
`)}}}async function eM(){return(await We("/api/databases")).connections}async function tM(){return(await We("/api/databases/detect")).detected}async function iM(e){await Kc("/api/databases",e)}async function sM(e){return Kc("/api/databases/test",e)}async function nM(e){await We(`/api/databases/${encodeURIComponent(e)}`,{method:"DELETE"})}async function rM(e){return(await We(`/api/databases/${encodeURIComponent(e)}/tables`)).tables}async function aM(e,t,i=100,n=0){return We(`/api/databases/${encodeURIComponent(e)}/rows?table=${encodeURIComponent(t)}&limit=${i}&offset=${n}`)}function oM(e,t,i,n,a){const l=n.map(c=>`- ${c.name}: ${c.dataType}${c.primaryKey?" (PK)":""}${c.nullable?"":" NOT NULL"}`).join(`
|
|
15
|
+
`);return[`I'm looking at a row in my ${t} database (connection "${e}", table \`${i.qualifiedName}\`).`,"","## Table schema",l,"","## Row","```json",JSON.stringify(a,null,2),"```","","Explain what this row represents and anything notable about its values."].join(`
|
|
16
|
+
`)}async function lM(e=100){return(await We(`/api/errors?limit=${e}`)).incidents}async function cM(e){return We(`/api/errors/${e}/prompt`)}async function uM(e,t=!1){return We(`/api/errors/${e}/bundle${t?"?save=1":""}`)}async function dM(e=200){return(await We(`/api/git/graph?limit=${e}`)).commits}async function hM(e,t){const i=new URLSearchParams({hash:e});t&&i.set("file",t);const n=await fetch(`/api/git/commit?${i.toString()}`);if(!n.ok){const a=await n.json().catch(()=>({error:n.statusText}));throw new Error(a.error||"Unable to load commit diff")}return n.text()}async function fM(e){return(await We(`/api/git/commit/files?hash=${encodeURIComponent(e)}`)).files}async function mM(){return(await We("/api/git/files")).files}async function pM(){return(await We("/api/git/file-sizes")).files}async function gM(e){const t=await We(`/api/git/file?path=${encodeURIComponent(e)}`);return{content:t.content,truncated:t.truncated,binary:t.binary,size:t.size}}async function _M(e,t){await We("/api/git/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,content:t})})}async function bM(e){const t=await fetch(`/api/git/diff?file=${encodeURIComponent(e)}`);if(!t.ok){const i=await t.json().catch(()=>({error:t.statusText}));throw new Error(i.error||"Unable to load diff")}return t.text()}async function vM(e){await We(`/api/git/repositories/${encodeURIComponent(e)}`,{method:"DELETE"})}async function xM(){return(await We("/api/log-sources")).sources}async function yM(e){return(await Kc("/api/log-sources",e)).sources}async function iE(e,t={}){const i=new URLSearchParams;return i.set("lines",String(t.lines??500)),t.since&&i.set("since",t.since),t.until&&i.set("until",t.until),t.grep&&i.set("grep",t.grep),t.level&&i.set("level",t.level),t.cursor&&i.set("cursor",t.cursor),t.before&&i.set("before",t.before),(await We(`/api/log-sources/${encodeURIComponent(e)}/logs?${i.toString()}`)).logs}async function SM(){return We("/api/dashboard")}async function wM(e){await We(`/api/services/${encodeURIComponent(e)}`,{method:"DELETE"})}async function EM(e,t,i){t.includes(i)||await rs("/api/bundles",{name:e,originalName:e,services:[...t,i].join(",")})}async function CM(e,t,i){t.includes(i)&&await rs("/api/bundles",{name:e,originalName:e,services:t.filter(n=>n!==i).join(",")})}async function sE(e,{files:t=!1}={}){const i=new URLSearchParams({path:e});return t&&i.set("files","1"),We(`/api/fs/directories?${i.toString()}`)}async function nE(e,t={}){const i=new URLSearchParams;i.set("lines",String(t.lines??500)),t.since&&i.set("since",t.since),t.until&&i.set("until",t.until),t.grep&&i.set("grep",t.grep),t.level&&i.set("level",t.level),t.cursor&&i.set("cursor",t.cursor),t.before&&i.set("before",t.before);const n=await We(`/api/services/${encodeURIComponent(e)}/logs?${i.toString()}`);return{logs:n.logs,queryable:!!n.queryable}}async function kM(e,t){const i=t?`?path=${encodeURIComponent(t)}`:"";return We(`/api/services/${encodeURIComponent(e)}/config-browse${i}`)}async function NM(e){const t=await We(`/api/services/${encodeURIComponent(e)}/config-files`);return{cwd:t.cwd,files:t.files}}async function Ox(e,t){return We(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`)}async function TM(e,t,i){return We(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({entries:i})})}async function AM(e,t,i){return We(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:i})})}async function MM(e){return(await We(`/api/services/${encodeURIComponent(e)}/metrics`)).metrics}async function RM(e){return Kc("/api/services/test",e)}async function DM(e,t){return Kc(`/api/services/${encodeURIComponent(e)}/test`,t?{pattern:t}:{})}async function OM(){return(await We("/api/terminal/sessions")).sessions}async function Ld(e){return(await We("/api/terminal/sessions",{method:"POST",...e?.serviceName?{headers:{"content-type":"application/json"},body:JSON.stringify({serviceName:e.serviceName})}:{}})).session}async function jM(e){await We(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function rE(e){var t,i,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(i=rE(e[t]))&&(n&&(n+=" "),n+=i)}else for(i in e)e[i]&&(n&&(n+=" "),n+=i);return n}function Rc(){for(var e,t,i=0,n="",a=arguments.length;i<a;i++)(e=arguments[i])&&(t=rE(e))&&(n&&(n+=" "),n+=t);return n}const jx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Lx=Rc,aE=(e,t)=>i=>{var n;if(t?.variants==null)return Lx(e,i?.class,i?.className);const{variants:a,defaultVariants:l}=t,c=Object.keys(a).map(f=>{const g=i?.[f],b=l?.[f];if(g===null)return null;const v=jx(g)||jx(b);return a[f][v]}),h=i&&Object.entries(i).reduce((f,g)=>{let[b,v]=g;return v===void 0||(f[b]=v),f},{}),m=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((f,g)=>{let{class:b,className:v,...x}=g;return Object.entries(x).every(y=>{let[w,C]=y;return Array.isArray(C)?C.includes({...l,...h}[w]):{...l,...h}[w]===C})?[...f,b,v]:f},[]);return Lx(e,c,m,i?.class,i?.className)},LM=(e,t)=>{const i=new Array(e.length+t.length);for(let n=0;n<e.length;n++)i[n]=e[n];for(let n=0;n<t.length;n++)i[e.length+n]=t[n];return i},BM=(e,t)=>({classGroupId:e,validator:t}),oE=(e=new Map,t=null,i)=>({nextPart:e,validators:t,classGroupId:i}),Xd="-",Bx=[],zM="arbitrary..",IM=e=>{const t=UM(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return PM(c);const h=c.split(Xd),m=h[0]===""&&h.length>1?1:0;return lE(h,m,t)},getConflictingClassGroupIds:(c,h)=>{if(h){const m=n[c],f=i[c];return m?f?LM(f,m):m:f||Bx}return i[c]||Bx}}},lE=(e,t,i)=>{if(e.length-t===0)return i.classGroupId;const a=e[t],l=i.nextPart.get(a);if(l){const f=lE(e,t+1,l);if(f)return f}const c=i.validators;if(c===null)return;const h=t===0?e.join(Xd):e.slice(t).join(Xd),m=c.length;for(let f=0;f<m;f++){const g=c[f];if(g.validator(h))return g.classGroupId}},PM=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),i=t.indexOf(":"),n=t.slice(0,i);return n?zM+n:void 0})(),UM=e=>{const{theme:t,classGroups:i}=e;return HM(i,t)},HM=(e,t)=>{const i=oE();for(const n in e){const a=e[n];U0(a,i,n,t)}return i},U0=(e,t,i,n)=>{const a=e.length;for(let l=0;l<a;l++){const c=e[l];FM(c,t,i,n)}},FM=(e,t,i,n)=>{if(typeof e=="string"){$M(e,t,i);return}if(typeof e=="function"){VM(e,t,i,n);return}qM(e,t,i,n)},$M=(e,t,i)=>{const n=e===""?t:cE(t,e);n.classGroupId=i},VM=(e,t,i,n)=>{if(KM(e)){U0(e(n),t,i,n);return}t.validators===null&&(t.validators=[]),t.validators.push(BM(i,e))},qM=(e,t,i,n)=>{const a=Object.entries(e),l=a.length;for(let c=0;c<l;c++){const[h,m]=a[c];U0(m,cE(t,h),i,n)}},cE=(e,t)=>{let i=e;const n=t.split(Xd),a=n.length;for(let l=0;l<a;l++){const c=n[l];let h=i.nextPart.get(c);h||(h=oE(),i.nextPart.set(c,h)),i=h}return i},KM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,GM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,i=Object.create(null),n=Object.create(null);const a=(l,c)=>{i[l]=c,t++,t>e&&(t=0,n=i,i=Object.create(null))};return{get(l){let c=i[l];if(c!==void 0)return c;if((c=n[l])!==void 0)return a(l,c),c},set(l,c){l in i?i[l]=c:a(l,c)}}},gg="!",zx=":",WM=[],Ix=(e,t,i,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:i,maybePostfixModifierPosition:n,isExternal:a}),YM=e=>{const{prefix:t,experimentalParseClassName:i}=e;let n=a=>{const l=[];let c=0,h=0,m=0,f;const g=a.length;for(let w=0;w<g;w++){const C=a[w];if(c===0&&h===0){if(C===zx){l.push(a.slice(m,w)),m=w+1;continue}if(C==="/"){f=w;continue}}C==="["?c++:C==="]"?c--:C==="("?h++:C===")"&&h--}const b=l.length===0?a:a.slice(m);let v=b,x=!1;b.endsWith(gg)?(v=b.slice(0,-1),x=!0):b.startsWith(gg)&&(v=b.slice(1),x=!0);const y=f&&f>m?f-m:void 0;return Ix(l,x,v,y)};if(t){const a=t+zx,l=n;n=c=>c.startsWith(a)?l(c.slice(a.length)):Ix(WM,!1,c,void 0,!0)}if(i){const a=n;n=l=>i({className:l,parseClassName:a})}return n},XM=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((i,n)=>{t.set(i,1e6+n)}),i=>{const n=[];let a=[];for(let l=0;l<i.length;l++){const c=i[l],h=c[0]==="[",m=t.has(c);h||m?(a.length>0&&(a.sort(),n.push(...a),a=[]),n.push(c)):a.push(c)}return a.length>0&&(a.sort(),n.push(...a)),n}},ZM=e=>({cache:GM(e.cacheSize),parseClassName:YM(e),sortModifiers:XM(e),postfixLookupClassGroupIds:QM(e),...IM(e)}),QM=e=>{const t=Object.create(null),i=e.postfixLookupClassGroups;if(i)for(let n=0;n<i.length;n++)t[i[n]]=!0;return t},JM=/\s+/,e6=(e,t)=>{const{parseClassName:i,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:l,postfixLookupClassGroupIds:c}=t,h=[],m=e.trim().split(JM);let f="";for(let g=m.length-1;g>=0;g-=1){const b=m[g],{isExternal:v,modifiers:x,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:C}=i(b);if(v){f=b+(f.length>0?" "+f:f);continue}let N=!!C,T;if(N){const j=w.substring(0,C);T=n(j);const R=T&&c[T]?n(w):void 0;R&&R!==T&&(T=R,N=!1)}else T=n(w);if(!T){if(!N){f=b+(f.length>0?" "+f:f);continue}if(T=n(w),!T){f=b+(f.length>0?" "+f:f);continue}N=!1}const D=x.length===0?"":x.length===1?x[0]:l(x).join(":"),A=y?D+gg:D,L=A+T;if(h.indexOf(L)>-1)continue;h.push(L);const G=a(T,N);for(let j=0;j<G.length;++j){const R=G[j];h.push(A+R)}f=b+(f.length>0?" "+f:f)}return f},t6=(...e)=>{let t=0,i,n,a="";for(;t<e.length;)(i=e[t++])&&(n=uE(i))&&(a&&(a+=" "),a+=n);return a},uE=e=>{if(typeof e=="string")return e;let t,i="";for(let n=0;n<e.length;n++)e[n]&&(t=uE(e[n]))&&(i&&(i+=" "),i+=t);return i},i6=(e,...t)=>{let i,n,a,l;const c=m=>{const f=t.reduce((g,b)=>b(g),e());return i=ZM(f),n=i.cache.get,a=i.cache.set,l=h,h(m)},h=m=>{const f=n(m);if(f)return f;const g=e6(m,i);return a(m,g),g};return l=c,(...m)=>l(t6(...m))},s6=[],oi=e=>{const t=i=>i[e]||s6;return t.isThemeGetter=!0,t},dE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,n6=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,r6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,a6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,o6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,l6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jr=e=>n6.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),an=e=>!!e&&Number.isInteger(Number(e)),Gm=e=>e.endsWith("%")&&qe(e.slice(0,-1)),qn=e=>r6.test(e),fE=()=>!0,u6=e=>a6.test(e)&&!o6.test(e),H0=()=>!1,d6=e=>l6.test(e),h6=e=>c6.test(e),f6=e=>!ye(e)&&!we(e),m6=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),p6=e=>Xr(e,gE,H0),ye=e=>dE.test(e),Sa=e=>Xr(e,_E,u6),Px=e=>Xr(e,w6,qe),g6=e=>Xr(e,vE,fE),_6=e=>Xr(e,bE,H0),Ux=e=>Xr(e,mE,H0),b6=e=>Xr(e,pE,h6),bd=e=>Xr(e,xE,d6),we=e=>hE.test(e),sc=e=>Fa(e,_E),v6=e=>Fa(e,bE),Hx=e=>Fa(e,mE),x6=e=>Fa(e,gE),y6=e=>Fa(e,pE),vd=e=>Fa(e,xE,!0),S6=e=>Fa(e,vE,!0),Xr=(e,t,i)=>{const n=dE.exec(e);return n?n[1]?t(n[1]):i(n[2]):!1},Fa=(e,t,i=!1)=>{const n=hE.exec(e);return n?n[1]?t(n[1]):i:!1},mE=e=>e==="position"||e==="percentage",pE=e=>e==="image"||e==="url",gE=e=>e==="length"||e==="size"||e==="bg-size",_E=e=>e==="length",w6=e=>e==="number",bE=e=>e==="family-name",vE=e=>e==="number"||e==="weight",xE=e=>e==="shadow",E6=()=>{const e=oi("color"),t=oi("font"),i=oi("text"),n=oi("font-weight"),a=oi("tracking"),l=oi("leading"),c=oi("breakpoint"),h=oi("container"),m=oi("spacing"),f=oi("radius"),g=oi("shadow"),b=oi("inset-shadow"),v=oi("text-shadow"),x=oi("drop-shadow"),y=oi("blur"),w=oi("perspective"),C=oi("aspect"),N=oi("ease"),T=oi("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...A(),we,ye],G=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],R=()=>[we,ye,m],H=()=>[jr,"full","auto",...R()],I=()=>[an,"none","subgrid",we,ye],W=()=>["auto",{span:["full",an,we,ye]},an,we,ye],J=()=>[an,"auto",we,ye],P=()=>["auto","min","max","fr",we,ye],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...R()],$=()=>[jr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],F=()=>[jr,"screen","full","dvw","lvw","svw","min","max","fit",...R()],V=()=>[jr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],Y=()=>[e,we,ye],O=()=>[...A(),Hx,Ux,{position:[we,ye]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",x6,p6,{size:[we,ye]}],ie=()=>[Gm,sc,Sa],le=()=>["","none","full",f,we,ye],me=()=>["",qe,sc,Sa],Se=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[qe,Gm,Hx,Ux],nt=()=>["","none",y,we,ye],lt=()=>["none",qe,we,ye],ct=()=>["none",qe,we,ye],Be=()=>[qe,we,ye],Ft=()=>[jr,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qn],breakpoint:[qn],color:[fE],container:[qn],"drop-shadow":[qn],ease:["in","out","in-out"],font:[f6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qn],shadow:[qn],spacing:["px",qe],text:[qn],"text-shadow":[qn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",jr,ye,we,C]}],container:["container"],"container-type":[{"@container":["","normal","size",we,ye]}],"container-named":[m6],columns:[{columns:[qe,ye,we,h]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[an,"auto",we,ye]}],basis:[{basis:[jr,"full","auto",h,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,jr,"auto","initial","none",ye]}],grow:[{grow:["",qe,we,ye]}],shrink:[{shrink:["",qe,we,ye]}],order:[{order:[an,"first","last","none",we,ye]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[h,"screen",...$()]}],"min-w":[{"min-w":[h,"screen","none",...$()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[c]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",i,sc,Sa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,S6,g6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gm,ye]}],"font-family":[{font:[v6,_6,t]}],"font-features":[{"font-features":[ye]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,we,ye]}],"line-clamp":[{"line-clamp":[qe,"none",we,Px]}],leading:[{leading:[l,...R()]}],"list-image":[{"list-image":["none",we,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",we,Sa]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[qe,"auto",we,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[an,we,ye]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},an,we,ye],radial:["",we,ye],conic:[an,we,ye]},y6,b6]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-bs":[{"border-bs":Y()}],"border-color-be":[{"border-be":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,we,ye]}],"outline-w":[{outline:["",qe,sc,Sa]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",g,vd,bd]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",b,vd,bd]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[qe,Sa]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",v,vd,bd]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[qe,we,ye]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[we,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,ye]}],filter:[{filter:["","none",we,ye]}],blur:[{blur:nt()}],brightness:[{brightness:[qe,we,ye]}],contrast:[{contrast:[qe,we,ye]}],"drop-shadow":[{"drop-shadow":["","none",x,vd,bd]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",qe,we,ye]}],"hue-rotate":[{"hue-rotate":[qe,we,ye]}],invert:[{invert:["",qe,we,ye]}],saturate:[{saturate:[qe,we,ye]}],sepia:[{sepia:["",qe,we,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",we,ye]}],"backdrop-blur":[{"backdrop-blur":nt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,we,ye]}],"backdrop-contrast":[{"backdrop-contrast":[qe,we,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,we,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,we,ye]}],"backdrop-invert":[{"backdrop-invert":["",qe,we,ye]}],"backdrop-opacity":[{"backdrop-opacity":[qe,we,ye]}],"backdrop-saturate":[{"backdrop-saturate":[qe,we,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,we,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",we,ye]}],ease:[{ease:["linear","initial",N,we,ye]}],delay:[{delay:[qe,we,ye]}],animate:[{animate:["none",T,we,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,we,ye]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:lt()}],"rotate-x":[{"rotate-x":lt()}],"rotate-y":[{"rotate-y":lt()}],"rotate-z":[{"rotate-z":lt()}],scale:[{scale:ct()}],"scale-x":[{"scale-x":ct()}],"scale-y":[{"scale-y":ct()}],"scale-z":[{"scale-z":ct()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[we,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ft()}],"translate-x":[{"translate-x":Ft()}],"translate-y":[{"translate-y":Ft()}],"translate-z":[{"translate-z":Ft()}],"translate-none":["translate-none"],zoom:[{zoom:[an,we,ye]}],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we,ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Y()}],"scrollbar-track-color":[{"scrollbar-track":Y()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we,ye]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[qe,sc,Sa,Px]}],stroke:[{stroke:["none",...Y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},C6=i6(E6);function fe(...e){return C6(Rc(e))}const yE=aE("inline-flex h-9 shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md border border-transparent px-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",outline:"border-border bg-background hover:bg-muted",ghost:"hover:bg-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90"},size:{default:"h-9 px-3",sm:"h-8 px-2.5 text-xs",icon:"size-9 p-0"}},defaultVariants:{variant:"default",size:"default"}});function de({className:e,variant:t,size:i,...n}){return u.jsx("button",{className:fe(yE({variant:t,size:i,className:e})),...n})}const SE=E.createContext({});function k6(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const N6=typeof window<"u",T6=N6?E.useLayoutEffect:E.useEffect,F0=E.createContext(null);function $0(e,t){e.indexOf(t)===-1&&e.push(t)}function Zd(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}const _n=(e,t,i)=>i>t?t:i<e?e:i;let V0=()=>{};const Kr={},wE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function EE(e){return typeof e=="object"&&e!==null}const CE=e=>/^0[^.\s]+$/u.test(e);function kE(e){let t;return()=>(t===void 0&&(t=e()),t)}const Is=e=>e,A6=(e,t)=>i=>t(e(i)),Gc=(...e)=>e.reduce(A6),Dc=(e,t,i)=>{const n=t-e;return n===0?1:(i-e)/n};class q0{constructor(){this.subscriptions=[]}add(t){return $0(this.subscriptions,t),()=>Zd(this.subscriptions,t)}notify(t,i,n){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,i,n);else for(let l=0;l<a;l++){const c=this.subscriptions[l];c&&c(t,i,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const xs=e=>e*1e3,Bs=e=>e/1e3;function NE(e,t){return t?e*(1e3/t):0}const TE=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e,M6=1e-7,R6=12;function D6(e,t,i,n,a){let l,c,h=0;do c=t+(i-t)/2,l=TE(c,n,a)-e,l>0?i=c:t=c;while(Math.abs(l)>M6&&++h<R6);return c}function Wc(e,t,i,n){if(e===t&&i===n)return Is;const a=l=>D6(l,0,1,e,i);return l=>l===0||l===1?l:TE(a(l),t,n)}const AE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ME=e=>t=>1-e(1-t),RE=Wc(.33,1.53,.69,.99),K0=ME(RE),DE=AE(K0),OE=e=>e>=1?1:(e*=2)<1?.5*K0(e):.5*(2-Math.pow(2,-10*(e-1))),G0=e=>1-Math.sin(Math.acos(e)),jE=ME(G0),LE=AE(G0),O6=Wc(.42,0,1,1),j6=Wc(0,0,.58,1),BE=Wc(.42,0,.58,1),L6=e=>Array.isArray(e)&&typeof e[0]!="number",zE=e=>Array.isArray(e)&&typeof e[0]=="number",B6={linear:Is,easeIn:O6,easeInOut:BE,easeOut:j6,circIn:G0,circInOut:LE,circOut:jE,backIn:K0,backInOut:DE,backOut:RE,anticipate:OE},z6=e=>typeof e=="string",Fx=e=>{if(zE(e)){V0(e.length===4);const[t,i,n,a]=e;return Wc(t,i,n,a)}else if(z6(e))return B6[e];return e},xd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function I6(e,t){let i=new Set,n=new Set,a=!1,l=!1;const c=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function m(g){c.has(g)&&(f.schedule(g),e()),g(h)}const f={schedule:(g,b=!1,v=!1)=>{const y=v&&a?i:n;return b&&c.add(g),y.add(g),g},cancel:g=>{n.delete(g),c.delete(g)},process:g=>{if(h=g,a){l=!0;return}a=!0;const b=i;i=n,n=b,i.forEach(m),i.clear(),a=!1,l&&(l=!1,f.process(g))}};return f}const P6=40;function IE(e,t){let i=!1,n=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>i=!0,c=xd.reduce((D,A)=>(D[A]=I6(l),D),{}),{setup:h,read:m,resolveKeyframes:f,preUpdate:g,update:b,preRender:v,render:x,postRender:y}=c,w=()=>{const D=Kr.useManualTiming,A=D?a.timestamp:performance.now();i=!1,D||(a.delta=n?1e3/60:Math.max(Math.min(A-a.timestamp,P6),1)),a.timestamp=A,a.isProcessing=!0,h.process(a),m.process(a),f.process(a),g.process(a),b.process(a),v.process(a),x.process(a),y.process(a),a.isProcessing=!1,i&&t&&(n=!1,e(w))},C=()=>{i=!0,n=!0,a.isProcessing||e(w)};return{schedule:xd.reduce((D,A)=>{const L=c[A];return D[A]=(G,j=!1,R=!1)=>(i||C(),L.schedule(G,j,R)),D},{}),cancel:D=>{for(let A=0;A<xd.length;A++)c[xd[A]].cancel(D)},state:a,steps:c}}const{schedule:wt,cancel:Gr,state:Ni,steps:Wm}=IE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Is,!0);let Bd;function U6(){Bd=void 0}const $i={now:()=>(Bd===void 0&&$i.set(Ni.isProcessing||Kr.useManualTiming?Ni.timestamp:performance.now()),Bd),set:e=>{Bd=e,queueMicrotask(U6)}},PE=e=>t=>typeof t=="string"&&t.startsWith(e),UE=PE("--"),H6=PE("var(--"),W0=e=>H6(e)?F6.test(e.split("/*")[0].trim()):!1,F6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function $x(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Jo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Oc={...Jo,transform:e=>_n(0,1,e)},yd={...Jo,default:1},wc=e=>Math.round(e*1e5)/1e5,Y0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $6(e){return e==null}const V6=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,X0=(e,t)=>i=>!!(typeof i=="string"&&V6.test(i)&&i.startsWith(e)||t&&!$6(i)&&Object.prototype.hasOwnProperty.call(i,t)),HE=(e,t,i)=>n=>{if(typeof n!="string")return n;const[a,l,c,h]=n.match(Y0);return{[e]:parseFloat(a),[t]:parseFloat(l),[i]:parseFloat(c),alpha:h!==void 0?parseFloat(h):1}},q6=e=>_n(0,255,e),Ym={...Jo,transform:e=>Math.round(q6(e))},Ma={test:X0("rgb","red"),parse:HE("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:n=1})=>"rgba("+Ym.transform(e)+", "+Ym.transform(t)+", "+Ym.transform(i)+", "+wc(Oc.transform(n))+")"};function K6(e){let t="",i="",n="",a="";return e.length>5?(t=e.substring(1,3),i=e.substring(3,5),n=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),i=e.substring(2,3),n=e.substring(3,4),a=e.substring(4,5),t+=t,i+=i,n+=n,a+=a),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:a?parseInt(a,16)/255:1}}const _g={test:X0("#"),parse:K6,transform:Ma.transform},Yc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pr=Yc("deg"),mn=Yc("%"),ke=Yc("px"),G6=Yc("vh"),W6=Yc("vw"),Vx={...mn,parse:e=>mn.parse(e)/100,transform:e=>mn.transform(e*100)},Uo={test:X0("hsl","hue"),parse:HE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:n=1})=>"hsla("+Math.round(e)+", "+mn.transform(wc(t))+", "+mn.transform(wc(i))+", "+wc(Oc.transform(n))+")"},ii={test:e=>Ma.test(e)||_g.test(e)||Uo.test(e),parse:e=>Ma.test(e)?Ma.parse(e):Uo.test(e)?Uo.parse(e):_g.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ma.transform(e):Uo.transform(e),getAnimatableNone:e=>{const t=ii.parse(e);return t.alpha=0,ii.transform(t)}},Y6=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function X6(e){return isNaN(e)&&typeof e=="string"&&(e.match(Y0)?.length||0)+(e.match(Y6)?.length||0)>0}const FE="number",$E="color",Z6="var",Q6="var(",qx="${}",J6=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Wo(e){const t=e.toString(),i=[],n={color:[],number:[],var:[]},a=[];let l=0;const h=t.replace(J6,m=>(ii.test(m)?(n.color.push(l),a.push($E),i.push(ii.parse(m))):m.startsWith(Q6)?(n.var.push(l),a.push(Z6),i.push(m)):(n.number.push(l),a.push(FE),i.push(parseFloat(m))),++l,qx)).split(qx);return{values:i,split:h,indexes:n,types:a}}function eR(e){return Wo(e).values}function VE({split:e,types:t}){const i=e.length;return n=>{let a="";for(let l=0;l<i;l++)if(a+=e[l],n[l]!==void 0){const c=t[l];c===FE?a+=wc(n[l]):c===$E?a+=ii.transform(n[l]):a+=n[l]}return a}}function tR(e){return VE(Wo(e))}const iR=e=>typeof e=="number"?0:ii.test(e)?ii.getAnimatableNone(e):e,sR=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:iR(e);function nR(e){const t=Wo(e);return VE(t)(t.values.map((n,a)=>sR(n,t.split[a])))}const Zs={test:X6,parse:eR,createTransformer:tR,getAnimatableNone:nR};function Xm(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function rR({hue:e,saturation:t,lightness:i,alpha:n}){e/=360,t/=100,i/=100;let a=0,l=0,c=0;if(!t)a=l=c=i;else{const h=i<.5?i*(1+t):i+t-i*t,m=2*i-h;a=Xm(m,h,e+1/3),l=Xm(m,h,e),c=Xm(m,h,e-1/3)}return{red:Math.round(a*255),green:Math.round(l*255),blue:Math.round(c*255),alpha:n}}function Qd(e,t){return i=>i>0?t:e}const At=(e,t,i)=>e+(t-e)*i,Zm=(e,t,i)=>{const n=e*e,a=i*(t*t-n)+n;return a<0?0:Math.sqrt(a)},aR=[_g,Ma,Uo],oR=e=>aR.find(t=>t.test(e));function Kx(e){const t=oR(e);if(!t)return!1;let i=t.parse(e);return t===Uo&&(i=rR(i)),i}const Gx=(e,t)=>{const i=Kx(e),n=Kx(t);if(!i||!n)return Qd(e,t);const a={...i};return l=>(a.red=Zm(i.red,n.red,l),a.green=Zm(i.green,n.green,l),a.blue=Zm(i.blue,n.blue,l),a.alpha=At(i.alpha,n.alpha,l),Ma.transform(a))},bg=new Set(["none","hidden"]);function lR(e,t){return bg.has(e)?i=>i<=0?e:t:i=>i>=1?t:e}function cR(e,t){return i=>At(e,t,i)}function Z0(e){return typeof e=="number"?cR:typeof e=="string"?W0(e)?Qd:ii.test(e)?Gx:hR:Array.isArray(e)?qE:typeof e=="object"?ii.test(e)?Gx:uR:Qd}function qE(e,t){const i=[...e],n=i.length,a=e.map((l,c)=>Z0(l)(l,t[c]));return l=>{for(let c=0;c<n;c++)i[c]=a[c](l);return i}}function uR(e,t){const i={...e,...t},n={};for(const a in i)e[a]!==void 0&&t[a]!==void 0&&(n[a]=Z0(e[a])(e[a],t[a]));return a=>{for(const l in n)i[l]=n[l](a);return i}}function dR(e,t){const i=[],n={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const l=t.types[a],c=e.indexes[l][n[l]],h=e.values[c]??0;i[a]=h,n[l]++}return i}const hR=(e,t)=>{const i=Zs.createTransformer(t),n=Wo(e),a=Wo(t);return n.indexes.var.length===a.indexes.var.length&&n.indexes.color.length===a.indexes.color.length&&n.indexes.number.length>=a.indexes.number.length?bg.has(e)&&!a.values.length||bg.has(t)&&!n.values.length?lR(e,t):Gc(qE(dR(n,a),a.values),i):Qd(e,t)};function KE(e,t,i){return typeof e=="number"&&typeof t=="number"&&typeof i=="number"?At(e,t,i):Z0(e)(e,t)}const fR=e=>{const t=({timestamp:i})=>e(i);return{start:(i=!0)=>wt.update(t,i),stop:()=>Gr(t),now:()=>Ni.isProcessing?Ni.timestamp:$i.now()}},GE=(e,t,i=10)=>{let n="";const a=Math.max(Math.round(t/i),2);for(let l=0;l<a;l++)n+=Math.round(e(l/(a-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Jd=2e4;function Q0(e){let t=0;const i=50;let n=e.next(t);for(;!n.done&&t<Jd;)t+=i,n=e.next(t);return t>=Jd?1/0:t}function mR(e,t=100,i){const n=i({...e,keyframes:[0,t]}),a=Math.min(Q0(n),Jd);return{type:"keyframes",ease:l=>n.next(a*l).value/t,duration:Bs(a)}}const Pt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function vg(e,t){return e*Math.sqrt(1-t*t)}const pR=12;function gR(e,t,i){let n=i;for(let a=1;a<pR;a++)n=n-e(n)/t(n);return n}const Qm=.001;function _R({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:i=Pt.velocity,mass:n=Pt.mass}){let a,l,c=1-t;c=_n(Pt.minDamping,Pt.maxDamping,c),e=_n(Pt.minDuration,Pt.maxDuration,Bs(e)),c<1?(a=f=>{const g=f*c,b=g*e,v=g-i,x=vg(f,c),y=Math.exp(-b);return Qm-v/x*y},l=f=>{const b=f*c*e,v=b*i+i,x=Math.pow(c,2)*Math.pow(f,2)*e,y=Math.exp(-b),w=vg(Math.pow(f,2),c);return(-a(f)+Qm>0?-1:1)*((v-x)*y)/w}):(a=f=>{const g=Math.exp(-f*e),b=(f-i)*e+1;return-Qm+g*b},l=f=>{const g=Math.exp(-f*e),b=(i-f)*(e*e);return g*b});const h=5/e,m=gR(a,l,h);if(e=xs(e),isNaN(m))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const f=Math.pow(m,2)*n;return{stiffness:f,damping:c*2*Math.sqrt(n*f),duration:e}}}const bR=["duration","bounce"],vR=["stiffness","damping","mass"];function Wx(e,t){return t.some(i=>e[i]!==void 0)}function xR(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!Wx(e,vR)&&Wx(e,bR))if(t.velocity=0,e.visualDuration){const i=e.visualDuration,n=2*Math.PI/(i*1.2),a=n*n,l=2*_n(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Pt.mass,stiffness:a,damping:l}}else{const i=_R({...e,velocity:0});t={...t,...i,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function eh(e=Pt.visualDuration,t=Pt.bounce){const i=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:a}=i;const l=i.keyframes[0],c=i.keyframes[i.keyframes.length-1],h={done:!1,value:l},{stiffness:m,damping:f,mass:g,duration:b,velocity:v,isResolvedFromDuration:x}=xR({...i,velocity:-Bs(i.velocity||0)}),y=v||0,w=f/(2*Math.sqrt(m*g)),C=c-l,N=Bs(Math.sqrt(m/g)),T=Math.abs(C)<5;n||(n=T?Pt.restSpeed.granular:Pt.restSpeed.default),a||(a=T?Pt.restDelta.granular:Pt.restDelta.default);let D,A,L,G,j,R;if(w<1)L=vg(N,w),G=(y+w*N*C)/L,D=I=>{const W=Math.exp(-w*N*I);return c-W*(G*Math.sin(L*I)+C*Math.cos(L*I))},j=w*N*G+C*L,R=w*N*C-G*L,A=I=>Math.exp(-w*N*I)*(j*Math.sin(L*I)+R*Math.cos(L*I));else if(w===1){D=W=>c-Math.exp(-N*W)*(C+(y+N*C)*W);const I=y+N*C;A=W=>Math.exp(-N*W)*(N*I*W-y)}else{const I=N*Math.sqrt(w*w-1);D=te=>{const K=Math.exp(-w*N*te),M=Math.min(I*te,300);return c-K*((y+w*N*C)*Math.sinh(M)+I*C*Math.cosh(M))/I};const W=(y+w*N*C)/I,J=w*N*W-C*I,P=w*N*C-W*I;A=te=>{const K=Math.exp(-w*N*te),M=Math.min(I*te,300);return K*(J*Math.sinh(M)+P*Math.cosh(M))}}const H={calculatedDuration:x&&b||null,velocity:I=>xs(A(I)),next:I=>{if(!x&&w<1){const J=Math.exp(-w*N*I),P=Math.sin(L*I),te=Math.cos(L*I),K=c-J*(G*P+C*te),M=xs(J*(j*P+R*te));return h.done=Math.abs(M)<=n&&Math.abs(c-K)<=a,h.value=h.done?c:K,h}const W=D(I);if(x)h.done=I>=b;else{const J=xs(A(I));h.done=Math.abs(J)<=n&&Math.abs(c-W)<=a}return h.value=h.done?c:W,h},toString:()=>{const I=Math.min(Q0(H),Jd),W=GE(J=>H.next(I*J).value,I,30);return I+"ms "+W},toTransition:()=>{}};return H}eh.applyToOptions=e=>{const t=mR(e,100,eh);return e.ease=t.ease,e.duration=xs(t.duration),e.type="keyframes",e};const yR=5;function WE(e,t,i){const n=Math.max(t-yR,0);return NE(i-e(n),t-n)}function xg({keyframes:e,velocity:t=0,power:i=.8,timeConstant:n=325,bounceDamping:a=10,bounceStiffness:l=500,modifyTarget:c,min:h,max:m,restDelta:f=.5,restSpeed:g}){const b=e[0],v={done:!1,value:b},x=R=>h!==void 0&&R<h||m!==void 0&&R>m,y=R=>h===void 0?m:m===void 0||Math.abs(h-R)<Math.abs(m-R)?h:m;let w=i*t;const C=b+w,N=c===void 0?C:c(C);N!==C&&(w=N-b);const T=R=>-w*Math.exp(-R/n),D=R=>N+T(R),A=R=>{const H=T(R),I=D(R);v.done=Math.abs(H)<=f,v.value=v.done?N:I};let L,G;const j=R=>{x(v.value)&&(L=R,G=eh({keyframes:[v.value,y(v.value)],velocity:WE(D,R,v.value),damping:a,stiffness:l,restDelta:f,restSpeed:g}))};return j(0),{calculatedDuration:null,next:R=>{let H=!1;return!G&&L===void 0&&(H=!0,A(R),j(R)),L!==void 0&&R>=L?G.next(R-L):(!H&&A(R),v)}}}function SR(e,t,i){const n=[],a=i||Kr.mix||KE,l=e.length-1;for(let c=0;c<l;c++){let h=a(e[c],e[c+1]);if(t){const m=Array.isArray(t)?t[c]||Is:t;h=Gc(m,h)}n.push(h)}return n}function wR(e,t,{clamp:i=!0,ease:n,mixer:a}={}){const l=e.length;if(V0(l===t.length),l===1)return()=>t[0];if(l===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),t=[...t].reverse());const h=SR(t,n,a),m=h.length,f=g=>{if(c&&g<e[0])return t[0];let b=0;if(m>1)for(;b<e.length-2&&!(g<e[b+1]);b++);const v=Dc(e[b],e[b+1],g);return h[b](v)};return i?g=>f(_n(e[0],e[l-1],g)):f}function ER(e,t){const i=e[e.length-1];for(let n=1;n<=t;n++){const a=Dc(0,t,n);e.push(At(i,1,a))}}function CR(e){const t=[0];return ER(t,e.length-1),t}function kR(e,t){return e.map(i=>i*t)}function NR(e,t){return e.map(()=>t||BE).splice(0,e.length-1)}function Ec({duration:e=300,keyframes:t,times:i,ease:n="easeInOut"}){const a=L6(n)?n.map(Fx):Fx(n),l={done:!1,value:t[0]},c=kR(i&&i.length===t.length?i:CR(t),e),h=wR(c,t,{ease:Array.isArray(a)?a:NR(t,a)});return{calculatedDuration:e,next:m=>(l.value=h(m),l.done=m>=e,l)}}const TR=e=>e!==null;function kh(e,{repeat:t,repeatType:i="loop"},n,a=1){const l=e.filter(TR),h=a<0||t&&i!=="loop"&&t%2===1?0:l.length-1;return!h||n===void 0?l[h]:n}const AR={decay:xg,inertia:xg,tween:Ec,keyframes:Ec,spring:eh};function YE(e){typeof e.type=="string"&&(e.type=AR[e.type])}class J0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,i){return this.finished.then(t,i)}}const MR=e=>e/100;class th extends J0{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:i}=this.options;i&&i.updatedAt!==$i.now()&&this.tick($i.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;YE(t);const{type:i=Ec,repeat:n=0,repeatDelay:a=0,repeatType:l,velocity:c=0}=t;let{keyframes:h}=t;const m=i||Ec;m!==Ec&&typeof h[0]!="number"&&(this.mixKeyframes=Gc(MR,KE(h[0],h[1])),h=[0,100]);const f=m({...t,keyframes:h});l==="mirror"&&(this.mirroredGenerator=m({...t,keyframes:[...h].reverse(),velocity:-c})),f.calculatedDuration===null&&(f.calculatedDuration=Q0(f));const{calculatedDuration:g}=f;this.calculatedDuration=g,this.resolvedDuration=g+a,this.totalDuration=this.resolvedDuration*(n+1)-a,this.generator=f}updateTime(t){const i=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(t,i=!1){const{generator:n,totalDuration:a,mixKeyframes:l,mirroredGenerator:c,resolvedDuration:h,calculatedDuration:m}=this;if(this.startTime===null)return n.next(0);const{delay:f=0,keyframes:g,repeat:b,repeatType:v,repeatDelay:x,type:y,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),i?this.currentTime=t:this.updateTime(t);const N=this.currentTime-f*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?N<0:N>a;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let D=this.currentTime,A=n;if(b){const R=Math.min(this.currentTime,a)/h;let H=Math.floor(R),I=R%1;!I&&R>=1&&(I=1),I===1&&H--,H=Math.min(H,b+1),H%2&&(v==="reverse"?(I=1-I,x&&(I-=x/h)):v==="mirror"&&(A=c)),D=_n(0,1,I)*h}let L;T?(this.delayState.value=g[0],L=this.delayState):L=A.next(D),l&&!T&&(L.value=l(L.value));let{done:G}=L;!T&&m!==null&&(G=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&G);return j&&y!==xg&&(L.value=kh(g,this.options,C,this.speed)),w&&w(L.value),j&&this.finish(),L}then(t,i){return this.finished.then(t,i)}get duration(){return Bs(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Bs(t)}get time(){return Bs(this.currentTime)}set time(t){t=xs(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const i=this.generator.next(t).value;return WE(n=>this.generator.next(n).value,t,i)}get speed(){return this.playbackSpeed}set speed(t){const i=this.playbackSpeed!==t;i&&this.driver&&this.updateTime($i.now()),this.playbackSpeed=t,i&&this.driver&&(this.time=Bs(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=fR,startTime:i}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),this.options.onPlay?.();const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=i??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime($i.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function RR(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ra=e=>e*180/Math.PI,yg=e=>{const t=Ra(Math.atan2(e[1],e[0]));return Sg(t)},DR={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yg,rotateZ:yg,skewX:e=>Ra(Math.atan(e[1])),skewY:e=>Ra(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Sg=e=>(e=e%360,e<0&&(e+=360),e),Yx=yg,Xx=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Zx=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),OR={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xx,scaleY:Zx,scale:e=>(Xx(e)+Zx(e))/2,rotateX:e=>Sg(Ra(Math.atan2(e[6],e[5]))),rotateY:e=>Sg(Ra(Math.atan2(-e[2],e[0]))),rotateZ:Yx,rotate:Yx,skewX:e=>Ra(Math.atan(e[4])),skewY:e=>Ra(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wg(e){return e.includes("scale")?1:0}function Eg(e,t){if(!e||e==="none")return wg(t);const i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,a;if(i)n=OR,a=i;else{const h=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=DR,a=h}if(!a)return wg(t);const l=n[t],c=a[1].split(",").map(LR);return typeof l=="function"?l(c):c[l]}const jR=(e,t)=>{const{transform:i="none"}=getComputedStyle(e);return Eg(i,t)};function LR(e){return parseFloat(e.trim())}const el=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tl=new Set(el),Qx=e=>e===Jo||e===ke,BR=new Set(["x","y","z"]),zR=el.filter(e=>!BR.has(e));function IR(e){const t=[];return zR.forEach(i=>{const n=e.getValue(i);n!==void 0&&(t.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),t}const Fr={width:({x:e},{paddingLeft:t="0",paddingRight:i="0",boxSizing:n})=>{const a=e.max-e.min;return n==="border-box"?a:a-parseFloat(t)-parseFloat(i)},height:({y:e},{paddingTop:t="0",paddingBottom:i="0",boxSizing:n})=>{const a=e.max-e.min;return n==="border-box"?a:a-parseFloat(t)-parseFloat(i)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Eg(t,"x"),y:(e,{transform:t})=>Eg(t,"y")};Fr.translateX=Fr.x;Fr.translateY=Fr.y;const Oa=new Set;let Cg=!1,kg=!1,Ng=!1;function XE(){if(kg){const e=Array.from(Oa).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),i=new Map;t.forEach(n=>{const a=IR(n);a.length&&(i.set(n,a),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const a=i.get(n);a&&a.forEach(([l,c])=>{n.getValue(l)?.set(c)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}kg=!1,Cg=!1,Oa.forEach(e=>e.complete(Ng)),Oa.clear()}function ZE(){Oa.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(kg=!0)})}function PR(){Ng=!0,ZE(),XE(),Ng=!1}class e_{constructor(t,i,n,a,l,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=i,this.name=n,this.motionValue=a,this.element=l,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(Oa.add(this),Cg||(Cg=!0,wt.read(ZE),wt.resolveKeyframes(XE))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:i,element:n,motionValue:a}=this;if(t[0]===null){const l=a?.get(),c=t[t.length-1];if(l!==void 0)t[0]=l;else if(n&&i){const h=n.readValue(i,c);h!=null&&(t[0]=h)}t[0]===void 0&&(t[0]=c),a&&l===void 0&&a.set(t[0])}RR(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Oa.delete(this)}cancel(){this.state==="scheduled"&&(Oa.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const UR=e=>e.startsWith("--");function QE(e,t,i){UR(t)?e.style.setProperty(t,i):e.style[t]=i}const HR={};function JE(e,t){const i=kE(e);return()=>HR[t]??i()}const FR=JE(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),eC=JE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),mc=([e,t,i,n])=>`cubic-bezier(${e}, ${t}, ${i}, ${n})`,Jx={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:mc([0,.65,.55,1]),circOut:mc([.55,0,1,.45]),backIn:mc([.31,.01,.66,-.59]),backOut:mc([.33,1.53,.69,.99])};function tC(e,t){if(e)return typeof e=="function"?eC()?GE(e,t):"ease-out":zE(e)?mc(e):Array.isArray(e)?e.map(i=>tC(i,t)||Jx.easeOut):Jx[e]}function $R(e,t,i,{delay:n=0,duration:a=300,repeat:l=0,repeatType:c="loop",ease:h="easeOut",times:m}={},f=void 0){const g={[t]:i};m&&(g.offset=m);const b=tC(h,a);Array.isArray(b)&&(g.easing=b);const v={delay:n,duration:a,easing:Array.isArray(b)?"linear":b,fill:"both",iterations:l+1,direction:c==="reverse"?"alternate":"normal"};return f&&(v.pseudoElement=f),e.animate(g,v)}function iC(e){return typeof e=="function"&&"applyToOptions"in e}function VR({type:e,...t}){return iC(e)&&eC()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class sC extends J0{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:i,name:n,keyframes:a,pseudoElement:l,allowFlatten:c=!1,finalKeyframe:h,onComplete:m}=t;this.isPseudoElement=!!l,this.allowFlatten=c,this.options=t,V0(typeof t.type!="string");const f=VR(t);this.animation=$R(i,n,a,f,l),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const g=kh(a,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(g),QE(i,n,g),this.animation.cancel()}m?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Bs(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Bs(t)}get time(){return Bs(Number(this.animation.currentTime)||0)}set time(t){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xs(t),i&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:i,rangeEnd:n,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&FR()?(this.animation.timeline=t,i&&(this.animation.rangeStart=i),n&&(this.animation.rangeEnd=n),Is):a(this)}}const nC={anticipate:OE,backInOut:DE,circInOut:LE};function qR(e){return e in nC}function KR(e){typeof e.ease=="string"&&qR(e.ease)&&(e.ease=nC[e.ease])}const Jm=10;class GR extends sC{constructor(t){KR(t),YE(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:i,onUpdate:n,onComplete:a,element:l,...c}=this.options;if(!i)return;if(t!==void 0){i.set(t);return}const h=new th({...c,autoplay:!1}),m=Math.max(Jm,$i.now()-this.startTime),f=_n(0,Jm,m-Jm),g=h.sample(m).value,{name:b}=this.options;l&&b&&QE(l,b,g),i.setWithVelocity(h.sample(Math.max(0,m-f)).value,g,f),h.stop()}}const ey=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Zs.test(e)||e==="0")&&!e.startsWith("url("));function WR(e){const t=e[0];if(e.length===1)return!0;for(let i=0;i<e.length;i++)if(e[i]!==t)return!0}function YR(e,t,i,n){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],c=ey(a,t),h=ey(l,t);return!c||!h?!1:WR(e)||(i==="spring"||iC(i))&&n}function Tg(e){e.duration=0,e.type="keyframes"}const rC=new Set(["opacity","clipPath","filter","transform"]),XR=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ZR(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&XR.test(e[t]))return!0;return!1}const QR=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),JR=kE(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function e8(e){const{motionValue:t,name:i,repeatDelay:n,repeatType:a,damping:l,type:c,keyframes:h}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:g}=t.owner.getProps();return JR()&&i&&(rC.has(i)||QR.has(i)&&ZR(h))&&(i!=="transform"||!g)&&!f&&!n&&a!=="mirror"&&l!==0&&c!=="inertia"}const t8=40;class i8 extends J0{constructor({autoplay:t=!0,delay:i=0,type:n="keyframes",repeat:a=0,repeatDelay:l=0,repeatType:c="loop",keyframes:h,name:m,motionValue:f,element:g,...b}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=$i.now();const v={autoplay:t,delay:i,type:n,repeat:a,repeatDelay:l,repeatType:c,name:m,motionValue:f,element:g,...b},x=g?.KeyframeResolver||e_;this.keyframeResolver=new x(h,(y,w,C)=>this.onKeyframesResolved(y,w,v,!C),m,f,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,n,a){this.keyframeResolver=void 0;const{name:l,type:c,velocity:h,delay:m,isHandoff:f,onUpdate:g}=n;this.resolvedAt=$i.now();let b=!0;YR(t,l,c,h)||(b=!1,(Kr.instantAnimations||!m)&&g?.(kh(t,n,i)),t[0]=t[t.length-1],Tg(n),n.repeat=0);const x={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>t8?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:t},y=b&&!f&&e8(x),w=x.motionValue?.owner?.current;let C;if(y)try{C=new GR({...x,element:w})}catch{C=new th(x)}else C=new th(x);C.finished.then(()=>{this.notifyFinished()}).catch(Is),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(t,i){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),PR()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function aC(e,t,i,n=0,a=1){const l=Array.from(e).sort((f,g)=>f.sortNodePosition(g)).indexOf(t),c=e.size,h=(c-1)*n;return typeof i=="function"?i(l,c):a===1?l*n:h-l*n}const s8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function n8(e){const t=s8.exec(e);if(!t)return[,];const[,i,n,a]=t;return[`--${i??n}`,a]}function oC(e,t,i=1){const[n,a]=n8(e);if(!n)return;const l=window.getComputedStyle(t).getPropertyValue(n);if(l){const c=l.trim();return wE(c)?parseFloat(c):c}return W0(a)?oC(a,t,i+1):a}const r8={type:"spring",stiffness:500,damping:25,restSpeed:10},a8=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),o8={type:"keyframes",duration:.8},l8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},c8=(e,{keyframes:t})=>t.length>2?o8:tl.has(e)?e.startsWith("scale")?a8(t[1]):r8:l8;function lC(e,t){if(e?.inherit&&t){const{inherit:i,...n}=e;return{...t,...n}}return e}function t_(e,t){const i=e?.[t]??e?.default??e;return i!==e?lC(i,e):i}const u8=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function d8(e){for(const t in e)if(!u8.has(t))return!0;return!1}const i_=(e,t,i,n={},a,l)=>c=>{const h=t_(n,e)||{},m=h.delay||n.delay||0;let{elapsed:f=0}=n;f=f-xs(m);const g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...h,delay:-f,onUpdate:v=>{t.set(v),h.onUpdate&&h.onUpdate(v)},onComplete:()=>{c(),h.onComplete&&h.onComplete()},name:e,motionValue:t,element:l?void 0:a};d8(h)||Object.assign(g,c8(e,g)),g.duration&&(g.duration=xs(g.duration)),g.repeatDelay&&(g.repeatDelay=xs(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let b=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(Tg(g),g.delay===0&&(b=!0)),(Kr.instantAnimations||Kr.skipAnimations||a?.shouldSkipAnimations)&&(b=!0,Tg(g),g.delay=0),g.allowFlatten=!h.type&&!h.ease,b&&!l&&t.get()!==void 0){const v=kh(g.keyframes,h);if(v!==void 0){wt.update(()=>{g.onUpdate(v),g.onComplete()});return}}return h.isSync?new th(g):new i8(g)};function ty(e){const t=[{},{}];return e?.values.forEach((i,n)=>{t[0][n]=i.get(),t[1][n]=i.getVelocity()}),t}function s_(e,t,i,n){if(typeof t=="function"){const[a,l]=ty(n);t=t(i!==void 0?i:e.custom,a,l)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,l]=ty(n);t=t(i!==void 0?i:e.custom,a,l)}return t}function ja(e,t,i){const n=e.getProps();return s_(n,t,i!==void 0?i:n.custom,e)}const cC=new Set(["width","height","top","left","right","bottom",...el]),iy=30,h8=e=>!isNaN(parseFloat(e));class f8{constructor(t,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{const a=$i.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=i.owner}setCurrent(t){this.current=t,this.updatedAt=$i.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=h8(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,i){this.events[t]||(this.events[t]=new q0);const n=this.events[t].add(i);return t==="change"?()=>{n(),wt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,i){this.passiveEffect=t,this.stopPassiveEffect=i}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,i,n){this.set(i),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,i=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=$i.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>iy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,iy);return NE(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(t){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=t(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yo(e,t){return new f8(e,t)}const Ag=e=>Array.isArray(e);function m8(e,t,i){e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,Yo(i))}function p8(e){return Ag(e)?e[e.length-1]||0:e}function g8(e,t){const i=ja(e,t);let{transitionEnd:n={},transition:a={},...l}=i||{};l={...l,...n};for(const c in l){const h=p8(l[c]);m8(e,c,h)}}const Ai=e=>!!(e&&e.getVelocity);function _8(e){return!!(Ai(e)&&e.add)}function Mg(e,t){const i=e.getValue("willChange");if(_8(i))return i.add(t);if(!i&&Kr.WillChange){const n=new Kr.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function n_(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const b8="framerAppearId",uC="data-"+n_(b8);function dC(e){return e.props[uC]}function v8({protectedKeys:e,needsAnimating:t},i){const n=e.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,n}function hC(e,t,{delay:i=0,transitionOverride:n,type:a}={}){let{transition:l,transitionEnd:c,...h}=t;const m=e.getDefaultTransition();l=l?lC(l,m):m;const f=l?.reduceMotion;n&&(l=n);const g=[],b=a&&e.animationState&&e.animationState.getState()[a];for(const v in h){const x=e.getValue(v,e.latestValues[v]??null),y=h[v];if(y===void 0||b&&v8(b,v))continue;const w={delay:i,...t_(l||{},v)},C=x.get();if(C!==void 0&&!x.isAnimating()&&!Array.isArray(y)&&y===C&&!w.velocity){wt.update(()=>x.set(y));continue}let N=!1;if(window.MotionHandoffAnimation){const A=dC(e);if(A){const L=window.MotionHandoffAnimation(A,v,wt);L!==null&&(w.startTime=L,N=!0)}}Mg(e,v);const T=f??e.shouldReduceMotion;x.start(i_(v,x,y,T&&cC.has(v)?{type:!1}:w,e,N));const D=x.animation;D&&g.push(D)}if(c){const v=()=>wt.update(()=>{c&&g8(e,c)});g.length?Promise.all(g).then(v):v()}return g}function Rg(e,t,i={}){const n=ja(e,t,i.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(a=i.transitionOverride);const l=n?()=>Promise.all(hC(e,n,i)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:f=0,staggerChildren:g,staggerDirection:b}=a;return x8(e,t,m,f,g,b,i)}:()=>Promise.resolve(),{when:h}=a;if(h){const[m,f]=h==="beforeChildren"?[l,c]:[c,l];return m().then(()=>f())}else return Promise.all([l(),c(i.delay)])}function x8(e,t,i=0,n=0,a=0,l=1,c){const h=[];for(const m of e.variantChildren)m.notify("AnimationStart",t),h.push(Rg(m,t,{...c,delay:i+(typeof n=="function"?0:n)+aC(e.variantChildren,m,n,a,l)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(h)}function y8(e,t,i={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const a=t.map(l=>Rg(e,l,i));n=Promise.all(a)}else if(typeof t=="string")n=Rg(e,t,i);else{const a=typeof t=="function"?ja(e,t,i.custom):t;n=Promise.all(hC(e,a,i))}return n.then(()=>{e.notify("AnimationComplete",t)})}const S8={test:e=>e==="auto",parse:e=>e},fC=e=>t=>t.test(e),mC=[Jo,ke,mn,Pr,W6,G6,S8],sy=e=>mC.find(fC(e));function w8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||CE(e):!0}const E8=new Set(["brightness","contrast","saturate","opacity"]);function C8(e){const[t,i]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=i.match(Y0)||[];if(!n)return e;const a=i.replace(n,"");let l=E8.has(t)?1:0;return n!==i&&(l*=100),t+"("+l+a+")"}const k8=/\b([a-z-]*)\(.*?\)/gu,Dg={...Zs,getAnimatableNone:e=>{const t=e.match(k8);return t?t.map(C8).join(" "):e}},Og={...Zs,getAnimatableNone:e=>{const t=Zs.parse(e);return Zs.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},ny={...Jo,transform:Math.round},N8={rotate:Pr,rotateX:Pr,rotateY:Pr,rotateZ:Pr,scale:yd,scaleX:yd,scaleY:yd,scaleZ:yd,skew:Pr,skewX:Pr,skewY:Pr,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:Oc,originX:Vx,originY:Vx,originZ:ke},r_={borderWidth:ke,borderTopWidth:ke,borderRightWidth:ke,borderBottomWidth:ke,borderLeftWidth:ke,borderRadius:ke,borderTopLeftRadius:ke,borderTopRightRadius:ke,borderBottomRightRadius:ke,borderBottomLeftRadius:ke,width:ke,maxWidth:ke,height:ke,maxHeight:ke,top:ke,right:ke,bottom:ke,left:ke,inset:ke,insetBlock:ke,insetBlockStart:ke,insetBlockEnd:ke,insetInline:ke,insetInlineStart:ke,insetInlineEnd:ke,padding:ke,paddingTop:ke,paddingRight:ke,paddingBottom:ke,paddingLeft:ke,paddingBlock:ke,paddingBlockStart:ke,paddingBlockEnd:ke,paddingInline:ke,paddingInlineStart:ke,paddingInlineEnd:ke,margin:ke,marginTop:ke,marginRight:ke,marginBottom:ke,marginLeft:ke,marginBlock:ke,marginBlockStart:ke,marginBlockEnd:ke,marginInline:ke,marginInlineStart:ke,marginInlineEnd:ke,fontSize:ke,backgroundPositionX:ke,backgroundPositionY:ke,...N8,zIndex:ny,fillOpacity:Oc,strokeOpacity:Oc,numOctaves:ny},T8={...r_,color:ii,backgroundColor:ii,outlineColor:ii,fill:ii,stroke:ii,borderColor:ii,borderTopColor:ii,borderRightColor:ii,borderBottomColor:ii,borderLeftColor:ii,filter:Dg,WebkitFilter:Dg,mask:Og,WebkitMask:Og},pC=e=>T8[e],A8=new Set([Dg,Og]);function gC(e,t){let i=pC(e);return A8.has(i)||(i=Zs),i.getAnimatableNone?i.getAnimatableNone(t):void 0}const M8=new Set(["auto","none","0"]);function R8(e,t,i){let n=0,a;for(;n<e.length&&!a;){const l=e[n];typeof l=="string"&&!M8.has(l)&&Wo(l).values.length&&(a=e[n]),n++}if(a&&i)for(const l of t)e[l]=gC(i,a)}class D8 extends e_{constructor(t,i,n,a,l){super(t,i,n,a,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:i,name:n}=this;if(!i||!i.current)return;super.readKeyframes();for(let g=0;g<t.length;g++){let b=t[g];if(typeof b=="string"&&(b=b.trim(),W0(b))){const v=oC(b,i.current);v!==void 0&&(t[g]=v),g===t.length-1&&(this.finalKeyframe=b)}}if(this.resolveNoneKeyframes(),!cC.has(n)||t.length!==2)return;const[a,l]=t,c=sy(a),h=sy(l),m=$x(a),f=$x(l);if(m!==f&&Fr[n]){this.needsMeasurement=!0;return}if(c!==h)if(Qx(c)&&Qx(h))for(let g=0;g<t.length;g++){const b=t[g];typeof b=="string"&&(t[g]=parseFloat(b))}else Fr[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:i}=this,n=[];for(let a=0;a<t.length;a++)(t[a]===null||w8(t[a]))&&n.push(a);n.length&&R8(t,n,i)}measureInitialState(){const{element:t,unresolvedKeyframes:i,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Fr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i[0]=this.measuredOrigin;const a=i[i.length-1];a!==void 0&&t.getValue(n,a).jump(a,!1)}measureEndState(){const{element:t,name:i,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const a=t.getValue(i);a&&a.jump(this.measuredOrigin,!1);const l=n.length-1,c=n[l];n[l]=Fr[i](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([h,m])=>{t.getValue(h).set(m)}),this.resolveNoneKeyframes()}}function _C(e,t,i){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const a=i?.[e]??n.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(n=>n!=null)}const bC=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function O8(e){return EE(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:a_}=IE(queueMicrotask,!1),Ws={x:!1,y:!1};function vC(){return Ws.x||Ws.y}function j8(e){return e==="x"||e==="y"?Ws[e]?null:(Ws[e]=!0,()=>{Ws[e]=!1}):Ws.x||Ws.y?null:(Ws.x=Ws.y=!0,()=>{Ws.x=Ws.y=!1})}function xC(e,t){const i=_C(e),n=new AbortController,a={passive:!0,...t,signal:n.signal};return[i,a,()=>n.abort()]}function L8(e){return!(e.pointerType==="touch"||vC())}function B8(e,t,i={}){const[n,a,l]=xC(e,i);return n.forEach(c=>{let h=!1,m=!1,f;const g=()=>{c.removeEventListener("pointerleave",y)},b=C=>{f&&(f(C),f=void 0),g()},v=C=>{h=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),m&&(m=!1,b(C))},x=()=>{h=!0,window.addEventListener("pointerup",v,a),window.addEventListener("pointercancel",v,a)},y=C=>{if(C.pointerType!=="touch"){if(h){m=!0;return}b(C)}},w=C=>{if(!L8(C))return;m=!1;const N=t(c,C);typeof N=="function"&&(f=N,c.addEventListener("pointerleave",y,a))};c.addEventListener("pointerenter",w,a),c.addEventListener("pointerdown",x,a)}),l}const yC=(e,t)=>t?e===t?!0:yC(e,t.parentElement):!1,o_=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,z8=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function I8(e){return z8.has(e.tagName)||e.isContentEditable===!0}const P8=new Set(["INPUT","SELECT","TEXTAREA"]);function U8(e){return P8.has(e.tagName)||e.isContentEditable===!0}const zd=new WeakSet;function ry(e){return t=>{t.key==="Enter"&&e(t)}}function ep(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const H8=(e,t)=>{const i=e.currentTarget;if(!i)return;const n=ry(()=>{if(zd.has(i))return;ep(i,"down");const a=ry(()=>{ep(i,"up")}),l=()=>ep(i,"cancel");i.addEventListener("keyup",a,t),i.addEventListener("blur",l,t)});i.addEventListener("keydown",n,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),t)};function ay(e){return o_(e)&&!vC()}const oy=new WeakSet;function F8(e,t,i={}){const[n,a,l]=xC(e,i),c=h=>{const m=h.currentTarget;if(!ay(h)||oy.has(h))return;zd.add(m),i.stopPropagation&&oy.add(h);const f=t(m,h),g=(x,y)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",v),zd.has(m)&&zd.delete(m),ay(x)&&typeof f=="function"&&f(x,{success:y})},b=x=>{g(x,m===window||m===document||i.useGlobalTarget||yC(m,x.target))},v=x=>{g(x,!1)};window.addEventListener("pointerup",b,a),window.addEventListener("pointercancel",v,a)};return n.forEach(h=>{(i.useGlobalTarget?window:h).addEventListener("pointerdown",c,a),O8(h)&&(h.addEventListener("focus",f=>H8(f,a)),!I8(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),l}function l_(e){return EE(e)&&"ownerSVGElement"in e}const Id=new WeakMap;let Pd;const SC=(e,t,i)=>(n,a)=>a&&a[0]?a[0][e+"Size"]:l_(n)&&"getBBox"in n?n.getBBox()[t]:n[i],$8=SC("inline","width","offsetWidth"),V8=SC("block","height","offsetHeight");function q8({target:e,borderBoxSize:t}){Id.get(e)?.forEach(i=>{i(e,{get width(){return $8(e,t)},get height(){return V8(e,t)}})})}function K8(e){e.forEach(q8)}function G8(){typeof ResizeObserver>"u"||(Pd=new ResizeObserver(K8))}function W8(e,t){Pd||G8();const i=_C(e);return i.forEach(n=>{let a=Id.get(n);a||(a=new Set,Id.set(n,a)),a.add(t),Pd?.observe(n)}),()=>{i.forEach(n=>{const a=Id.get(n);a?.delete(t),a?.size||Pd?.unobserve(n)})}}const Ud=new Set;let Ho;function Y8(){Ho=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ud.forEach(t=>t(e))},window.addEventListener("resize",Ho)}function X8(e){return Ud.add(e),Ho||Y8(),()=>{Ud.delete(e),!Ud.size&&typeof Ho=="function"&&(window.removeEventListener("resize",Ho),Ho=void 0)}}function ly(e,t){return typeof e=="function"?X8(e):W8(e,t)}function Z8(e){return l_(e)&&e.tagName==="svg"}const Q8=[...mC,ii,Zs],J8=e=>Q8.find(fC(e)),cy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fo=()=>({x:cy(),y:cy()}),uy=()=>({min:0,max:0}),ui=()=>({x:uy(),y:uy()}),eD=new WeakMap;function Nh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function jc(e){return typeof e=="string"||Array.isArray(e)}const c_=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],u_=["initial",...c_];function Th(e){return Nh(e.animate)||u_.some(t=>jc(e[t]))}function wC(e){return!!(Th(e)||e.variants)}function tD(e,t,i){for(const n in t){const a=t[n],l=i[n];if(Ai(a))e.addValue(n,a);else if(Ai(l))e.addValue(n,Yo(a,{owner:e}));else if(l!==a)if(e.hasValue(n)){const c=e.getValue(n);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=e.getStaticValue(n);e.addValue(n,Yo(c!==void 0?c:a,{owner:e}))}}for(const n in i)t[n]===void 0&&e.removeValue(n);return t}const jg={current:null},EC={current:!1},iD=typeof window<"u";function sD(){if(EC.current=!0,!!iD)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>jg.current=e.matches;e.addEventListener("change",t),t()}else jg.current=!1}const dy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ih={};function CC(e){ih=e}function nD(){return ih}class rD{scrapeMotionValuesFromProps(t,i,n){return{}}constructor({parent:t,props:i,presenceContext:n,reducedMotionConfig:a,skipAnimations:l,blockInitialAnimation:c,visualState:h},m={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=e_,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=$i.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,wt.render(this.render,!1,!0))};const{latestValues:f,renderState:g}=h;this.latestValues=f,this.baseTarget={...f},this.initialValues=i.initial?{...f}:{},this.renderState=g,this.parent=t,this.props=i,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=l,this.options=m,this.blockInitialAnimation=!!c,this.isControllingVariants=Th(i),this.isVariantNode=wC(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:b,...v}=this.scrapeMotionValuesFromProps(i,{},this);for(const x in v){const y=v[x];f[x]!==void 0&&Ai(y)&&y.set(f[x])}}mount(t){if(this.hasBeenMounted)for(const i in this.initialValues)this.values.get(i)?.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,eD.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,n)=>this.bindToMotionValue(n,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(EC.current||sD(),this.shouldReduceMotion=jg.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Gr(this.notifyUpdate),Gr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const i=this.features[t];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,i){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),i.accelerate&&rC.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:h,times:m,ease:f,duration:g}=i.accelerate,b=new sC({element:this.current,name:t,keyframes:h,times:m,ease:f,duration:xs(g)}),v=c(b);this.valueSubscriptions.set(t,()=>{v(),b.cancel()});return}const n=tl.has(t);n&&this.onBindTransform&&this.onBindTransform();const a=i.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&wt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,i)),this.valueSubscriptions.set(t,()=>{a(),l&&l(),i.owner&&i.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ih){const i=ih[t];if(!i)continue;const{isEnabled:n,Feature:a}=i;if(!this.features[t]&&a&&n(this.props)&&(this.features[t]=new a(this)),this.features[t]){const l=this.features[t];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ui()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,i){this.latestValues[t]=i}update(t,i){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let n=0;n<dy.length;n++){const a=dy[n];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const l="on"+a,c=t[l];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=tD(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(t),()=>i.variantChildren.delete(t)}addValue(t,i){const n=this.values.get(t);i!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,i),this.values.set(t,i),this.latestValues[t]=i.get())}removeValue(t){this.values.delete(t);const i=this.valueSubscriptions.get(t);i&&(i(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,i){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&i!==void 0&&(n=Yo(i===null?void 0:i,{owner:this}),this.addValue(t,n)),n}readValue(t,i){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(wE(n)||CE(n))?n=parseFloat(n):!J8(n)&&Zs.test(i)&&(n=gC(t,i)),this.setBaseTarget(t,Ai(n)?n.get():n)),Ai(n)?n.get():n}setBaseTarget(t,i){this.baseTarget[t]=i}getBaseTarget(t){const{initial:i}=this.props;let n;if(typeof i=="string"||typeof i=="object"){const l=s_(this.props,i,this.presenceContext?.custom);l&&(n=l[t])}if(i&&n!==void 0)return n;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Ai(a)?a:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,i){return this.events[t]||(this.events[t]=new q0),this.events[t].add(i)}notify(t,...i){this.events[t]&&this.events[t].notify(...i)}scheduleRenderMicrotask(){a_.render(this.render)}}class kC extends rD{constructor(){super(...arguments),this.KeyframeResolver=D8}sortInstanceNodePosition(t,i){return t.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(t,i){const n=t.style;return n?n[i]:void 0}removeValueFromRenderState(t,{vars:i,style:n}){delete i[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ai(t)&&(this.childSubscription=t.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function NC({top:e,left:t,right:i,bottom:n}){return{x:{min:t,max:i},y:{min:e,max:n}}}function aD({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function oD(e,t){if(!t)return e;const i=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}function tp(e){return e===void 0||e===1}function Lg({scale:e,scaleX:t,scaleY:i}){return!tp(e)||!tp(t)||!tp(i)}function ka(e){return Lg(e)||TC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function TC(e){return hy(e.x)||hy(e.y)}function hy(e){return e&&e!=="0%"}function sh(e,t,i){const n=e-i,a=t*n;return i+a}function fy(e,t,i,n,a){return a!==void 0&&(e=sh(e,a,n)),sh(e,i,n)+t}function Bg(e,t=0,i=1,n,a){e.min=fy(e.min,t,i,n,a),e.max=fy(e.max,t,i,n,a)}function AC(e,{x:t,y:i}){Bg(e.x,t.translate,t.scale,t.originPoint),Bg(e.y,i.translate,i.scale,i.originPoint)}const my=.999999999999,py=1.0000000000001;function lD(e,t,i,n=!1){const a=i.length;if(!a)return;t.x=t.y=1;let l,c;for(let h=0;h<a;h++){l=i[h],c=l.projectionDelta;const{visualElement:m}=l.options;m&&m.props.style&&m.props.style.display==="contents"||(n&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(hn(e.x,-l.scroll.offset.x),hn(e.y,-l.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,AC(e,c)),n&&ka(l.latestValues)&&Hd(e,l.latestValues,l.layout?.layoutBox))}t.x<py&&t.x>my&&(t.x=1),t.y<py&&t.y>my&&(t.y=1)}function hn(e,t){e.min+=t,e.max+=t}function gy(e,t,i,n,a=.5){const l=At(e.min,e.max,a);Bg(e,t,i,l,n)}function _y(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Hd(e,t,i){const n=i??e;gy(e.x,_y(t.x,n.x),t.scaleX,t.scale,t.originX),gy(e.y,_y(t.y,n.y),t.scaleY,t.scale,t.originY)}function MC(e,t){return NC(oD(e.getBoundingClientRect(),t))}function cD(e,t,i){const n=MC(e,i),{scroll:a}=t;return a&&(hn(n.x,a.offset.x),hn(n.y,a.offset.y)),n}const uD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dD=el.length;function hD(e,t,i){let n="",a=!0;for(let l=0;l<dD;l++){const c=el[l],h=e[c];if(h===void 0)continue;let m=!0;if(typeof h=="number")m=h===(c.startsWith("scale")?1:0);else{const f=parseFloat(h);m=c.startsWith("scale")?f===1:f===0}if(!m||i){const f=bC(h,r_[c]);if(!m){a=!1;const g=uD[c]||c;n+=`${g}(${f}) `}i&&(t[c]=f)}}return n=n.trim(),i?n=i(t,a?"":n):a&&(n="none"),n}function d_(e,t,i){const{style:n,vars:a,transformOrigin:l}=e;let c=!1,h=!1;for(const m in t){const f=t[m];if(tl.has(m)){c=!0;continue}else if(UE(m)){a[m]=f;continue}else{const g=bC(f,r_[m]);m.startsWith("origin")?(h=!0,l[m]=g):n[m]=g}}if(t.transform||(c||i?n.transform=hD(t,e.transform,i):n.transform&&(n.transform="none")),h){const{originX:m="50%",originY:f="50%",originZ:g=0}=l;n.transformOrigin=`${m} ${f} ${g}`}}function RC(e,{style:t,vars:i},n,a){const l=e.style;let c;for(c in t)l[c]=t[c];a?.applyProjectionStyles(l,n);for(c in i)l.setProperty(c,i[c])}function by(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const nc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const i=by(e,t.target.x),n=by(e,t.target.y);return`${i}% ${n}%`}},fD={correct:(e,{treeScale:t,projectionDelta:i})=>{const n=e,a=Zs.parse(e);if(a.length>5)return n;const l=Zs.createTransformer(e),c=typeof a[0]!="number"?1:0,h=i.x.scale*t.x,m=i.y.scale*t.y;a[0+c]/=h,a[1+c]/=m;const f=At(h,m,.5);return typeof a[2+c]=="number"&&(a[2+c]/=f),typeof a[3+c]=="number"&&(a[3+c]/=f),l(a)}},zg={borderRadius:{...nc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:nc,borderTopRightRadius:nc,borderBottomLeftRadius:nc,borderBottomRightRadius:nc,boxShadow:fD};function DC(e,{layout:t,layoutId:i}){return tl.has(e)||e.startsWith("origin")||(t||i!==void 0)&&(!!zg[e]||e==="opacity")}function h_(e,t,i){const n=e.style,a=t?.style,l={};if(!n)return l;for(const c in n)(Ai(n[c])||a&&Ai(a[c])||DC(c,e)||i?.getValue(c)?.liveStyle!==void 0)&&(l[c]=n[c]);return l}function mD(e){return window.getComputedStyle(e)}class pD extends kC{constructor(){super(...arguments),this.type="html",this.renderInstance=RC}readValueFromInstance(t,i){if(tl.has(i))return this.projection?.isProjecting?wg(i):jR(t,i);{const n=mD(t),a=(UE(i)?n.getPropertyValue(i):n[i])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:i}){return MC(t,i)}build(t,i,n){d_(t,i,n.transformTemplate)}scrapeMotionValuesFromProps(t,i,n){return h_(t,i,n)}}const gD={offset:"stroke-dashoffset",array:"stroke-dasharray"},_D={offset:"strokeDashoffset",array:"strokeDasharray"};function bD(e,t,i=1,n=0,a=!0){e.pathLength=1;const l=a?gD:_D;e[l.offset]=`${-n}`,e[l.array]=`${t} ${i}`}const vD=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function OC(e,{attrX:t,attrY:i,attrScale:n,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...h},m,f,g){if(d_(e,h,f),m){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:b,style:v}=e;b.transform&&(v.transform=b.transform,delete b.transform),(v.transform||b.transformOrigin)&&(v.transformOrigin=b.transformOrigin??"50% 50%",delete b.transformOrigin),v.transform&&(v.transformBox=g?.transformBox??"fill-box",delete b.transformBox);for(const x of vD)b[x]!==void 0&&(v[x]=b[x],delete b[x]);t!==void 0&&(b.x=t),i!==void 0&&(b.y=i),n!==void 0&&(b.scale=n),a!==void 0&&bD(b,a,l,c,!1)}const jC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),LC=e=>typeof e=="string"&&e.toLowerCase()==="svg";function xD(e,t,i,n){RC(e,t,void 0,n);for(const a in t.attrs)e.setAttribute(jC.has(a)?a:n_(a),t.attrs[a])}function BC(e,t,i){const n=h_(e,t,i);for(const a in e)if(Ai(e[a])||Ai(t[a])){const l=el.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;n[l]=e[a]}return n}class yD extends kC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ui}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(tl.has(i)){const n=pC(i);return n&&n.default||0}return i=jC.has(i)?i:n_(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,n){return BC(t,i,n)}build(t,i,n){OC(t,i,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,i,n,a){xD(t,i,n,a)}mount(t){this.isSVGTag=LC(t.tagName),super.mount(t)}}const SD=u_.length;function zC(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent?zC(e.parent)||{}:{};return e.props.initial!==void 0&&(i.initial=e.props.initial),i}const t={};for(let i=0;i<SD;i++){const n=u_[i],a=e.props[n];(jc(a)||a===!1)&&(t[n]=a)}return t}function IC(e,t){if(!Array.isArray(t))return!1;const i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}const wD=[...c_].reverse(),ED=c_.length;function CD(e){return t=>Promise.all(t.map(({animation:i,options:n})=>y8(e,i,n)))}function kD(e){let t=CD(e),i=vy(),n=!0,a=!1;const l=f=>(g,b)=>{const v=ja(e,b,f==="exit"?e.presenceContext?.custom:void 0);if(v){const{transition:x,transitionEnd:y,...w}=v;g={...g,...w,...y}}return g};function c(f){t=f(e)}function h(f){const{props:g}=e,b=zC(e.parent)||{},v=[],x=new Set;let y={},w=1/0;for(let N=0;N<ED;N++){const T=wD[N],D=i[T],A=g[T]!==void 0?g[T]:b[T],L=jc(A),G=T===f?D.isActive:null;G===!1&&(w=N);let j=A===b[T]&&A!==g[T]&&L;if(j&&(n||a)&&e.manuallyAnimateOnMount&&(j=!1),D.protectedKeys={...y},!D.isActive&&G===null||!A&&!D.prevProp||Nh(A)||typeof A=="boolean")continue;if(T==="exit"&&D.isActive&&G!==!0){D.prevResolvedValues&&(y={...y,...D.prevResolvedValues});continue}const R=ND(D.prevProp,A);let H=R||T===f&&D.isActive&&!j&&L||N>w&&L,I=!1;const W=Array.isArray(A)?A:[A];let J=W.reduce(l(T),{});G===!1&&(J={});const{prevResolvedValues:P={}}=D,te={...P,...J},K=F=>{H=!0,x.has(F)&&(I=!0,x.delete(F)),D.needsAnimating[F]=!0;const V=e.getValue(F);V&&(V.liveStyle=!1)};for(const F in te){const V=J[F],Y=P[F];if(y.hasOwnProperty(F))continue;let O=!1;Ag(V)&&Ag(Y)?O=!IC(V,Y):O=V!==Y,O?V!=null?K(F):x.add(F):V!==void 0&&x.has(F)?K(F):D.protectedKeys[F]=!0}D.prevProp=A,D.prevResolvedValues=J,D.isActive&&(y={...y,...J}),(n||a)&&e.blockInitialAnimation&&(H=!1);const M=j&&R;H&&(!M||I)&&v.push(...W.map(F=>{const V={type:T};if(typeof F=="string"&&(n||a)&&!M&&e.manuallyAnimateOnMount&&e.parent){const{parent:Y}=e,O=ja(Y,F);if(Y.enteringChildren&&O){const{delayChildren:ee}=O.transition||{};V.delay=aC(Y.enteringChildren,e,ee)}}return{animation:F,options:V}}))}if(x.size){const N={};if(typeof g.initial!="boolean"){const T=ja(e,Array.isArray(g.initial)?g.initial[0]:g.initial);T&&T.transition&&(N.transition=T.transition)}x.forEach(T=>{const D=e.getBaseTarget(T),A=e.getValue(T);A&&(A.liveStyle=!0),N[T]=D??null}),v.push({animation:N})}let C=!!v.length;return n&&(g.initial===!1||g.initial===g.animate)&&!e.manuallyAnimateOnMount&&(C=!1),n=!1,a=!1,C?t(v):Promise.resolve()}function m(f,g){if(i[f].isActive===g)return Promise.resolve();e.variantChildren?.forEach(v=>v.animationState?.setActive(f,g)),i[f].isActive=g;const b=h(f);for(const v in i)i[v].protectedKeys={};return b}return{animateChanges:h,setActive:m,setAnimateFunction:c,getState:()=>i,reset:()=>{i=vy(),a=!0}}}function ND(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!IC(t,e):!1}function wa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vy(){return{animate:wa(!0),whileInView:wa(),whileHover:wa(),whileTap:wa(),whileDrag:wa(),whileFocus:wa(),exit:wa()}}function Ig(e,t){e.min=t.min,e.max=t.max}function Gs(e,t){Ig(e.x,t.x),Ig(e.y,t.y)}function xy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const PC=1e-4,TD=1-PC,AD=1+PC,UC=.01,MD=0-UC,RD=0+UC;function Vi(e){return e.max-e.min}function DD(e,t,i){return Math.abs(e-t)<=i}function yy(e,t,i,n=.5){e.origin=n,e.originPoint=At(t.min,t.max,e.origin),e.scale=Vi(i)/Vi(t),e.translate=At(i.min,i.max,e.origin)-e.originPoint,(e.scale>=TD&&e.scale<=AD||isNaN(e.scale))&&(e.scale=1),(e.translate>=MD&&e.translate<=RD||isNaN(e.translate))&&(e.translate=0)}function Cc(e,t,i,n){yy(e.x,t.x,i.x,n?n.originX:void 0),yy(e.y,t.y,i.y,n?n.originY:void 0)}function Sy(e,t,i,n=0){const a=n?At(i.min,i.max,n):i.min;e.min=a+t.min,e.max=e.min+Vi(t)}function OD(e,t,i,n){Sy(e.x,t.x,i.x,n?.x),Sy(e.y,t.y,i.y,n?.y)}function wy(e,t,i,n=0){const a=n?At(i.min,i.max,n):i.min;e.min=t.min-a,e.max=e.min+Vi(t)}function nh(e,t,i,n){wy(e.x,t.x,i.x,n?.x),wy(e.y,t.y,i.y,n?.y)}function Ey(e,t,i,n,a){return e-=t,e=sh(e,1/i,n),a!==void 0&&(e=sh(e,1/a,n)),e}function jD(e,t=0,i=1,n=.5,a,l=e,c=e){if(mn.test(t)&&(t=parseFloat(t),t=At(c.min,c.max,t/100)-c.min),typeof t!="number")return;let h=At(l.min,l.max,n);e===l&&(h-=t),e.min=Ey(e.min,t,i,h,a),e.max=Ey(e.max,t,i,h,a)}function Cy(e,t,[i,n,a],l,c){jD(e,t[i],t[n],t[a],t.scale,l,c)}const LD=["x","scaleX","originX"],BD=["y","scaleY","originY"];function ky(e,t,i,n){Cy(e.x,t,LD,i?i.x:void 0,n?n.x:void 0),Cy(e.y,t,BD,i?i.y:void 0,n?n.y:void 0)}function Ny(e){return e.translate===0&&e.scale===1}function HC(e){return Ny(e.x)&&Ny(e.y)}function Ty(e,t){return e.min===t.min&&e.max===t.max}function zD(e,t){return Ty(e.x,t.x)&&Ty(e.y,t.y)}function Ay(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function FC(e,t){return Ay(e.x,t.x)&&Ay(e.y,t.y)}function My(e){return Vi(e.x)/Vi(e.y)}function Ry(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function dn(e){return[e("x"),e("y")]}function ID(e,t,i){let n="";const a=e.x.translate/t.x,l=e.y.translate/t.y,c=i?.z||0;if((a||l||c)&&(n=`translate3d(${a}px, ${l}px, ${c}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),i){const{transformPerspective:f,rotate:g,rotateX:b,rotateY:v,skewX:x,skewY:y}=i;f&&(n=`perspective(${f}px) ${n}`),g&&(n+=`rotate(${g}deg) `),b&&(n+=`rotateX(${b}deg) `),v&&(n+=`rotateY(${v}deg) `),x&&(n+=`skewX(${x}deg) `),y&&(n+=`skewY(${y}deg) `)}const h=e.x.scale*t.x,m=e.y.scale*t.y;return(h!==1||m!==1)&&(n+=`scale(${h}, ${m})`),n||"none"}const $C=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],PD=$C.length,Dy=e=>typeof e=="string"?parseFloat(e):e,Oy=e=>typeof e=="number"||ke.test(e);function UD(e,t,i,n,a,l){a?(e.opacity=At(0,i.opacity??1,HD(n)),e.opacityExit=At(t.opacity??1,0,FD(n))):l&&(e.opacity=At(t.opacity??1,i.opacity??1,n));for(let c=0;c<PD;c++){const h=$C[c];let m=jy(t,h),f=jy(i,h);if(m===void 0&&f===void 0)continue;m||(m=0),f||(f=0),m===0||f===0||Oy(m)===Oy(f)?(e[h]=Math.max(At(Dy(m),Dy(f),n),0),(mn.test(f)||mn.test(m))&&(e[h]+="%")):e[h]=f}(t.rotate||i.rotate)&&(e.rotate=At(t.rotate||0,i.rotate||0,n))}function jy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const HD=VC(0,.5,jE),FD=VC(.5,.95,Is);function VC(e,t,i){return n=>n<e?0:n>t?1:i(Dc(e,t,n))}function $D(e,t,i){const n=Ai(e)?e:Yo(e);return n.start(i_("",n,t,i)),n.animation}function Lc(e,t,i,n={passive:!0}){return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i)}const VD=(e,t)=>e.depth-t.depth;class qD{constructor(){this.children=[],this.isDirty=!1}add(t){$0(this.children,t),this.isDirty=!0}remove(t){Zd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(VD),this.isDirty=!1,this.children.forEach(t)}}function KD(e,t){const i=$i.now(),n=({timestamp:a})=>{const l=a-i;l>=t&&(Gr(n),e(l-t))};return wt.setup(n,!0),()=>Gr(n)}function Fd(e){return Ai(e)?e.get():e}class GD{constructor(){this.members=[]}add(t){$0(this.members,t);for(let i=this.members.length-1;i>=0;i--){const n=this.members[i];if(n===t||n===this.lead||n===this.prevLead)continue;const a=n.instance;(!a||a.isConnected===!1)&&!n.snapshot&&(Zd(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(Zd(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(t){for(let i=this.members.indexOf(t)-1;i>=0;i--){const n=this.members[i];if(n.isPresent!==!1&&n.instance?.isConnected!==!1)return this.promote(n),!0}return!1}promote(t,i){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:a}=n.options,{layoutDependency:l}=t.options;(a===void 0||a!==l)&&(t.resumeFrom=n,i&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const $d={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ip=["","X","Y","Z"],WD=1e3;let YD=0;function sp(e,t,i,n){const{latestValues:a}=t;a[e]&&(i[e]=a[e],t.setStaticValue(e,0),n&&(n[e]=0))}function qC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const i=dC(t);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:a,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",wt,!(a||l))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&qC(n)}function KC({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:n,resetTransform:a}){return class{constructor(c={},h=t?.()){this.id=YD++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(QD),this.nodes.forEach(nO),this.nodes.forEach(rO),this.nodes.forEach(JD)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new qD)}addEventListener(c,h){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new q0),this.eventHandlers.get(c).add(h)}notifyListeners(c,...h){const m=this.eventHandlers.get(c);m&&m.notify(...h)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=l_(c)&&!Z8(c),this.instance=c;const{layoutId:h,layout:m,visualElement:f}=this.options;if(f&&!f.current&&f.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||h)&&(this.isLayoutDirty=!0),e){let g,b=0;const v=()=>this.root.updateBlockedByResize=!1;wt.read(()=>{b=window.innerWidth}),e(c,()=>{const x=window.innerWidth;x!==b&&(b=x,this.root.updateBlockedByResize=!0,g&&g(),g=KD(v,250),$d.hasAnimatedSinceResize&&($d.hasAnimatedSinceResize=!1,this.nodes.forEach(zy)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&f&&(h||m)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:b,hasRelativeLayoutChanged:v,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||f.getDefaultTransition()||uO,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=f.getProps(),N=!this.targetLayout||!FC(this.targetLayout,x),T=!b&&v;if(this.options.layoutRoot||this.resumeFrom||T||b&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const D={...t_(y,"layout"),onPlay:w,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D),this.setAnimationOrigin(g,T)}else b||zy(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Gr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(aO),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const b=this.path[g];b.shouldResetTransform=!0,(typeof b.latestValues.x=="string"||typeof b.latestValues.y=="string")&&(b.isLayoutDirty=!0),b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:h,layout:m}=this.options;if(h===void 0&&!m)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const m=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),m&&this.nodes.forEach(tO),this.nodes.forEach(Ly);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(By);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(iO),this.nodes.forEach(sO),this.nodes.forEach(XD),this.nodes.forEach(ZD)):this.nodes.forEach(By),this.clearAllSnapshots();const h=$i.now();Ni.delta=_n(0,1e3/60,h-Ni.timestamp),Ni.timestamp=h,Ni.isProcessing=!0,Wm.update.process(Ni),Wm.preRender.process(Ni),Wm.render.process(Ni),Ni.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,a_.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eO),this.sharedNodes.forEach(oO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Vi(this.snapshot.measuredBox.x)&&!Vi(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ui()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:h}=this.options;h&&h.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(h=!1),h&&this.instance){const m=n(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!a)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!HC(this.projectionDelta),m=this.getTransformTemplate(),f=m?m(this.latestValues,""):void 0,g=f!==this.prevTransformTemplateValue;c&&this.instance&&(h||ka(this.latestValues)||g)&&(a(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const h=this.measurePageBox();let m=this.removeElementScroll(h);return c&&(m=this.removeTransform(m)),dO(m),{animationId:this.root.animationId,measuredBox:h,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return ui();const h=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(hO))){const{scroll:f}=this.root;f&&(hn(h.x,f.offset.x),hn(h.y,f.offset.y))}return h}removeElementScroll(c){const h=ui();if(Gs(h,c),this.scroll?.wasRoot)return h;for(let m=0;m<this.path.length;m++){const f=this.path[m],{scroll:g,options:b}=f;f!==this.root&&g&&b.layoutScroll&&(g.wasRoot&&Gs(h,c),hn(h.x,g.offset.x),hn(h.y,g.offset.y))}return h}applyTransform(c,h=!1,m){const f=m||ui();Gs(f,c);for(let g=0;g<this.path.length;g++){const b=this.path[g];!h&&b.options.layoutScroll&&b.scroll&&b!==b.root&&(hn(f.x,-b.scroll.offset.x),hn(f.y,-b.scroll.offset.y)),ka(b.latestValues)&&Hd(f,b.latestValues,b.layout?.layoutBox)}return ka(this.latestValues)&&Hd(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const h=ui();Gs(h,c);for(let m=0;m<this.path.length;m++){const f=this.path[m];if(!ka(f.latestValues))continue;let g;f.instance&&(Lg(f.latestValues)&&f.updateSnapshot(),g=ui(),Gs(g,f.measurePageBox())),ky(h,f.latestValues,f.snapshot?.layoutBox,g)}return ka(this.latestValues)&&ky(h,this.latestValues),h}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ni.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==h;if(!(c||m&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:b}=this.options;if(!this.layout||!(g||b))return;this.resolvedRelativeTargetAt=Ni.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ui(),this.targetWithTransforms=ui()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),OD(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Gs(this.target,this.layout.layoutBox),AC(this.target,this.targetDelta)):Gs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Lg(this.parent.latestValues)||TC(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,h,m){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ui(),this.relativeTargetOrigin=ui(),nh(this.relativeTargetOrigin,h,m,this.options.layoutAnchor||void 0),Gs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const c=this.getLead(),h=!!this.resumingFrom||this!==c;let m=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(m=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===Ni.timestamp&&(m=!1),m)return;const{layout:f,layoutId:g}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||g))return;Gs(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,v=this.treeScale.y;lD(this.layoutCorrected,this.treeScale,this.path,h),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=ui());const{target:x}=c;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xy(this.prevProjectionDelta.x,this.projectionDelta.x),xy(this.prevProjectionDelta.y,this.projectionDelta.y)),Cc(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==v||!Ry(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ry(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Fo(),this.projectionDelta=Fo(),this.projectionDeltaWithTransform=Fo()}setAnimationOrigin(c,h=!1){const m=this.snapshot,f=m?m.latestValues:{},g={...this.latestValues},b=Fo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const v=ui(),x=m?m.source:void 0,y=this.layout?this.layout.source:void 0,w=x!==y,C=this.getStack(),N=!C||C.members.length<=1,T=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(cO));this.animationProgress=0;let D;this.mixTargetDelta=A=>{const L=A/1e3;Iy(b.x,c.x,L),Iy(b.y,c.y,L),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(nh(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),lO(this.relativeTarget,this.relativeTargetOrigin,v,L),D&&zD(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=ui()),Gs(D,this.relativeTarget)),w&&(this.animationValues=g,UD(g,f,this.latestValues,L,T,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Gr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{$d.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Yo(0)),this.motionValue.jump(0,!1),this.currentAnimation=$D(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),c.onUpdate&&c.onUpdate(h)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(WD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:h,target:m,layout:f,latestValues:g}=c;if(!(!h||!m||!f)){if(this!==c&&this.layout&&f&&GC(this.options.animationType,this.layout.layoutBox,f.layoutBox)){m=this.target||ui();const b=Vi(this.layout.layoutBox.x);m.x.min=c.target.x.min,m.x.max=m.x.min+b;const v=Vi(this.layout.layoutBox.y);m.y.min=c.target.y.min,m.y.max=m.y.min+v}Gs(h,m),Hd(h,g),Cc(this.projectionDeltaWithTransform,this.layoutCorrected,h,g)}}registerSharedNode(c,h){this.sharedNodes.has(c)||this.sharedNodes.set(c,new GD),this.sharedNodes.get(c).add(h);const f=h.options.initialPromotionConfig;h.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(h):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:h,preserveFollowOpacity:m}={}){const f=this.getStack();f&&f.promote(this,m),c&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let h=!1;const{latestValues:m}=c;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(h=!0),!h)return;const f={};m.z&&sp("z",c,f,this.animationValues);for(let g=0;g<ip.length;g++)sp(`rotate${ip[g]}`,c,f,this.animationValues),sp(`skew${ip[g]}`,c,f,this.animationValues);c.render();for(const g in f)c.setStaticValue(g,f[g]),this.animationValues&&(this.animationValues[g]=f[g]);c.scheduleRender()}applyProjectionStyles(c,h){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=Fd(h?.pointerEvents)||"",c.transform=m?m(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=Fd(h?.pointerEvents)||""),this.hasProjected&&!ka(this.latestValues)&&(c.transform=m?m({},""):"none",this.hasProjected=!1);return}c.visibility="";const g=f.animationValues||f.latestValues;this.applyTransformsToTarget();let b=ID(this.projectionDeltaWithTransform,this.treeScale,g);m&&(b=m(g,b)),c.transform=b;const{x:v,y:x}=this.projectionDelta;c.transformOrigin=`${v.origin*100}% ${x.origin*100}% 0`,f.animationValues?c.opacity=f===this?g.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:c.opacity=f===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const y in zg){if(g[y]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=zg[y],T=b==="none"?g[y]:w(g[y],f);if(C){const D=C.length;for(let A=0;A<D;A++)c[C[A]]=T}else N?this.options.visualElement.renderState.vars[y]=T:c[y]=T}this.options.layoutId&&(c.pointerEvents=f===this?Fd(h?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Ly),this.root.sharedNodes.clear()}}}function XD(e){e.updateLayout()}function ZD(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:n}=e.layout,{animationType:a}=e.options,l=t.source!==e.layout.source;if(a==="size")dn(g=>{const b=l?t.measuredBox[g]:t.layoutBox[g],v=Vi(b);b.min=i[g].min,b.max=b.min+v});else if(a==="x"||a==="y"){const g=a==="x"?"y":"x";Ig(l?t.measuredBox[g]:t.layoutBox[g],i[g])}else GC(a,t.layoutBox,i)&&dn(g=>{const b=l?t.measuredBox[g]:t.layoutBox[g],v=Vi(i[g]);b.max=b.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+v)});const c=Fo();Cc(c,i,t.layoutBox);const h=Fo();l?Cc(h,e.applyTransform(n,!0),t.measuredBox):Cc(h,i,t.layoutBox);const m=!HC(c);let f=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:b,layout:v}=g;if(b&&v){const x=e.options.layoutAnchor||void 0,y=ui();nh(y,t.layoutBox,b.layoutBox,x);const w=ui();nh(w,i,v.layoutBox,x),FC(y,w)||(f=!0),g.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:h,layoutDelta:c,hasLayoutChanged:m,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function QD(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function JD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eO(e){e.clearSnapshot()}function Ly(e){e.clearMeasurements()}function tO(e){e.isLayoutDirty=!0,e.updateLayout()}function By(e){e.isLayoutDirty=!1}function iO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function sO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function zy(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function nO(e){e.resolveTargetDelta()}function rO(e){e.calcProjection()}function aO(e){e.resetSkewAndRotation()}function oO(e){e.removeLeadSnapshot()}function Iy(e,t,i){e.translate=At(t.translate,0,i),e.scale=At(t.scale,1,i),e.origin=t.origin,e.originPoint=t.originPoint}function Py(e,t,i,n){e.min=At(t.min,i.min,n),e.max=At(t.max,i.max,n)}function lO(e,t,i,n){Py(e.x,t.x,i.x,n),Py(e.y,t.y,i.y,n)}function cO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uO={duration:.45,ease:[.4,0,.1,1]},Uy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Hy=Uy("applewebkit/")&&!Uy("chrome/")?Math.round:Is;function Fy(e){e.min=Hy(e.min),e.max=Hy(e.max)}function dO(e){Fy(e.x),Fy(e.y)}function GC(e,t,i){return e==="position"||e==="preserve-aspect"&&!DD(My(t),My(i),.2)}function hO(e){return e!==e.root&&e.scroll?.wasRoot}const fO=KC({attachResizeListener:(e,t)=>Lc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),np={current:void 0},WC=KC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new fO({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),YC=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function mO(e=!0){const t=E.useContext(F0);if(t===null)return[!0,null];const{isPresent:i,onExitComplete:n,register:a}=t,l=E.useId();E.useEffect(()=>{if(e)return a(l)},[e]);const c=E.useCallback(()=>e&&n&&n(l),[l,n,e]);return!i&&n?[!1,c]:[!0]}const XC=E.createContext({strict:!1}),$y={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Vy=!1;function pO(){if(Vy)return;const e={};for(const t in $y)e[t]={isEnabled:i=>$y[t].some(n=>!!i[n])};CC(e),Vy=!0}function ZC(){return pO(),nD()}function gO(e){const t=ZC();for(const i in e)t[i]={...t[i],...e[i]};CC(t)}const _O=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function rh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||_O.has(e)}let QC=e=>!rh(e);function bO(e){typeof e=="function"&&(QC=t=>t.startsWith("on")?!rh(t):e(t))}try{bO(require("@emotion/is-prop-valid").default)}catch{}function vO(e,t,i){const n={};for(const a in e)a==="values"&&typeof e.values=="object"||Ai(e[a])||(QC(a)||i===!0&&rh(a)||!t&&!rh(a)||e.draggable&&a.startsWith("onDrag"))&&(n[a]=e[a]);return n}const Ah=E.createContext({});function xO(e,t){if(Th(e)){const{initial:i,animate:n}=e;return{initial:i===!1||jc(i)?i:void 0,animate:jc(n)?n:void 0}}return e.inherit!==!1?t:{}}function yO(e){const{initial:t,animate:i}=xO(e,E.useContext(Ah));return E.useMemo(()=>({initial:t,animate:i}),[qy(t),qy(i)])}function qy(e){return Array.isArray(e)?e.join(" "):e}const f_=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function JC(e,t,i){for(const n in t)!Ai(t[n])&&!DC(n,i)&&(e[n]=t[n])}function SO({transformTemplate:e},t){return E.useMemo(()=>{const i=f_();return d_(i,t,e),Object.assign({},i.vars,i.style)},[t])}function wO(e,t){const i=e.style||{},n={};return JC(n,i,e),Object.assign(n,SO(e,t)),n}function EO(e,t){const i={},n=wO(e,t);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=n,i}const ek=()=>({...f_(),attrs:{}});function CO(e,t,i,n){const a=E.useMemo(()=>{const l=ek();return OC(l,t,LC(n),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};JC(l,e.style,e),a.style={...l,...a.style}}return a}const kO=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function m_(e){return typeof e!="string"||e.includes("-")?!1:!!(kO.indexOf(e)>-1||/[A-Z]/u.test(e))}function NO(e,t,i,{latestValues:n},a,l=!1,c){const m=(c??m_(e)?CO:EO)(t,n,a,e),f=vO(t,typeof e=="string",l),g=e!==E.Fragment?{...f,...m,ref:i}:{},{children:b}=t,v=E.useMemo(()=>Ai(b)?b.get():b,[b]);return E.createElement(e,{...g,children:v})}function TO({scrapeMotionValuesFromProps:e,createRenderState:t},i,n,a){return{latestValues:AO(i,n,a,e),renderState:t()}}function AO(e,t,i,n){const a={},l=n(e,{});for(const v in l)a[v]=Fd(l[v]);let{initial:c,animate:h}=e;const m=Th(e),f=wC(e);t&&f&&!m&&e.inherit!==!1&&(c===void 0&&(c=t.initial),h===void 0&&(h=t.animate));let g=i?i.initial===!1:!1;g=g||c===!1;const b=g?h:c;if(b&&typeof b!="boolean"&&!Nh(b)){const v=Array.isArray(b)?b:[b];for(let x=0;x<v.length;x++){const y=s_(e,v[x]);if(y){const{transitionEnd:w,transition:C,...N}=y;for(const T in N){let D=N[T];if(Array.isArray(D)){const A=g?D.length-1:0;D=D[A]}D!==null&&(a[T]=D)}for(const T in w)a[T]=w[T]}}}return a}const tk=e=>(t,i)=>{const n=E.useContext(Ah),a=E.useContext(F0),l=()=>TO(e,t,n,a);return i?l():k6(l)},MO=tk({scrapeMotionValuesFromProps:h_,createRenderState:f_}),RO=tk({scrapeMotionValuesFromProps:BC,createRenderState:ek}),DO=Symbol.for("motionComponentSymbol");function OO(e,t,i){const n=E.useRef(i);E.useInsertionEffect(()=>{n.current=i});const a=E.useRef(null);return E.useCallback(l=>{l&&e.onMount?.(l);const c=n.current;if(typeof c=="function")if(l){const h=c(l);typeof h=="function"&&(a.current=h)}else a.current?(a.current(),a.current=null):c(l);else c&&(c.current=l);t&&(l?t.mount(l):t.unmount())},[t])}const ik=E.createContext({});function Io(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function jO(e,t,i,n,a,l){const{visualElement:c}=E.useContext(Ah),h=E.useContext(XC),m=E.useContext(F0),f=E.useContext(YC),g=f.reducedMotion,b=f.skipAnimations,v=E.useRef(null),x=E.useRef(!1);n=n||h.renderer,!v.current&&n&&(v.current=n(e,{visualState:t,parent:c,props:i,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:g,skipAnimations:b,isSVG:l}),x.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const y=v.current,w=E.useContext(ik);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&LO(v.current,i,a,w);const C=E.useRef(!1);E.useInsertionEffect(()=>{y&&C.current&&y.update(i,m)});const N=i[uC],T=E.useRef(!!N&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(N)&&window.MotionHasOptimisedAnimation?.(N));return T6(()=>{x.current=!0,y&&(C.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),T.current&&y.animationState&&y.animationState.animateChanges())}),E.useEffect(()=>{y&&(!T.current&&y.animationState&&y.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(N)}),T.current=!1),y.enteringChildren=void 0)}),y}function LO(e,t,i,n){const{layoutId:a,layout:l,drag:c,dragConstraints:h,layoutScroll:m,layoutRoot:f,layoutAnchor:g,layoutCrossfade:b}=t;e.projection=new i(e.latestValues,t["data-framer-portal-id"]?void 0:sk(e.parent)),e.projection.setOptions({layoutId:a,layout:l,alwaysMeasureLayout:!!c||h&&Io(h),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:n,crossfade:b,layoutScroll:m,layoutRoot:f,layoutAnchor:g})}function sk(e){if(e)return e.options.allowProjection!==!1?e.projection:sk(e.parent)}function rp(e,{forwardMotionProps:t=!1,type:i}={},n,a){n&&gO(n);const l=i?i==="svg":m_(e),c=l?RO:MO;function h(f,g){let b;const v={...E.useContext(YC),...f,layoutId:BO(f)},{isStatic:x}=v,y=yO(f),w=c(f,x);if(!x&&typeof window<"u"){zO();const C=IO(v);b=C.MeasureLayout,y.visualElement=jO(e,w,v,a,C.ProjectionNode,l)}return u.jsxs(Ah.Provider,{value:y,children:[b&&y.visualElement?u.jsx(b,{visualElement:y.visualElement,...v}):null,NO(e,f,OO(w,y.visualElement,g),w,x,t,l)]})}h.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=E.forwardRef(h);return m[DO]=e,m}function BO({layoutId:e}){const t=E.useContext(SE).id;return t&&e!==void 0?t+"-"+e:e}function zO(e,t){E.useContext(XC).strict}function IO(e){const t=ZC(),{drag:i,layout:n}=t;if(!i&&!n)return{};const a={...i,...n};return{MeasureLayout:i?.isEnabled(e)||n?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function PO(e,t){if(typeof Proxy>"u")return rp;const i=new Map,n=(l,c)=>rp(l,c,e,t),a=(l,c)=>n(l,c);return new Proxy(a,{get:(l,c)=>c==="create"?n:(i.has(c)||i.set(c,rp(c,void 0,e,t)),i.get(c))})}const UO=(e,t)=>t.isSVG??m_(e)?new yD(t):new pD(t,{allowProjection:e!==E.Fragment});class HO extends Zr{constructor(t){super(t),t.animationState||(t.animationState=kD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Nh(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:i}=this.node.prevProps||{};t!==i&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let FO=0;class $O extends Zr{constructor(){super(...arguments),this.id=FO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:i}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&n===!1){if(this.isExitComplete){const{initial:l,custom:c}=this.node.getProps();if(typeof l=="string"){const h=ja(this.node,l,c);if(h){const{transition:m,transitionEnd:f,...g}=h;for(const b in g)this.node.getValue(b)?.jump(g[b])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const a=this.node.animationState.setActive("exit",!t);i&&!t&&a.then(()=>{this.isExitComplete=!0,i(this.id)})}mount(){const{register:t,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const VO={animation:{Feature:HO},exit:{Feature:$O}};function Xc(e){return{point:{x:e.pageX,y:e.pageY}}}const qO=e=>t=>o_(t)&&e(t,Xc(t));function kc(e,t,i,n){return Lc(e,t,qO(i),n)}const nk=({current:e})=>e?e.ownerDocument.defaultView:null,Ky=(e,t)=>Math.abs(e-t);function KO(e,t){const i=Ky(e.x,t.x),n=Ky(e.y,t.y);return Math.sqrt(i**2+n**2)}const Gy=new Set(["auto","scroll"]);class rk{constructor(t,i,{transformPagePoint:n,contextWindow:a=window,dragSnapToOrigin:l=!1,distanceThreshold:c=3,element:h}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Sd(this.lastRawMoveEventInfo,this.transformPagePoint));const x=ap(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,w=KO(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!w)return;const{point:C}=x,{timestamp:N}=Ni;this.history.push({...C,timestamp:N});const{onStart:T,onMove:D}=this.handlers;y||(T&&T(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=Sd(y,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:w,onSessionEnd:C,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=ap(x.type==="pointercancel"?this.lastMoveEventInfo:Sd(y,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,T),C&&C(x,T)},!o_(t))return;this.dragSnapToOrigin=l,this.handlers=i,this.transformPagePoint=n,this.distanceThreshold=c,this.contextWindow=a||window;const m=Xc(t),f=Sd(m,this.transformPagePoint),{point:g}=f,{timestamp:b}=Ni;this.history=[{...g,timestamp:b}];const{onSessionStart:v}=i;v&&v(t,ap(f,this.history)),this.removeListeners=Gc(kc(this.contextWindow,"pointermove",this.handlePointerMove),kc(this.contextWindow,"pointerup",this.handlePointerUp),kc(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(t){let i=t.parentElement;for(;i;){const n=getComputedStyle(i);(Gy.has(n.overflowX)||Gy.has(n.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const i=this.scrollPositions.get(t);if(!i)return;const n=t===window,a=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},l={x:a.x-i.x,y:a.y-i.y};l.x===0&&l.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(t,a),wt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Gr(this.updatePoint)}}function Sd(e,t){return t?{point:t(e.point)}:e}function Wy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ap({point:e},t){return{point:e,delta:Wy(e,ak(t)),offset:Wy(e,GO(t)),velocity:WO(t,.1)}}function GO(e){return e[0]}function ak(e){return e[e.length-1]}function WO(e,t){if(e.length<2)return{x:0,y:0};let i=e.length-1,n=null;const a=ak(e);for(;i>=0&&(n=e[i],!(a.timestamp-n.timestamp>xs(t)));)i--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&a.timestamp-n.timestamp>xs(t)*2&&(n=e[1]);const l=Bs(a.timestamp-n.timestamp);if(l===0)return{x:0,y:0};const c={x:(a.x-n.x)/l,y:(a.y-n.y)/l};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function YO(e,{min:t,max:i},n){return t!==void 0&&e<t?e=n?At(t,e,n.min):Math.max(e,t):i!==void 0&&e>i&&(e=n?At(i,e,n.max):Math.min(e,i)),e}function Yy(e,t,i){return{min:t!==void 0?e.min+t:void 0,max:i!==void 0?e.max+i-(e.max-e.min):void 0}}function XO(e,{top:t,left:i,bottom:n,right:a}){return{x:Yy(e.x,i,a),y:Yy(e.y,t,n)}}function Xy(e,t){let i=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([i,n]=[n,i]),{min:i,max:n}}function ZO(e,t){return{x:Xy(e.x,t.x),y:Xy(e.y,t.y)}}function QO(e,t){let i=.5;const n=Vi(e),a=Vi(t);return a>n?i=Dc(t.min,t.max-n,e.min):n>a&&(i=Dc(e.min,e.max-a,t.min)),_n(0,1,i)}function JO(e,t){const i={};return t.min!==void 0&&(i.min=t.min-e.min),t.max!==void 0&&(i.max=t.max-e.min),i}const Pg=.35;function e7(e=Pg){return e===!1?e=0:e===!0&&(e=Pg),{x:Zy(e,"left","right"),y:Zy(e,"top","bottom")}}function Zy(e,t,i){return{min:Qy(e,t),max:Qy(e,i)}}function Qy(e,t){return typeof e=="number"?e:e[t]||0}const t7=new WeakMap;class i7{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ui(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:i=!1,distanceThreshold:n}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const l=b=>{i&&this.snapToCursor(Xc(b).point),this.stopAnimation()},c=(b,v)=>{const{drag:x,dragPropagation:y,onDragStart:w}=this.getProps();if(x&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=j8(x),!this.openDragLock))return;this.latestPointerEvent=b,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),dn(N=>{let T=this.getAxisMotionValue(N).get()||0;if(mn.test(T)){const{projection:D}=this.visualElement;if(D&&D.layout){const A=D.layout.layoutBox[N];A&&(T=Vi(A)*(parseFloat(T)/100))}}this.originPoint[N]=T}),w&&wt.update(()=>w(b,v),!1,!0),Mg(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},h=(b,v)=>{this.latestPointerEvent=b,this.latestPanInfo=v;const{dragPropagation:x,dragDirectionLock:y,onDirectionLock:w,onDrag:C}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=v;if(y&&this.currentDirection===null){this.currentDirection=n7(N),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",v.point,N),this.updateAxis("y",v.point,N),this.visualElement.render(),C&&wt.update(()=>C(b,v),!1,!0)},m=(b,v)=>{this.latestPointerEvent=b,this.latestPanInfo=v,this.stop(b,v),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:b}=this.getProps();(b||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:g}=this.getProps();this.panSession=new rk(t,{onSessionStart:l,onStart:c,onMove:h,onSessionEnd:m,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:n,contextWindow:nk(this.visualElement),element:this.visualElement.current})}stop(t,i){const n=t||this.latestPointerEvent,a=i||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!a||!n)return;const{velocity:c}=a;this.startAnimation(c);const{onDragEnd:h}=this.getProps();h&&wt.postRender(()=>h(n,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:i}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,i,n){const{drag:a}=this.getProps();if(!n||!wd(t,a,this.currentDirection))return;const l=this.getAxisMotionValue(t);let c=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(c=YO(c,this.constraints[t],this.elastic[t])),l.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:i}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;t&&Io(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=XO(n.layoutBox,t):this.constraints=!1,this.elastic=e7(i),a!==this.constraints&&!Io(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&dn(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=JO(n.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!Io(t))return!1;const n=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const l=cD(n,a.root,this.visualElement.getTransformPagePoint());let c=ZO(a.layout.layoutBox,l);if(i){const h=i(aD(c));this.hasMutatedConstraints=!!h,h&&(c=NC(h))}return c}startAnimation(t){const{drag:i,dragMomentum:n,dragElastic:a,dragTransition:l,dragSnapToOrigin:c,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},f=dn(g=>{if(!wd(g,i,this.currentDirection))return;let b=m&&m[g]||{};(c===!0||c===g)&&(b={min:0,max:0});const v=a?200:1e6,x=a?40:1e7,y={type:"inertia",velocity:n?t[g]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...l,...b};return this.startAxisValueAnimation(g,y)});return Promise.all(f).then(h)}startAxisValueAnimation(t,i){const n=this.getAxisMotionValue(t);return Mg(this.visualElement,t),n.start(i_(t,n,0,i,this.visualElement,!1))}stopAnimation(){dn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const i=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),a=n[i];return a||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){dn(i=>{const{drag:n}=this.getProps();if(!wd(i,n,this.currentDirection))return;const{projection:a}=this.visualElement,l=this.getAxisMotionValue(i);if(a&&a.layout){const{min:c,max:h}=a.layout.layoutBox[i],m=l.get()||0;l.set(t[i]-At(c,h,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:i}=this.getProps(),{projection:n}=this.visualElement;if(!Io(i)||!n||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};dn(c=>{const h=this.getAxisMotionValue(c);if(h&&this.constraints!==!1){const m=h.get();a[c]=QO({min:m,max:m},this.constraints[c])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),dn(c=>{if(!wd(c,t,null))return;const h=this.getAxisMotionValue(c),{min:m,max:f}=this.constraints[c];h.set(At(m,f,a[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;t7.set(this.visualElement,this);const t=this.visualElement.current,i=kc(t,"pointerdown",f=>{const{drag:g,dragListener:b=!0}=this.getProps(),v=f.target,x=v!==t&&U8(v);g&&b&&!x&&this.start(f)});let n;const a=()=>{const{dragConstraints:f}=this.getProps();Io(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),n||(n=s7(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,c=l.addEventListener("measure",a);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),wt.read(a);const h=Lc(window,"resize",()=>this.scalePositionWithinConstraints()),m=l.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:g})=>{this.isDragging&&g&&(dn(b=>{const v=this.getAxisMotionValue(b);v&&(this.originPoint[b]+=f[b].translate,v.set(v.get()+f[b].translate))}),this.visualElement.render())}));return()=>{h(),i(),c(),m&&m(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:n=!1,dragPropagation:a=!1,dragConstraints:l=!1,dragElastic:c=Pg,dragMomentum:h=!0}=t;return{...t,drag:i,dragDirectionLock:n,dragPropagation:a,dragConstraints:l,dragElastic:c,dragMomentum:h}}}function Jy(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function s7(e,t,i){const n=ly(e,Jy(i)),a=ly(t,Jy(i));return()=>{n(),a()}}function wd(e,t,i){return(t===!0||t===e)&&(i===null||i===e)}function n7(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}class r7 extends Zr{constructor(t){super(t),this.removeGroupControls=Is,this.removeListeners=Is,this.controls=new i7(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Is}update(){const{dragControls:t}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};t!==i&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const op=e=>(t,i)=>{e&&wt.update(()=>e(t,i),!1,!0)};class a7 extends Zr{constructor(){super(...arguments),this.removePointerDownListener=Is}onPointerDown(t){this.session=new rk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nk(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:i,onPan:n,onPanEnd:a}=this.node.getProps();return{onSessionStart:op(t),onStart:op(i),onMove:op(n),onEnd:(l,c)=>{delete this.session,a&&wt.postRender(()=>a(l,c))}}}mount(){this.removePointerDownListener=kc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let lp=!1;class o7 extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:n,layoutId:a}=this.props,{projection:l}=t;l&&(i.group&&i.group.add(l),n&&n.register&&a&&n.register(l),lp&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),$d.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:i,visualElement:n,drag:a,isPresent:l}=this.props,{projection:c}=n;return c&&(c.isPresent=l,t.layoutDependency!==i&&c.setOptions({...c.options,layoutDependency:i}),lp=!0,a||t.layoutDependency!==i||i===void 0||t.isPresent!==l?c.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?c.promote():c.relegate()||wt.postRender(()=>{const h=c.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:i}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=i,n.root.didUpdate(),a_.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:n}=this.props,{projection:a}=t;lp=!0,a&&(a.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(a),n&&n.deregister&&n.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ok(e){const[t,i]=mO(),n=E.useContext(SE);return u.jsx(o7,{...e,layoutGroup:n,switchLayoutGroup:E.useContext(ik),isPresent:t,safeToRemove:i})}const l7={pan:{Feature:a7},drag:{Feature:r7,ProjectionNode:WC,MeasureLayout:ok}};function eS(e,t,i){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",i==="Start");const a="onHover"+i,l=n[a];l&&wt.postRender(()=>l(t,Xc(t)))}class c7 extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=B8(t,(i,n)=>(eS(this.node,n,"Start"),a=>eS(this.node,a,"End"))))}unmount(){}}class u7 extends Zr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Gc(Lc(this.node.current,"focus",()=>this.onFocus()),Lc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tS(e,t,i){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",i==="Start");const a="onTap"+(i==="End"?"":i),l=n[a];l&&wt.postRender(()=>l(t,Xc(t)))}class d7 extends Zr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:i,propagate:n}=this.node.props;this.unmount=F8(t,(a,l)=>(tS(this.node,l,"Start"),(c,{success:h})=>tS(this.node,c,h?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:n?.tap===!1})}unmount(){}}const Ug=new WeakMap,cp=new WeakMap,h7=e=>{const t=Ug.get(e.target);t&&t(e)},f7=e=>{e.forEach(h7)};function m7({root:e,...t}){const i=e||document;cp.has(i)||cp.set(i,{});const n=cp.get(i),a=JSON.stringify(t);return n[a]||(n[a]=new IntersectionObserver(f7,{root:e,...t})),n[a]}function p7(e,t,i){const n=m7(t);return Ug.set(e,i),n.observe(e),()=>{Ug.delete(e),n.unobserve(e)}}const g7={some:0,all:1};class _7 extends Zr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:i,margin:n,amount:a="some",once:l}=t,c={root:i?i.current:void 0,rootMargin:n,threshold:typeof a=="number"?a:g7[a]},h=m=>{const{isIntersecting:f}=m;if(this.isInView===f||(this.isInView=f,l&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:g,onViewportLeave:b}=this.node.getProps(),v=f?g:b;v&&v(m)};this.stopObserver=p7(this.node.current,c,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:i}=this.node;["amount","margin","root"].some(b7(t,i))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function b7({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}const v7={inView:{Feature:_7},tap:{Feature:d7},focus:{Feature:u7},hover:{Feature:c7}},x7={layout:{ProjectionNode:WC,MeasureLayout:ok}},y7={...VO,...v7,...l7,...x7},up=PO(y7,UO),Ke=({label:e,children:t,variant:i="primary",size:n="medium",icon:a,onClick:l,removable:c=!1,className:h,maxWidth:m,appearance:f,onRemove:g,isLoading:b=!1})=>{const v=S7(i),x=f??(i==="outline"?"outline":"solid"),y=e??t,w=!!l,C={primary:{solid:"bg-primary text-primary-foreground border border-transparent",outline:"border-2 border-primary/60 text-foreground",subtle:"bg-primary/15 text-foreground border border-transparent"},secondary:{solid:"bg-secondary text-secondary-foreground border border-transparent",outline:"border-2 border-border text-foreground bg-card",subtle:"bg-muted text-foreground border border-border"},success:{solid:"bg-emerald-600 text-white border border-transparent",outline:"border-2 border-emerald-600 text-emerald-700 dark:text-emerald-400",subtle:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 border border-transparent"},warning:{solid:"bg-amber-500 text-white border border-transparent",outline:"border-2 border-amber-500 text-amber-700 dark:text-amber-400",subtle:"bg-amber-500/15 text-amber-700 dark:text-amber-300 border border-transparent"},error:{solid:"bg-destructive text-destructive-foreground border border-transparent",outline:"border-2 border-destructive text-destructive dark:text-red-400",subtle:"bg-destructive/20 text-destructive dark:text-red-300 border border-transparent"}},N={small:"text-xs px-2 py-1",medium:"text-xs px-2.5 py-1",large:"text-sm px-3 py-1.5"},T=A=>{A.stopPropagation(),l?.()},D=A=>{A.stopPropagation(),g?.()};return u.jsxs(up.div,{initial:{opacity:0,scale:.95,y:8,filter:"blur(8px)"},animate:{opacity:1,scale:1,y:0,filter:"blur(0px)"},transition:{duration:.32,ease:"easeInOut",type:"spring"},whileHover:{scale:w?1.04:1,transition:{duration:.2,ease:"easeInOut",type:"spring"}},onClick:T,style:{maxWidth:m},className:fe("inline-flex max-w-full items-center gap-1.5 rounded-lg font-medium shadow-[0_0_16px_rgba(0,0,0,0.14)] backdrop-blur-sm",C[v][x],N[n],w&&"cursor-pointer",h),children:[b?u.jsx(up.div,{animate:{rotate:360},transition:{duration:1,ease:"linear",repeat:1/0},className:"flex-shrink-0",children:u.jsx(as,{className:"size-3.5"})}):a&&u.jsx("span",{className:"flex-shrink-0",children:a}),u.jsx("span",{className:"min-w-0 truncate",children:y}),c&&u.jsx(up.button,{initial:{opacity:0,scale:.95,filter:"blur(8px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},whileHover:{scale:1.1,opacity:1,transition:{duration:.2,ease:"easeInOut",type:"spring"}},className:"flex items-center justify-center rounded-md bg-foreground/15 p-1 opacity-70 hover:opacity-100",onClick:D,type:"button",children:u.jsx(Js,{className:"size-3.5"})})]})};function S7(e){return e==="danger"?"error":e==="default"||e==="outline"?"primary":e}const w7=aE("rounded-lg border p-4 text-sm",{variants:{variant:{default:"border-border bg-card text-card-foreground",muted:"border-border bg-muted text-muted-foreground",destructive:"border-destructive/40 bg-destructive/10 text-destructive dark:text-red-300"}},defaultVariants:{variant:"default"}});function dt({className:e,variant:t,...i}){return u.jsx("div",{className:fe(w7({variant:t,className:e})),...i})}function Qn({className:e,...t}){return u.jsx("div",{className:fe("rounded-lg border border-border bg-card text-card-foreground",e),...t})}function Jn({className:e,...t}){return u.jsx("div",{className:fe("grid gap-1.5 p-4",e),...t})}function er({className:e,...t}){return u.jsx("h3",{className:fe("text-sm font-semibold tracking-tight",e),...t})}function Qr({className:e,...t}){return u.jsx("p",{className:fe("text-sm text-muted-foreground",e),...t})}function tr({className:e,...t}){return u.jsx("div",{className:fe("p-4 pt-0",e),...t})}const iS=100;function E7(){const[e,t]=E.useState([]),[i,n]=E.useState(!1),a=E.useRef(new Set);E.useEffect(()=>{const c=new EventSource("/api/agent/tool-calls/stream");return c.addEventListener("open",()=>n(!0)),c.addEventListener("error",()=>n(!1)),c.addEventListener("tool-call",h=>{try{const m=JSON.parse(h.data);t(f=>{if(a.current.has(m.id))return f;a.current.add(m.id);const g=[...f,m];return g.length>iS&&g.splice(0,g.length-iS),g})}catch{}}),()=>{c.close()}},[]);const l=[...e].reverse();return u.jsxs(Qn,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(Jn,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Go,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"Live MCP Tool Calls"}),u.jsx(Ke,{variant:"outline",size:"small",children:e.length})]}),u.jsx(Ke,{variant:"outline",size:"small",icon:u.jsx("span",{className:fe("inline-block size-1.5 rounded-full",i?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:i?"live":"reconnecting…"})]}),u.jsx(Qr,{className:"text-xs",children:"Streamed from this NoMoreIDE MCP server. Newest at the top."})]}),u.jsx(tr,{className:"p-0",children:l.length?u.jsx("ul",{className:"max-h-96 divide-y divide-border overflow-auto",children:l.map(c=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:c.tool}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[u.jsxs("span",{children:[c.durationMs," ms"]}),u.jsx(Ke,{variant:c.status==="ok"?"success":"error",appearance:"outline",size:"small",children:c.status})]})]}),c.args?u.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:c.args}):null,c.error?u.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-destructive",children:c.error}):null,u.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/80",children:new Date(c.startedAt).toLocaleTimeString()})]},c.id))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No tool calls yet. Invoke a NoMoreIDE MCP tool from your agent and it will appear here."})})]})}function C7({agent:e}){return u.jsxs(u.Fragment,{children:[u.jsx(E7,{}),u.jsxs(Qn,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Jn,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(wh,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"Recent Projects"})]}),u.jsx(Ke,{variant:"outline",size:"small",children:e.projects.length})]}),u.jsx(Qr,{className:"text-xs",children:"Most recently active projects known to the agent."})]}),u.jsx(tr,{className:"p-0",children:e.projects.length?u.jsx("ul",{className:"divide-y divide-border",children:e.projects.map(t=>u.jsxs("li",{className:fe("flex items-start justify-between gap-3 px-3 py-2",t.current&&"bg-primary/5"),children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:t.path}),t.current?u.jsx(Ke,{variant:"outline",size:"small",children:"current"}):null]}),t.lastSessionFirstPrompt?u.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:t.lastSessionFirstPrompt}):null]}),u.jsxs("div",{className:"shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:[t.mcpServerCount?u.jsxs("div",{children:[t.mcpServerCount," mcp"]}):null,t.lastSessionModified?u.jsx("div",{children:k7(t.lastSessionModified)}):null]})]},t.path))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No known projects."})})]})]})}function k7(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function Zc({className:e}){return u.jsx("svg",{className:fe("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:u.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})})}function Mh({className:e}){return u.jsx("svg",{className:fe("size-3.5",e),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:u.jsx("path",{d:"M11.248 18.25q-.825 0-1.568-.314a4.3 4.3 0 0 1-1.32-.874 4 4 0 0 1-1.304.214 4 4 0 0 1-2.046-.544 4.27 4.27 0 0 1-1.518-1.485 4 4 0 0 1-.56-2.095q0-.48.131-1.04A4.4 4.4 0 0 1 2.04 10.71a4.07 4.07 0 0 1 .017-3.4 4.2 4.2 0 0 1 1.056-1.418 3.8 3.8 0 0 1 1.6-.842 3.9 3.9 0 0 1 .76-1.683q.593-.759 1.451-1.188a4.04 4.04 0 0 1 1.832-.429q.825 0 1.567.313.742.314 1.32.875a4 4 0 0 1 1.304-.215q1.106 0 2.046.545a4.14 4.14 0 0 1 1.501 1.485q.578.941.578 2.095 0 .48-.132 1.04.66.61 1.023 1.419.363.792.363 1.666 0 .892-.38 1.717a4.3 4.3 0 0 1-1.072 1.435 3.8 3.8 0 0 1-1.584.825 3.8 3.8 0 0 1-.775 1.683 4.06 4.06 0 0 1-1.436 1.188 4.04 4.04 0 0 1-1.832.429m-4.076-2.062q.825 0 1.435-.347l3.103-1.782a.36.36 0 0 0 .164-.313v-1.42L7.881 14.62a.67.67 0 0 1-.726 0l-3.118-1.798a.5.5 0 0 1-.017.115v.198q0 .841.396 1.551.413.693 1.139 1.089a3.2 3.2 0 0 0 1.617.412m.165-2.69a.4.4 0 0 0 .181.05q.083 0 .165-.05l1.238-.71-3.977-2.31a.7.7 0 0 1-.363-.643v-3.58q-.825.362-1.32 1.122a2.9 2.9 0 0 0-.495 1.65q0 .809.413 1.55.412.743 1.072 1.123zm3.91 3.663q.875 0 1.585-.396a2.96 2.96 0 0 0 1.534-2.64v-3.564a.32.32 0 0 0-.165-.297l-1.254-.726v4.604a.7.7 0 0 1-.363.643l-3.119 1.799a3 3 0 0 0 1.783.577m.627-6.039V8.878L10.01 7.822 8.129 8.878v2.244l1.881 1.056zM7.057 5.859a.7.7 0 0 1 .363-.644l3.119-1.798a3 3 0 0 0-1.782-.578q-.874 0-1.584.396A2.96 2.96 0 0 0 6.05 4.324a3.07 3.07 0 0 0-.396 1.551v3.547q0 .199.165.314l1.237.726zm8.383 7.887q.825-.364 1.303-1.123.495-.758.495-1.65a3.15 3.15 0 0 0-.412-1.55q-.413-.743-1.073-1.123l-3.086-1.782q-.099-.065-.181-.049a.3.3 0 0 0-.165.05l-1.238.692 3.993 2.327a.6.6 0 0 1 .264.264.64.64 0 0 1 .1.363zm-3.317-8.382a.63.63 0 0 1 .726 0l3.135 1.831v-.297q0-.792-.396-1.501a2.86 2.86 0 0 0-1.105-1.155q-.71-.43-1.65-.43-.825 0-1.436.347L8.294 5.941a.36.36 0 0 0-.165.314v1.418z"})})}function N7({agent:e,agentId:t}){const i=e.project.instructionFileName??(e.project.claudeMdPath?"CLAUDE.md":void 0),n=e.project.instructionFilePreview??e.project.claudeMdPreview,a=e.project.memoryFiles.length+(i?1:0);return u.jsxs(Qn,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Jn,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(P2,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"Project Memory"})]}),u.jsx(Ke,{variant:"outline",size:"small",children:a})]}),u.jsx(Qr,{className:"truncate text-xs",children:e.project.memoryDir??(t==="codex"?"No Codex memory directory found for this project.":"No memory directory found for this project.")})]}),u.jsxs(tr,{className:"space-y-2 p-3",children:[i?u.jsx(sS,{title:i,preview:n,defaultOpen:!0}):null,e.project.memoryFiles.length?e.project.memoryFiles.map(l=>u.jsx(sS,{title:l.name,subtitle:`${l.size} B`,preview:l.preview,defaultOpen:l.name==="MEMORY.md"},l.path)):i?null:u.jsx("p",{className:"text-xs text-muted-foreground",children:"No memory files persisted yet for this project."})]})]})}function sS({title:e,subtitle:t,preview:i,defaultOpen:n=!1}){const[a,l]=E.useState(n);return u.jsxs("div",{className:"rounded-md border border-border bg-background/40",children:[u.jsxs("button",{type:"button",onClick:()=>l(!a),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-xs font-semibold",children:[u.jsx(Yr,{className:fe("size-3.5 text-muted-foreground transition-transform",a&&"rotate-90")}),u.jsx("span",{children:e}),t?u.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:t}):null]}),a&&i?u.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap border-t border-border px-2.5 py-2 font-mono text-[11px] leading-relaxed text-muted-foreground",children:i}):null]})}const T7=[{animationDelay:"-1.2s",transform:"rotate(.0001deg) translate(146%)"},{animationDelay:"-1.1s",transform:"rotate(30deg) translate(146%)"},{animationDelay:"-1.0s",transform:"rotate(60deg) translate(146%)"},{animationDelay:"-0.9s",transform:"rotate(90deg) translate(146%)"},{animationDelay:"-0.8s",transform:"rotate(120deg) translate(146%)"},{animationDelay:"-0.7s",transform:"rotate(150deg) translate(146%)"},{animationDelay:"-0.6s",transform:"rotate(180deg) translate(146%)"},{animationDelay:"-0.5s",transform:"rotate(210deg) translate(146%)"},{animationDelay:"-0.4s",transform:"rotate(240deg) translate(146%)"},{animationDelay:"-0.3s",transform:"rotate(270deg) translate(146%)"},{animationDelay:"-0.2s",transform:"rotate(300deg) translate(146%)"},{animationDelay:"-0.1s",transform:"rotate(330deg) translate(146%)"}],A7=({size:e=20,color:t="#8f8f8f"})=>u.jsx("div",{style:{width:e,height:e},children:u.jsx("div",{className:"relative left-1/2 top-1/2",style:{width:e,height:e},children:T7.map(i=>u.jsx("div",{className:"absolute -left-[10%] -top-[3.9%] h-[8%] w-[24%] animate-fade-spin rounded-[5px]",style:{backgroundColor:t,...i}},i.transform))})}),M7=[{tiny:"px-1.5 h-6 text-sm",small:"px-1.5 h-8 text-sm",medium:"px-2.5 h-10 text-sm",large:"px-3.5 h-12 text-base"},{tiny:"w-6 h-6 text-sm",small:"w-8 h-8 text-sm",medium:"w-10 h-10 text-sm",large:"w-12 h-12 text-base"}],R7={primary:"bg-gray-1000 hover:bg-gray-1000-h text-background-100 fill-background-100",secondary:"bg-background-100 hover:bg-gray-alpha-200 text-gray-1000 fill-gray-1000 border border-gray-alpha-400",tertiary:"bg-none hover:bg-gray-alpha-200 text-gray-1000 fill-gray-1000",error:"bg-red-800 hover:bg-red-900 text-white fill-white",warning:"bg-amber-800 hover:bg-amber-850 text-black fill-black"},D7={square:{tiny:"rounded",small:"rounded-md",medium:"rounded-md",large:"rounded-lg"},circle:{tiny:"rounded-[100%]",small:"rounded-[100%]",medium:"rounded-[100%]",large:"rounded-[100%]"},rounded:{tiny:"rounded-[100px]",small:"rounded-[100px]",medium:"rounded-[100px]",large:"rounded-[100px]"}},Ed=({size:e="medium",type:t="primary",variant:i="styled",shape:n="square",svgOnly:a=!1,children:l,prefix:c,suffix:h,shadow:m=!1,loading:f=!1,disabled:g=!1,fullWidth:b=!1,className:v,...x})=>u.jsxs("button",{disabled:g,tabIndex:0,className:Rc("flex items-center justify-center gap-0.5 duration-150",M7[+a][e],g||f?"cursor-not-allowed border border-gray-400 bg-gray-100 text-gray-700":R7[t],D7[n][e],m&&"shadow-border-small border-none",b&&"w-full",i==="unstyled"?"h-fit bg-transparent px-0 text-gray-1000 outline-none hover:bg-transparent":"focus:shadow-focus-ring focus:outline-0",v),type:"button",...x,children:[f?u.jsx(A7,{size:e==="large"?24:16}):c,u.jsx("span",{className:Rc("relative overflow-hidden overflow-ellipsis whitespace-nowrap font-sans",e!=="tiny"&&i!=="unstyled"&&"px-1.5"),children:l}),!f&&h]}),O7=({className:e})=>u.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:e,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z"})}),j7=()=>u.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:"fill-gray-1000",children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z"})});let dp=null,L7=0;const si={toasts:[],listeners:new Set,add(e,t,i,n,a,l){const c=L7++,h={id:c,text:e,preserve:i,action:n,onAction:a,onUndoAction:l,type:t};if(!h.preserve){h.remaining=3e3,h.start=Date.now();const m=()=>{this.toasts=this.toasts.filter(f=>f.id!==c),this.notify()};h.timeout=setTimeout(m,h.remaining),h.pause=()=>{h.timeout&&(clearTimeout(h.timeout),h.timeout=void 0,h.remaining-=Date.now()-h.start)},h.resume=()=>{h.timeout||(h.start=Date.now(),h.timeout=setTimeout(m,h.remaining))}}this.toasts.push(h),this.notify()},remove(e){si.toasts=si.toasts.filter(t=>t.id!==e),si.notify()},subscribe(e){return si.listeners.add(e),()=>{si.listeners.delete(e)}},notify(){si.listeners.forEach(e=>{e()})}},B7=()=>{const[e,t]=E.useState([]),[i,n]=E.useState([]),[a,l]=E.useState(!1),c=y=>w=>{w&&y.measuredHeight==null&&(y.measuredHeight=w.getBoundingClientRect().height,si.notify())};E.useEffect(()=>(t([...si.toasts]),si.subscribe(()=>{t([...si.toasts])})),[]),E.useEffect(()=>{const y=e.filter(w=>!i.includes(w.id)).map(w=>w.id);y.length>0&&requestAnimationFrame(()=>{n(w=>[...w,...y])})},[i,e]);const m=Math.max(0,e.length-3),f=(y,w)=>{if(y===w-1)return"none";const C=w-1-y;let N=e[w-1]?.measuredHeight||63;for(let A=w-1;A>y;A--)a?N+=(e[A-1]?.measuredHeight||63)+10:N+=20;const T=-C,D=a?1:1-.05*C;return`translate3d(0, calc(100% - ${N}px), ${T}px) scale(${D})`},g=()=>{l(!0),si.toasts.forEach(y=>{y.pause?.()})},b=()=>{l(!1),si.toasts.forEach(y=>{y.resume?.()})},x=e.slice(m).reduce((y,w)=>y+(w.measuredHeight??63),0);return u.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[9999] w-[min(420px,calc(100vw-2rem))]",style:{height:x},children:u.jsx("div",{className:"pointer-events-auto relative w-full",style:{height:x},onMouseEnter:g,onMouseLeave:b,children:e.map((y,w)=>{const C=w>=m;return u.jsx("div",{ref:c(y),className:Rc("absolute bottom-0 right-0 h-fit rounded-xl p-4 leading-[21px] shadow-menu",{message:"bg-geist-background text-gray-1000",success:"bg-blue-700 text-contrast-fg",warning:"bg-amber-800 text-gray-1000 dark:text-gray-100",error:"bg-red-800 text-contrast-fg"}[y.type],C?"opacity-100":"opacity-0",w<m&&"pointer-events-none"),style:{width:"100%",transition:"all .35s cubic-bezier(.25,.75,.6,.98)",transform:i.includes(y.id)?f(w,e.length):"translate3d(0, 100%, 150px) scale(1)"},children:u.jsxs("div",{className:"flex flex-col items-center justify-between text-[.875rem]",children:[u.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[u.jsx("span",{children:y.text}),!y.action&&u.jsxs("div",{className:"flex gap-1",children:[y.onUndoAction&&u.jsx(Ed,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>{y.onUndoAction?.(),si.remove(y.id)},children:u.jsx(j7,{})}),u.jsx(Ed,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>si.remove(y.id),children:u.jsx(O7,{className:{message:"fill-gray-1000",success:"fill-contrast-fg",warning:"fill-gray-1000 dark:fill-gray-100",error:"fill-contrast-fg"}[y.type]})})]})]}),y.action&&u.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[u.jsx(Ed,{type:"tertiary",size:"small",onClick:()=>si.remove(y.id),children:"Dismiss"}),u.jsx(Ed,{type:"primary",size:"small",onClick:()=>{y.onAction?.(),si.remove(y.id)},children:y.action})]})]})},y.id)})})})},Cd=()=>{if(dp)return;const e=document.createElement("div");e.className="fixed bottom-4 right-4 z-[9999]",document.body.appendChild(e),dp=B2.createRoot(e),dp.render(u.jsx(B7,{}))},qi=()=>({message:E.useCallback(({text:e,preserve:t,action:i,onAction:n,onUndoAction:a})=>{Cd(),si.add(e,"message",t,i,n,a)},[]),success:E.useCallback(e=>{Cd(),si.add(e,"success")},[]),warning:E.useCallback(e=>{Cd(),si.add(e,"warning")},[]),error:E.useCallback(e=>{Cd(),si.add(e,"error")},[])});function z7({usage:e}){const t=e.inputTokens+e.cacheCreationInputTokens+e.cacheReadInputTokens,i=t>0?e.cacheReadInputTokens/t*100:0;return u.jsxs("div",{className:"rounded-md border border-border",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Zc,{className:"size-3.5 text-amber-700"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Claude Code · last session"}),e.sessionId?u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.sessionId.slice(0,8)}):null]}),u.jsxs("span",{className:"font-mono text-sm font-semibold text-emerald-700",children:["$",e.costUSD.toFixed(4)]})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1.5 px-3 py-2 text-[11px] sm:grid-cols-4",children:[u.jsx(Bi,{label:"Input",value:js(e.inputTokens)}),u.jsx(Bi,{label:"Output",value:js(e.outputTokens)}),u.jsx(Bi,{label:"Cache read",value:js(e.cacheReadInputTokens)}),u.jsx(Bi,{label:"Cache create",value:js(e.cacheCreationInputTokens)}),u.jsx(Bi,{label:"Lines +",value:String(e.linesAdded)}),u.jsx(Bi,{label:"Lines −",value:String(e.linesRemoved)}),u.jsx(Bi,{label:"Wall",value:rS(e.durationMs)}),u.jsx(Bi,{label:"API",value:rS(e.apiDurationMs)})]}),u.jsxs("div",{className:"border-t border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[u.jsx("span",{children:"Cache read share of input"}),u.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${Math.min(100,i).toFixed(2)}%`}})})]}),e.fiveHour||e.weekly?u.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.fiveHour?u.jsx(ah,{label:"5h block",window:e.fiveHour}):null,e.weekly?u.jsx(ah,{label:"This week",window:e.weekly}):null]}):null,e.models.length?u.jsxs("div",{className:"space-y-1 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"By model"}),e.models.map(n=>u.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[11px]",children:[u.jsx("span",{className:"truncate",children:n.model}),u.jsxs("span",{className:"shrink-0 text-muted-foreground",children:[js(n.inputTokens+n.outputTokens)," tok ·"," ",u.jsxs("span",{className:"text-emerald-700",children:["$",n.costUSD.toFixed(4)]})]})]},n.model))]}):null]})}function I7({usage:e}){const t=e.inputTokens>0?e.cachedInputTokens/e.inputTokens*100:0,i=e.contextWindow&&e.contextWindow>0?e.lastTotalTokens/e.contextWindow*100:0;return u.jsxs("div",{className:"rounded-md border border-border",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Mh,{className:"size-3.5 text-foreground"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Codex · last session"})]}),e.timestamp?u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}):null]}),u.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1.5 px-3 py-2 text-[11px] sm:grid-cols-4",children:[u.jsx(Bi,{label:"Input",value:js(e.inputTokens)}),u.jsx(Bi,{label:"Output",value:js(e.outputTokens)}),u.jsx(Bi,{label:"Cache read",value:js(e.cachedInputTokens)}),u.jsx(Bi,{label:"Reasoning",value:js(e.reasoningOutputTokens)}),u.jsx(Bi,{label:"Total",value:js(e.totalTokens)}),u.jsx(Bi,{label:"Last turn",value:js(e.lastTotalTokens)}),u.jsx(Bi,{label:"Context",value:e.contextWindow?js(e.contextWindow):"n/a"}),u.jsx(Bi,{label:"Cost",value:"n/a"})]}),u.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[u.jsx(nS,{label:"Cache read share of input",value:t,tone:"bg-emerald-500"}),e.contextWindow?u.jsx(nS,{label:"Last turn context share",value:i,tone:"bg-sky-500"}):null]}),e.primary||e.secondary?u.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.primary?u.jsx(ah,{label:"5h window",window:e.primary}):null,e.secondary?u.jsx(ah,{label:"Weekly window",window:e.secondary}):null]}):null]})}function nS({label:e,value:t,tone:i}){const n=Math.min(100,Math.max(0,t));return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[u.jsx("span",{children:e}),u.jsxs("span",{className:"font-mono",children:[n.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:fe("h-full",i),style:{width:`${n.toFixed(2)}%`}})})]})}function ah({label:e,window:t}){const i=Math.min(100,Math.max(0,t.usedPercent)),n=t.resetsAtUnix?new Date(t.resetsAtUnix*1e3).toLocaleString():null,a=i>=90?"bg-red-500":i>=70?"bg-amber-500":"bg-emerald-500";return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[u.jsx("span",{className:"text-muted-foreground",children:e}),u.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:fe("h-full",a),style:{width:`${i.toFixed(2)}%`}})}),n?u.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:["resets ",n]}):null]})}function Bi({label:e,value:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),u.jsx("div",{className:"font-mono text-xs font-semibold",children:t})]})}function js(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function rS(e){if(!e)return"0s";if(e<1e3)return`${e}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const i=Math.floor(t/60),n=Math.round(t-i*60);return`${i}m ${n}s`}function P7(e=1e4){const[t,i]=E.useState(null),[n,a]=E.useState(null);return E.useEffect(()=>{let l=!0;const c=()=>{W4().then(m=>{l&&(i(m),a(null))}).catch(m=>{l&&a(m instanceof Error?m.message:String(m))})};c();const h=window.setInterval(c,e);return()=>{l=!1,window.clearInterval(h)}},[e]),{usage:t,error:n}}const U7={"claude-code":{label:"Claude Code",icon:u.jsx(Zc,{})},codex:{label:"Codex",icon:u.jsx(Mh,{})}};function H7({agent:e,agentId:t,isDetected:i}){const{usage:n,error:a}=P7(),l=U7[t],c=t==="codex";return u.jsxs(Qn,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Jn,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(K2,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:c?"Token Usage & Rate Limits":"Token & Cost Usage"}),u.jsx(Ke,{variant:"outline",size:"small",icon:l.icon,children:l.label}),i?u.jsx(Ke,{variant:"outline",size:"small",children:"active session"}):u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Not the active agent in this session"}),c?null:u.jsx(F7,{className:"ml-auto"})]}),u.jsxs(Qr,{className:"truncate text-xs",children:[c?u.jsxs(u.Fragment,{children:["Session metrics from ",u.jsx("code",{className:"font-mono",children:"~/.codex/sessions"})]}):u.jsxs(u.Fragment,{children:["Last-session metrics from ",u.jsx("code",{className:"font-mono",children:"~/.claude.json"})]})," · ",u.jsx("span",{className:"font-mono",children:e.project.cwd})]})]}),u.jsxs(tr,{className:"p-3",children:[a?u.jsx("p",{className:"text-xs text-destructive",children:a}):null,c?n?.codex?u.jsx(I7,{usage:n.codex}):a?null:u.jsx(aS,{agent:"Codex CLI"}):n?.claude?u.jsx(z7,{usage:n.claude}):a?null:u.jsx(aS,{agent:"Claude Code"})]})]})}function F7({className:e}){const[t,i]=E.useState(!0),[n,a]=E.useState(!0),[l,c]=E.useState(!1),h=qi();E.useEffect(()=>{let f=!0;return Y4().then(g=>f&&i(g.coAuthorWithClaude)).catch(()=>{}).finally(()=>f&&a(!1)),()=>{f=!1}},[]);const m=async()=>{const f=!t;c(!0),i(f);try{const g=await X4({coAuthorWithClaude:f});i(g.coAuthorWithClaude),h.success(g.coAuthorWithClaude?"Claude co-author trailer enabled for commits":"Claude co-author trailer disabled for commits")}catch(g){i(!f),h.error(g instanceof Error?g.message:"Failed to update setting")}finally{c(!1)}};return u.jsxs(de,{type:"button",variant:t?"default":"outline",size:"sm",onClick:m,disabled:n||l,"aria-pressed":t,title:t?"Claude will be added as commit co-author. Click to disable.":"Co-author trailer disabled. Click to enable.",className:fe("gap-1.5",e),children:[u.jsx(Zc,{className:"size-3.5"}),"Co-author"]})}function aS({agent:e}){return u.jsxs("p",{className:"text-xs text-muted-foreground",children:["No usage data yet. Run a session with ",e," in this project."]})}function $7({agent:e,agentId:t}){return u.jsxs("div",{className:"grid grid-cols-1 divide-y divide-border xl:grid-cols-2 xl:divide-x xl:divide-y-0",children:[u.jsxs(Qn,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Jn,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(J2,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"Skills"})]}),u.jsx(Ke,{variant:"outline",size:"small",children:e.skills.length})]}),u.jsx(Qr,{className:"text-xs",children:t==="codex"?"User, project, and system skills discovered for Codex.":"User, project, and plugin skills discovered for the active agent."})]}),u.jsx(tr,{className:"p-0",children:e.skills.length?u.jsx("ul",{className:"divide-y divide-border",children:e.skills.map(i=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i.name}),u.jsx(Ke,{variant:"outline",size:"small",children:i.scope})]}),i.description?u.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:i.description}):null]},`${i.scope}:${i.name}`))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No skills found."})})]}),u.jsx(V7,{agent:e,agentId:t})]})}function V7({agent:e,agentId:t}){const[i,n]=E.useState([]),[a,l]=E.useState(!1),c=E.useCallback(async()=>{l(!0);try{n(await G4(t))}catch{n([])}finally{l(!1)}},[t]);E.useEffect(()=>{c()},[c]);const h=E.useMemo(()=>{const f={};for(const g of i)f[g.name]=g.state;return f},[i]),m=E.useMemo(()=>{const f=new Set(e.mcpServers.map(b=>b.name)),g=i.filter(b=>!f.has(b.name)).map(b=>({name:b.name,scope:"user",synthetic:!0}));return[...e.mcpServers,...g]},[e.mcpServers,i]);return u.jsxs(Qn,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Jn,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(X2,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"MCP Servers"})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Ke,{variant:"outline",size:"small",children:m.length}),u.jsx(de,{type:"button",variant:"ghost",size:"icon",className:"size-6",onClick:()=>{c()},disabled:a,title:"Re-check authentication status","aria-label":"Re-check authentication status",children:u.jsx(Eh,{className:a?"animate-spin":void 0})})]})]}),u.jsxs(Qr,{className:"text-xs",children:["From"," ",u.jsx("code",{className:"font-mono",children:t==="codex"?"~/.codex/config.toml":"~/.claude.json"}),t==="codex"?"":" + claude.ai connectors",". Status via"," ",u.jsxs("code",{className:"font-mono",children:[t==="codex"?"codex":"claude"," mcp list"]})," ","(fresh health check)."]})]}),u.jsx(tr,{className:"p-0",children:m.length?u.jsx("ul",{className:"divide-y divide-border",children:m.map(f=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:f.name}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[u.jsx(K7,{state:h[f.name],loading:a}),u.jsx(Ke,{variant:"outline",size:"small",children:f.synthetic?"connector":f.scope})]})]}),u.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:f.synthetic?"claude.ai managed connector":G7(f)})]},`${f.scope}:${f.name}`))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No MCP servers configured."})})]})}const q7={connected:{label:"Connected",dot:"bg-emerald-500"},"needs-auth":{label:"Needs auth",dot:"bg-amber-500"},failed:{label:"Failed",dot:"bg-red-500"},"no-auth":{label:"local",dot:"bg-muted-foreground/50"}};function K7({state:e,loading:t}){if(!e)return t?u.jsx(as,{className:"size-3 animate-spin text-muted-foreground"}):null;const i=e==="unknown"?void 0:q7[e];return i?u.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[u.jsx("span",{className:fe("size-1.5 shrink-0 rounded-full",i.dot),"aria-hidden":!0}),i.label]}):null}function G7(e){return e.command?[e.command,...e.args??[]].join(" "):e.url??e.type??"-"}const W7=[{id:"claude-code",label:"Claude Code",icon:u.jsx(Zc,{className:"size-4"})},{id:"codex",label:"Codex",icon:u.jsx(Mh,{className:"size-4"})}],Y7=[{id:"overview",label:"Overview",icon:u.jsx(K2,{className:"size-3.5"})},{id:"memory",label:"Memory",icon:u.jsx(P2,{className:"size-3.5"})},{id:"tools",label:"Skills & MCPs",icon:u.jsx(X2,{className:"size-3.5"})},{id:"activity",label:"Activity",icon:u.jsx(Go,{className:"size-3.5"})}];function X7(){const[e,t]=E.useState(null),[i,n]=E.useState(null),[a,l]=E.useState("claude-code"),[c,h]=E.useState("overview");if(E.useEffect(()=>{let f=!0;return K4().then(g=>{f&&(t(g),g.detected.name==="codex"&&l("codex"))}).catch(g=>{f&&n(g instanceof Error?g.message:String(g))}),()=>{f=!1}},[]),i)return u.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:u.jsxs(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load agent info: ",i]})});if(!e)return u.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:u.jsx(dt,{variant:"muted",children:"Loading agent info…"})});const m=e.agents?.[a]??e;return u.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[u.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card/90 px-3 py-2",children:W7.map(f=>{const g=a===f.id,b=e.detected.name===f.id;return u.jsxs("button",{type:"button",onClick:()=>l(f.id),className:fe("flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",g?"border-border bg-background text-foreground shadow-sm":"border-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[f.icon,f.label,b?u.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500","aria-label":"active session"}):null]},f.id)})}),u.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/90 px-3",children:Y7.map(f=>u.jsxs("button",{type:"button",onClick:()=>h(f.id),className:fe("relative flex items-center gap-1.5 px-2.5 py-2 text-xs font-medium transition-colors",c===f.id?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[f.icon,f.label,c===f.id?u.jsx("span",{className:"absolute inset-x-1 -bottom-px h-0.5 bg-primary"}):null]},f.id))}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[c==="overview"?u.jsx(H7,{agent:m,agentId:a,isDetected:e.detected.name===a}):null,c==="memory"?u.jsx(N7,{agent:m,agentId:a}):null,c==="tools"?u.jsx($7,{agent:m,agentId:a}):null,c==="activity"?u.jsx(C7,{agent:m,agentId:a}):null]})]})}const p_="application/x-nomoreide-path";function lk(e,t){return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function ck(e,t){e.setData(p_,t)}function oS(e){return e.types.includes(p_)}function Z7(e){return e.getData(p_)||null}function uk(e){return{draggable:!0,onDragStart:t=>{ck(t.dataTransfer,e),t.dataTransfer.effectAllowed="copy"}}}const Q7=new Set(["c","cpp","cs","go","java","js","jsx","kt","mjs","py","rs","swift","ts","tsx"]),J7=new Set([".env",".gitignore","components.json","dockerfile","package.json","tsconfig.json","vite.config.ts"]),ej=new Set(["conf","config","ini","toml","yaml","yml"]),tj=new Set(["csv","json","sql","xml"]),ij=new Set(["md","mdx","rst","txt"]),sj=new Set(["gif","jpeg","jpg","png","svg","webp"]),nj=new Set(["package-lock.json","pnpm-lock.yaml","yarn.lock"]),rj=new Set(["css","less","sass","scss"]);function aj(e){const t=e.split("/").pop()?.toLowerCase()??e.toLowerCase(),i=t.includes(".")?t.split(".").pop()??"":"";return nj.has(t)||t.endsWith(".lock")?"lock":oj(t)?"test":J7.has(t)||ej.has(i)?"config":rj.has(i)?"style":sj.has(i)?"image":ij.has(i)?"document":tj.has(i)?"data":Q7.has(i)?"code":"generic"}function oj(e){return e.includes(".test.")||e.includes(".spec.")||e.endsWith("_test.go")}function g_({path:e,className:t}){const i=aj(e),n=lj[i];return u.jsx(n,{"aria-label":`${i} file`,className:fe("size-3.5 shrink-0",cj[i],t)})}const lj={code:hA,config:E4,data:za,document:pA,generic:q2,image:jA,lock:UA,style:QA,test:bA},cj={code:"text-sky-600",config:"text-zinc-600",data:"text-emerald-700",document:"text-blue-700",generic:"text-muted-foreground",image:"text-fuchsia-700",lock:"text-amber-700",style:"text-rose-700",test:"text-violet-700"};function uj(e){const t=e.lastIndexOf(".");return t>0?e.slice(t):""}function dj({onPick:e,onClose:t}){const[i,n]=E.useState(""),[a,l]=E.useState(null),[c,h]=E.useState(null),[m,f]=E.useState(!1),g=E.useRef(null),b=a?a.parent!==a.path:!1;return E.useEffect(()=>{function v(x){g.current&&!g.current.contains(x.target)&&t()}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[t]),E.useEffect(()=>{let v=!0;return f(!0),h(null),sE(i,{files:!0}).then(x=>v&&l(x)).catch(x=>v&&h(x instanceof Error?x.message:String(x))).finally(()=>v&&f(!1)),()=>{v=!1}},[i]),u.jsxs("div",{ref:g,className:"absolute bottom-full left-2 z-10 mb-2 w-[22rem] max-w-[calc(100vw-1rem)] overflow-hidden rounded-md border border-border bg-card shadow-lg",children:[u.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:[u.jsx(de,{"aria-label":"Parent folder",className:"size-7",disabled:!b,onClick:()=>a&&n(a.parent),size:"icon",type:"button",variant:"ghost",children:u.jsx(z0,{})}),u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",title:a?.path,children:a?.path??"…"}),m?u.jsx(as,{className:"size-3.5 animate-spin text-muted-foreground"}):null,a?u.jsxs(de,{className:"h-7 px-2 text-[11px]",onClick:()=>e(a.path),size:"sm",title:"Attach this folder",type:"button",variant:"outline",children:[u.jsx(eA,{})," This folder"]}):null,u.jsx(de,{"aria-label":"Close",className:"size-7",onClick:t,size:"icon",type:"button",variant:"ghost",children:u.jsx(Js,{})})]}),u.jsx("div",{className:"max-h-64 overflow-auto p-1",children:c?u.jsx(dt,{variant:"destructive",className:"m-1",children:c}):a&&a.entries.length===0?u.jsx(dt,{variant:"muted",className:"m-1 text-center",children:"Empty folder."}):a?.entries.map(v=>{const x=v.isDir?"":uj(v.name);return u.jsxs("button",{className:"flex w-full items-center gap-1.5 rounded-sm px-2 py-1 text-left text-[12px] hover:bg-muted",onClick:()=>v.isDir?n(v.path):e(v.path),title:v.path,type:"button",children:[v.isDir?u.jsx(Ha,{className:"size-3.5 shrink-0 text-amber-600"}):u.jsx(g_,{path:v.path}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:v.name}),x?u.jsx("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] text-muted-foreground",children:x}):null]},v.path)})})]})}let lS=0;const cS=()=>(lS+=1,`t${Date.now()}-${lS}`);function hj(){const[e,t]=E.useState([]),[i,n]=E.useState(!1),[a,l]=E.useState(null),[c,h]=E.useState(null),[m,f]=E.useState(null),[g,b]=E.useState([]),v=E.useRef(null),x=E.useRef(void 0);E.useEffect(()=>{Z4().then(T=>{h(T.configured),f(T.provider)}).catch(()=>h(!1))},[]);const y=E.useCallback(async(T,D)=>{b(L=>L.filter(G=>G.requestId!==T));const A=x.current;if(A)try{await Q4(A,T,D)}catch{}},[]),w=E.useCallback(()=>{v.current?.abort(),v.current=null,n(!1)},[]),C=E.useCallback(async T=>{const D=T.trim();if(!D||i)return;l(null);const A={id:cS(),role:"user",text:D,tools:[]},L=cS(),G={id:L,role:"assistant",text:"",tools:[]};t(H=>[...H,A,G]);const j=H=>t(I=>I.map(W=>W.id===L?H(W):W)),R=new AbortController;v.current=R,n(!0);try{await J4(D,x.current,H=>{switch(H.type){case"session":x.current=H.sessionId;break;case"text":j(I=>({...I,text:I.text+H.text}));break;case"tool_use":j(I=>({...I,tools:[...I.tools,{id:H.id,name:H.name,input:H.input,status:"running"}]}));break;case"tool_result":j(I=>({...I,tools:I.tools.map(W=>W.id===H.id?{...W,preview:H.preview,isError:H.isError,status:"done"}:W)}));break;case"approval_request":b(I=>[...I,{requestId:H.requestId,name:H.name,input:H.input}]);break;case"error":l(H.message);break;case"done":break}},R.signal)}catch(H){R.signal.aborted||l(H instanceof Error?H.message:String(H))}finally{v.current=null,n(!1)}},[i]),N=E.useCallback(()=>{w(),x.current=void 0,t([]),b([]),l(null)},[w]);return{turns:e,streaming:i,error:a,configured:c,provider:m,approvals:g,send:C,stop:w,clear:N,respond:y}}function fj({onOpenAgentPage:e}){const[t,i]=E.useState(!1),{turns:n,streaming:a,error:l,configured:c,provider:h,approvals:m,send:f,stop:g,clear:b,respond:v}=hj(),[x,y]=E.useState(""),[w,C]=E.useState(!1),[N,T]=E.useState(!1),[D,A]=E.useState(!1),L=E.useRef(null),G=E.useRef(null);function j(P){i(!0),y(te=>te.trim()?`${te.replace(/\s*$/,"")} ${P} `:`${P} `),requestAnimationFrame(()=>G.current?.focus())}E.useEffect(()=>{t&&G.current?.focus()},[t]),E.useEffect(()=>{const P=K=>{K.dataTransfer&&oS(K.dataTransfer)&&C(!0)},te=()=>{C(!1),T(!1)};return document.addEventListener("dragstart",P),document.addEventListener("dragend",te),document.addEventListener("drop",te),()=>{document.removeEventListener("dragstart",P),document.removeEventListener("dragend",te),document.removeEventListener("drop",te)}},[]),E.useEffect(()=>{const P=L.current;P&&(P.scrollTop=P.scrollHeight)},[n,t]);async function R(){const P=x;y(""),await f(P)}function H(P){P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),R())}function I(P){oS(P.dataTransfer)&&(P.preventDefault(),P.dataTransfer.dropEffect="copy",t||i(!0),T(!0))}function W(P){P.currentTarget.contains(P.relatedTarget)||T(!1)}function J(P){T(!1);const te=Z7(P.dataTransfer);te&&(P.preventDefault(),j(te))}return u.jsx("div",{className:fe("fixed inset-x-0 bottom-0 z-50 flex flex-col border-t border-border bg-card/95 shadow-[0_-8px_24px_-12px_rgba(0,0,0,0.25)] backdrop-blur transition-[height] duration-200",t?"h-[50vh]":w?"h-12":"h-9",w&&!N&&"border-primary/60 bg-primary/5",N&&"outline-dashed outline-2 -outline-offset-2 outline-primary/70"),onDragOver:I,onDragLeave:W,onDrop:J,children:t?u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"flex h-9 shrink-0 items-center gap-2 border-b border-border px-3",children:[u.jsx(uS,{provider:h,className:"size-4 text-primary"}),u.jsx("span",{className:"text-sm font-medium",children:h?.label??"Agent"}),a?u.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[u.jsx(as,{className:"size-3 animate-spin"})," thinking…"]}):null,u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e?u.jsx(de,{"aria-label":"Open agent page",className:"size-7",onClick:e,size:"icon",title:"Open the full agent page",type:"button",variant:"ghost",children:u.jsx(a4,{})}):null,u.jsx(de,{"aria-label":"Clear conversation",className:"size-7",disabled:n.length===0,onClick:b,size:"icon",title:"Clear conversation",type:"button",variant:"ghost",children:u.jsx(qc,{})}),u.jsx(de,{"aria-label":"Collapse agent",className:"size-7",onClick:()=>i(!1),size:"icon",title:"Collapse",type:"button",variant:"ghost",children:u.jsx(Qs,{})})]})]}),u.jsxs("div",{ref:L,className:"min-h-0 flex-1 space-y-3 overflow-auto px-3 py-3",children:[n.length===0?u.jsx(mj,{configured:c,provider:h}):n.map(P=>u.jsx(pj,{turn:P},P.id)),l?u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[u.jsx(I4,{className:"mt-px size-3.5 shrink-0"}),u.jsx("span",{className:"min-w-0 break-words",children:l})]}):null]}),m.length>0?u.jsx("div",{className:"shrink-0 space-y-1.5 border-t border-amber-400/40 bg-amber-50/60 px-3 py-2",children:m.map(P=>u.jsx(_j,{prompt:P,onRespond:v},P.requestId))}):null,u.jsxs("div",{className:fe("relative shrink-0 border-t border-border p-2 transition-colors",w&&"bg-primary/5"),children:[D?u.jsx(dj,{onClose:()=>A(!1),onPick:P=>{A(!1),j(P)}}):null,u.jsxs("div",{className:"flex items-end gap-2",children:[u.jsx(de,{"aria-label":"Attach a file or folder",className:"size-9 shrink-0",disabled:c===!1,onClick:()=>A(!0),size:"icon",title:"Attach a file or folder",type:"button",variant:D?"secondary":"outline",children:u.jsx(l4,{})}),u.jsx("textarea",{ref:G,className:"max-h-32 min-h-9 flex-1 resize-none rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",disabled:c===!1,onChange:P=>y(P.target.value),onKeyDown:H,placeholder:c===!1?`${h?.label??"Agent"} (\`${h?.commandName??"agent"}\`) is not installed`:`Ask ${h?.label??"the agent"} anything about this project...`,rows:1,value:x}),a?u.jsxs(de,{onClick:g,size:"sm",type:"button",variant:"outline",children:[u.jsx(Ch,{})," Stop"]}):u.jsxs(de,{disabled:!x.trim()||c===!1,onClick:()=>{R()},size:"sm",type:"button",children:["Send ",u.jsx(QT,{})]})]})]})]}):u.jsx("button",{className:fe("flex h-full w-full items-center gap-2 px-3 text-left text-sm hover:bg-muted/50",w?"font-medium text-primary":"text-muted-foreground"),onClick:()=>i(!0),type:"button",children:w?u.jsxs(u.Fragment,{children:[u.jsx(rA,{className:"size-4 animate-bounce text-primary"}),u.jsx("span",{children:"Drop here to add it to your message"})]}):u.jsxs(u.Fragment,{children:[u.jsx(uS,{provider:h,className:"size-4 text-primary"}),u.jsxs("span",{children:["Ask ",h?.label??"the agent","..."]}),a?u.jsx(as,{className:"size-3.5 animate-spin"}):null,u.jsx("span",{className:"ml-auto text-xs text-muted-foreground/70",children:"click to expand"})]})})})}function uS({provider:e,className:t}){return e?.id==="claude"?u.jsx(Zc,{className:t}):e?.id==="codex"?u.jsx(Mh,{className:t}):u.jsx(J2,{className:t})}function mj({configured:e,provider:t}){return e===!1?u.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:["This dock runs the ",u.jsx("code",{className:"font-mono",children:t?.commandName??"agent"})," ","CLI. ",t?.installHint??"Install the active agent CLI, then reload."]}):u.jsx("div",{className:"text-xs text-muted-foreground",children:t?.intro??'This is the active agent, running in your workspace with full tools - e.g. "restart the api and tail its logs", "what changed in git and why?", "fix the failing test".'})}function pj({turn:e}){return e.role==="user"?u.jsx("div",{className:"flex justify-end",children:u.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-br-sm bg-primary px-3 py-1.5 text-sm text-primary-foreground",children:e.text})}):u.jsxs("div",{className:"space-y-1.5",children:[e.tools.map(t=>u.jsx(gj,{tool:t},t.id)),e.text?u.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-bl-sm bg-muted px-3 py-1.5 text-sm",children:e.text}):null]})}function gj({tool:e}){const t=dk(e.input);return u.jsxs("div",{className:fe("inline-flex max-w-[85%] items-center gap-1.5 rounded-md border px-2 py-1 font-mono text-[11px]",e.isError?"border-destructive/40 bg-destructive/5 text-destructive":"border-border bg-background text-muted-foreground"),children:[e.status==="running"?u.jsx(as,{className:"size-3 animate-spin"}):u.jsx(F4,{className:"size-3"}),u.jsx("span",{className:"font-semibold",children:e.name}),t?u.jsx("span",{className:"truncate",children:t}):null]})}function _j({prompt:e,onRespond:t}){const i=dk(e.input).slice(0,140);return u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-400/50 bg-background/80 px-2 py-1.5 text-xs",children:[u.jsx(k4,{className:"size-4 shrink-0 text-amber-600"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"font-mono font-semibold",children:e.name}),i?u.jsx("span",{className:"ml-1 truncate font-mono text-muted-foreground",children:i}):null]}),u.jsxs(de,{className:"h-7",onClick:()=>t(e.requestId,"deny"),size:"sm",type:"button",variant:"outline",children:[u.jsx(Js,{})," Deny"]}),u.jsxs(de,{className:"h-7",onClick:()=>t(e.requestId,"allow"),size:"sm",type:"button",children:[u.jsx(Qo,{})," Allow"]})]})}function dk(e){return!e||typeof e!="object"?"":Object.values(e).filter(i=>i!==void 0&&i!=="").map(i=>String(i)).join(" ")}function ot({className:e,type:t,...i}){return u.jsx("input",{type:t,className:fe("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...i})}var __=L2();function Xn({children:e,icon:t,onClose:i,title:n,size:a="md"}){return E.useEffect(()=>{function l(c){c.key==="Escape"&&i()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i]),__.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",onMouseDown:i,children:u.jsxs("div",{"aria-modal":"true",className:`flex max-h-[min(760px,calc(100vh-2rem))] w-full flex-col overflow-hidden rounded-lg border border-border bg-card shadow-xl ${a==="lg"?"max-w-3xl":"max-w-lg"}`,onMouseDown:l=>l.stopPropagation(),role:"dialog",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-md border border-border bg-background text-foreground [&_svg]:size-4",children:t}),u.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:n}),u.jsx(de,{"aria-label":"Close dialog",onClick:i,size:"icon",type:"button",variant:"ghost",children:u.jsx(Js,{})})]}),u.jsx("div",{className:"min-h-0 overflow-auto p-4",children:e})]})}),document.body)}const hp={host:"",port:"",user:"",password:"",database:"",ssl:!1},bj="localhost";function Hg(e,t,{includePassword:i=!0}={}){const n=e==="mysql"?"mysql":"postgres",a=t.host.trim()||bj,l=t.port.trim(),c=t.database.trim().replace(/^\//,""),h=t.user.trim(),m=i&&t.password,f=h?`${encodeURIComponent(h)}${m?`:${encodeURIComponent(t.password)}`:""}@`:"",g=l?`:${l}`:"",b=e==="postgres"&&t.ssl?"?sslmode=require":"";return`${n}://${f}${a}${g}/${c}${b}`}function Fg(e){if(!e.trim())return null;let t;try{t=new URL(e.trim())}catch{return null}return{host:t.hostname,port:t.port,user:dS(t.username),password:dS(t.password),database:t.pathname.replace(/^\//,""),ssl:t.searchParams.get("sslmode")==="require"||t.searchParams.has("ssl")}}function vj(e){const t=/^([a-z0-9+]+):\/\//i.exec(e.trim());if(!t)return null;const i=t[1].toLowerCase();return i.startsWith("postgres")?"postgres":i.startsWith("mysql")?"mysql":i.startsWith("sqlite")||i==="file"?"sqlite":null}function dS(e){try{return decodeURIComponent(e)}catch{return e}}const xj=[{value:"postgres",label:"Postgres"},{value:"mysql",label:"MySQL"},{value:"sqlite",label:"SQLite"}];function yj({onClose:e,onSaved:t,initial:i}){const{error:n,success:a}=qi(),l=!!i,c=E.useMemo(()=>Sj(i),[i]),[h,m]=E.useState(c.engine),[f,g]=E.useState(c.name),[b,v]=E.useState(c.url),[x,y]=E.useState(c.fields),[w,C]=E.useState([]),[N,T]=E.useState({status:"idle"}),[D,A]=E.useState(!1),[L,G]=E.useState(!1);E.useEffect(()=>{l||tM().then(C).catch(()=>C([]))},[l]);const j=h==="sqlite",R=j?b.trim():Hg(h,x),H=j?!!b.trim():!!(x.host.trim()&&x.database.trim());function I(){T({status:"idle"})}function W(V,Y){return Hg(V,Y,{includePassword:!1})}function J(V){m(V),I(),V!=="sqlite"&&v(W(V,x))}function P(V){const Y={...x,...V};y(Y),v(W(h,Y)),I()}function te(V){I();const Y=vj(V),O=Y??h;Y&&Y!==h&&m(Y);const ee=Y==="sqlite"?null:Fg(V);if(!ee){v(V);return}ee.password?(y(ee),v(W(O,ee))):(y({...ee,password:x.password}),v(V))}function K(V){m(V.engine);const Y=V.engine==="sqlite"?null:Fg(V.url);Y?(y(Y),v(W(V.engine,Y))):v(V.url),I(),f.trim()||g(wj(V))}function M(){return f.trim()?j?b.trim()?null:"Database file path is required.":x.host.trim()?x.database.trim()?null:"Database name is required.":"Host is required.":"Name is required."}async function $(){if(H){A(!0),I();try{const V=await sM({engine:h,url:R});T(V.ok?{status:"ok",message:"Connected"}:{status:"fail",message:V.error??"Connection failed"})}catch(V){T({status:"fail",message:V instanceof Error?V.message:String(V)})}finally{A(!1)}}}async function F(){const V=M();if(V){n(V);return}G(!0);try{await iM({name:f.trim(),engine:h,url:R}),a(`Saved connection "${f.trim()}".`),t(),e()}catch(Y){n(Y instanceof Error?Y.message:String(Y))}finally{G(!1)}}return u.jsx(Xn,{icon:u.jsx(za,{}),onClose:e,title:l?"Edit database connection":"Add database connection",children:u.jsxs("div",{className:"flex flex-col gap-4",children:[w.length>0?u.jsxs("section",{children:[u.jsxs("p",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[u.jsx(U4,{className:"size-3.5"}),"Found in your services"]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.map(V=>u.jsxs("button",{type:"button",onClick:()=>K(V),className:"group flex items-center gap-1.5 rounded-md border border-border bg-background px-2 py-1 text-left text-xs transition-colors hover:border-primary hover:bg-muted",title:V.maskedUrl,children:[u.jsx(Ke,{variant:"outline",size:"small",children:V.engine}),u.jsx("span",{className:"font-mono",children:V.service}),u.jsxs("span",{className:"font-mono text-muted-foreground",children:["·",V.key]})]},`${V.service}:${V.key}`))})]}):null,u.jsxs("section",{children:[u.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Engine"}),u.jsx("div",{className:"flex gap-1.5",children:xj.map(V=>u.jsx(de,{size:"sm",variant:h===V.value?"default":"outline",onClick:()=>J(V.value),disabled:l,type:"button",children:V.label},V.value))})]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),u.jsx(ot,{value:f,onChange:V=>g(V.target.value),placeholder:"e.g. shop-db",disabled:l}),l?u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"The name identifies the connection and can't be changed here."}):null]}),j?null:u.jsxs("section",{className:"flex flex-col gap-3",children:[u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Host"}),u.jsx(ot,{value:x.host,onChange:V=>P({host:V.target.value}),placeholder:"localhost",className:"font-mono text-xs"})]}),u.jsxs("label",{className:"flex w-24 flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Port"}),u.jsx(ot,{value:x.port,onChange:V=>P({port:V.target.value}),placeholder:h==="mysql"?"3306":"5432",className:"font-mono text-xs"})]})]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"User"}),u.jsx(ot,{value:x.user,onChange:V=>P({user:V.target.value}),placeholder:"postgres",className:"font-mono text-xs"})]}),u.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Password"}),u.jsx(ot,{type:"password",value:x.password,onChange:V=>P({password:V.target.value}),placeholder:l?"leave blank to keep current":"••••••••",className:"font-mono text-xs"})]})]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Database"}),u.jsx(ot,{value:x.database,onChange:V=>P({database:V.target.value}),placeholder:"app",className:"font-mono text-xs"})]}),h==="postgres"?u.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[u.jsx("input",{type:"checkbox",checked:x.ssl,onChange:V=>P({ssl:V.target.checked}),className:"size-3.5 accent-primary"}),"Require SSL (adds ",u.jsx("span",{className:"font-mono",children:"?sslmode=require"}),")"]}):null]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:j?"Database file path":"Connection URL"}),u.jsx(ot,{value:b,onChange:V=>te(V.target.value),placeholder:j?"/abs/path/to/app.db":h==="mysql"?"mysql://user:pass@host:3306/db":"postgres://user:pass@host:5432/db",className:"font-mono text-xs"}),u.jsx("span",{className:"text-[11px] text-muted-foreground",children:j?"Read-only. Stored like a secret and masked in the UI and API.":"Synced with the fields above; the password stays in its field and is never shown here. Stored like a secret and masked in the UI and API."})]}),N.status!=="idle"?u.jsxs("div",{className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs ${N.status==="ok"?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400":"border-destructive/40 text-destructive"}`,children:[N.status==="ok"?u.jsx(Qo,{className:"size-3.5"}):u.jsx(Js,{className:"size-3.5"}),u.jsx("span",{className:"break-all font-mono",children:N.message})]}):null,u.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border pt-3",children:[u.jsxs(de,{variant:"outline",size:"sm",onClick:()=>{$()},disabled:D||!H,type:"button",children:[D?u.jsx(as,{className:"animate-spin"}):null,"Test connection"]}),u.jsxs(de,{size:"sm",onClick:()=>{F()},disabled:L,type:"button",children:[L?u.jsx(as,{className:"animate-spin"}):null,l?"Save changes":"Save"]})]})]})})}function Sj(e){if(!e)return{engine:"postgres",name:"",fields:hp,url:""};if(e.engine==="sqlite")return{engine:"sqlite",name:e.name,fields:hp,url:e.url};const t=Fg(e.url),i=t?{...t,password:""}:hp;return{engine:e.engine,name:e.name,fields:i,url:Hg(e.engine,i,{includePassword:!1})}}function wj(e){try{const i=new URL(e.url).pathname.replace(/^\//,"");if(i)return`${e.service}-${i}`}catch{}return`${e.service}-${e.engine}`}function Ej({connections:e,selected:t,onSelect:i,onAdd:n,onEdit:a,onRemove:l}){const[c,h]=E.useState(!1),m=E.useRef(null),f=e.find(g=>g.name===t);return E.useEffect(()=>{if(!c)return;function g(b){m.current&&b.target instanceof Node&&!m.current.contains(b.target)&&h(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[c]),u.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:m,children:[u.jsxs(de,{className:"max-w-[240px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>h(g=>!g),size:"sm",type:"button",variant:"outline",children:[u.jsx(za,{className:"text-muted-foreground"}),u.jsx("span",{className:"truncate",children:f?.name??"Select connection"}),f?u.jsx(Ke,{variant:"outline",size:"small",children:f.engine}):null,u.jsx(Qs,{className:fe("ml-auto transition-transform",c&&"rotate-180")})]}),c?u.jsxs("div",{className:"absolute right-0 top-10 z-50 w-[min(420px,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(za,{className:"size-3.5 text-muted-foreground"}),u.jsx("div",{className:"text-xs font-semibold",children:"Connections"}),u.jsx(Ke,{className:"ml-auto",variant:"outline",size:"small",children:e.length})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?u.jsx("div",{className:"divide-y divide-border",children:e.map(g=>{const b=g.name===t;return u.jsxs("div",{className:fe("group grid w-full grid-cols-[1fr_auto_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",b&&"bg-muted/70"),children:[u.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{i(g.name),h(!1)},type:"button",children:[u.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:g.name}),u.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:g.url})]}),b?u.jsx(Qo,{className:"size-3.5"}):u.jsx("span",{className:"size-3.5"}),u.jsx(de,{"aria-label":`Edit ${g.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{a(g),h(!1)},size:"icon",title:`Edit ${g.name}`,type:"button",variant:"ghost",children:u.jsx(Mc,{className:"size-3.5"})}),u.jsx(de,{"aria-label":`Remove ${g.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>l(g.name),size:"icon",title:`Remove ${g.name}`,type:"button",variant:"ghost",children:u.jsx(qc,{className:"size-3.5 text-destructive"})})]},g.name)})}):u.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved connections yet."})}),u.jsx("div",{className:"border-t border-border bg-muted/20 p-2",children:u.jsxs(de,{className:"w-full",onClick:()=>{n(),h(!1)},size:"sm",type:"button",children:[u.jsx(zs,{className:"size-3"}),"Add connection"]})})]}):null]})}function Cj({connection:e,sample:t}){const{success:i,error:n}=qi();async function a(l){try{const c=oM(e,t.engine,t.table,t.columns,l);await navigator.clipboard.writeText(c),i("Copied row + schema prompt to clipboard.")}catch(c){n(c instanceof Error?c.message:String(c))}}return t.columns.length===0?u.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This table has no columns."}):u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:u.jsxs("table",{className:"w-max min-w-full border-collapse text-left font-mono text-[11px]",children:[u.jsx("thead",{className:"sticky top-0 z-10 bg-card",children:u.jsxs("tr",{className:"border-b border-border",children:[u.jsx("th",{className:"w-10 px-2 py-2"}),t.columns.map(l=>u.jsxs("th",{className:"whitespace-nowrap px-3 py-2 font-semibold text-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[l.primaryKey?u.jsx(zA,{className:"size-3 text-amber-500"}):null,l.name]}),u.jsx("span",{className:"block text-[10px] font-normal text-muted-foreground",children:l.dataType})]},l.name))]})}),u.jsxs("tbody",{children:[t.rows.map((l,c)=>u.jsxs("tr",{className:"group border-b border-border/60 hover:bg-muted/40",children:[u.jsx("td",{className:"px-2 py-1 align-top",children:u.jsx(de,{size:"icon",variant:"ghost",className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",title:"Explain this row to the agent",onClick:()=>{a(l)},type:"button",children:u.jsx(Tc,{className:"size-3.5"})})}),t.columns.map(h=>u.jsx("td",{className:"max-w-[320px] truncate px-3 py-1 align-top text-muted-foreground",title:hS(l[h.name]),children:hS(l[h.name])},h.name))]},c)),t.rows.length===0?u.jsx("tr",{children:u.jsx("td",{colSpan:t.columns.length+1,className:"px-3 py-6 text-center text-muted-foreground",children:"No rows."})}):null]})]})})}function hS(e){return e==null?"NULL":typeof e=="object"?JSON.stringify(e):String(e)}function kj(){const[e,t]=E.useState([]),[i,n]=E.useState(!0),[a,l]=E.useState(null),c=E.useCallback(async()=>{n(!0),l(null);try{t(await eM())}catch(h){l(h instanceof Error?h.message:String(h))}finally{n(!1)}},[]);return E.useEffect(()=>{c()},[c]),{connections:e,loading:i,error:a,refresh:c}}const Nj=[50,100,500,1e3];function Tj(e){const[t,i]=E.useState([]),[n,a]=E.useState(null),[l,c]=E.useState(null),[h,m]=E.useState(null),[f,g]=E.useState(null),[b,v]=E.useState(!1),[x,y]=E.useState(!1),[w,C]=E.useState(100),[N,T]=E.useState(0);E.useEffect(()=>{T(0)},[e,n]),E.useEffect(()=>{if(i([]),a(null),c(null),m(null),g(null),!e)return;let R=!1;return v(!0),rM(e).then(H=>{R||(i(H),a(H[0]?.qualifiedName??null))}).catch(H=>{R||m(H instanceof Error?H.message:String(H))}).finally(()=>{R||v(!1)}),()=>{R=!0}},[e]),E.useEffect(()=>{if(c(null),g(null),!e||!n)return;let R=!1;return y(!0),aM(e,n,w,N).then(H=>{R||c(H)}).catch(H=>{R||g(H instanceof Error?H.message:String(H))}).finally(()=>{R||y(!1)}),()=>{R=!0}},[e,n,w,N]);const D=N>0,A=l?l.rowCount===w:!1;function L(R){C(R),T(0)}function G(){A&&T(R=>R+w)}function j(){T(R=>Math.max(0,R-w))}return{tables:t,selectedTable:n,setSelectedTable:a,sample:l,tablesError:h,rowsError:f,loadingTables:b,loadingRows:x,limit:w,offset:N,canPrev:D,canNext:A,changePageSize:L,nextPage:G,prevPage:j}}function Aj(){const{connections:e,loading:t,error:i,refresh:n}=kj(),{error:a,success:l}=qi(),[c,h]=E.useState(null),[m,f]=E.useState(null);E.useEffect(()=>{if(e.length===0){h(null);return}h(v=>v&&e.some(x=>x.name===v)?v:e[0].name)},[e]);async function g(v){try{await nM(v),l(`Removed connection "${v}".`),await n()}catch(x){a(x instanceof Error?x.message:String(x))}}function b(v){f({mode:"edit",target:v})}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[u.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(za,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Databases"}),t&&e.length===0?u.jsx(as,{className:"size-3.5 animate-spin text-muted-foreground"}):null]}),u.jsx(Ej,{connections:e,selected:c,onSelect:h,onAdd:()=>f({mode:"add"}),onEdit:b,onRemove:v=>{g(v)}})]}),u.jsx("div",{className:"min-h-0 flex-1",children:i?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:i})}):c?u.jsx(Mj,{connection:c}):u.jsx(Rj,{onAdd:()=>f({mode:"add"})})}),m?u.jsx(yj,{initial:m.mode==="edit"?m.target:void 0,onClose:()=>f(null),onSaved:n}):null]})}function Mj({connection:e}){const{tables:t,selectedTable:i,setSelectedTable:n,sample:a,tablesError:l,rowsError:c,loadingTables:h,loadingRows:m,limit:f,offset:g,canPrev:b,canNext:v,changePageSize:x,nextPage:y,prevPage:w}=Tj(e);return u.jsxs("div",{className:"flex h-full min-h-0",children:[u.jsxs("div",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(j4,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Tables"}),u.jsx(Ke,{variant:"outline",size:"small",children:t.length}),h?u.jsx(as,{className:"size-3.5 animate-spin"}):null]}),l?u.jsx("div",{className:"p-3",children:u.jsx(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:l})}):u.jsxs("ul",{className:"min-h-0 flex-1 overflow-auto",children:[t.map(C=>u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>n(C.qualifiedName),className:fe("w-full truncate px-3 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-muted/50",C.qualifiedName===i&&"bg-muted/70 font-semibold"),children:C.qualifiedName})},C.qualifiedName)),!h&&t.length===0?u.jsx("li",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No tables."}):null]})]}),u.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i??"Select a table"}),a?u.jsxs("div",{className:"flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[u.jsx("span",{className:"tabular-nums",children:a.rowCount===0?"no rows":`rows ${g+1}–${g+a.rowCount}`}),u.jsx("select",{"aria-label":"Rows per page",className:"rounded-md border border-border bg-background px-1.5 py-0.5 text-[11px]",value:f,onChange:C=>x(Number(C.target.value)),children:Nj.map(C=>u.jsxs("option",{value:C,children:[C," / page"]},C))}),u.jsx(de,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:w,disabled:!b,type:"button",children:"Prev"}),u.jsx(de,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:y,disabled:!v,type:"button",children:"Next"})]}):null]}),c?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:c})}):m?u.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[u.jsx(as,{className:"mr-2 size-4 animate-spin"}),"Loading rows…"]}):a?u.jsx(Cj,{connection:e,sample:a}):u.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"Pick a table to sample its rows."})]})]})}function Rj({onAdd:e}){return u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(za,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No connections yet"}),u.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Add a read-only Postgres, MySQL, or SQLite connection to browse tables and sample rows. NoMoreIDE can auto-detect connection strings from your services' ",u.jsx("code",{children:".env"})," files."]}),u.jsxs(de,{className:"mt-4",size:"sm",onClick:e,type:"button",children:[u.jsx(zs,{}),"Add connection"]})]})})}function Dj({incident:e}){const{error:t,success:i}=qi(),[n,a]=E.useState(!1),[l,c]=E.useState(!1),[h,m]=E.useState(!1);async function f(){a(!0);try{const{prompt:b}=await cM(e.id);await navigator.clipboard.writeText(b),c(!0),i("Copied debugging prompt to clipboard."),window.setTimeout(()=>c(!1),2e3)}catch(b){t(b instanceof Error?b.message:String(b))}finally{a(!1)}}async function g(){m(!0);try{const{markdown:b}=await uM(e.id);await navigator.clipboard.writeText(b),i("Copied repro bundle to clipboard.")}catch(b){t(b instanceof Error?b.message:String(b))}finally{m(!1)}}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-3",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Ke,{variant:e.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:e.level}),u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:e.service}),e.count>1?u.jsxs(Ke,{variant:"outline",size:"small",children:["×",e.count]}):null]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(de,{onClick:()=>{g()},disabled:h,size:"sm",variant:"outline",children:[u.jsx(XA,{}),h?"Bundling…":"Copy repro bundle"]}),u.jsxs(de,{onClick:()=>{f()},disabled:n,size:"sm",children:[l?u.jsx(Qo,{}):u.jsx(WT,{}),l?"Copied":"Copy to agent"]})]})]}),u.jsx("p",{className:"mt-1.5 break-words font-mono text-xs text-foreground",children:e.title}),e.file?u.jsxs("p",{className:"mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[u.jsx(V2,{className:"size-3.5"}),e.file,e.line?`:${e.line}`:""]}):null,u.jsxs("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground/80",children:["first ",new Date(e.firstSeen).toLocaleString()," · last"," ",new Date(e.lastSeen).toLocaleTimeString()]})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[u.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Log excerpt"}),u.jsx("pre",{className:"overflow-x-auto rounded-md border border-border bg-muted/40 p-3 font-mono text-[11px] leading-relaxed",children:e.logExcerpt.join(`
|
|
17
|
+
`)}),u.jsx("p",{className:"mt-3 text-[11px] text-muted-foreground",children:'"Copy to agent" bundles this excerpt with the affected file\'s diff and the last 40 log lines. "Copy repro bundle" adds the service\'s runtime state and masked `.env` for sharing.'})]})]})}function fS(e){return[...e].sort((t,i)=>t.lastSeen<i.lastSeen?1:t.lastSeen>i.lastSeen?-1:i.id-t.id)}function Oj(){const[e,t]=E.useState([]),[i,n]=E.useState(!1),[a,l]=E.useState(null),c=E.useCallback(h=>{t(m=>fS([...m.filter(f=>f.id!==h.id),h]))},[]);return E.useEffect(()=>{let h=!0;lM().then(f=>{h&&t(fS(f))}).catch(f=>{h&&l(f instanceof Error?f.message:String(f))});const m=new EventSource("/api/errors/stream");return m.addEventListener("open",()=>n(!0)),m.addEventListener("error",()=>n(!1)),m.addEventListener("incident",f=>{try{const g=JSON.parse(f.data);c(g)}catch{}}),()=>{h=!1,m.close()}},[c]),{incidents:e,connected:i,error:a}}function jj(){const{incidents:e,connected:t,error:i}=Oj(),[n,a]=E.useState(null);E.useEffect(()=>{if(e.length===0){a(null);return}a(c=>c!==null&&e.some(h=>h.id===c)?c:e[0].id)},[e]);const l=E.useMemo(()=>e.find(c=>c.id===n)??null,[e,n]);return u.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[u.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(pg,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Incidents"}),u.jsx(Ke,{variant:"outline",size:"small",children:e.length})]}),u.jsx(Ke,{variant:"outline",size:"small",icon:u.jsx("span",{className:fe("inline-block size-1.5 rounded-full",t?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:t?"live":"reconnecting…"})]}),u.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border overflow-auto",children:e.map(c=>u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>a(c.id),className:fe("flex w-full flex-col gap-1 px-3 py-2 text-left transition-colors hover:bg-muted/50",c.id===n&&"bg-muted/70"),children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-[11px] font-semibold",children:c.service}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c.count>1?u.jsxs(Ke,{variant:"outline",size:"small",children:["×",c.count]}):null,u.jsx(Ke,{variant:c.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:c.level})]})]}),u.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:c.title}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:new Date(c.lastSeen).toLocaleTimeString()})]})},c.id))})]}),u.jsx("div",{className:"min-h-0 flex-1",children:i?u.jsx("div",{className:"p-4",children:u.jsxs(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load incidents: ",i]})}):l?u.jsx(Dj,{incident:l}):u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(pg,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No incidents yet"}),u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Errors and stack traces from your running services land here automatically. Each one becomes a one-click prompt for your agent."})]})})})]})}const Lj={top:"bottom-full left-1/2 mb-1.5 -translate-x-1/2",bottom:"top-full left-1/2 mt-1.5 -translate-x-1/2",left:"right-full top-1/2 mr-1.5 -translate-y-1/2",right:"left-full top-1/2 ml-1.5 -translate-y-1/2"};function Hr({label:e,children:t,side:i="bottom",className:n}){return u.jsxs("span",{className:fe("group/tt relative inline-flex",n),children:[t,u.jsx("span",{role:"tooltip",className:fe("pointer-events-none absolute z-[1100] whitespace-nowrap rounded-md bg-foreground px-2 py-1 text-xs font-medium text-background shadow-md","opacity-0 transition-opacity duration-150 group-hover/tt:opacity-100",Lj[i]),children:e})]})}function Bj({context:e}){const[t,i]=E.useState(!1);if(!e)return u.jsx("div",{className:"rounded-md border border-border bg-muted/30 p-3 text-xs text-muted-foreground",children:"No agent context available yet."});async function n(){try{await navigator.clipboard.writeText(e),i(!0),window.setTimeout(()=>i(!1),1500)}catch{i(!1)}}return u.jsxs("section",{"aria-label":"Agent context",className:"rounded-md border border-border bg-muted/30 p-3","data-testid":"agent-context-panel",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-medium",children:[u.jsx(Tc,{className:"size-3.5"}),"Agent context"]}),u.jsxs(de,{onClick:n,size:"sm",type:"button",variant:"outline",children:[t?u.jsx(Qo,{className:"size-3.5"}):u.jsx(H2,{className:"size-3.5"}),t?"Copied":"Copy"]})]}),u.jsx("pre",{className:"mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded bg-background p-3 font-mono text-[11px] leading-relaxed",children:e})]})}function Ds({className:e,...t}){return u.jsx("label",{className:fe("grid gap-1.5 text-xs font-medium text-muted-foreground",e),...t})}const Us='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>',Hs='</title><path d="',Fs='"/></svg>',zj={title:".NET",slug:"dotnet",get svg(){return Us+".NET"+Hs+this.path+Fs},path:"M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z",source:"https://github.com/dotnet/brand/blob/c7d0f51b8ec59531332d05fb27a5b758a7a3d689/logo/dotnet-logo.svg",hex:"512BD4",guidelines:"https://github.com/dotnet/brand/blob/c7d0f51b8ec59531332d05fb27a5b758a7a3d689/dotnet-styleGuide-2024.pdf",license:{type:"CC0-1.0",url:"https://spdx.org/licenses/CC0-1.0"}},Ij={title:"Bun",slug:"bun",get svg(){return Us+"Bun"+Hs+this.path+Fs},path:"M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z",source:"https://bun.sh/press-kit",hex:"000000"},Pj={title:"Deno",slug:"deno",get svg(){return Us+"Deno"+Hs+this.path+Fs},path:"M1.105 18.02A11.9 11.9 0 0 1 0 12.985q0-.698.078-1.376a12 12 0 0 1 .231-1.34A12 12 0 0 1 4.025 4.02a12 12 0 0 1 5.46-2.771 12 12 0 0 1 3.428-.23c1.452.112 2.825.477 4.077 1.05a12 12 0 0 1 2.78 1.774 12.02 12.02 0 0 1 4.053 7.078A12 12 0 0 1 24 12.985q0 .454-.036.914a12 12 0 0 1-.728 3.305 12 12 0 0 1-2.38 3.875c-1.33 1.357-3.02 1.962-4.43 1.936a4.4 4.4 0 0 1-2.724-1.024c-.99-.853-1.391-1.83-1.53-2.919a5 5 0 0 1 .128-1.518c.105-.38.37-1.116.76-1.437-.455-.197-1.04-.624-1.226-.829-.045-.05-.04-.13 0-.183a.155.155 0 0 1 .177-.053c.392.134.869.267 1.372.35.66.111 1.484.25 2.317.292 2.03.1 4.153-.813 4.812-2.627s.403-3.609-1.96-4.685-3.454-2.356-5.363-3.128c-1.247-.505-2.636-.205-4.06.582-3.838 2.121-7.277 8.822-5.69 15.032a.191.191 0 0 1-.315.19 12 12 0 0 1-1.25-1.634 12 12 0 0 1-.769-1.404M11.57 6.087c.649-.051 1.214.501 1.31 1.236.13.979-.228 1.99-1.41 2.013-1.01.02-1.315-.997-1.248-1.614.066-.616.574-1.575 1.35-1.635",source:"https://github.com/denoland/docs/blob/5dee713844c7447f80acd4093caa9d350d80bf36/static/img/logo.svg",hex:"000000",guidelines:"https://deno.com/brand",license:{type:"MIT",url:"https://spdx.org/licenses/MIT"}},Uj={title:"Docker",slug:"docker",get svg(){return Us+"Docker"+Hs+this.path+Fs},path:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z",source:"https://www.docker.com/company/newsroom/media-resources",hex:"2496ED"},Hj={title:"Go",slug:"go",get svg(){return Us+"Go"+Hs+this.path+Fs},path:"M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z",source:"https://blog.golang.org/go-brand",hex:"00ADD8",guidelines:"https://blog.golang.org/go-brand"},Fj={title:"Node.js",slug:"nodedotjs",get svg(){return Us+"Node.js"+Hs+this.path+Fs},path:"M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z",source:"https://nodejs.org/en/about/branding",hex:"5FA04E",guidelines:"https://nodejs.org/en/about/branding"},$j={title:"npm",slug:"npm",get svg(){return Us+"npm"+Hs+this.path+Fs},path:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z",source:"https://www.npmjs.com",hex:"CB3837",guidelines:"https://docs.npmjs.com/policies/logos-and-usage"},Vj={title:"pnpm",slug:"pnpm",get svg(){return Us+"pnpm"+Hs+this.path+Fs},path:"M0 0v7.5h7.5V0zm8.25 0v7.5h7.498V0zm8.25 0v7.5H24V0zM2 2h3.5v3.5H2zm8.25 0h3.498v3.5H10.25zm8.25 0H22v3.5h-3.5zM8.25 8.25v7.5h7.498v-7.5zm8.25 0v7.5H24v-7.5zm2 2H22v3.5h-3.5zM0 16.5V24h7.5v-7.5zm8.25 0V24h7.498v-7.5zm8.25 0V24H24v-7.5z",source:"https://pnpm.io/logos",hex:"F69220"},qj={title:"Python",slug:"python",get svg(){return Us+"Python"+Hs+this.path+Fs},path:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z",source:"https://www.python.org/community/logos/",hex:"3776AB",guidelines:"https://www.python.org/community/logos/"},mS={title:"Rust",slug:"rust",get svg(){return Us+"Rust"+Hs+this.path+Fs},path:"M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z",source:"https://www.rust-lang.org",hex:"000000",guidelines:"https://www.rust-lang.org/policies/media-guide",license:{type:"CC-BY-SA-4.0",url:"https://spdx.org/licenses/CC-BY-SA-4.0"}},Kj={title:"Vite",slug:"vite",get svg(){return Us+"Vite"+Hs+this.path+Fs},path:"M13.056 23.238a.57.57 0 0 1-1.02-.355v-5.202c0-.63-.512-1.143-1.144-1.143H5.148a.57.57 0 0 1-.464-.903l3.777-5.29c.54-.753 0-1.804-.93-1.804H.57a.574.574 0 0 1-.543-.746.6.6 0 0 1 .08-.157L5.008.78a.57.57 0 0 1 .467-.24h14.589a.57.57 0 0 1 .466.903l-3.778 5.29c-.54.755 0 1.806.93 1.806h5.745c.238 0 .424.138.513.322a.56.56 0 0 1-.063.603z",source:"https://github.com/voidzero-dev/community-design-resources/blob/55902097229cf01cf2a4ceb376f992f5cf306756/brand-assets/vite/vite-icon-color-bracketless.svg",hex:"9135FF"},Gj={title:"Yarn",slug:"yarn",get svg(){return Us+"Yarn"+Hs+this.path+Fs},path:"M12 0C5.375 0 0 5.375 0 12s5.375 12 12 12 12-5.375 12-12S18.625 0 12 0zm.768 4.105c.183 0 .363.053.525.157.125.083.287.185.755 1.154.31-.088.468-.042.551-.019.204.056.366.19.463.375.477.917.542 2.553.334 3.605-.241 1.232-.755 2.029-1.131 2.576.324.329.778.899 1.117 1.825.278.774.31 1.478.273 2.015a5.51 5.51 0 0 0 .602-.329c.593-.366 1.487-.917 2.553-.931.714-.009 1.269.445 1.353 1.103a1.23 1.23 0 0 1-.945 1.362c-.649.158-.95.278-1.821.843-1.232.797-2.539 1.242-3.012 1.39a1.686 1.686 0 0 1-.704.343c-.737.181-3.266.315-3.466.315h-.046c-.783 0-1.214-.241-1.45-.491-.658.329-1.51.19-2.122-.134a1.078 1.078 0 0 1-.58-1.153 1.243 1.243 0 0 1-.153-.195c-.162-.25-.528-.936-.454-1.946.056-.723.556-1.367.88-1.71a5.522 5.522 0 0 1 .408-2.256c.306-.727.885-1.348 1.32-1.737-.32-.537-.644-1.367-.329-2.21.227-.602.412-.936.82-1.08h-.005c.199-.074.389-.153.486-.259a3.418 3.418 0 0 1 2.298-1.103c.037-.093.079-.185.125-.283.31-.658.639-1.029 1.024-1.168a.94.94 0 0 1 .328-.06zm.006.7c-.507.016-1.001 1.519-1.001 1.519s-1.27-.204-2.266.871c-.199.218-.468.334-.746.44-.079.028-.176.023-.417.672-.371.991.625 2.094.625 2.094s-1.186.839-1.626 1.881c-.486 1.144-.338 2.261-.338 2.261s-.843.732-.899 1.487c-.051.663.139 1.2.343 1.515.227.343.51.176.51.176s-.561.653-.037.931c.477.25 1.283.394 1.71-.037.31-.31.371-1.001.486-1.283.028-.065.12.111.209.199.097.093.264.195.264.195s-.755.324-.445 1.066c.102.246.468.403 1.066.398.222-.005 2.664-.139 3.313-.296.375-.088.505-.283.505-.283s1.566-.431 2.998-1.357c.917-.598 1.293-.76 2.034-.936.612-.148.57-1.098-.241-1.084-.839.009-1.575.44-2.196.825-1.163.718-1.742.672-1.742.672l-.018-.032c-.079-.13.371-1.293-.134-2.678-.547-1.515-1.413-1.881-1.344-1.997.297-.5 1.038-1.297 1.334-2.78.176-.899.13-2.377-.269-3.151-.074-.144-.732.241-.732.241s-.616-1.371-.788-1.483a.271.271 0 0 0-.157-.046z",source:"https://github.com/yarnpkg/assets/blob/76d30ca2aebed5b73ea8131d972218fb860bd32d/yarn-kitten-circle.svg",hex:"2C8EBB",guidelines:"https://github.com/yarnpkg/assets/tree/76d30ca2aebed5b73ea8131d972218fb860bd32d",license:{type:"CC-BY-4.0",url:"https://spdx.org/licenses/CC-BY-4.0"}};function Wj(e){const t=e.toLowerCase();return/\bvite\b/.test(t)?is.vite:/\bcargo\s+/.test(t)?is.cargo:/\brustc\b/.test(t)?is.rust:/\bdotnet\b/.test(t)?is.dotnet:/\bdocker(?:\s+compose|-compose|\s+)/.test(t)?is.docker:/\bpython3?\b|\buvicorn\b|\bfastapi\b/.test(t)?is.python:/\bgo\s+(run|test|build)\b|\bair\b/.test(t)?is.go:/\bbun\b/.test(t)?is.bun:/\bdeno\b/.test(t)?is.deno:/\bpnpm\b/.test(t)?is.pnpm:/\byarn\b/.test(t)?is.yarn:/\bnpm\b/.test(t)?is.npm:/\bnode\b/.test(t)?is.node:is.generic}const is={bun:{kind:"bun",label:"Bun"},cargo:{kind:"cargo",label:"Cargo"},deno:{kind:"deno",label:"Deno"},dotnet:{kind:"dotnet",label:".NET"},docker:{kind:"docker",label:"Docker"},generic:{kind:"generic",label:"Process"},go:{kind:"go",label:"Go"},node:{kind:"node",label:"Node"},npm:{kind:"npm",label:"npm"},pnpm:{kind:"pnpm",label:"pnpm"},python:{kind:"python",label:"Python"},rust:{kind:"rust",label:"Rust"},vite:{kind:"vite",label:"Vite"},yarn:{kind:"yarn",label:"Yarn"}};function b_({command:e,compact:t}){const i=Wj(e),n=Yj[i.kind];return u.jsx("span",{"aria-label":`${i.label} process`,className:fe("inline-flex shrink-0 items-center justify-center rounded-md border bg-card shadow-sm dark:bg-zinc-100",t?"size-6":"size-7",n?"border-border":"border-border bg-muted text-muted-foreground dark:bg-zinc-100 dark:text-zinc-700"),style:n?{color:`#${n.hex}`}:void 0,title:i.label,children:n?u.jsx("svg",{"aria-hidden":"true",className:t?"size-3.5":"size-4",fill:"currentColor",role:"img",viewBox:"0 0 24 24",children:u.jsx("path",{d:n.path})}):u.jsx(eE,{className:t?"size-3.5":"size-4"})})}const Yj={bun:Ij,cargo:mS,deno:Pj,dotnet:zj,docker:Uj,generic:null,go:Hj,node:Fj,npm:$j,pnpm:Vj,python:qj,rust:mS,vite:Kj,yarn:Gj},Xj=[{label:"npm",command:"npm run dev",description:"Node dev server"},{label:"pnpm",command:"pnpm dev",description:"pnpm dev server"},{label:"yarn",command:"yarn dev",description:"Yarn dev server"},{label:"bun",command:"bun dev",description:"Bun dev server"},{label:"Deno",command:"deno task dev",description:"Deno dev task"},{label:"Vite",badgeCommand:"vite",command:"npm run dev -- --host 127.0.0.1",description:"Vite app"},{label:"Go",command:"go run .",description:"Go app"},{label:"Rust",command:"cargo run",description:"Rust app"},{label:".NET",command:"dotnet watch run",description:".NET app"},{label:"Python",command:"python manage.py runserver",description:"Python app"},{label:"Docker",command:"docker compose up",description:"Docker Compose stack"}],pS=[{value:"local",label:"Local",hint:"Run a command in a local working directory."},{value:"docker-compose",label:"Docker Compose",hint:"Bring up a service defined in a docker-compose.yml file."},{value:"ssh",label:"SSH (remote)",hint:"Run a command on a remote host using your local ~/.ssh/config + ssh-agent."}];function Zj({result:e}){const t=[...e.stdout,...e.stderr].slice(0,4);return u.jsxs(dt,{variant:e.ok?"default":"destructive",children:[u.jsx("div",{className:"font-medium",children:e.ok?"Command test passed":"Command test failed"}),u.jsx("div",{className:"mt-1 text-xs",children:e.message}),t.length?u.jsx("pre",{className:"mt-2 max-h-24 overflow-auto rounded-md bg-background/80 p-2 font-mono text-[11px] leading-4",children:t.join(`
|
|
18
|
+
`)}):null]})}function v_({active:e,baseUrl:t,compact:i=!1,onRefresh:n,onStarted:a,restartAction:l,solidStart:c=!1,targetLabel:h}){return e?u.jsxs(u.Fragment,{children:[u.jsx(fp,{compact:i,intent:"restart",icon:u.jsx(Z2,{}),label:"Restart",action:l,targetLabel:h,url:`${t}/restart`,onRefresh:n,onSuccess:a}),u.jsx(fp,{compact:i,intent:"stop",icon:u.jsx(Ch,{}),label:"Stop",targetLabel:h,url:`${t}/stop`,onRefresh:n})]}):u.jsx(fp,{compact:i,intent:c?"startSolid":"start",icon:u.jsx(Y2,{}),label:"Start",targetLabel:h,url:`${t}/start`,onRefresh:n,onSuccess:a})}function Bc(e,t,i){const n=i instanceof Error?i.message:String(i);return`${e} failed for ${t}: ${n}`}function fp({action:e,compact:t=!1,intent:i="neutral",icon:n,label:a,targetLabel:l,url:c,onRefresh:h,onSuccess:m}){const[f,g]=E.useState(!1),[b,v]=E.useState(null),{error:x,success:y}=qi();async function w(N={}){g(!0);try{e?await e():await rs(c,N),y(`${a} requested for ${l}.`),await h(),v(null),m?.()}catch(T){T instanceof tE?v(T.conflict):x(Bc(a,l,T))}finally{g(!1)}}const C=u.jsxs(de,{"aria-label":a,className:`${Jj[i]} ${t?"size-7":""}`.trim(),disabled:f,onClick:()=>w(),size:t?"icon":"sm",variant:"outline",children:[n,t?null:a]});return u.jsxs(u.Fragment,{children:[t?u.jsx(Hr,{label:a,children:C}):C,b?u.jsx(Qj,{busy:f,conflict:b,onCancel:()=>v(null),onKillAndStart:()=>w({strategy:"killHolder"}),targetLabel:l}):null]})}function Qj({busy:e,conflict:t,onCancel:i,onKillAndStart:n,targetLabel:a}){const l=t.holder,c=`http://localhost:${t.port}/`;return u.jsx(Xn,{icon:u.jsx(q4,{}),onClose:e?()=>{}:i,title:`Port ${t.port} is already in use`,children:u.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:a})," wants port"," ",u.jsx("span",{className:"font-mono",children:t.port}),", but it's already held by:"]}),u.jsx("pre",{className:"overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:l?`pid ${l.pid}${l.pgid?` (pgid ${l.pgid})`:""}
|
|
19
|
+
${l.command}`:"unknown process"}),u.jsxs("div",{className:"flex flex-wrap justify-end gap-2 pt-2",children:[u.jsx(de,{onClick:i,size:"sm",type:"button",variant:"outline",disabled:e,children:"Cancel"}),u.jsxs(de,{onClick:()=>window.open(c,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",disabled:e,children:[u.jsx(F2,{}),"Open in browser"]}),u.jsx(de,{className:"border-red-600 bg-red-600 text-white hover:bg-red-700",disabled:e||!l,onClick:n,size:"sm",type:"button",children:"Stop holder & start"})]})]})})}const Jj={neutral:"",restart:"border-amber-600 bg-amber-600 text-white hover:bg-amber-700",start:"",startSolid:"border-emerald-600 bg-emerald-600 text-white hover:bg-emerald-700",stop:"border-red-600 bg-red-600 text-white hover:bg-red-700"};function eL({cwd:e,onRefresh:t,onSaved:i,initialService:n}){const{error:a,success:l}=qi(),c=!!n,[h,m]=E.useState(n?.kind??"local"),[f,g]=E.useState(n?.name??""),[b,v]=E.useState(n?.command??""),[x,y]=E.useState(n?.cwd??e),[w,C]=E.useState(n?.port?String(n.port):""),[N,T]=E.useState(n?.description??""),[D,A]=E.useState(n?.composeFile??""),[L,G]=E.useState(n?.composeService??""),[j,R]=E.useState(n?.host??""),[H,I]=E.useState(null),[W,J]=E.useState(!1);E.useEffect(()=>{I(null)},[b,x,w,h]);function P(){g(""),v(""),y(e),C(""),T(""),A(""),G(""),R(""),I(null)}async function te(M){M.preventDefault();try{const $={name:f,kind:h,cwd:x,port:w,description:N};(h==="local"||h==="ssh")&&($.command=b),h==="docker-compose"&&($.composeFile=D,$.composeService=L),h==="ssh"&&($.host=j),await rs("/api/services",$),c||P(),l(c?`${f} updated.`:`${f} added.`),await t(),i?.()}catch($){a(Bc(c?"Update service":"Add service",f||"service",$))}}async function K(){if(!b.trim()){a("Test command failed for service: command is required.");return}J(!0);try{I(await RM({command:b,cwd:x,port:w}))}catch(M){a(Bc("Test command",f||"service",M))}finally{J(!1)}}return{editing:c,kind:h,setKind:m,name:f,setName:g,command:b,setCommand:v,formCwd:x,setFormCwd:y,port:w,setPort:C,description:N,setDescription:T,composeFile:D,setComposeFile:A,composeService:L,setComposeService:G,host:j,setHost:R,testResult:H,testing:W,submit:te,testCommand:K}}function gS({cwd:e,onRefresh:t,onSaved:i,initialService:n}){const{editing:a,kind:l,setKind:c,name:h,setName:m,command:f,setCommand:g,formCwd:b,setFormCwd:v,port:x,setPort:y,description:w,setDescription:C,composeFile:N,setComposeFile:T,composeService:D,setComposeService:A,host:L,setHost:G,testResult:j,testing:R,submit:H,testCommand:I}=eL({cwd:e,onRefresh:t,onSaved:i,initialService:n}),W=pS.find(K=>K.value===l),J=l==="local"&&f.trim().length>0&&b.trim().length>0,P="grid gap-2 rounded-md border border-border bg-muted/30 p-3",te="px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground";return u.jsxs("form",{className:"grid gap-3",onSubmit:H,children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[u.jsxs("fieldset",{className:`${P} sm:col-span-2`,children:[u.jsx("legend",{className:te,children:"Step 1 · Service kind"}),u.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:pS.map(K=>u.jsx(de,{className:"justify-center",disabled:a,onClick:()=>c(K.value),size:"sm",type:"button",variant:l===K.value?"default":"outline",children:K.label},K.value))}),u.jsx("p",{className:"text-[11px] text-muted-foreground",children:W.hint})]}),u.jsxs("div",{className:"grid gap-3 sm:col-start-1 sm:row-start-2 sm:self-start",children:[u.jsxs("fieldset",{className:P,children:[u.jsx("legend",{className:te,children:"Step 2 · Identity"}),u.jsxs(Ds,{children:["Name",u.jsx(ot,{className:"h-8 text-sm",name:"name",onChange:K=>m(K.target.value),placeholder:"backend",readOnly:a,required:!0,value:h}),a?u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Name is the service key and can't be changed here."}):null]}),u.jsxs(Ds,{children:["Description",u.jsx(ot,{className:"h-8 text-sm",name:"description",onChange:K=>C(K.target.value),placeholder:"API server",value:w})]})]}),u.jsxs("fieldset",{className:P,children:[u.jsx("legend",{className:te,children:"Step 4 · Networking (optional)"}),u.jsxs(Ds,{children:["Port",u.jsx(ot,{className:"h-8 text-sm",inputMode:"numeric",name:"port",onChange:K=>y(K.target.value),placeholder:"3001",value:x})]})]})]}),l==="local"?u.jsxs("fieldset",{className:`${P} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:te,children:"Step 3 · Local command"}),u.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4",children:Xj.map(K=>u.jsxs(de,{className:"justify-start gap-1.5",onClick:()=>{g(K.command),C(K.description)},size:"sm",type:"button",variant:"outline",children:[u.jsx(b_,{command:K.badgeCommand??K.command,compact:!0}),u.jsx("span",{className:"truncate",children:K.label})]},K.label))}),u.jsxs(Ds,{children:["Command",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"command",onChange:K=>g(K.target.value),placeholder:"npm run dev",required:!0,value:f})]}),u.jsxs(Ds,{children:["Working Directory",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"cwd",onChange:K=>v(K.target.value),required:!0,value:b})]})]}):null,l==="docker-compose"?u.jsxs("fieldset",{className:`${P} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:te,children:"Step 3 · Docker Compose target"}),u.jsxs(Ds,{children:["Compose Service",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"composeService",onChange:K=>A(K.target.value),placeholder:"api",required:!0,value:D})]}),u.jsxs(Ds,{children:["Compose File (optional)",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"composeFile",onChange:K=>T(K.target.value),placeholder:"docker-compose.yml",value:N})]}),u.jsxs(Ds,{children:["Working Directory (where compose file lives)",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"cwd",onChange:K=>v(K.target.value),required:!0,value:b})]})]}):null,l==="ssh"?u.jsxs("fieldset",{className:`${P} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:te,children:"Step 3 · SSH connection"}),u.jsxs(Ds,{children:["SSH Host (alias from ~/.ssh/config)",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"host",onChange:K=>G(K.target.value),placeholder:"devbox",required:!0,value:L})]}),u.jsxs(Ds,{children:["Remote Command",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"command",onChange:K=>g(K.target.value),placeholder:"npm run dev",required:!0,value:f})]}),u.jsxs(Ds,{children:["Remote Working Directory",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"cwd",onChange:K=>v(K.target.value),placeholder:"/srv/app",required:!0,value:b})]}),u.jsxs(dt,{variant:"muted",children:[u.jsx("div",{className:"font-medium",children:"SSH key handling"}),u.jsxs("div",{className:"mt-1 text-xs",children:["NoMoreIDE never stores key files. Add a ",u.jsxs("code",{children:["Host ",L||"<alias>"]})," entry to",u.jsx("code",{children:" ~/.ssh/config"})," with ",u.jsx("code",{children:"HostName"}),", ",u.jsx("code",{children:"User"}),", and"," ",u.jsx("code",{children:"IdentityFile ~/.ssh/your-key.pem"})," (chmod 0600). Make sure"," ",u.jsx("code",{children:"ssh-agent"})," is running or your key is loaded (",u.jsx("code",{children:"ssh-add ~/.ssh/your-key.pem"}),"). NoMoreIDE will run"," ",u.jsxs("code",{children:["ssh ",L||"<alias>"]})," using that config."]})]})]}):null]}),j?u.jsx(Zj,{result:j}):null,u.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[l==="local"?u.jsxs(de,{disabled:R||!J,onClick:I,type:"button",variant:"outline",children:[u.jsx(eE,{}),R?"Testing...":"Test Command"]}):null,u.jsx(de,{type:"submit",children:a?"Save Service":"Add Service"})]})]})}function hk({initialName:e="",initialServices:t=[],onSaved:i,onRefresh:n,originalName:a,services:l,submitLabel:c="Save Group"}){const{error:h,success:m}=qi();async function f(g){g.preventDefault();const b=g.currentTarget,v=new FormData(b),x=String(v.get("name")??""),y=v.getAll("services").map(w=>String(w)).filter(Boolean);try{await rs("/api/bundles",{name:x,originalName:a,services:y.join(",")}),b.reset(),m(`${x} group saved.`),await n(),i?.()}catch(w){h(Bc("Save group",x||"group",w))}}return u.jsxs("form",{className:"grid gap-2.5",onSubmit:f,children:[u.jsxs(Ds,{children:["Group name",u.jsx(ot,{className:"h-8 text-sm",defaultValue:e,name:"name",placeholder:"full-stack",required:!0})]}),u.jsxs("fieldset",{className:"grid gap-1.5",children:[u.jsx("legend",{className:"text-xs font-medium",children:"Services"}),l.length?l.map(g=>u.jsxs("label",{className:"flex items-center gap-2 overflow-hidden rounded-md border border-border px-2.5 py-1.5 text-sm",children:[u.jsx("input",{className:"size-4 shrink-0 accent-primary",defaultChecked:t.includes(g.name),name:"services",type:"checkbox",value:g.name}),u.jsx(b_,{command:g.command??"",compact:!0}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate text-sm font-medium",children:g.name}),u.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:g.command??g.kind??""})]})]},g.name)):u.jsx(dt,{variant:"muted",children:"All services are already grouped, or none registered."})]}),u.jsx(de,{className:"h-8",disabled:!l.length,type:"submit",children:c})]})}function oh({label:e}){return u.jsx(dt,{variant:"muted",className:"m-4 text-center",children:e})}const tL=900*1e3,pc=12,mp=200;function iL({events:e}){const[t,i]=E.useState(null),[n,a]=E.useState(null),{rows:l,windowStart:c,windowEnd:h}=E.useMemo(()=>sL(e),[e]),m=t?l.find(f=>f.service===t)??null:null;return u.jsxs(u.Fragment,{children:[u.jsxs(Qn,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(Jn,{className:"border-b border-border px-3 py-2",children:[u.jsxs(er,{className:"flex items-center gap-2",children:[u.jsx(Go,{className:"size-3.5"}),"Runtime Monitor"]}),u.jsx(Qr,{className:"text-xs",children:e.length===0?"No events yet":`${e.length} event${e.length===1?"":"s"} · last 15 min`})]}),u.jsx(tr,{className:"p-0",children:l.length===0?u.jsx(oh,{label:"No runtime timeline events yet."}):u.jsxs("div",{className:"divide-y divide-border",children:[l.map(f=>u.jsx(rL,{onClick:()=>i(f.service),row:f,windowEnd:h,windowStart:c},f.service)),u.jsxs("div",{className:"flex justify-between px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:[u.jsx("span",{children:lh(c)}),u.jsx("span",{children:"now"})]})]})})]}),m?u.jsx(Xn,{icon:u.jsx(Go,{}),onClose:()=>i(null),title:m.service,children:u.jsx(oL,{onSelect:a,row:m})}):null,n?u.jsx(Xn,{icon:u.jsx(Go,{}),onClose:()=>a(null),title:n.title,children:u.jsx(lL,{event:n})}):null]})}function sL(e){const t=Date.now(),i=t,n=t-tL;let a=e.filter(m=>{if(m.kind==="service.http")return!1;const f=new Date(m.timestamp).getTime();return!Number.isNaN(f)&&f>=n});a.length===0&&e.length>0?a=e.slice(-mp):a.length>mp&&(a=a.slice(-mp));const l=new Map;for(const m of a){const f=m.service||"·system",g=l.get(f)??[];g.push(m),l.set(f,g)}const c=Math.max(i-n,1);return{rows:Array.from(l.entries()).map(([m,f])=>{const g=[...f].sort((T,D)=>T.timestamp.localeCompare(D.timestamp)),b=new Array(pc).fill(0),v=new Array(pc).fill(null);for(const T of g){const D=new Date(T.timestamp).getTime(),A=Math.max(n,Math.min(i,D)),L=Math.min(pc-1,Math.floor((A-n)/c*pc));b[L]+=1;const G=v[L];v[L]=nL(G,T.severity)}const x=g.filter(T=>T.severity==="error").length,y=g.filter(T=>T.severity==="warning").length,w=g.length-x-y,C=[...g].reverse().find(T=>T.severity!=="info")??null,N=x>0?"error":y>0?"warning":"info";return{service:m,events:g,errors:x,warnings:y,infos:w,buckets:b,bucketSeverity:v,lastNotable:C,worstSeverity:N}}).sort((m,f)=>{const g=v=>v.errors*1e3+v.warnings,b=g(f)-g(m);return b!==0?b:m.service.localeCompare(f.service)}),windowStart:n,windowEnd:i}}function nL(e,t){return e==="error"||t==="error"?"error":e==="warning"||t==="warning"?"warning":"info"}function rL({onClick:e,row:t,windowEnd:i,windowStart:n}){const a=Math.max(1,...t.buckets);return u.jsxs("button",{className:"timeline-service-row block w-full px-3 py-2 text-left transition-colors hover:bg-muted/40 focus:outline-none focus-visible:bg-muted/40","data-testid":"timeline-service-row",onClick:e,type:"button",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{className:fe("size-2 shrink-0 rounded-full",fk(t.worstSeverity))}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",dir:"rtl",children:u.jsx("bdi",{children:t.service})}),t.errors>0?u.jsxs("span",{className:"rounded bg-red-500/15 px-1 font-mono text-[10px] text-red-500",children:[t.errors,"E"]}):null,t.warnings>0?u.jsxs("span",{className:"rounded bg-amber-500/15 px-1 font-mono text-[10px] text-amber-500",children:[t.warnings,"W"]}):null,u.jsx(Yr,{className:"size-3 text-muted-foreground"})]}),u.jsx("div",{className:"timeline-density mt-1.5 grid h-3 gap-px","data-testid":"timeline-density",style:{gridTemplateColumns:`repeat(${pc}, minmax(0, 1fr))`},children:t.buckets.map((l,c)=>u.jsx(aL,{count:l,max:a,severity:t.bucketSeverity[c]},c))}),t.lastNotable?u.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:t.lastNotable.detail??t.lastNotable.title}):u.jsxs("div",{className:"mt-1 truncate text-[10px] text-muted-foreground",children:[t.infos," info ",t.infos===1?"event":"events"]}),u.jsxs("div",{className:"mt-0.5 flex justify-between font-mono text-[9px] text-muted-foreground/60",children:[u.jsx("span",{children:lh(n)}),u.jsx("span",{children:lh(i)})]})]})}function aL({count:e,max:t,severity:i}){if(e===0)return u.jsx("span",{className:"rounded-sm bg-border/60"});const n=Math.min(1,.35+e/t*.65);return u.jsx("span",{className:fe("rounded-sm",cL(i)),style:{opacity:n},title:`${e} event${e===1?"":"s"}`})}function oL({onSelect:e,row:t}){const i=[...t.events].sort((n,a)=>a.timestamp.localeCompare(n.timestamp));return u.jsxs("div",{className:"flex max-h-[480px] flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 text-xs text-muted-foreground",children:[u.jsxs("span",{children:[t.events.length," events"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[t.errors," error",t.errors===1?"":"s"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[t.warnings," warning",t.warnings===1?"":"s"]})]}),u.jsx("ul",{className:"min-h-0 divide-y divide-border overflow-auto",children:i.map(n=>u.jsx("li",{children:u.jsxs("button",{className:"block w-full px-4 py-2 text-left hover:bg-muted/40 focus:outline-none focus-visible:bg-muted/40",onClick:()=>e(n),type:"button",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:fe("size-2 shrink-0 rounded-full",fk(n.severity))}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",children:n.title}),u.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:lh(n.timestamp)})]}),n.detail?u.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:n.detail}):null]})},n.id))})]})}function lL({event:e}){const t=new Date(e.timestamp);return u.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:fe("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",uL(e.severity)),children:e.severity}),u.jsx("span",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.kind}),e.service?u.jsx("span",{className:"rounded border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e.service}):null]}),u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"When"}),u.jsx("div",{className:"font-mono text-xs",children:Number.isNaN(t.getTime())?e.timestamp:t.toLocaleString()})]}),e.detail?u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Detail"}),u.jsx("pre",{className:"mt-1 max-h-72 overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:e.detail})]}):null]})}function fk(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-400"}function cL(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-500"}function uL(e){return e==="error"?"bg-red-600":e==="warning"?"bg-amber-600":"bg-zinc-700"}function lh(e){const t=typeof e=="number"?new Date(e):new Date(e);return Number.isNaN(t.getTime())?"--:--:--":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function dL({health:e}){if(!e)return null;const t=e.processTree,i=e.status==="healthy"||e.status==="unknown"?void 0:pL(e.summary);return u.jsxs("div",{className:"mt-1.5 grid min-w-0 gap-2 text-[11px] text-muted-foreground sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsxs("span",{className:fe("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium",hL(e.status)),children:[u.jsx("span",{className:"inline-flex shrink-0",children:u.jsx(Go,{className:"size-3"})}),u.jsx("span",{className:"whitespace-nowrap",children:e.status})]}),i?u.jsx("span",{className:"min-w-0 truncate",children:i}):null]}),t?u.jsxs("div",{className:"health-metrics flex min-w-max items-center gap-2 font-mono sm:justify-end",children:[u.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[u.jsx(iA,{className:"size-3"}),t.processCount," ",t.processCount===1?"process":"processes"]}),u.jsxs("span",{children:[mL(t.cpuPercent)," CPU"]}),u.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[u.jsx($A,{className:"size-3"}),fL(t.rssMb)," RAM"]})]}):null]})}function hL(e){return e==="healthy"?"bg-emerald-600 text-white":e==="warning"?"bg-amber-600 text-white":e==="unhealthy"?"bg-red-600 text-white":"bg-zinc-700 text-white"}function fL(e){return Number.isInteger(e)?`${e} MB`:`${e.toFixed(1)} MB`}function mL(e){return`${e.toFixed(1)}%`}function pL(e){return e.replace(/^Recent error log:\s*/i,"Recent stderr: ").replace(/:\s*\d+(?:\.\d+)? MB RSS\.?$/i,"").replace(/\s+RSS\.?$/i,"")}function gL({ports:e}){const t=e.filter(n=>n.state==="occupied").length,i=e.filter(n=>n.state==="managed").length;return u.jsxs(Qn,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(Jn,{className:"border-b border-border px-3 py-2",children:[u.jsxs(er,{className:"flex items-center gap-2",children:[u.jsx(WA,{className:"size-3.5"}),"Ports"]}),u.jsxs(Qr,{className:"text-xs",children:[i," managed, ",t," occupied by other"]})]}),u.jsx(tr,{className:"p-0",children:e.length?u.jsx("div",{className:"divide-y divide-border",children:e.map(n=>u.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2 px-3 py-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"font-mono text-xs",children:[":",n.port]}),u.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:n.services.join(", ")||"Unassigned"}),n.urls[0]?u.jsx("div",{className:"truncate font-mono text-[10px] text-muted-foreground",children:n.urls[0]}):null]}),u.jsx(_L,{port:n})]},n.port))}):u.jsx(oh,{label:"No configured ports yet."})})]})}function _L({compact:e,port:t}){const i=t.state==="managed"?"managed":t.state==="occupied"?"occupied by other":"available",n=t.state==="managed"?"success":t.state==="occupied"?"warning":"outline";return u.jsx(Ke,{className:fe(e&&"max-w-36 truncate"),variant:n,children:i})}function bL({onChange:e,value:t}){return u.jsxs("label",{className:"relative block",children:[u.jsx(x4,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),u.jsx(ot,{"aria-label":"Search logs",className:"h-8 w-44 pl-7 text-xs",onChange:i=>e(i.target.value),placeholder:"Search logs",value:t})]})}function vL({className:e,containerRef:t,emptyText:i,logs:n,query:a}){return u.jsx("div",{className:fe("h-full max-w-full overflow-auto font-mono text-[11px] leading-5",e),ref:t,role:"log",children:n.length?n.map((l,c)=>u.jsxs("div",{className:fe("grid min-w-max grid-cols-[168px_minmax(420px,1fr)] gap-2 border-b border-border/45 px-3 py-0.5",l.stream==="stderr"?"bg-red-50/70 text-red-800":"bg-emerald-50/35 text-zinc-800"),children:[u.jsx("span",{className:"text-muted-foreground",children:l.timestamp}),u.jsxs("span",{className:"whitespace-pre-wrap break-words",children:[l.stream==="stderr"?u.jsx("span",{className:"mr-2 rounded bg-red-100 px-1 font-semibold uppercase text-red-700",children:"stderr"}):null,yL(l.text,a)]})]},`${l.timestamp}-${l.stream}-${c}`)):u.jsx("div",{className:"p-3 text-muted-foreground",children:i})})}function xL(e){return`${e.timestamp} ${e.stream} ${e.text}`}function yL(e,t){const i=t.trim();if(!i)return e;const n=e.toLowerCase(),a=i.toLowerCase(),l=[];let c=0,h=n.indexOf(a);for(;h!==-1;){h>c&&l.push(e.slice(c,h));const m=h+i.length;l.push(u.jsx("mark",{className:"rounded bg-amber-200 px-0.5 text-amber-950",children:e.slice(h,m)},`${h}-${m}`)),c=m,h=n.indexOf(a,c)}return c<e.length&&l.push(e.slice(c)),l}function _S(e){return`${e.kind}:${e.name}`}function SL(e,t=!1,i={}){const[n,a]=E.useState(),[l,c]=E.useState(),[h,m]=E.useState(e.kind==="source"),f=JSON.stringify(i);return E.useEffect(()=>{a(void 0),c(void 0);let g=!1;const b=async()=>{try{if(e.kind==="service"){const x=await nE(e.name,i);g||(a(x.logs),m(x.queryable),c(void 0))}else{const x=await iE(e.name,i);g||(a(x),m(!0),c(void 0))}}catch(x){g||c(x instanceof Error?x.message:String(x))}};b();const v=window.setInterval(b,t?1e3:2e3);return()=>{g=!0,window.clearInterval(v)}},[e.kind,e.name,t,f]),{logs:n,error:l,queryable:h}}const wL=[{label:"Live tail",value:""},{label:"Last 15 min",value:"15 min ago"},{label:"Last hour",value:"1 hour ago"},{label:"Today",value:"today"},{label:"Last 24h",value:"1 day ago"},{label:"Last 7 days",value:"7 days ago"}];function mk({target:e,query:t,setQuery:i,streaming:n,setStreaming:a,hideStdout:l,setHideStdout:c,fill:h=!1,leading:m,trailing:f}){const g=e.kind==="source",[b,v]=E.useState(""),[x,y]=E.useState(""),[w,C]=E.useState(t);E.useEffect(()=>{const V=window.setTimeout(()=>C(t),300);return()=>window.clearTimeout(V)},[t]);const N=E.useMemo(()=>{const V={};b&&(V.since=b),x&&(V.level=x);const Y=w.trim();return Y&&(V.grep=Y),V},[b,x,w]),{logs:T,error:D,queryable:A}=SL(e,n,N),L=g||A,G=E.useRef(null),j=E.useRef(!0),[R,H]=E.useState([]),[I,W]=E.useState(!1),J=JSON.stringify(N);E.useEffect(()=>{H([])},[J,e.kind,e.name]);const P=E.useMemo(()=>{const V=T??[];if(R.length===0)return V;const Y=new Set(R.map(O=>O.cursor).filter(Boolean));return[...R,...V.filter(O=>!O.cursor||!Y.has(O.cursor))]},[T,R]),te=(R[0]??(T??[])[0])?.cursor;async function K(){if(!(!L||!te||I)){W(!0),j.current=!1;try{const V={...N,before:te,lines:200},Y=e.kind==="source"?await iE(e.name,V):(await nE(e.name,V)).logs;Y.length&&H(O=>{const ee=new Set(O.map(ie=>ie.cursor).filter(Boolean));return[...Y.filter(ie=>!ie.cursor||!ee.has(ie.cursor)),...O]})}finally{W(!1)}}}const M=t.trim().toLowerCase(),$=E.useMemo(()=>{let V=P;return l&&(V=V.filter(Y=>Y.stream==="stderr")),M&&(V=V.filter(Y=>xL(Y).toLowerCase().includes(M))),V},[P,l,M]);E.useEffect(()=>{const V=G.current;if(!V)return;const Y=()=>{const O=V.scrollHeight-V.scrollTop-V.clientHeight;j.current=O<40};return Y(),V.addEventListener("scroll",Y,{passive:!0}),()=>V.removeEventListener("scroll",Y)},[]),E.useEffect(()=>{if(!n||!j.current||$.length===0)return;const V=G.current;V&&(V.scrollTop=V.scrollHeight)},[n,$]);const F=T?M?`No log lines match "${t.trim()}".`:l?"No stderr output captured.":"No log entries.":"Loading…";return u.jsxs("div",{className:h?"flex h-full min-h-0 flex-col gap-2":"flex flex-col gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m,u.jsx(bL,{onChange:i,value:t}),L?u.jsxs(u.Fragment,{children:[u.jsx("select",{"aria-label":"Time range",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:V=>v(V.target.value),value:b,children:wL.map(V=>u.jsx("option",{value:V.value,children:V.label},V.label))}),u.jsxs("select",{"aria-label":"Level",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:V=>y(V.target.value),value:x,children:[u.jsx("option",{value:"",children:"All levels"}),u.jsx("option",{value:"warn",children:"Warnings+"}),u.jsx("option",{value:"error",children:"Errors"})]})]}):u.jsxs(bS,{active:l,activeClassName:"border-amber-600 bg-amber-50 text-amber-700",onClick:()=>c(!l),children:[u.jsx(kA,{}),"Errors only"]}),u.jsxs(bS,{active:n,activeClassName:"border-emerald-600 bg-emerald-50 text-emerald-700",onClick:()=>a(!n),children:[u.jsx(m4,{}),n?"Streaming":"Stream"]}),L&&te?u.jsxs(de,{disabled:I,onClick:()=>{K()},size:"sm",type:"button",variant:"outline",children:[u.jsx(z0,{}),I?"Loading…":"Load older"]}):null,f?u.jsx("div",{className:"ml-auto flex items-center gap-2",children:f}):null]}),D?u.jsx("div",{className:"text-red-600",children:D}):null,u.jsx(vL,{className:fe("rounded border border-border/60",h?"min-h-0 flex-1":"max-h-80"),containerRef:G,emptyText:F,logs:$,query:t})]})}function bS({active:e,activeClassName:t,children:i,onClick:n}){return u.jsx(de,{"aria-pressed":e,className:e?t:void 0,onClick:n,size:"sm",type:"button",variant:"outline",children:i})}function EL(e,t){return e.kind===t.kind&&e.name===t.name}function CL({options:e,target:t,onChange:i,className:n}){const a=e.findIndex(c=>EL(c.target,t)),l=[...new Set(e.map(c=>c.group))];return u.jsx("select",{"aria-label":"Log source",className:n??"h-8 max-w-44 rounded-md border border-border bg-background px-2 text-xs",onChange:c=>i(e[Number(c.target.value)].target),value:String(a),children:l.map(c=>u.jsx("optgroup",{label:c,children:e.map((h,m)=>h.group===c?u.jsx("option",{value:String(m),children:h.label},`${h.group}:${h.label}`):null)},c))})}function kL({serviceName:e}){const[t,i]=E.useState(""),[n,a]=E.useState(!1),[l,c]=E.useState(!1),[h,m]=E.useState(!1),f=u.jsx(mk,{fill:!0,hideStdout:l,query:t,setHideStdout:c,setQuery:i,setStreaming:a,streaming:n,target:{kind:"service",name:e},trailing:u.jsxs(de,{onClick:()=>m(g=>!g),size:"sm",type:"button",variant:"outline",children:[h?u.jsx(W2,{}):u.jsx(G2,{}),h?"Exit":"Expand"]})});return h?u.jsx(x_,{onClose:()=>m(!1),title:`Logs — ${e}`,children:f}):u.jsx("div",{className:"h-[60vh] min-h-[24rem]",children:f})}function x_({title:e,onClose:t,children:i,maxWidthClass:n="max-w-6xl"}){return E.useEffect(()=>{function a(l){l.key==="Escape"&&t()}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),__.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] bg-black/40 p-4 sm:p-8",onMouseDown:t,children:u.jsxs("div",{"aria-modal":"true",className:`mx-auto flex h-full ${n} flex-col overflow-hidden rounded-lg border border-border bg-card text-xs shadow-xl`,onMouseDown:a=>a.stopPropagation(),role:"dialog",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[u.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),u.jsx(de,{"aria-label":"Close logs",onClick:t,size:"icon",type:"button",variant:"ghost",children:u.jsx(Js,{})})]}),u.jsx("div",{className:"min-h-0 flex-1 p-3",children:i})]})}),document.body)}const NL={journald:"Queries `journalctl -u <unit>` — time range, text, and level filter server-side. Add a host to run it over SSH.",docker:"Queries `docker logs <container>` — time window server-side. Add a host to run it over SSH.",ssh:"Reads via `ssh <host> tail -n 500 <path>` using your ~/.ssh/config + ssh-agent.",file:"Tails an absolute file path on this machine.",command:"Runs the command and treats its output as the log (kubectl logs, …)."};function TL({onClose:e,onAdded:t}){const[i,n]=E.useState(""),[a,l]=E.useState("journald"),[c,h]=E.useState(""),[m,f]=E.useState(""),[g,b]=E.useState(""),[v,x]=E.useState(""),[y,w]=E.useState(""),[C,N]=E.useState(""),[T,D]=E.useState(),[A,L]=E.useState(!1);async function G(){L(!0),D(void 0);try{const j={name:i.trim(),kind:"command"};a==="file"?(j.kind="file",j.path=m.trim()):a==="ssh"?(j.kind="ssh",j.host=c.trim(),j.path=m.trim()):a==="command"?(j.kind="command",j.command=g.trim(),v.trim()&&(j.cwd=v.trim())):a==="journald"?(j.driver="journald",j.unit=y.trim(),c.trim()&&(j.host=c.trim())):a==="docker"&&(j.driver="docker",j.container=C.trim(),c.trim()&&(j.host=c.trim()));const R=await yM(j);t(R,j.name),e()}catch(j){D(j instanceof Error?j.message:String(j))}finally{L(!1)}}return u.jsx(Xn,{icon:u.jsx(Q2,{}),onClose:e,size:"md",title:"Add log source",children:u.jsxs("form",{className:"flex flex-col gap-3 p-4 text-xs",onSubmit:j=>{j.preventDefault(),G()},children:[u.jsx(Kn,{label:"Name",children:u.jsx(ot,{autoFocus:!0,onChange:j=>n(j.target.value),placeholder:"PROD",value:i})}),u.jsxs(Kn,{label:"Type",children:[u.jsxs("select",{className:"h-9 w-full rounded-md border border-border bg-background px-2 text-xs",onChange:j=>l(j.target.value),value:a,children:[u.jsx("option",{value:"journald",children:"systemd journal (journald)"}),u.jsx("option",{value:"docker",children:"Docker container"}),u.jsx("option",{value:"ssh",children:"Remote file (SSH)"}),u.jsx("option",{value:"file",children:"Local file"}),u.jsx("option",{value:"command",children:"Command"})]}),u.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:NL[a]})]}),a==="journald"||a==="docker"?u.jsx(Kn,{label:"Host (optional — leave blank to run locally)",children:u.jsx(ot,{onChange:j=>h(j.target.value),placeholder:"jobjourney-prod (an alias from ~/.ssh/config)",value:c})}):null,a==="journald"?u.jsx(Kn,{label:"Unit",children:u.jsx(ot,{onChange:j=>w(j.target.value),placeholder:"jobjourney",value:y})}):null,a==="docker"?u.jsx(Kn,{label:"Container",children:u.jsx(ot,{onChange:j=>N(j.target.value),placeholder:"brainctl-api",value:C})}):null,a==="ssh"?u.jsx(Kn,{label:"Host",children:u.jsx(ot,{onChange:j=>h(j.target.value),placeholder:"prod (an alias from ~/.ssh/config)",value:c})}):null,a==="file"||a==="ssh"?u.jsx(Kn,{label:a==="ssh"?"Remote path":"File path",children:u.jsx(ot,{onChange:j=>f(j.target.value),placeholder:"/var/log/app/out.log",value:m})}):null,a==="command"?u.jsxs(u.Fragment,{children:[u.jsx(Kn,{label:"Command",children:u.jsx(ot,{onChange:j=>b(j.target.value),placeholder:"kubectl logs -l app=myapp --tail 500",value:g})}),u.jsx(Kn,{label:"Working directory (optional)",children:u.jsx(ot,{onChange:j=>x(j.target.value),placeholder:"/srv/app",value:v})})]}):null,T?u.jsx("div",{className:"text-red-600",children:T}):null,u.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u.jsx(de,{onClick:e,size:"sm",type:"button",variant:"outline",children:"Cancel"}),u.jsx(de,{disabled:A||!i.trim(),size:"sm",type:"submit",children:A?"Saving…":"Add source"})]})]})})}function Kn({label:e,children:t}){return u.jsxs("label",{className:"flex flex-col gap-1",children:[u.jsx("span",{className:"font-medium text-muted-foreground",children:e}),t]})}const vS=4;function AL({services:e,initialService:t,onClose:i}){const[n,a]=E.useState([]),[l,c]=E.useState(!1),[h,m]=E.useState(()=>[0]),[f,g]=E.useState(()=>{const D=t?{kind:"service",name:t}:e[0]?{kind:"service",name:e[0]}:void 0;return D?{0:D}:{}}),b=E.useRef(1);E.useEffect(()=>{let D=!1;return xM().then(A=>{D||a(A)}),()=>{D=!0}},[]);const v=[...e.map(D=>({target:{kind:"service",name:D},label:D,group:"Services"})),...n.map(D=>({target:{kind:"source",name:D.name},label:D.name,group:"Log sources"}))],x=v.map(D=>D.target);function y(){if(h.length>=vS||x.length===0)return;const D=b.current++,A=new Set(Object.values(f).map(_S)),L=x.find(G=>!A.has(_S(G)))??x[0];m(G=>[...G,D]),g(G=>({...G,[D]:L}))}function w(D){m(A=>A.filter(L=>L!==D)),g(A=>{const L={...A};return delete L[D],L})}function C(D,A){g(L=>({...L,[D]:A}))}function N(D,A){a(D);const L=h[0];L!==void 0&&C(L,{kind:"source",name:A})}const T=u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{children:"Logs"}),u.jsxs(de,{onClick:()=>c(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(zs,{}),"Add source"]}),u.jsxs(de,{disabled:h.length>=vS||x.length===0,onClick:y,size:"sm",type:"button",variant:"outline",children:[u.jsx(zs,{}),"Add pane"]})]});return u.jsxs(u.Fragment,{children:[u.jsx(x_,{maxWidthClass:"max-w-[1500px]",onClose:i,title:T,children:x.length===0?u.jsx("div",{className:"grid h-full place-items-center text-center text-muted-foreground",children:u.jsxs("div",{children:[u.jsx("p",{children:"No services or log sources yet."}),u.jsxs(de,{className:"mt-2",onClick:()=>c(!0),size:"sm",type:"button",children:[u.jsx(zs,{}),"Add a log source"]})]})}):u.jsx("div",{className:fe("grid h-full min-h-0 gap-3",h.length>1?"lg:grid-cols-2":"grid-cols-1",h.length>2?"lg:grid-rows-2":"grid-rows-1"),children:h.map(D=>u.jsx(ML,{onChangeTarget:A=>C(D,A),onRemove:h.length>1?()=>w(D):void 0,options:v,target:f[D]??x[0]},D))})}),l?u.jsx(TL,{onAdded:N,onClose:()=>c(!1)}):null]})}function ML({options:e,target:t,onChangeTarget:i,onRemove:n}){const[a,l]=E.useState(""),[c,h]=E.useState(!0),[m,f]=E.useState(!1);return u.jsx("div",{className:"flex min-h-0 min-w-0 flex-col rounded-lg border border-border bg-background/60 p-2",children:u.jsx(mk,{fill:!0,hideStdout:m,leading:u.jsx(CL,{onChange:i,options:e,target:t}),query:a,setHideStdout:f,setQuery:l,setStreaming:h,streaming:c,target:t,trailing:n?u.jsx(de,{"aria-label":"Remove pane",onClick:n,size:"icon",type:"button",variant:"ghost",children:u.jsx(Js,{})}):void 0})})}function RL({rows:e,revealAll:t,onAdd:i,onRemove:n,onUpdate:a}){return e.length===0?u.jsxs("div",{className:"text-muted-foreground",children:["No variables yet."," ",u.jsx("button",{className:"underline",onClick:i,type:"button",children:"Add one"}),"."]}):u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"Key"}),u.jsx("th",{className:"py-1 pr-3",children:"Value"}),u.jsx("th",{className:"py-1 w-8"})]})}),u.jsx("tbody",{children:e.map((l,c)=>{const h=!l.reveal&&!t;return u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3 align-top",children:u.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>a(c,{key:m.target.value}),placeholder:"KEY",spellCheck:!1,value:l.key})}),u.jsx("td",{className:"py-1 pr-3 align-top",children:u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>a(c,{value:m.target.value}),spellCheck:!1,type:h?"password":"text",value:l.value}),u.jsx("button",{className:"text-muted-foreground hover:text-foreground",onClick:()=>a(c,{reveal:!l.reveal}),title:l.reveal||t?"Hide":"Reveal",type:"button",children:l.reveal||t?u.jsx($2,{size:14}):u.jsx(I0,{size:14})})]})}),u.jsx("td",{className:"py-1 align-top",children:u.jsx("button",{className:"text-muted-foreground hover:text-red-600",onClick:()=>n(c),type:"button",children:u.jsx(qc,{size:14})})})]},c)})})]})})}function DL({serviceName:e,onClose:t,onPick:i}){const[n,a]=E.useState(),[l,c]=E.useState(),[h,m]=E.useState(!0),[f,g]=E.useState();E.useEffect(()=>{let x=!1;return m(!0),c(void 0),(async()=>{try{const y=await kM(e,f);x||a(y)}catch(y){x||c(y instanceof Error?y.message:String(y))}finally{x||m(!1)}})(),()=>{x=!0}},[e,f]);function b(x){if(x.kind==="directory"){g(x.relativePath);return}x.supported&&i(x.relativePath)}function v(){if(!n||n.isRoot)return;const x=n.relativePath,y=x.includes("/")?x.slice(0,x.lastIndexOf("/")):"";g(y||void 0)}return u.jsx(Xn,{icon:u.jsx(wh,{}),onClose:t,size:"lg",title:"Pick a config file",children:u.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsxs(de,{disabled:!n||n.isRoot,onClick:v,size:"sm",type:"button",variant:"outline",children:[u.jsx(z0,{})," Up"]}),u.jsx("code",{className:"truncate rounded bg-muted px-2 py-1 font-mono",children:n?.relativePath||"./"})]}),l?u.jsx("div",{className:"text-red-600",children:l}):h?u.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):!n||n.entries.length===0?u.jsx("div",{className:"text-muted-foreground",children:"Empty directory."}):u.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border border-border/60",children:u.jsx("ul",{className:"divide-y divide-border/40",children:n.entries.map(x=>{const y=x.kind==="directory",w=y||x.supported;return u.jsx("li",{children:u.jsxs("button",{className:fe("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs",w?"hover:bg-muted":"cursor-not-allowed text-muted-foreground"),disabled:!w,onClick:()=>b(x),type:"button",children:[y?u.jsx(Ha,{size:14}):u.jsx(q2,{size:14}),u.jsx("span",{className:"flex-1 truncate font-mono",children:x.name}),!y&&x.format?u.jsx(Ke,{size:"small",variant:"secondary",children:x.format}):null]})},x.relativePath)})})}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Only ",u.jsx("code",{children:".env*"}),", ",u.jsx("code",{children:"appsettings*.json"}),", and"," ",u.jsx("code",{children:"application*.yml"})," can be selected. Other files are shown disabled."]})]})})}function pk(e){if(!e.trim())return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function OL(e){const{error:t,success:i}=qi(),[n,a]=E.useState([]),[l,c]=E.useState(),[h,m]=E.useState(),[f,g]=E.useState(!0),[b,v]=E.useState(!1),[x,y]=E.useState(!1),[w,C]=E.useState(!1),[N,T]=E.useState();E.useEffect(()=>{let I=!1;return g(!0),T(void 0),(async()=>{try{const W=await NM(e);if(I)return;a(W.files),W.files.length>0?c(J=>J??W.files[0].path):(c(void 0),m(void 0))}catch(W){I||T(W instanceof Error?W.message:String(W))}finally{I||g(!1)}})(),()=>{I=!0}},[e]);const D=E.useCallback(async I=>{v(!0),T(void 0);try{const W=await Ox(e,I),J={path:W.path,relativePath:W.relativePath,format:W.format};W.format==="env"?m({info:J,exists:W.exists,rows:W.entries.map(P=>({...P,reveal:!1}))}):m({info:J,exists:W.exists,text:W.format==="json"?pk(W.content):W.content}),C(!1)}catch(W){T(W instanceof Error?W.message:String(W))}finally{v(!1)}},[e]);E.useEffect(()=>{l&&D(l)},[l,D]);function A(I,W){m(J=>{if(!J?.rows)return J;const P=J.rows.map((te,K)=>K===I?{...te,...W}:te);return{...J,rows:P}}),C(!0)}function L(){m(I=>I?.rows?{...I,rows:[...I.rows,{key:"",value:"",secret:!1,reveal:!0}]}:I),C(!0)}function G(I){m(W=>W?.rows?{...W,rows:W.rows.filter((J,P)=>P!==I)}:W),C(!0)}function j(I){m(W=>W&&{...W,text:I}),C(!0)}async function R(){if(h){y(!0);try{if(h.info.format==="env"&&h.rows){const I=await TM(e,h.info.path,h.rows.map(W=>({key:W.key.trim(),value:W.value})));m({info:{path:I.path,relativePath:I.relativePath,format:I.format},exists:I.exists,rows:I.entries.map(W=>({...W,reveal:!1}))}),i(`Saved ${I.entries.length} entries to ${I.relativePath}.`)}else if(h.text!==void 0){const I=await AM(e,h.info.path,h.text);m({info:{path:I.path,relativePath:I.relativePath,format:I.format},exists:I.exists,text:I.content}),i(`Saved ${I.relativePath}.`)}C(!1)}catch(I){t(I instanceof Error?I.message:String(I))}finally{y(!1)}}}async function H(I){try{const W=await Ox(e,I),J={path:W.path,relativePath:W.relativePath,format:W.format};return a(P=>P.some(te=>te.path===J.path)?P:[...P,J]),c(J.path),i(`Loaded ${J.relativePath}.`),!0}catch(W){return t(W instanceof Error?W.message:String(W)),!1}}return{files:n,selectedPath:l,setSelectedPath:c,loaded:h,loadingList:f,loadingFile:b,saving:x,dirty:w,error:N,addRow:L,removeRow:G,updateRow:A,updateText:j,save:R,pickFile:H}}function jL({serviceName:e}){const{files:t,selectedPath:i,setSelectedPath:n,loaded:a,loadingList:l,loadingFile:c,saving:h,dirty:m,error:f,addRow:g,removeRow:b,updateRow:v,updateText:x,save:y,pickFile:w}=OL(e),[C,N]=E.useState(!1),[T,D]=E.useState(!1);return l?u.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):f&&!a?u.jsx("div",{className:"text-red-600",children:f}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-muted-foreground",children:"File:"}),t.length>0?u.jsx("select",{className:"rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono text-xs",onChange:A=>n(A.target.value),value:i??"",children:t.map(A=>u.jsxs("option",{value:A.path,children:[A.relativePath," [",A.format,"]"]},A.path))}):u.jsx("span",{className:"text-muted-foreground",children:"none detected"}),u.jsxs(de,{onClick:()=>D(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(wh,{})," Browse files"]}),a?u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-muted-foreground",children:a.info.path}):null]}),u.jsxs("div",{className:"flex items-center gap-1",children:[a?.info.format==="env"?u.jsxs(u.Fragment,{children:[u.jsxs(de,{onClick:()=>N(A=>!A),size:"sm",type:"button",variant:"outline",children:[C?u.jsx($2,{}):u.jsx(I0,{}),C?"Hide secrets":"Reveal secrets"]}),u.jsxs(de,{onClick:g,size:"sm",type:"button",variant:"outline",children:[u.jsx(zs,{})," Add"]})]}):null,u.jsxs(de,{disabled:!m||h||!a,onClick:y,size:"sm",type:"button",children:[u.jsx(P0,{})," ",h?"Saving…":"Save"]})]})]}),f&&!a?u.jsx("div",{className:"text-red-600",children:f}):a?.info.format==="env"&&a.rows?u.jsx("div",{className:fe(c&&"opacity-60 transition-opacity"),children:u.jsx(RL,{revealAll:C,rows:a.rows,onAdd:g,onRemove:b,onUpdate:v})}):a?.text!==void 0?u.jsxs("div",{className:fe("space-y-1",c&&"opacity-60 transition-opacity"),children:[a.info.format==="json"?u.jsx("div",{className:"flex justify-end",children:u.jsx(de,{onClick:()=>x(pk(a.text??"")),size:"sm",type:"button",variant:"outline",children:"Format JSON"})}):null,u.jsx("textarea",{className:"min-h-[300px] w-full rounded border border-border/60 bg-background p-2 font-mono text-[11px] leading-relaxed",onChange:A=>x(A.target.value),spellCheck:!1,value:a.text})]}):c?u.jsx("div",{className:"text-muted-foreground",children:"Loading file…"}):null,a?u.jsxs("p",{className:"text-muted-foreground",children:[a.info.format==="env"?"Comments and blank lines are preserved.":a.info.format==="json"?"JSON is validated on save.":"YAML is saved as raw text."," ","The running process won't see changes until you restart it."]}):null,T?u.jsx(DL,{onClose:()=>D(!1),onPick:A=>{w(A).then(L=>{L&&D(!1)})},serviceName:e}):null]})}function LL({serviceName:e,status:t,timeline:i,onRefresh:n}){const{error:a,success:l}=qi(),[c,h]=E.useState(!1),m=t?.inspector,f=t?.state==="running",g=E.useMemo(()=>i.filter(x=>x.kind==="service.http"&&x.service===e).map(x=>{const y=x.data??{};return{id:y.id??x.id,startedAt:x.timestamp,method:y.method??"?",path:y.path??"?",status:y.status??0,durationMs:y.durationMs??0,reqBytes:y.reqBytes??0,resBytes:y.resBytes??0}}).slice(-500).reverse(),[i,e]);async function b(x){h(!0);try{await rs(`/api/services/${encodeURIComponent(e)}/inspector`,{enabled:x?"true":"false"}),await n(),l(x?`HTTP inspector started for ${e}.`:`HTTP inspector stopped for ${e}.`)}catch(y){a(y instanceof Error?y.message:String(y))}finally{h(!1)}}if(!f)return u.jsx("div",{className:"text-muted-foreground",children:"Service is not running."});if(!m?.enabled)return u.jsxs("div",{className:"space-y-2",children:[u.jsx("p",{className:"text-muted-foreground",children:"The HTTP inspector starts a local proxy that forwards traffic to this service and records every request. Hit the inspect URL instead of the original port to see requests appear here. The service itself is not touched."}),u.jsxs(de,{disabled:c,onClick:()=>b(!0),size:"sm",type:"button",children:[u.jsx(Y2,{})," Start HTTP inspector"]})]});const v=m.port?`http://127.0.0.1:${m.port}`:void 0;return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-muted-foreground",children:"Inspect URL:"}),v?u.jsxs(u.Fragment,{children:[u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:v}),u.jsxs(de,{onClick:()=>{navigator.clipboard.writeText(v),l("Copied inspect URL.")},size:"sm",type:"button",variant:"outline",children:[u.jsx(H2,{})," Copy"]}),u.jsx(de,{onClick:()=>window.open(v,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",children:"Open"})]}):u.jsx("span",{className:"text-muted-foreground",children:"starting…"}),u.jsxs("span",{className:"text-muted-foreground",children:["→ upstream :",m.upstreamPort??"?"]}),u.jsxs(de,{disabled:c,onClick:()=>b(!1),size:"sm",type:"button",variant:"outline",children:[u.jsx(Ch,{})," Stop"]})]}),g.length===0?u.jsx("div",{className:"text-muted-foreground",children:"No requests captured yet. Hit the inspect URL in your browser to see traffic."}):u.jsx("div",{className:"max-h-80 overflow-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"sticky top-0 bg-muted/60 text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"Time"}),u.jsx("th",{className:"py-1 pr-3",children:"Method"}),u.jsx("th",{className:"py-1 pr-3",children:"Path"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"Status"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"Size"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"ms"})]})}),u.jsx("tbody",{children:g.map(x=>u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:new Date(x.startedAt).toLocaleTimeString()}),u.jsx("td",{className:"py-1 pr-3",children:x.method}),u.jsx("td",{className:"py-1 pr-3 truncate max-w-[40ch]",children:x.path}),u.jsx("td",{className:fe("py-1 pr-3 text-right",BL(x.status)),children:x.status}),u.jsx("td",{className:"py-1 pr-3 text-right text-muted-foreground",children:zL(x.resBytes)}),u.jsx("td",{className:"py-1 pr-3 text-right",children:x.durationMs.toFixed(1)})]},x.id))})]})})]})}function BL(e){return e>=500?"text-red-600 dark:text-red-400":e>=400?"text-amber-600 dark:text-amber-400":e>=300?"text-zinc-500":e>=200?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground"}function zL(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function IL({serviceName:e}){const[t,i]=E.useState(null),[n,a]=E.useState(null);if(E.useEffect(()=>{let h=!1;async function m(){try{const g=await MM(e);h||(i(g),a(null))}catch(g){h||a(g instanceof Error?g.message:String(g))}}m();const f=setInterval(()=>{m()},3e3);return()=>{h=!0,clearInterval(f)}},[e]),n)return u.jsxs("p",{className:"text-destructive",children:["Failed to load metrics: ",n]});if(!t)return u.jsx("p",{className:"text-muted-foreground",children:"Loading metrics…"});if(t.samples.length===0)return u.jsx("p",{className:"text-muted-foreground",children:"No samples yet. Metrics start collecting once the service is running."});const l=t.samples[t.samples.length-1],c=t.startedAt?new Date(t.startedAt):null;return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("header",{className:"flex flex-wrap items-baseline gap-x-6 gap-y-1",children:[u.jsx(kd,{label:"CPU",value:`${l.cpu.toFixed(1)}%`}),u.jsx(kd,{label:"RSS",value:`${l.rss.toFixed(1)} MB`}),u.jsx(kd,{label:"Samples",value:String(t.samples.length)}),c?u.jsx(kd,{label:"Started",value:c.toLocaleTimeString()}):null]}),u.jsx(yS,{label:"CPU",samples:t.samples,pick:h=>h.cpu,color:"#22c55e",suffix:"%",unit:"percent"}),u.jsx(yS,{label:"Memory (RSS)",samples:t.samples,pick:h=>h.rss,color:"#3b82f6",suffix:" MB",unit:"mb"})]})}function kd({label:e,value:t}){return u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),u.jsx("span",{className:"font-mono text-sm",children:t})]})}const Nd=160,xS=44,PL=20;function yS({label:e,samples:t,pick:i,color:n,suffix:a,unit:l}){const c=t.map(i),h=Math.max(...c,l==="percent"?10:1),m=UL(h),f=0,g=m-f||1,b=t[0].t,v=t[t.length-1].t,x=Math.max(1,v-b),y=j=>(j-b)/x*1e3,w=j=>(1-(j-f)/g)*1e3,C=t.map(j=>`${y(j.t).toFixed(1)},${w(i(j)).toFixed(1)}`),N=`M0,1000 L${C.join(" L")} L1000,1000 Z`,T=`M${C.join(" L")}`,D=[1,.75,.5,.25,0],A=5,L=c[c.length-1],G=Math.max(...c);return u.jsxs("figure",{className:"space-y-1",children:[u.jsxs("figcaption",{className:"flex items-baseline justify-between",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e}),u.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:["now ",u.jsxs("span",{className:"text-foreground",children:[L.toFixed(1),a]}),u.jsx("span",{className:"mx-1.5",children:"·"}),"peak ",G.toFixed(1),a]})]}),u.jsxs("div",{className:"rounded border border-border bg-card p-2",children:[u.jsxs("div",{className:"flex",children:[u.jsx("div",{className:"relative flex shrink-0 flex-col justify-between text-right font-mono text-[10px] text-muted-foreground",style:{width:xS,height:Nd},children:D.map(j=>u.jsx("span",{className:"pr-1 leading-none",children:HL(f+j*g,l)},j))}),u.jsxs("div",{className:"relative min-w-0 flex-1",style:{height:Nd},children:[D.map((j,R)=>u.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-border/40",style:{top:`${j===1?0:j===0?Nd-1:(1-j)*Nd}px`,borderStyle:R===D.length-1?"solid":"dashed"}},j)),u.jsxs("svg",{"aria-label":e,className:"absolute inset-0 h-full w-full",preserveAspectRatio:"none",role:"img",viewBox:"0 0 1000 1000",children:[u.jsx("path",{d:N,fill:n,fillOpacity:.18}),u.jsx("path",{d:T,fill:"none",stroke:n,strokeWidth:2,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round"})]})]})]}),u.jsx("div",{className:"flex font-mono text-[10px] text-muted-foreground",style:{height:PL,paddingLeft:xS},children:u.jsx("div",{className:"relative flex-1",children:Array.from({length:A+1},(j,R)=>{const H=R/A,I=b+H*x;return u.jsx("span",{className:"absolute top-1 whitespace-nowrap",style:{left:`${H*100}%`,transform:R===0?"translateX(0)":R===A?"translateX(-100%)":"translateX(-50%)"},children:FL(I-v)},R)})})})]})]})}function UL(e){if(e<=1)return 1;const t=Math.pow(10,Math.floor(Math.log10(e))),i=e/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function HL(e,t){return t==="percent"?`${e.toFixed(0)}%`:e>=1024?`${(e/1024).toFixed(1)}G`:`${e.toFixed(0)}M`}function FL(e){const t=Math.round(e/1e3);if(t===0)return"now";if(Math.abs(t)<60)return`${t}s`;const n=Math.round(t/60);return Math.abs(n)<60?`${n}m`:`${Math.round(n/60)}h`}function $L({rows:e}){if(e.length===0)return u.jsx("div",{className:"text-muted-foreground",children:"No process tree (service not running)."});const t=[...e].sort((n,a)=>a.cpuPercent-n.cpuPercent),i=new Set(e.map(n=>n.pid));return u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"PID"}),u.jsx("th",{className:"py-1 pr-3",children:"PPID"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"CPU%"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"RSS MB"}),u.jsx("th",{className:"py-1",children:"Command"})]})}),u.jsx("tbody",{children:t.map(n=>{const a=i.has(n.ppid);return u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3",children:n.pid}),u.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:n.ppid}),u.jsx("td",{className:"py-1 pr-3 text-right",children:n.cpuPercent.toFixed(1)}),u.jsx("td",{className:"py-1 pr-3 text-right",children:n.rssMb.toFixed(1)}),u.jsx("td",{className:fe("py-1 truncate max-w-[60ch]",a&&"pl-4"),children:n.command})]},n.pid)})})]})})}var VL=2,qL=1,KL=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(){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:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),a=Math.max(0,parseInt(i.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),c={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},h=c.top+c.bottom,m=c.right+c.left,f=n-h,g=a-m-t;return{cols:Math.max(VL,Math.floor(g/e.css.cell.width)),rows:Math.max(qL,Math.floor(f/e.css.cell.height))}}};var gk=Object.defineProperty,GL=Object.getOwnPropertyDescriptor,WL=(e,t)=>{for(var i in t)gk(e,i,{get:t[i],enumerable:!0})},Ht=(e,t,i,n)=>{for(var a=n>1?void 0:n?GL(t,i):t,l=e.length-1,c;l>=0;l--)(c=e[l])&&(a=(n?c(t,i,a):c(a))||a);return n&&a&&gk(t,i,a),a},ve=(e,t)=>(i,n)=>t(i,n,e),SS="Terminal input",$g={get:()=>SS,set:e=>SS=e},wS="Too much output to announce, navigate to rows manually to read",Vg={get:()=>wS,set:e=>wS=e};function YL(e){return e.replace(/\r?\n/g,"\r")}function XL(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function ZL(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function QL(e,t,i,n){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");_k(a,t,i,n)}}function _k(e,t,i,n){e=YL(e),e=XL(e,i.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function bk(e,t,i){let n=i.getBoundingClientRect(),a=e.clientX-n.left-10,l=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${a}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function ES(e,t,i,n,a){bk(e,t,i),a&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function Ur(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Rh(e,t=0,i=e.length){let n="";for(let a=t;a<i;++a){let l=e[a];l>65535?(l-=65536,n+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):n+=String.fromCharCode(l)}return n}var JL=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let n=0,a=0;if(this._interim){let l=e.charCodeAt(a++);56320<=l&&l<=57343?t[n++]=(this._interim-55296)*1024+l-56320+65536:(t[n++]=this._interim,t[n++]=l),this._interim=0}for(let l=a;l<i;++l){let c=e.charCodeAt(l);if(55296<=c&&c<=56319){if(++l>=i)return this._interim=c,n;let h=e.charCodeAt(l);56320<=h&&h<=57343?t[n++]=(c-55296)*1024+h-56320+65536:(t[n++]=c,t[n++]=h);continue}c!==65279&&(t[n++]=c)}return n}},e9=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let n=0,a,l,c,h,m=0,f=0;if(this.interim[0]){let v=!1,x=this.interim[0];x&=(x&224)===192?31:(x&240)===224?15:7;let y=0,w;for(;(w=this.interim[++y]&63)&&y<4;)x<<=6,x|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,N=C-y;for(;f<N;){if(f>=i)return 0;if(w=e[f++],(w&192)!==128){f--,v=!0;break}else this.interim[y++]=w,x<<=6,x|=w&63}v||(C===2?x<128?f--:t[n++]=x:C===3?x<2048||x>=55296&&x<=57343||x===65279||(t[n++]=x):x<65536||x>1114111||(t[n++]=x)),this.interim.fill(0)}let g=i-4,b=f;for(;b<i;){for(;b<g&&!((a=e[b])&128)&&!((l=e[b+1])&128)&&!((c=e[b+2])&128)&&!((h=e[b+3])&128);)t[n++]=a,t[n++]=l,t[n++]=c,t[n++]=h,b+=4;if(a=e[b++],a<128)t[n++]=a;else if((a&224)===192){if(b>=i)return this.interim[0]=a,n;if(l=e[b++],(l&192)!==128){b--;continue}if(m=(a&31)<<6|l&63,m<128){b--;continue}t[n++]=m}else if((a&240)===224){if(b>=i)return this.interim[0]=a,n;if(l=e[b++],(l&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=l,n;if(c=e[b++],(c&192)!==128){b--;continue}if(m=(a&15)<<12|(l&63)<<6|c&63,m<2048||m>=55296&&m<=57343||m===65279)continue;t[n++]=m}else if((a&248)===240){if(b>=i)return this.interim[0]=a,n;if(l=e[b++],(l&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=l,n;if(c=e[b++],(c&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=l,this.interim[2]=c,n;if(h=e[b++],(h&192)!==128){b--;continue}if(m=(a&7)<<18|(l&63)<<12|(c&63)<<6|h&63,m<65536||m>1114111)continue;t[n++]=m}}return n}},vk="",$r=" ",Qc=class xk{constructor(){this.fg=0,this.bg=0,this.extended=new ch}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 xk;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}},ch=class yk{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new yk(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ps=class Sk extends Qc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ch,this.combinedData=""}static fromCharData(t){let i=new Sk;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ur(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(n-55296)*1024+a-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},CS="di$target",qg="di$dependencies",pp=new Map;function t9(e){return e[qg]||[]}function vi(e){if(pp.has(e))return pp.get(e);let t=function(i,n,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");i9(t,i,a)};return t._id=e,pp.set(e,t),t}function i9(e,t,i){t[CS]===t?t[qg].push({id:e,index:i}):(t[qg]=[{id:e,index:i}],t[CS]=t)}var Ki=vi("BufferService"),wk=vi("CoreMouseService"),$a=vi("CoreService"),s9=vi("CharsetService"),y_=vi("InstantiationService"),Ek=vi("LogService"),Gi=vi("OptionsService"),Ck=vi("OscLinkService"),n9=vi("UnicodeService"),Jc=vi("DecorationService"),Kg=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let n=[],a=this._optionsService.rawOptions.linkHandler,l=new Ps,c=i.getTrimmedLength(),h=-1,m=-1,f=!1;for(let g=0;g<c;g++)if(!(m===-1&&!i.hasContent(g))){if(i.loadCell(g,l),l.hasExtendedAttrs()&&l.extended.urlId)if(m===-1){m=g,h=l.extended.urlId;continue}else f=l.extended.urlId!==h;else m!==-1&&(f=!0);if(f||m!==-1&&g===c-1){let b=this._oscLinkService.getLinkData(h)?.uri;if(b){let v={start:{x:m+1,y:e},end:{x:g+(!f&&g===c-1?1:0),y:e}},x=!1;if(!a?.allowNonHttpProtocols)try{let y=new URL(b);["http:","https:"].includes(y.protocol)||(x=!0)}catch{x=!0}x||n.push({text:b,range:v,activate:(y,w)=>a?a.activate(y,w,v):r9(y,w),hover:(y,w)=>a?.hover?.(y,w,v),leave:(y,w)=>a?.leave?.(y,w,v)})}f=!1,l.hasExtendedAttrs()&&l.extended.urlId?(m=g,h=l.extended.urlId):(m=-1,h=-1)}}t(n)}};Kg=Ht([ve(0,Ki),ve(1,Gi),ve(2,Ck)],Kg);function r9(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
20
|
+
|
|
21
|
+
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Dh=vi("CharSizeService"),ir=vi("CoreBrowserService"),S_=vi("MouseService"),sr=vi("RenderService"),a9=vi("SelectionService"),kk=vi("CharacterJoinerService"),il=vi("ThemeService"),Nk=vi("LinkProviderService"),o9=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?kS.isErrorNoTelemetry(e)?new kS(e.message+`
|
|
22
|
+
|
|
23
|
+
`+e.stack):new Error(e.message+`
|
|
24
|
+
|
|
25
|
+
`+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)}},l9=new o9;function Vd(e){c9(e)||l9.onUnexpectedError(e)}var Gg="Canceled";function c9(e){return e instanceof u9?!0:e instanceof Error&&e.name===Gg&&e.message===Gg}var u9=class extends Error{constructor(){super(Gg),this.name=this.message}};function d9(e){return new Error(`Illegal argument: ${e}`)}var kS=class Wg extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Wg)return t;let i=new Wg;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Yg=class Tk extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Tk.prototype)}};function _s(e,t=0){return e[e.length-(1+t)]}var h9;(e=>{function t(l){return l<0}e.isLessThan=t;function i(l){return l<=0}e.isLessThanOrEqual=i;function n(l){return l>0}e.isGreaterThan=n;function a(l){return l===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(h9||={});function f9(e,t){let i=this,n=!1,a;return function(){return n||(n=!0,t||(a=e.apply(i,arguments))),a}}var Ak;(e=>{function t(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function n(){return i}e.empty=n;function*a(A){yield A}e.single=a;function l(A){return t(A)?A:a(A)}e.wrap=l;function c(A){return A||i}e.from=c;function*h(A){for(let L=A.length-1;L>=0;L--)yield A[L]}e.reverse=h;function m(A){return!A||A[Symbol.iterator]().next().done===!0}e.isEmpty=m;function f(A){return A[Symbol.iterator]().next().value}e.first=f;function g(A,L){let G=0;for(let j of A)if(L(j,G++))return!0;return!1}e.some=g;function b(A,L){for(let G of A)if(L(G))return G}e.find=b;function*v(A,L){for(let G of A)L(G)&&(yield G)}e.filter=v;function*x(A,L){let G=0;for(let j of A)yield L(j,G++)}e.map=x;function*y(A,L){let G=0;for(let j of A)yield*L(j,G++)}e.flatMap=y;function*w(...A){for(let L of A)yield*L}e.concat=w;function C(A,L,G){let j=G;for(let R of A)j=L(j,R);return j}e.reduce=C;function*N(A,L,G=A.length){for(L<0&&(L+=A.length),G<0?G+=A.length:G>A.length&&(G=A.length);L<G;L++)yield A[L]}e.slice=N;function T(A,L=Number.POSITIVE_INFINITY){let G=[];if(L===0)return[G,A];let j=A[Symbol.iterator]();for(let R=0;R<L;R++){let H=j.next();if(H.done)return[G,e.empty()];G.push(H.value)}return[G,{[Symbol.iterator](){return j}}]}e.consume=T;async function D(A){let L=[];for await(let G of A)L.push(G);return Promise.resolve(L)}e.asyncToArray=D})(Ak||={});function Ia(e){if(Ak.is(e)){let t=[];for(let i of e)if(i)try{i.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 m9(...e){return Dt(()=>Ia(e))}function Dt(e){return{dispose:f9(()=>{e()})}}var Mk=class Rk{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{Ia(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?Rk.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)}};Mk.DISABLE_DISPOSED_WARNING=!1;var Vr=Mk,Ge=class{constructor(){this._store=new Vr,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)}};Ge.None=Object.freeze({dispose(){}});var Xo=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},Yn=typeof window=="object"?window:globalThis,Xg=class Zg{constructor(t){this.element=t,this.next=Zg.Undefined,this.prev=Zg.Undefined}};Xg.Undefined=new Xg(void 0);var Lt=Xg,NS=class{constructor(){this._first=Lt.Undefined,this._last=Lt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Lt.Undefined}clear(){let e=this._first;for(;e!==Lt.Undefined;){let t=e.next;e.prev=Lt.Undefined,e.next=Lt.Undefined,e=t}this._first=Lt.Undefined,this._last=Lt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new Lt(e);if(this._first===Lt.Undefined)this._first=i,this._last=i;else if(t){let a=this._last;this._last=i,i.prev=a,a.next=i}else{let a=this._first;this._first=i,i.next=a,a.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==Lt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Lt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Lt.Undefined&&e.next!==Lt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Lt.Undefined&&e.next===Lt.Undefined?(this._first=Lt.Undefined,this._last=Lt.Undefined):e.next===Lt.Undefined?(this._last=this._last.prev,this._last.next=Lt.Undefined):e.prev===Lt.Undefined&&(this._first=this._first.next,this._first.prev=Lt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Lt.Undefined;)yield e.element,e=e.next}},p9=globalThis.performance&&typeof globalThis.performance.now=="function",g9=class Dk{static create(t){return new Dk(t)}constructor(t){this._now=p9&&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}},Ti;(e=>{e.None=()=>Ge.None;function t(J,P){return b(J,()=>{},0,void 0,!0,void 0,P)}e.defer=t;function i(J){return(P,te=null,K)=>{let M=!1,$;return $=J(F=>{if(!M)return $?$.dispose():M=!0,P.call(te,F)},null,K),M&&$.dispose(),$}}e.once=i;function n(J,P,te){return f((K,M=null,$)=>J(F=>K.call(M,P(F)),null,$),te)}e.map=n;function a(J,P,te){return f((K,M=null,$)=>J(F=>{P(F),K.call(M,F)},null,$),te)}e.forEach=a;function l(J,P,te){return f((K,M=null,$)=>J(F=>P(F)&&K.call(M,F),null,$),te)}e.filter=l;function c(J){return J}e.signal=c;function h(...J){return(P,te=null,K)=>{let M=m9(...J.map($=>$(F=>P.call(te,F))));return g(M,K)}}e.any=h;function m(J,P,te,K){let M=te;return n(J,$=>(M=P(M,$),M),K)}e.reduce=m;function f(J,P){let te,K={onWillAddFirstListener(){te=J(M.fire,M)},onDidRemoveLastListener(){te?.dispose()}},M=new pe(K);return P?.add(M),M.event}function g(J,P){return P instanceof Array?P.push(J):P&&P.add(J),J}function b(J,P,te=100,K=!1,M=!1,$,F){let V,Y,O,ee=0,ue,ie={leakWarningThreshold:$,onWillAddFirstListener(){V=J(me=>{ee++,Y=P(Y,me),K&&!O&&(le.fire(Y),Y=void 0),ue=()=>{let Se=Y;Y=void 0,O=void 0,(!K||ee>1)&&le.fire(Se),ee=0},typeof te=="number"?(clearTimeout(O),O=setTimeout(ue,te)):O===void 0&&(O=0,queueMicrotask(ue))})},onWillRemoveListener(){M&&ee>0&&ue?.()},onDidRemoveLastListener(){ue=void 0,V.dispose()}},le=new pe(ie);return F?.add(le),le.event}e.debounce=b;function v(J,P=0,te){return e.debounce(J,(K,M)=>K?(K.push(M),K):[M],P,void 0,!0,void 0,te)}e.accumulate=v;function x(J,P=(K,M)=>K===M,te){let K=!0,M;return l(J,$=>{let F=K||!P($,M);return K=!1,M=$,F},te)}e.latch=x;function y(J,P,te){return[e.filter(J,P,te),e.filter(J,K=>!P(K),te)]}e.split=y;function w(J,P=!1,te=[],K){let M=te.slice(),$=J(Y=>{M?M.push(Y):V.fire(Y)});K&&K.add($);let F=()=>{M?.forEach(Y=>V.fire(Y)),M=null},V=new pe({onWillAddFirstListener(){$||($=J(Y=>V.fire(Y)),K&&K.add($))},onDidAddFirstListener(){M&&(P?setTimeout(F):F())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return K&&K.add(V),V.event}e.buffer=w;function C(J,P){return(te,K,M)=>{let $=P(new T);return J(function(F){let V=$.evaluate(F);V!==N&&te.call(K,V)},void 0,M)}}e.chain=C;let N=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(P){return this.steps.push(P),this}forEach(P){return this.steps.push(te=>(P(te),te)),this}filter(P){return this.steps.push(te=>P(te)?te:N),this}reduce(P,te){let K=te;return this.steps.push(M=>(K=P(K,M),K)),this}latch(P=(te,K)=>te===K){let te=!0,K;return this.steps.push(M=>{let $=te||!P(M,K);return te=!1,K=M,$?M:N}),this}evaluate(P){for(let te of this.steps)if(P=te(P),P===N)break;return P}}function D(J,P,te=K=>K){let K=(...V)=>F.fire(te(...V)),M=()=>J.on(P,K),$=()=>J.removeListener(P,K),F=new pe({onWillAddFirstListener:M,onDidRemoveLastListener:$});return F.event}e.fromNodeEventEmitter=D;function A(J,P,te=K=>K){let K=(...V)=>F.fire(te(...V)),M=()=>J.addEventListener(P,K),$=()=>J.removeEventListener(P,K),F=new pe({onWillAddFirstListener:M,onDidRemoveLastListener:$});return F.event}e.fromDOMEventEmitter=A;function L(J){return new Promise(P=>i(J)(P))}e.toPromise=L;function G(J){let P=new pe;return J.then(te=>{P.fire(te)},()=>{P.fire(void 0)}).finally(()=>{P.dispose()}),P.event}e.fromPromise=G;function j(J,P){return J(te=>P.fire(te))}e.forward=j;function R(J,P,te){return P(te),J(K=>P(K))}e.runAndSubscribe=R;class H{constructor(P,te){this._observable=P,this._counter=0,this._hasChanged=!1;let K={onWillAddFirstListener:()=>{P.addObserver(this)},onDidRemoveLastListener:()=>{P.removeObserver(this)}};this.emitter=new pe(K),te&&te.add(this.emitter)}beginUpdate(P){this._counter++}handlePossibleChange(P){}handleChange(P,te){this._hasChanged=!0}endUpdate(P){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function I(J,P){return new H(J,P).emitter.event}e.fromObservable=I;function W(J){return(P,te,K)=>{let M=0,$=!1,F={beginUpdate(){M++},endUpdate(){M--,M===0&&(J.reportChanges(),$&&($=!1,P.call(te)))},handlePossibleChange(){},handleChange(){$=!0}};J.addObserver(F),J.reportChanges();let V={dispose(){J.removeObserver(F)}};return K instanceof Vr?K.add(V):Array.isArray(K)&&K.push(V),V}}e.fromObservableLight=W})(Ti||={});var Qg=class Jg{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Jg._idPool++}`,Jg.all.add(this)}start(t){this._stopWatch=new g9,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}}};Qg.all=new Set,Qg._idPool=0;var _9=Qg,b9=-1,Ok=class jk{constructor(t,i,n=(jk._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[l,c]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${c}):`;console.warn(h),console.warn(l);let m=new y9(h,l);this._errorHandler(m)}return()=>{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[n,a]of this._stacks)(!t||i<a)&&(t=[n,a],i=a);return t}};Ok._idPool=1;var v9=Ok,x9=class Lk{constructor(t){this.value=t}static create(){let t=new Error;return new Lk(t.stack??"")}print(){console.warn(this.value.split(`
|
|
26
|
+
`).slice(2).join(`
|
|
27
|
+
`))}},y9=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},S9=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},w9=0,gp=class{constructor(e){this.value=e,this.id=w9++}},E9=2,C9,pe=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new v9(t?.onListenerError??Vd,this._options?.leakWarningThreshold??b9):void 0,this._perfMon=this._options?._profName?new _9(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(t,i,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let m=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new S9(`${h}. HINT: Stack shows most frequent listener (${m[1]}-times)`,m[0]);return(this._options?.onListenerError||Vd)(f),Ge.None}if(this._disposed)return Ge.None;i&&(t=t.bind(i));let a=new gp(t),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=x9.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof gp?(this._deliveryQueue??=new k9,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let c=Dt(()=>{l?.(),this._removeListener(a)});return n instanceof Vr?n.add(c):Array.isArray(n)&&n.push(c),c},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,n=i.indexOf(t);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let a=this._deliveryQueue.current===this;if(this._size*E9<=i.length){let l=0;for(let c=0;c<i.length;c++)i[c]?i[l++]=i[c]:a&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=l}}_deliver(t,i){if(!t)return;let n=this._options?.onListenerError||Vd;if(!n){t.value(i);return}try{t.value(i)}catch(a){n(a)}}_deliverQueue(t){let i=t.current._listeners;for(;t.i<t.end;)this._deliver(i[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof gp)this._deliver(this._listeners,t);else{let i=this._deliveryQueue;i.enqueue(this,t,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},k9=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},e0=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new pe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new pe,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};e0.INSTANCE=new e0;var w_=e0;function N9(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}w_.INSTANCE.onDidChangeZoomLevel;function T9(e){return w_.INSTANCE.getZoomFactor(e)}w_.INSTANCE.onDidChangeFullscreen;var sl=typeof navigator=="object"?navigator.userAgent:"",t0=sl.indexOf("Firefox")>=0,A9=sl.indexOf("AppleWebKit")>=0,E_=sl.indexOf("Chrome")>=0,M9=!E_&&sl.indexOf("Safari")>=0;sl.indexOf("Electron/")>=0;sl.indexOf("Android")>=0;var _p=!1;if(typeof Yn.matchMedia=="function"){let e=Yn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Yn.matchMedia("(display-mode: fullscreen)");_p=e.matches,N9(Yn,e,({matches:i})=>{_p&&t.matches||(_p=i)})}var $o="en",i0=!1,s0=!1,qd=!1,Bk=!1,Td,Kd=$o,TS=$o,R9,Wn,La=globalThis,vs;typeof La.vscode<"u"&&typeof La.vscode.process<"u"?vs=La.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(vs=process);var D9=typeof vs?.versions?.electron=="string",O9=D9&&vs?.type==="renderer";if(typeof vs=="object"){i0=vs.platform==="win32",s0=vs.platform==="darwin",qd=vs.platform==="linux",qd&&vs.env.SNAP&&vs.env.SNAP_REVISION,vs.env.CI||vs.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Td=$o,Kd=$o;let e=vs.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Td=t.userLocale,TS=t.osLocale,Kd=t.resolvedLanguage||$o,R9=t.languagePack?.translationsConfigFile}catch{}Bk=!0}else typeof navigator=="object"&&!O9?(Wn=navigator.userAgent,i0=Wn.indexOf("Windows")>=0,s0=Wn.indexOf("Macintosh")>=0,(Wn.indexOf("Macintosh")>=0||Wn.indexOf("iPad")>=0||Wn.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,qd=Wn.indexOf("Linux")>=0,Wn?.indexOf("Mobi")>=0,Kd=globalThis._VSCODE_NLS_LANGUAGE||$o,Td=navigator.language.toLowerCase(),TS=Td):console.error("Unable to resolve platform.");var zk=i0,pn=s0,j9=qd,AS=Bk,bn=Wn,Lr=Kd,L9;(e=>{function t(){return Lr}e.value=t;function i(){return Lr.length===2?Lr==="en":Lr.length>=3?Lr[0]==="e"&&Lr[1]==="n"&&Lr[2]==="-":!1}e.isDefaultVariant=i;function n(){return Lr==="en"}e.isDefault=n})(L9||={});var B9=typeof La.postMessage=="function"&&!La.importScripts;(()=>{if(B9){let e=[];La.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,a=e.length;n<a;n++){let l=e[n];if(l.id===i.data.vscodeScheduleAsyncWork){e.splice(n,1),l.callback();return}}});let t=0;return i=>{let n=++t;e.push({id:n,callback:i}),La.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var z9=!!(bn&&bn.indexOf("Chrome")>=0);bn&&bn.indexOf("Firefox")>=0;!z9&&bn&&bn.indexOf("Safari")>=0;bn&&bn.indexOf("Edg/")>=0;bn&&bn.indexOf("Android")>=0;var Oo=typeof navigator=="object"?navigator:{};AS||document.queryCommandSupported&&document.queryCommandSupported("copy")||Oo&&Oo.clipboard&&Oo.clipboard.writeText,AS||Oo&&Oo.clipboard&&Oo.clipboard.readText;var C_=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}},bp=new C_,MS=new C_,RS=new C_,I9=new Array(230),Ik;(e=>{function t(h){return bp.keyCodeToStr(h)}e.toString=t;function i(h){return bp.strToKeyCode(h)}e.fromString=i;function n(h){return MS.keyCodeToStr(h)}e.toUserSettingsUS=n;function a(h){return RS.keyCodeToStr(h)}e.toUserSettingsGeneral=a;function l(h){return MS.strToKeyCode(h)||RS.strToKeyCode(h)}e.fromUserSettings=l;function c(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return bp.keyCodeToStr(h)}e.toElectronAccelerator=c})(Ik||={});var P9=class Pk{constructor(t,i,n,a,l){this.ctrlKey=t,this.shiftKey=i,this.altKey=n,this.metaKey=a,this.keyCode=l}equals(t){return t instanceof Pk&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",n=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${i}${n}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new U9([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},U9=class{constructor(e){if(e.length===0)throw d9("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function H9(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return Ik.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(t0)switch(t){case 59:return 85;case 60:if(j9)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(pn)return 57;break}else if(A9&&(pn&&t===93||!pn&&t===92))return 57;return I9[t]||0}var F9=pn?256:2048,$9=512,V9=1024,q9=pn?2048:256,DS=class{constructor(e){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=t.getModifierState?.("AltGraph"),this.keyCode=H9(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|=F9),this.altKey&&(t|=$9),this.shiftKey&&(t|=V9),this.metaKey&&(t|=q9),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new P9(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},OS=new WeakMap;function K9(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}var G9=class{static getSameOriginWindowChain(e){let t=OS.get(e);if(!t){t=[],OS.set(e,t);let i=e,n;do n=K9(i),n?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=n;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0,a=this.getSameOriginWindowChain(e);for(let l of a){let c=l.window.deref();if(i+=c?.scrollY??0,n+=c?.scrollX??0,c===t||!l.iframeElement)break;let h=l.iframeElement.getBoundingClientRect();i+=h.top,n+=h.left}return{top:i,left:n}}},Ad=class{constructor(t,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=G9.getPositionOfChildWindowRelativeToAncestorWindow(t,i.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},jS=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let n=!1;if(E_){let a=navigator.userAgent.match(/Chrome\/(\d+)/);n=(a?parseInt(a[1]):123)<=122}if(e){let a=e,l=e,c=e.view?.devicePixelRatio||1;if(typeof a.wheelDeltaY<"u")n?this.deltaY=a.wheelDeltaY/(120*c):this.deltaY=a.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?t0&&!pn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")M9&&zk?this.deltaX=-(a.wheelDeltaX/120):n?this.deltaX=a.wheelDeltaX/(120*c):this.deltaX=a.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?t0&&!pn?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*c):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},Uk=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),W9;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof Y9?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ti.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Uk})})(W9||={});var Y9=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?Uk:(this._emitter||(this._emitter=new pe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},k_=class{constructor(t,i){this._isDisposed=!1,this._token=-1,typeof t=="function"&&typeof i=="number"&&this.setIfNotSet(t,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(t,i){if(this._isDisposed)throw new Yg("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},i)}setIfNotSet(t,i){if(this._isDisposed)throw new Yg("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},i))}},X9=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new Yg("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=i.setInterval(()=>{e()},t);this.disposable=Dt(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Z9;(e=>{async function t(n){let a,l=await Promise.all(n.map(c=>c.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return l}e.settled=t;function i(n){return new Promise(async(a,l)=>{try{await n(a,l)}catch(c){l(c)}})}e.withAsyncBody=i})(Z9||={});var LS=class Os{static fromArray(t){return new Os(i=>{i.emitMany(t)})}static fromPromise(t){return new Os(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Os(async i=>{await Promise.all(t.map(async n=>i.emitOne(await n)))})}static merge(t){return new Os(async i=>{await Promise.all(t.map(async n=>{for await(let a of n)i.emitOne(a)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new pe,queueMicrotask(async()=>{let n={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(n)),this.resolve()}catch(a){this.reject(a)}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 Ti.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Os(async n=>{for await(let a of t)n.emitOne(i(a))})}map(t){return Os.map(this,t)}static filter(t,i){return new Os(async n=>{for await(let a of t)i(a)&&n.emitOne(a)})}filter(t){return Os.filter(this,t)}static coalesce(t){return Os.filter(t,i=>!!i)}coalesce(){return Os.coalesce(this)}static async toPromise(t){let i=[];for await(let n of t)i.push(n);return i}toPromise(){return Os.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())}};LS.EMPTY=LS.fromArray([]);var{getWindow:fn,getWindowId:Q9,onDidRegisterWindow:J9}=(function(){let e=new Map,t={window:Yn,disposables:new Vr};e.set(Yn.vscodeWindowId,t);let i=new pe,n=new pe,a=new pe;function l(c,h){return(typeof c=="number"?e.get(c):void 0)??(h?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:n.event,registerWindow(c){if(e.has(c.vscodeWindowId))return Ge.None;let h=new Vr,m={window:c,disposables:h.add(new Vr)};return e.set(c.vscodeWindowId,m),h.add(Dt(()=>{e.delete(c.vscodeWindowId),n.fire(c)})),h.add(Pe(c,pi.BEFORE_UNLOAD,()=>{a.fire(c)})),i.fire(m),h},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(c){return c.vscodeWindowId},hasWindow(c){return e.has(c)},getWindowById:l,getWindow(c){let h=c;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let m=c;return m?.view?m.view.window:Yn},getDocument(c){return fn(c).document}}})(),eB=class{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,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 Pe(e,t,i,n){return new eB(e,t,i,n)}var BS=function(e,t,i,n){return Pe(e,t,i,n)},N_,tB=class extends X9{constructor(e){super(),this.defaultTarget=e&&fn(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},zS=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){Vd(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,n=new Map,a=l=>{i.set(l,!1);let c=e.get(l)??[];for(t.set(l,c),e.set(l,[]),n.set(l,!0);c.length>0;)c.sort(zS.sort),c.shift().execute();n.set(l,!1)};N_=(l,c,h=0)=>{let m=Q9(l),f=new zS(c,h),g=e.get(m);return g||(g=[],e.set(m,g)),g.push(f),i.get(m)||(i.set(m,!0),l.requestAnimationFrame(()=>a(m))),f}})();function iB(e){let t=e.getBoundingClientRect(),i=fn(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var pi={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"},sB=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=ss(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ss(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ss(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ss(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ss(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ss(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ss(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ss(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ss(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ss(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ss(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=ss(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=ss(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ss(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 ss(e){return typeof e=="number"?`${e}px`:e}function Nc(e){return new sB(e)}var Hk=class{constructor(){this._hooks=new Vr,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=a;let l=e;try{e.setPointerCapture(t),this._hooks.add(Dt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=fn(e)}this._hooks.add(Pe(l,pi.POINTER_MOVE,c=>{if(c.buttons!==i){this.stopMonitoring(!0);return}c.preventDefault(),this._pointerMoveCallback(c)})),this._hooks.add(Pe(l,pi.POINTER_UP,c=>this.stopMonitoring(!0)))}};function nB(e,t,i){let n=null,a=null;if(typeof i.value=="function"?(n="value",a=i.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(n="get",a=i.get),!a)throw new Error("not supported");let l=`$memoize$${t}`;i[n]=function(...c){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,c)}),this[l]}}var cn;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(cn||={});var gc=class Li extends Ge{constructor(){super(),this.dispatched=!1,this.targets=new NS,this.ignoreTargets=new NS,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ti.runAndSubscribe(J9,({window:t,disposables:i})=>{i.add(Pe(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),i.add(Pe(t.document,"touchend",n=>this.onTouchEnd(t,n))),i.add(Pe(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:Yn,disposables:this._store}))}static addTarget(t){if(!Li.isTouchDevice())return Ge.None;Li.INSTANCE||(Li.INSTANCE=new Li);let i=Li.INSTANCE.targets.push(t);return Dt(i)}static ignoreTarget(t){if(!Li.isTouchDevice())return Ge.None;Li.INSTANCE||(Li.INSTANCE=new Li);let i=Li.INSTANCE.ignoreTargets.push(t);return Dt(i)}static isTouchDevice(){return"ontouchstart"in Yn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,a=t.targetTouches.length;n<a;n++){let l=t.targetTouches.item(n);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:i,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[i],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let c=this.newGestureEvent(cn.Start,l.target);c.pageX=l.pageX,c.pageY=l.pageY,this.dispatchEvent(c)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let n=Date.now(),a=Object.keys(this.activeTouches).length;for(let l=0,c=i.changedTouches.length;l<c;l++){let h=i.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let m=this.activeTouches[h.identifier],f=Date.now()-m.initialTimeStamp;if(f<Li.HOLD_DELAY&&Math.abs(m.initialPageX-_s(m.rollingPageX))<30&&Math.abs(m.initialPageY-_s(m.rollingPageY))<30){let g=this.newGestureEvent(cn.Tap,m.initialTarget);g.pageX=_s(m.rollingPageX),g.pageY=_s(m.rollingPageY),this.dispatchEvent(g)}else if(f>=Li.HOLD_DELAY&&Math.abs(m.initialPageX-_s(m.rollingPageX))<30&&Math.abs(m.initialPageY-_s(m.rollingPageY))<30){let g=this.newGestureEvent(cn.Contextmenu,m.initialTarget);g.pageX=_s(m.rollingPageX),g.pageY=_s(m.rollingPageY),this.dispatchEvent(g)}else if(a===1){let g=_s(m.rollingPageX),b=_s(m.rollingPageY),v=_s(m.rollingTimestamps)-m.rollingTimestamps[0],x=g-m.rollingPageX[0],y=b-m.rollingPageY[0],w=[...this.targets].filter(C=>m.initialTarget instanceof Node&&C.contains(m.initialTarget));this.inertia(t,w,n,Math.abs(x)/v,x>0?1:-1,g,Math.abs(y)/v,y>0?1:-1,b)}this.dispatchEvent(this.newGestureEvent(cn.End,m.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=i,n.tapCount=0,n}dispatchEvent(t){if(t.type===cn.Tap){let i=new Date().getTime(),n=0;i-this._lastSetTapCountTime>Li.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=i,t.tapCount=n}else(t.type===cn.Change||t.type===cn.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let i=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let a=0,l=t.initialTarget;for(;l&&l!==n;)a++,l=l.parentElement;i.push([a,n])}i.sort((n,a)=>n[0]-a[0]);for(let[n,a]of i)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,n,a,l,c,h,m,f){this.handle=N_(t,()=>{let g=Date.now(),b=g-n,v=0,x=0,y=!0;a+=Li.SCROLL_FRICTION*b,h+=Li.SCROLL_FRICTION*b,a>0&&(y=!1,v=l*a*b),h>0&&(y=!1,x=m*h*b);let w=this.newGestureEvent(cn.Change);w.translationX=v,w.translationY=x,i.forEach(C=>C.dispatchEvent(w)),y||this.inertia(t,i,g,a,l,c+v,h,m,f+x)})}onTouchMove(t){let i=Date.now();for(let n=0,a=t.changedTouches.length;n<a;n++){let l=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let c=this.activeTouches[l.identifier],h=this.newGestureEvent(cn.Change,c.initialTarget);h.translationX=l.pageX-_s(c.rollingPageX),h.translationY=l.pageY-_s(c.rollingPageY),h.pageX=l.pageX,h.pageY=l.pageY,this.dispatchEvent(h),c.rollingPageX.length>3&&(c.rollingPageX.shift(),c.rollingPageY.shift(),c.rollingTimestamps.shift()),c.rollingPageX.push(l.pageX),c.rollingPageY.push(l.pageY),c.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};gc.SCROLL_FRICTION=-.005,gc.HOLD_DELAY=700,gc.CLEAR_TAP_COUNT_TIME=400,Ht([nB],gc,"isTouchDevice",1);var rB=gc,T_=class extends Ge{onclick(e,t){this._register(Pe(e,pi.CLICK,i=>t(new Ad(fn(e),i))))}onmousedown(e,t){this._register(Pe(e,pi.MOUSE_DOWN,i=>t(new Ad(fn(e),i))))}onmouseover(e,t){this._register(Pe(e,pi.MOUSE_OVER,i=>t(new Ad(fn(e),i))))}onmouseleave(e,t){this._register(Pe(e,pi.MOUSE_LEAVE,i=>t(new Ad(fn(e),i))))}onkeydown(e,t){this._register(Pe(e,pi.KEY_DOWN,i=>t(new DS(i))))}onkeyup(e,t){this._register(Pe(e,pi.KEY_UP,i=>t(new DS(i))))}oninput(e,t){this._register(Pe(e,pi.INPUT,t))}onblur(e,t){this._register(Pe(e,pi.BLUR,t))}onfocus(e,t){this._register(Pe(e,pi.FOCUS,t))}onchange(e,t){this._register(Pe(e,pi.CHANGE,t))}ignoreGesture(e){return rB.ignoreTarget(e)}},IS=11,aB=class extends T_{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=IS+"px",this.domNode.style.height=IS+"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 Hk),this._register(BS(this.bgDomNode,pi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(BS(this.domNode,pi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new tB),this._pointerdownScheduleRepeatTimer=this._register(new k_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,fn(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},oB=class n0{constructor(t,i,n,a,l,c,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,n=n|0,a=a|0,l=l|0,c=c|0,h=h|0),this.rawScrollLeft=a,this.rawScrollTop=h,i<0&&(i=0),a+i>n&&(a=n-i),a<0&&(a=0),l<0&&(l=0),h+l>c&&(h=c-l),h<0&&(h=0),this.width=i,this.scrollWidth=n,this.scrollLeft=a,this.height=l,this.scrollHeight=c,this.scrollTop=h}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new n0(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new n0(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let n=this.width!==t.width,a=this.scrollWidth!==t.scrollWidth,l=this.scrollLeft!==t.scrollLeft,c=this.height!==t.height,h=this.scrollHeight!==t.scrollHeight,m=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:a,scrollLeftChanged:l,heightChanged:c,scrollHeightChanged:h,scrollTopChanged:m}}},lB=class extends Ge{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new oB(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){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;t?n=new US(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=US.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},PS=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function vp(e,t){let i=t-e;return function(n){return e+i*dB(n)}}function cB(e,t,i){return function(n){return n<i?e(n/i):t((n-i)/(1-i))}}var US=class r0{constructor(t,i,n,a){this.from=t,this.to=i,this.duration=a,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,i,n){if(Math.abs(t-i)>2.5*n){let a,l;return t<i?(a=t+.75*n,l=i-.75*n):(a=t-.75*n,l=i+.75*n),cB(vp(t,a),vp(l,i),.33)}return vp(t,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let i=(t-this.startTime)/this.duration;if(i<1){let n=this.scrollLeft(i),a=this.scrollTop(i);return new PS(n,a,!1)}return new PS(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,n){return r0.start(t,i,n)}static start(t,i,n){n=n+10;let a=Date.now()-10;return new r0(t,i,a,n)}};function uB(e){return Math.pow(e,3)}function dB(e){return 1-uB(1-e)}var hB=class extends Ge{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new k_)}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(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},fB=140,Fk=class extends T_{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 hB(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Hk),this._shouldRender=!0,this.domNode=Nc(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(Pe(this.domNode.domNode,pi.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new aB(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Nc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Pe(this.slider.domNode,pi.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);i<=a&&a<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let a=iB(this.domNode.domNode);t=e.pageX-a.left,i=e.pageY-a.top}let n=this._pointerDownRelativePosition(t,i);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),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{let l=this._sliderOrthogonalPointerPosition(a),c=Math.abs(l-i);if(zk&&c>fB){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let h=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(h))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},$k=class a0{constructor(t,i,n,a,l,c){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=l,this._scrollPosition=c,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new a0(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,n,a,l){let c=Math.max(0,n-t),h=Math.max(0,c-2*i),m=a>0&&a>n;if(!m)return{computedAvailableSize:Math.round(c),computedIsNeeded:m,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(n*h/a))),g=(h-f)/(a-n),b=l*g;return{computedAvailableSize:Math.round(c),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:g,computedSliderPosition:Math.round(b)}}_refreshComputedValues(){let t=a0._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,n=this._scrollPosition;return i<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},mB=class extends Fk{constructor(e,t,i){let n=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new $k(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,a.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}},pB=class extends Fk{constructor(e,t,i){let n=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new $k(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,a.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}},gB=500,HS=50,_B=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},o0=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,i=0,n=1,a=this._rear;do{let l=a===this._front?t:Math.pow(2,-n);if(t-=l,i+=this._memory[a].score*l,a===this._front)break;a=(this._capacity+a-1)%this._capacity,n++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(E_){let i=fn(t.browserEvent),n=T9(i);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,n){let a=null,l=new _B(t,i,n);this._front===-1&&this._rear===-1?(this._memory[0]=l,this._front=0,this._rear=0):(a=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]=l),l.score=this._computeScore(l,a)}_computeScore(t,i){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),i){let a=Math.abs(t.deltaX),l=Math.abs(t.deltaY),c=Math.abs(i.deltaX),h=Math.abs(i.deltaY),m=Math.max(Math.min(a,c),1),f=Math.max(Math.min(l,h),1),g=Math.max(a,c),b=Math.max(l,h);g%m===0&&b%f===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};o0.INSTANCE=new o0;var bB=o0,vB=class extends T_{constructor(e,t,i){super(),this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new pe),this.onWillScroll=this._onWillScroll.event,this._options=yB(t),this._scrollable=i,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let n={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new pB(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new mB(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=Nc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Nc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Nc(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,a=>this._onMouseOver(a)),this.onmouseleave(this._listenOnDomNode,a=>this._onMouseLeave(a)),this._hideTimeout=this._register(new k_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ia(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,pn&&(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 jS(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ia(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new jS(i))};this._mouseWheelToDispose.push(Pe(this._listenOnDomNode,pi.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=bB.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);let c=!pn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||c)&&!l&&(l=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),m={};if(a){let f=HS*a,g=h.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(m,g)}if(l){let f=HS*l,g=h.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(m,g)}m=this._scrollable.validateScrollPosition(m),(h.scrollLeft!==m.scrollLeft||h.scrollTop!==m.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(m):this._scrollable.setScrollPositionNow(m),i=!0)}let n=i;!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,i=e.scrollLeft>0,n=i?" left":"",a=t?" top":"",l=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${a}${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(),gB)}},xB=class extends vB{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function yB(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,pn&&(t.className+=" mac"),t}var l0=class extends Ge{constructor(e,t,i,n,a,l,c,h){super(),this._bufferService=i,this._optionsService=c,this._renderService=h,this._onRequestScrollLines=this._register(new pe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new lB({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>N_(n.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new xB(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},m)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(a.onProtocolChange(f=>{this._scrollableElement.updateOptions({handleMouseWheel:!(f&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Ti.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Dt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Dt(()=>this._styleElement.remove())),this._register(Ti.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
28
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(f=>this._handleScroll(f)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};l0=Ht([ve(2,Ki),ve(3,ir),ve(4,wk),ve(5,il),ve(6,Gi),ve(7,sr)],l0);var c0=class extends Ge{constructor(e,t,i,n,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=n,this._renderService=a,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(l=>this._removeDecoration(l))),this._register(Dt(()=>{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){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};c0=Ht([ve(1,Ki),ve(2,ir),ve(3,Jc),ve(4,sr)],c0);var SB=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},on={full:0,left:0,center:0,right:0},Br={full:0,left:0,center:0,right:0},rc={full:0,left:0,center:0,right:0},uh=class extends Ge{constructor(e,t,i,n,a,l,c,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=n,this._renderService=a,this._optionsService=l,this._themeService=c,this._coreBrowserService=h,this._colorZoneStore=new SB,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(Dt(()=>this._canvas?.remove()));let m=this._canvas.getContext("2d");if(m)this._ctx=m;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(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Br.full=this._canvas.width,Br.left=e,Br.center=t,Br.right=e,this._refreshDrawHeightConstants(),rc.full=1,rc.left=1,rc.center=1+Br.left,rc.right=1+Br.left+Br.center}_refreshDrawHeightConstants(){on.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);on.left=t,on.center=t,on.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*on.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*on.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*on.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*on.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(rc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-on[e.position||"full"]/2),Br[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+on[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}))}};uh=Ht([ve(2,Ki),ve(3,Jc),ve(4,sr),ve(5,Gi),ve(6,il),ve(7,ir)],uh);var ce;(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=`
|
|
29
|
+
`,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=""))(ce||={});var Gd;(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=""))(Gd||={});var Vk;(e=>e.ST=`${ce.ESC}\\`)(Vk||={});var u0=class{constructor(e,t,i,n,a,l){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=n,this._coreService=a,this._renderService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ce.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let l=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};u0=Ht([ve(2,Ki),ve(3,Gi),ve(4,$a),ve(5,sr)],u0);var gi=0,_i=0,bi=0,Ut=0,FS={css:"#00000000",rgba:0},ni;(e=>{function t(a,l,c,h){return h!==void 0?`#${Ea(a)}${Ea(l)}${Ea(c)}${Ea(h)}`:`#${Ea(a)}${Ea(l)}${Ea(c)}`}e.toCss=t;function i(a,l,c,h=255){return(a<<24|l<<16|c<<8|h)>>>0}e.toRgba=i;function n(a,l,c,h){return{css:e.toCss(a,l,c,h),rgba:e.toRgba(a,l,c,h)}}e.toColor=n})(ni||={});var Tt;(e=>{function t(m,f){if(Ut=(f.rgba&255)/255,Ut===1)return{css:f.css,rgba:f.rgba};let g=f.rgba>>24&255,b=f.rgba>>16&255,v=f.rgba>>8&255,x=m.rgba>>24&255,y=m.rgba>>16&255,w=m.rgba>>8&255;gi=x+Math.round((g-x)*Ut),_i=y+Math.round((b-y)*Ut),bi=w+Math.round((v-w)*Ut);let C=ni.toCss(gi,_i,bi),N=ni.toRgba(gi,_i,bi);return{css:C,rgba:N}}e.blend=t;function i(m){return(m.rgba&255)===255}e.isOpaque=i;function n(m,f,g){let b=Wd.ensureContrastRatio(m.rgba,f.rgba,g);if(b)return ni.toColor(b>>24&255,b>>16&255,b>>8&255)}e.ensureContrastRatio=n;function a(m){let f=(m.rgba|255)>>>0;return[gi,_i,bi]=Wd.toChannels(f),{css:ni.toCss(gi,_i,bi),rgba:f}}e.opaque=a;function l(m,f){return Ut=Math.round(f*255),[gi,_i,bi]=Wd.toChannels(m.rgba),{css:ni.toCss(gi,_i,bi,Ut),rgba:ni.toRgba(gi,_i,bi,Ut)}}e.opacity=l;function c(m,f){return Ut=m.rgba&255,l(m,Ut*f/255)}e.multiplyOpacity=c;function h(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=h})(Tt||={});var Bt;(e=>{let t,i;try{let a=document.createElement("canvas");a.width=1,a.height=1;let l=a.getContext("2d",{willReadFrequently:!0});l&&(t=l,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function n(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return gi=parseInt(a.slice(1,2).repeat(2),16),_i=parseInt(a.slice(2,3).repeat(2),16),bi=parseInt(a.slice(3,4).repeat(2),16),ni.toColor(gi,_i,bi);case 5:return gi=parseInt(a.slice(1,2).repeat(2),16),_i=parseInt(a.slice(2,3).repeat(2),16),bi=parseInt(a.slice(3,4).repeat(2),16),Ut=parseInt(a.slice(4,5).repeat(2),16),ni.toColor(gi,_i,bi,Ut);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let l=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return gi=parseInt(l[1]),_i=parseInt(l[2]),bi=parseInt(l[3]),Ut=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),ni.toColor(gi,_i,bi,Ut);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[gi,_i,bi,Ut]=t.getImageData(0,0,1,1).data,Ut!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ni.toRgba(gi,_i,bi,Ut),css:a}}e.toColor=n})(Bt||={});var Hi;(e=>{function t(n){return i(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function i(n,a,l){let c=n/255,h=a/255,m=l/255,f=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),g=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),b=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return f*.2126+g*.7152+b*.0722}e.relativeLuminance2=i})(Hi||={});var Wd;(e=>{function t(c,h){if(Ut=(h&255)/255,Ut===1)return h;let m=h>>24&255,f=h>>16&255,g=h>>8&255,b=c>>24&255,v=c>>16&255,x=c>>8&255;return gi=b+Math.round((m-b)*Ut),_i=v+Math.round((f-v)*Ut),bi=x+Math.round((g-x)*Ut),ni.toRgba(gi,_i,bi)}e.blend=t;function i(c,h,m){let f=Hi.relativeLuminance(c>>8),g=Hi.relativeLuminance(h>>8);if(Gn(f,g)<m){if(g<f){let x=n(c,h,m),y=Gn(f,Hi.relativeLuminance(x>>8));if(y<m){let w=a(c,h,m),C=Gn(f,Hi.relativeLuminance(w>>8));return y>C?x:w}return x}let b=a(c,h,m),v=Gn(f,Hi.relativeLuminance(b>>8));if(v<m){let x=n(c,h,m),y=Gn(f,Hi.relativeLuminance(x>>8));return v>y?b:x}return b}}e.ensureContrastRatio=i;function n(c,h,m){let f=c>>24&255,g=c>>16&255,b=c>>8&255,v=h>>24&255,x=h>>16&255,y=h>>8&255,w=Gn(Hi.relativeLuminance2(v,x,y),Hi.relativeLuminance2(f,g,b));for(;w<m&&(v>0||x>0||y>0);)v-=Math.max(0,Math.ceil(v*.1)),x-=Math.max(0,Math.ceil(x*.1)),y-=Math.max(0,Math.ceil(y*.1)),w=Gn(Hi.relativeLuminance2(v,x,y),Hi.relativeLuminance2(f,g,b));return(v<<24|x<<16|y<<8|255)>>>0}e.reduceLuminance=n;function a(c,h,m){let f=c>>24&255,g=c>>16&255,b=c>>8&255,v=h>>24&255,x=h>>16&255,y=h>>8&255,w=Gn(Hi.relativeLuminance2(v,x,y),Hi.relativeLuminance2(f,g,b));for(;w<m&&(v<255||x<255||y<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),w=Gn(Hi.relativeLuminance2(v,x,y),Hi.relativeLuminance2(f,g,b));return(v<<24|x<<16|y<<8|255)>>>0}e.increaseLuminance=a;function l(c){return[c>>24&255,c>>16&255,c>>8&255,c&255]}e.toChannels=l})(Wd||={});function Ea(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Gn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var wB=class extends Qc{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},dh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Ps}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let i=[],n=t.translateToString(!0),a=0,l=0,c=0,h=t.getFg(0),m=t.getBg(0);for(let f=0;f<t.getTrimmedLength();f++)if(t.loadCell(f,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==h||this._workCell.bg!==m){if(f-a>1){let g=this._getJoinedRanges(n,c,l,t,a);for(let b=0;b<g.length;b++)i.push(g[b])}a=f,c=l,h=this._workCell.fg,m=this._workCell.bg}l+=this._workCell.getChars().length||$r.length}if(this._bufferService.cols-a>1){let f=this._getJoinedRanges(n,c,l,t,a);for(let g=0;g<f.length;g++)i.push(f[g])}return i}_getJoinedRanges(e,t,i,n,a){let l=e.substring(t,i),c=[];try{c=this._characterJoiners[0].handler(l)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let m=this._characterJoiners[h].handler(l);for(let f=0;f<m.length;f++)dh._mergeRanges(c,m[f])}catch(m){console.error(m)}return this._stringRangesToCellRanges(c,n,a),c}_stringRangesToCellRanges(e,t,i){let n=0,a=!1,l=0,c=e[n];if(c){for(let h=i;h<this._bufferService.cols;h++){let m=t.getWidth(h),f=t.getString(h).length||$r.length;if(m!==0){if(!a&&c[0]<=l&&(c[0]=h,a=!0),c[1]<=l){if(c[1]=h,c=e[++n],!c)break;c[0]<=l?(c[0]=h,a=!0):a=!1}l+=f}}c&&(c[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let n=0;n<e.length;n++){let a=e[n];if(i){if(t[1]<=a[0])return e[n-1][1]=t[1],e;if(t[1]<=a[1])return e[n-1][1]=Math.max(t[1],a[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=a[0])return e.splice(n,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};dh=Ht([ve(0,Ki)],dh);function EB(e){return 57508<=e&&e<=57558}function CB(e){return 9472<=e&&e<=9631}function kB(e){return EB(e)||CB(e)}function NB(){return{css:{canvas:Md(),cell:Md()},device:{canvas:Md(),cell:Md(),char:{width:0,height:0,left:0,top:0}}}}function Md(){return{width:0,height:0}}var d0=class{constructor(e,t,i,n,a,l,c){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=n,this._coreService=a,this._decorationService=l,this._themeService=c,this._workCell=new Ps,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,n,a,l,c,h,m,f,g){let b=[],v=this._characterJoinerService.getJoinedCharacters(t),x=this._themeService.colors,y=e.getNoBgTrimmedLength();i&&y<l+1&&(y=l+1);let w,C=0,N="",T=0,D=0,A=0,L=0,G=!1,j=0,R=!1,H=0,I=0,W=[],J=f!==-1&&g!==-1;for(let P=0;P<y;P++){e.loadCell(P,this._workCell);let te=this._workCell.getWidth();if(te===0)continue;let K=!1,M=P>=I,$=P,F=this._workCell;if(v.length>0&&P===v[0][0]&&M){let Be=v.shift(),Ft=this._isCellInSelection(Be[0],t);for(T=Be[0]+1;T<Be[1];T++)M&&=Ft===this._isCellInSelection(T,t);M&&=!i||l<Be[0]||l>=Be[1],M?(K=!0,F=new wB(this._workCell,e.translateToString(!0,Be[0],Be[1]),Be[1]-Be[0]),$=Be[1]-1,te=F.getWidth()):I=Be[1]}let V=this._isCellInSelection(P,t),Y=i&&P===l,O=J&&P>=f&&P<=g,ee=!1;this._decorationService.forEachDecorationAtCell(P,t,void 0,Be=>{ee=!0});let ue=F.getChars()||$r;if(ue===" "&&(F.isUnderline()||F.isOverline())&&(ue=" "),H=te*h-m.get(ue,F.isBold(),F.isItalic()),!w)w=this._document.createElement("span");else if(C&&(V&&R||!V&&!R&&F.bg===D)&&(V&&R&&x.selectionForeground||F.fg===A)&&F.extended.ext===L&&O===G&&H===j&&!Y&&!K&&!ee&&M){F.isInvisible()?N+=$r:N+=ue,C++;continue}else C&&(w.textContent=N),w=this._document.createElement("span"),C=0,N="";if(D=F.bg,A=F.fg,L=F.extended.ext,G=O,j=H,R=V,K&&l>=P&&l<=$&&(l=P),!this._coreService.isCursorHidden&&Y&&this._coreService.isCursorInitialized){if(W.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&W.push("xterm-cursor-blink"),W.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":W.push("xterm-cursor-outline");break;case"block":W.push("xterm-cursor-block");break;case"bar":W.push("xterm-cursor-bar");break;case"underline":W.push("xterm-cursor-underline");break}}if(F.isBold()&&W.push("xterm-bold"),F.isItalic()&&W.push("xterm-italic"),F.isDim()&&W.push("xterm-dim"),F.isInvisible()?N=$r:N=F.getChars()||$r,F.isUnderline()&&(W.push(`xterm-underline-${F.extended.underlineStyle}`),N===" "&&(N=" "),!F.isUnderlineColorDefault()))if(F.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${Qc.toColorRGB(F.getUnderlineColor()).join(",")})`;else{let Be=F.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&F.isBold()&&Be<8&&(Be+=8),w.style.textDecorationColor=x.ansi[Be].css}F.isOverline()&&(W.push("xterm-overline"),N===" "&&(N=" ")),F.isStrikethrough()&&W.push("xterm-strikethrough"),O&&(w.style.textDecoration="underline");let ie=F.getFgColor(),le=F.getFgColorMode(),me=F.getBgColor(),Se=F.getBgColorMode(),ze=!!F.isInverse();if(ze){let Be=ie;ie=me,me=Be;let Ft=le;le=Se,Se=Ft}let Ee,nt,lt=!1;this._decorationService.forEachDecorationAtCell(P,t,void 0,Be=>{Be.options.layer!=="top"&<||(Be.backgroundColorRGB&&(Se=50331648,me=Be.backgroundColorRGB.rgba>>8&16777215,Ee=Be.backgroundColorRGB),Be.foregroundColorRGB&&(le=50331648,ie=Be.foregroundColorRGB.rgba>>8&16777215,nt=Be.foregroundColorRGB),lt=Be.options.layer==="top")}),!lt&&V&&(Ee=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,me=Ee.rgba>>8&16777215,Se=50331648,lt=!0,x.selectionForeground&&(le=50331648,ie=x.selectionForeground.rgba>>8&16777215,nt=x.selectionForeground)),lt&&W.push("xterm-decoration-top");let ct;switch(Se){case 16777216:case 33554432:ct=x.ansi[me],W.push(`xterm-bg-${me}`);break;case 50331648:ct=ni.toColor(me>>16,me>>8&255,me&255),this._addStyle(w,`background-color:#${$S((me>>>0).toString(16),"0",6)}`);break;default:ze?(ct=x.foreground,W.push("xterm-bg-257")):ct=x.background}switch(Ee||F.isDim()&&(Ee=Tt.multiplyOpacity(ct,.5)),le){case 16777216:case 33554432:F.isBold()&&ie<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ie+=8),this._applyMinimumContrast(w,ct,x.ansi[ie],F,Ee,void 0)||W.push(`xterm-fg-${ie}`);break;case 50331648:let Be=ni.toColor(ie>>16&255,ie>>8&255,ie&255);this._applyMinimumContrast(w,ct,Be,F,Ee,nt)||this._addStyle(w,`color:#${$S(ie.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(w,ct,x.foreground,F,Ee,nt)||ze&&W.push("xterm-fg-257")}W.length&&(w.className=W.join(" "),W.length=0),!Y&&!K&&!ee&&M?C++:w.textContent=N,H!==this.defaultSpacing&&(w.style.letterSpacing=`${H}px`),b.push(w),P=$}return w&&C&&(w.textContent=N),b}_applyMinimumContrast(e,t,i,n,a,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||kB(n.getCode()))return!1;let c=this._getContrastCache(n),h;if(!a&&!l&&(h=c.getColor(t.rgba,i.rgba)),h===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);h=Tt.ensureContrastRatio(a||t,l||i,m),c.setColor((a||t).rgba,(l||i).rgba,h??null)}return h?(this._addStyle(e,`color:${h.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,n=this._selectionEnd;return!i||!n?!1:this._columnSelectMode?i[0]<=n[0]?e>=i[0]&&t>=i[1]&&e<n[0]&&t<=n[1]:e<i[0]&&t>=i[1]&&e>=n[0]&&t<=n[1]:t>i[1]&&t<n[1]||i[1]===n[1]&&t===i[1]&&e>=i[0]&&e<n[0]||i[1]<n[1]&&t===n[1]&&e<n[0]||i[1]<n[1]&&t===i[1]&&e>=i[0]}};d0=Ht([ve(1,kk),ve(2,Gi),ve(3,ir),ve(4,$a),ve(5,Jc),ve(6,il)],d0);function $S(e,t,i){for(;e.length<i;)e=t+e;return e}var TB=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let i=e.createElement("span");i.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold",l.style.fontStyle="italic",this._measureElements=[i,n,a,l],this._container.appendChild(i),this._container.appendChild(n),this._container.appendChild(a),this._container.appendChild(l),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,i,n){e===this._font&&t===this._fontSize&&i===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,i){let n=0;if(!t&&!i&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let c=this._measure(e,0);return c>0&&(this._flat[n]=c),c}let a=e;t&&(a+="B"),i&&(a+="I");let l=this._holey.get(a);if(l===void 0){let c=0;t&&(c|=1),i&&(c|=2),l=this._measure(e,c),l>0&&this._holey.set(a,l)}return l}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},AB=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,n=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let a=e.buffers.active.ydisp,l=t[1]-a,c=i[1]-a,h=Math.max(l,0),m=Math.min(c,e.rows-1);if(h>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=l,this.viewportEndRow=c,this.viewportCappedStartRow=h,this.viewportCappedEndRow=m,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function MB(){return new AB}var xp="xterm-dom-renderer-owner-",Rs="xterm-rows",Rd="xterm-fg-",VS="xterm-bg-",ac="xterm-focus",Dd="xterm-selection",RB=1,h0=class extends Ge{constructor(e,t,i,n,a,l,c,h,m,f,g,b,v,x){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=n,this._viewportElement=a,this._helperContainer=l,this._linkifier2=c,this._charSizeService=m,this._optionsService=f,this._bufferService=g,this._coreService=b,this._coreBrowserService=v,this._themeService=x,this._terminalClass=RB++,this._rowElements=[],this._selectionRenderModel=MB(),this.onRequestRedraw=this._register(new pe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Rs),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(Dd),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=NB(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(y=>this._injectCss(y))),this._injectCss(this._themeService.colors),this._rowFactory=h.createInstance(d0,document),this._element.classList.add(xp+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(y=>this._handleLinkHover(y))),this._register(this._linkifier2.onHideLinkUnderline(y=>this._handleLinkLeave(y))),this._register(Dt(()=>{this._element.classList.remove(xp+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new TB(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Rs} 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} .${Rs} { 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} .${Rs} .xterm-dim { color: ${Tt.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let i=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Rs}.${ac} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Rs}.${ac} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Rs}.${ac} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${Rs} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Rs} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Rs} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Rs} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Rs} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Dd} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Dd} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Dd} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,c]of e.ansi.entries())t+=`${this._terminalSelector} .${Rd}${l} { color: ${c.css}; }${this._terminalSelector} .${Rd}${l}.xterm-dim { color: ${Tt.multiplyOpacity(c,.5).css}; }${this._terminalSelector} .${VS}${l} { background-color: ${c.css}; }`;t+=`${this._terminalSelector} .${Rd}257 { color: ${Tt.opaque(e.background).css}; }${this._terminalSelector} .${Rd}257.xterm-dim { color: ${Tt.multiplyOpacity(Tt.opaque(e.background),.5).css}; }${this._terminalSelector} .${VS}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let 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(ac),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ac),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,l=this._selectionRenderModel.viewportCappedStartRow,c=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(i){let m=e[0]>t[0];h.appendChild(this._createSelectionElement(l,m?t[0]:e[0],m?e[0]:t[0],c-l+1))}else{let m=n===l?e[0]:0,f=l===a?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(l,m,f));let g=c-l-1;if(h.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,g)),l!==c){let b=a===c?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(c,0,b))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,t,i,n=1){let a=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,c=this.dimensions.css.cell.width*(i-t);return l+c>this.dimensions.css.canvas.width&&(c=this.dimensions.css.canvas.width-l),a.style.height=`${n*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${l}px`,a.style.width=`${c}px`,a}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,n=i.ybase+i.y,a=Math.min(i.x,this._bufferService.cols-1),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,c=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=e;m<=t;m++){let f=m+i.ydisp,g=this._rowElements[m],b=i.lines.get(f);if(!g||!b)break;g.replaceChildren(...this._rowFactory.createRow(b,f,f===n,c,h,a,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${xp}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,n,a,l){i<0&&(e=0),n<0&&(t=0);let c=this._bufferService.rows-1;i=Math.max(Math.min(i,c),0),n=Math.max(Math.min(n,c),0),a=Math.min(a,this._bufferService.cols);let h=this._bufferService.buffer,m=h.ybase+h.y,f=Math.min(h.x,a-1),g=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let x=i;x<=n;++x){let y=x+h.ydisp,w=this._rowElements[x],C=h.lines.get(y);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,y,y===m,b,v,f,g,this.dimensions.css.cell.width,this._widthCache,l?x===i?e:0:-1,l?(x===n?t:a)-1:-1))}}};h0=Ht([ve(7,y_),ve(8,Dh),ve(9,Gi),ve(10,Ki),ve(11,$a),ve(12,ir),ve(13,il)],h0);var f0=class extends Ge{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new pe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new OB(this._optionsService))}catch{this._measureStrategy=this._register(new DB(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())}};f0=Ht([ve(2,Gi)],f0);var qk=class extends Ge{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)}},DB=class extends qk{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},OB=class extends qk{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}},jB=class extends Ge{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new LB(this._window)),this._onDprChange=this._register(new pe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new pe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(Ti.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Pe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Pe(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}},LB=class extends Ge{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Xo),this._onDprChange=this._register(new pe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Dt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Pe(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}},BB=class extends Ge{constructor(){super(),this.linkProviders=[],this._register(Dt(()=>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 A_(e,t,i){let n=i.getBoundingClientRect(),a=e.getComputedStyle(i),l=parseInt(a.getPropertyValue("padding-left")),c=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-n.left-l,t.clientY-n.top-c]}function zB(e,t,i,n,a,l,c,h,m){if(!l)return;let f=A_(e,t,i);if(f)return f[0]=Math.ceil((f[0]+(m?c/2:0))/c),f[1]=Math.ceil(f[1]/h),f[0]=Math.min(Math.max(f[0],1),n+(m?1:0)),f[1]=Math.min(Math.max(f[1],1),a),f}var m0=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,n,a){return zB(window,e,t,i,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let i=A_(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};m0=Ht([ve(0,sr),ve(1,Dh)],m0);var IB=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Kk={};WL(Kk,{getSafariVersion:()=>UB,isChromeOS:()=>Xk,isFirefox:()=>Gk,isIpad:()=>HB,isIphone:()=>FB,isLegacyEdge:()=>PB,isLinux:()=>M_,isMac:()=>hh,isNode:()=>Oh,isSafari:()=>Wk,isWindows:()=>Yk});var Oh=typeof process<"u"&&"title"in process,eu=Oh?"node":navigator.userAgent,tu=Oh?"node":navigator.platform,Gk=eu.includes("Firefox"),PB=eu.includes("Edge"),Wk=/^((?!chrome|android).)*safari/i.test(eu);function UB(){if(!Wk)return 0;let e=eu.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var hh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(tu),HB=tu==="iPad",FB=tu==="iPhone",Yk=["Windows","Win16","Win32","WinCE"].includes(tu),M_=tu.indexOf("Linux")>=0,Xk=/\bCrOS\b/.test(eu),Zk=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,n=e.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),a=e.timeRemaining(),i*1.5>a){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=a}this.clear()}},$B=class extends Zk{_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())}}},VB=class extends Zk{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},fh=!Oh&&"requestIdleCallback"in window?VB:$B,qB=class{constructor(){this._queue=new fh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},p0=class extends Ge{constructor(e,t,i,n,a,l,c,h,m){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=n,this._coreService=a,this._coreBrowserService=h,this._renderer=this._register(new Xo),this._pausedResizeTask=new qB,this._observerDisposable=this._register(new Xo),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 pe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new pe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new pe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new pe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new IB((f,g)=>this._renderRows(f,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new KB(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Dt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(c.onResize(()=>this._fullRefresh())),this._register(c.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(c.cols,c.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(c.buffer.y,c.buffer.y,!0))),this._register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(f=>this._registerIntersectionObserver(f,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=Dt(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),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(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};p0=Ht([ve(2,Gi),ve(3,Dh),ve(4,$a),ve(5,Jc),ve(6,Ki),ve(7,ir),ve(8,il)],p0);var KB=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function GB(e,t,i,n){let a=i.buffer.x,l=i.buffer.y;if(!i.buffer.hasScrollback)return XB(a,l,e,t,i,n)+jh(l,t,i,n)+ZB(a,l,e,t,i,n);let c;if(l===t)return c=a>e?"D":"C",Ic(Math.abs(a-e),zc(c,n));c=l>t?"D":"C";let h=Math.abs(l-t),m=YB(l>t?e:a,i)+(h-1)*i.cols+1+WB(l>t?a:e);return Ic(m,zc(c,n))}function WB(e,t){return e-1}function YB(e,t){return t.cols-e}function XB(e,t,i,n,a,l){return jh(t,n,a,l).length===0?"":Ic(Jk(e,t,e,t-Pa(t,a),!1,a).length,zc("D",l))}function jh(e,t,i,n){let a=e-Pa(e,i),l=t-Pa(t,i),c=Math.abs(a-l)-QB(e,t,i);return Ic(c,zc(Qk(e,t),n))}function ZB(e,t,i,n,a,l){let c;jh(t,n,a,l).length>0?c=n-Pa(n,a):c=t;let h=n,m=JB(e,t,i,n,a,l);return Ic(Jk(e,c,i,h,m==="C",a).length,zc(m,l))}function QB(e,t,i){let n=0,a=e-Pa(e,i),l=t-Pa(t,i);for(let c=0;c<Math.abs(a-l);c++){let h=Qk(e,t)==="A"?-1:1;i.buffer.lines.get(a+h*c)?.isWrapped&&n++}return n}function Pa(e,t){let i=0,n=t.buffer.lines.get(e),a=n?.isWrapped;for(;a&&e>=0&&e<t.rows;)i++,n=t.buffer.lines.get(--e),a=n?.isWrapped;return i}function JB(e,t,i,n,a,l){let c;return jh(i,n,a,l).length>0?c=n-Pa(n,a):c=t,e<i&&c<=n||e>=i&&c<n?"C":"D"}function Qk(e,t){return e>t?"A":"B"}function Jk(e,t,i,n,a,l){let c=e,h=t,m="";for(;(c!==i||h!==n)&&h>=0&&h<l.buffer.lines.length;)c+=a?1:-1,a&&c>l.cols-1?(m+=l.buffer.translateBufferLineToString(h,!1,e,c),c=0,e=0,h++):!a&&c<0&&(m+=l.buffer.translateBufferLineToString(h,!1,0,e+1),c=l.cols-1,e=c,h--);return m+l.buffer.translateBufferLineToString(h,!1,e,c)}function zc(e,t){let i=t?"O":"[";return ce.ESC+i+e}function Ic(e,t){e=Math.floor(e);let i="";for(let n=0;n<e;n++)i+=t;return i}var ez=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 qS(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 yp=50,tz=15,iz=50,sz=500,nz=" ",rz=new RegExp(nz,"g"),g0=class extends Ge{constructor(e,t,i,n,a,l,c,h,m){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=n,this._coreService=a,this._mouseService=l,this._optionsService=c,this._renderService=h,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Ps,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new pe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new pe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new pe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new pe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=f=>this._handleMouseMove(f),this._mouseUpListener=f=>this._handleMouseUp(f),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(f=>this._handleTrim(f)),this._register(this._bufferService.buffers.onBufferActivate(f=>this._handleBufferActivate(f))),this.enable(),this._model=new ez(this._bufferService),this._activeSelectionMode=0,this._register(Dt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(f=>{f.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],l=e[0]<t[0]?t[0]:e[0];for(let c=e[1];c<=t[1];c++){let h=i.translateBufferLineToString(c,!0,a,l);n.push(h)}}else{let a=e[1]===t[1]?t[0]:void 0;n.push(i.translateBufferLineToString(e[1],!0,e[0],a));for(let l=e[1]+1;l<=t[1]-1;l++){let c=i.lines.get(l),h=i.translateBufferLineToString(l,!0);c?.isWrapped?n[n.length-1]+=h:n.push(h)}if(e[1]!==t[1]){let l=i.lines.get(t[1]),c=i.translateBufferLineToString(t[1],!0,0,t[0]);l&&l.isWrapped?n[n.length-1]+=c:n.push(c)}}return n.map(a=>a.replace(rz," ")).join(Yk?`\r
|
|
30
|
+
`:`
|
|
31
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),M_&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!i||!n||!t?!1:this._areCoordsInSelection(t,i,n)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!i||!n?!1:this._areCoordsInSelection([e,t],i,n)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=qS(i,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=A_(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-yp),yp),t/=yp,t/Math.abs(t)+Math.round(t*(tz-1)))}shouldForceSelection(e){return hh?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(),iz)}_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&&!(hh&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let n=i.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<sz&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let n=GB(i[0]-1,i[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,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let n=0;t>=n;n++){let a=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:a>1&&t!==n&&(i+=a-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let a=this._bufferService.buffer,l=a.lines.get(e[1]);if(!l)return;let c=a.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(l,e[0]),m=h,f=e[0]-h,g=0,b=0,v=0,x=0;if(c.charAt(h)===" "){for(;h>0&&c.charAt(h-1)===" ";)h--;for(;m<c.length&&c.charAt(m+1)===" ";)m++}else{let C=e[0],N=e[0];l.getWidth(C)===0&&(g++,C--),l.getWidth(N)===2&&(b++,N++);let T=l.getString(N).length;for(T>1&&(x+=T-1,m+=T-1);C>0&&h>0&&!this._isCharWordSeparator(l.loadCell(C-1,this._workCell));){l.loadCell(C-1,this._workCell);let D=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,C--):D>1&&(v+=D-1,h-=D-1),h--,C--}for(;N<l.length&&m+1<c.length&&!this._isCharWordSeparator(l.loadCell(N+1,this._workCell));){l.loadCell(N+1,this._workCell);let D=this._workCell.getChars().length;this._workCell.getWidth()===2?(b++,N++):D>1&&(x+=D-1,m+=D-1),m++,N++}}m++;let y=h+f-g+v,w=Math.min(this._bufferService.cols,m-h+g+b-v-x);if(!(!t&&c.slice(h,m).trim()==="")){if(i&&y===0&&l.getCodePoint(0)!==32){let C=a.lines.get(e[1]-1);if(C&&l.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let N=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(N){let T=this._bufferService.cols-N.start;y-=T,w+=T}}}if(n&&y+w===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let C=a.lines.get(e[1]+1);if(C?.isWrapped&&C.getCodePoint(0)!==32){let N=this._getWordAt([0,e[1]+1],!1,!1,!0);N&&(w+=N.length)}}return{start:y,length:w}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=qS(i,this._bufferService.cols)}};g0=Ht([ve(3,Ki),ve(4,$a),ve(5,S_),ve(6,Gi),ve(7,sr),ve(8,ir)],g0);var KS=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},GS=class{constructor(){this._color=new KS,this._css=new KS}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},li=Object.freeze((()=>{let e=[Bt.toColor("#2e3436"),Bt.toColor("#cc0000"),Bt.toColor("#4e9a06"),Bt.toColor("#c4a000"),Bt.toColor("#3465a4"),Bt.toColor("#75507b"),Bt.toColor("#06989a"),Bt.toColor("#d3d7cf"),Bt.toColor("#555753"),Bt.toColor("#ef2929"),Bt.toColor("#8ae234"),Bt.toColor("#fce94f"),Bt.toColor("#729fcf"),Bt.toColor("#ad7fa8"),Bt.toColor("#34e2e2"),Bt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=t[i/36%6|0],a=t[i/6%6|0],l=t[i%6];e.push({css:ni.toCss(n,a,l),rgba:ni.toRgba(n,a,l)})}for(let i=0;i<24;i++){let n=8+i*10;e.push({css:ni.toCss(n,n,n),rgba:ni.toRgba(n,n,n)})}return e})()),Na=Bt.toColor("#ffffff"),_c=Bt.toColor("#000000"),WS=Bt.toColor("#ffffff"),YS=_c,oc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},az=Na,_0=class extends Ge{constructor(e){super(),this._optionsService=e,this._contrastCache=new GS,this._halfContrastCache=new GS,this._onChangeColors=this._register(new pe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Na,background:_c,cursor:WS,cursorAccent:YS,selectionForeground:void 0,selectionBackgroundTransparent:oc,selectionBackgroundOpaque:Tt.blend(_c,oc),selectionInactiveBackgroundTransparent:oc,selectionInactiveBackgroundOpaque:Tt.blend(_c,oc),scrollbarSliderBackground:Tt.opacity(Na,.2),scrollbarSliderHoverBackground:Tt.opacity(Na,.4),scrollbarSliderActiveBackground:Tt.opacity(Na,.5),overviewRulerBorder:Na,ansi:li.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=xt(e.foreground,Na),t.background=xt(e.background,_c),t.cursor=Tt.blend(t.background,xt(e.cursor,WS)),t.cursorAccent=Tt.blend(t.background,xt(e.cursorAccent,YS)),t.selectionBackgroundTransparent=xt(e.selectionBackground,oc),t.selectionBackgroundOpaque=Tt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=xt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Tt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?xt(e.selectionForeground,FS):void 0,t.selectionForeground===FS&&(t.selectionForeground=void 0),Tt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Tt.opacity(t.selectionBackgroundTransparent,.3)),Tt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Tt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=xt(e.scrollbarSliderBackground,Tt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=xt(e.scrollbarSliderHoverBackground,Tt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=xt(e.scrollbarSliderActiveBackground,Tt.opacity(t.foreground,.5)),t.overviewRulerBorder=xt(e.overviewRulerBorder,az),t.ansi=li.slice(),t.ansi[0]=xt(e.black,li[0]),t.ansi[1]=xt(e.red,li[1]),t.ansi[2]=xt(e.green,li[2]),t.ansi[3]=xt(e.yellow,li[3]),t.ansi[4]=xt(e.blue,li[4]),t.ansi[5]=xt(e.magenta,li[5]),t.ansi[6]=xt(e.cyan,li[6]),t.ansi[7]=xt(e.white,li[7]),t.ansi[8]=xt(e.brightBlack,li[8]),t.ansi[9]=xt(e.brightRed,li[9]),t.ansi[10]=xt(e.brightGreen,li[10]),t.ansi[11]=xt(e.brightYellow,li[11]),t.ansi[12]=xt(e.brightBlue,li[12]),t.ansi[13]=xt(e.brightMagenta,li[13]),t.ansi[14]=xt(e.brightCyan,li[14]),t.ansi[15]=xt(e.brightWhite,li[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<i;n++)t.ansi[n+16]=xt(e.extendedAnsi[n],li[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()}}};_0=Ht([ve(0,Gi)],_0);function xt(e,t){if(e!==void 0)try{return Bt.toColor(e)}catch{}return t}var oz=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},lz=class{constructor(){this._services=new oz,this._services.set(y_,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=t9(e).sort((l,c)=>l.index-c.index),n=[];for(let l of i){let c=this._services.get(l.id);if(!c)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);n.push(c)}let a=i.length>0?i[0].index:t.length;if(t.length!==a)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},cz={trace:0,debug:1,info:2,warn:3,error:4,off:5},uz="xterm.js: ",b0=class extends Ge{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=cz[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":uz)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};b0=Ht([ve(0,Gi)],b0);var XS=class extends Ge{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new pe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new pe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new pe),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...i){if(t){for(let 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+i.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<i.length;n++)this._array[this._getCyclicIndex(e+n)]=i[n];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let n=this._length+i.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let a=t-1;a>=0;a--)this.set(e+a+i,this.get(e+a));let n=e+t+i-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+i,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ve=3,ti=Object.freeze(new Qc),Od=0,Sp=2,bc=class e3{constructor(t,i,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ve);let a=i||Ps.fromCharData([0,vk,1,0]);for(let l=0;l<t;++l)this.setCell(l,a);this.length=t}get(t){let i=this._data[t*Ve+0],n=i&2097151;return[this._data[t*Ve+1],i&2097152?this._combined[t]:n?Ur(n):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,i){this._data[t*Ve+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Ve+0]=t|2097152|i[2]<<22):this._data[t*Ve+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*Ve+0]>>22}hasWidth(t){return this._data[t*Ve+0]&12582912}getFg(t){return this._data[t*Ve+1]}getBg(t){return this._data[t*Ve+2]}hasContent(t){return this._data[t*Ve+0]&4194303}getCodePoint(t){let i=this._data[t*Ve+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Ve+0]&2097152}getString(t){let i=this._data[t*Ve+0];return i&2097152?this._combined[t]:i&2097151?Ur(i&2097151):""}isProtected(t){return this._data[t*Ve+2]&536870912}loadCell(t,i){return Od=t*Ve,i.content=this._data[Od+0],i.fg=this._data[Od+1],i.bg=this._data[Od+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Ve+0]=i.content,this._data[t*Ve+1]=i.fg,this._data[t*Ve+2]=i.bg}setCellFromCodepoint(t,i,n,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Ve+0]=i|n<<22,this._data[t*Ve+1]=a.fg,this._data[t*Ve+2]=a.bg}addCodepointToCell(t,i,n){let a=this._data[t*Ve+0];a&2097152?this._combined[t]+=Ur(i):a&2097151?(this._combined[t]=Ur(a&2097151)+Ur(i),a&=-2097152,a|=2097152):a=i|1<<22,n&&(a&=-12582913,a|=n<<22),this._data[t*Ve+0]=a}insertCells(t,i,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),i<this.length-t){let a=new Ps;for(let l=this.length-t-i-1;l>=0;--l)this.setCell(t+i+l,this.loadCell(t+l,a));for(let l=0;l<i;++l)this.setCell(t+l,n)}else for(let a=t;a<this.length;++a)this.setCell(a,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,i,n){if(t%=this.length,i<this.length-t){let a=new Ps;for(let l=0;l<this.length-t-i;++l)this.setCell(t+l,this.loadCell(t+i+l,a));for(let l=this.length-i;l<this.length;++l)this.setCell(l,n)}else for(let a=t;a<this.length;++a)this.setCell(a,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,i,n,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,n);t<i&&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),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,n);t<i&&t<this.length;)this.setCell(t++,n)}resize(t,i){if(t===this.length)return this._data.length*4*Sp<this._data.buffer.byteLength;let n=t*Ve;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let a=new Uint32Array(n);a.set(this._data),this._data=a}for(let a=this.length;a<t;++a)this.setCell(a,i)}else{this._data=this._data.subarray(0,n);let a=Object.keys(this._combined);for(let c=0;c<a.length;c++){let h=parseInt(a[c],10);h>=t&&delete this._combined[h]}let l=Object.keys(this._extendedAttrs);for(let c=0;c<l.length;c++){let h=parseInt(l[c],10);h>=t&&delete this._extendedAttrs[h]}}return this.length=t,n*4*Sp<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Sp<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let 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 i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new e3(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ve+0]&4194303)return t+(this._data[t*Ve+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ve+0]&4194303||this._data[t*Ve+2]&50331648)return t+(this._data[t*Ve+0]>>22);return 0}copyCellsFrom(t,i,n,a,l){let c=t._data;if(l)for(let m=a-1;m>=0;m--){for(let f=0;f<Ve;f++)this._data[(n+m)*Ve+f]=c[(i+m)*Ve+f];c[(i+m)*Ve+2]&268435456&&(this._extendedAttrs[n+m]=t._extendedAttrs[i+m])}else for(let m=0;m<a;m++){for(let f=0;f<Ve;f++)this._data[(n+m)*Ve+f]=c[(i+m)*Ve+f];c[(i+m)*Ve+2]&268435456&&(this._extendedAttrs[n+m]=t._extendedAttrs[i+m])}let h=Object.keys(t._combined);for(let m=0;m<h.length;m++){let f=parseInt(h[m],10);f>=i&&(this._combined[f-i+n]=t._combined[f])}}translateToString(t,i,n,a){i=i??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),a&&(a.length=0);let l="";for(;i<n;){let c=this._data[i*Ve+0],h=c&2097151,m=c&2097152?this._combined[i]:h?Ur(h):$r;if(l+=m,a)for(let f=0;f<m.length;++f)a.push(i);i+=c>>22||1}return a&&a.push(i),l}};function dz(e,t,i,n,a,l){let c=[];for(let h=0;h<e.length-1;h++){let m=h,f=e.get(++m);if(!f.isWrapped)continue;let g=[e.get(h)];for(;m<e.length&&f.isWrapped;)g.push(f),f=e.get(++m);if(!l&&n>=h&&n<m){h+=g.length-1;continue}let b=0,v=Pc(g,b,t),x=1,y=0;for(;x<g.length;){let C=Pc(g,x,t),N=C-y,T=i-v,D=Math.min(N,T);g[b].copyCellsFrom(g[x],y,v,D,!1),v+=D,v===i&&(b++,v=0),y+=D,y===C&&(x++,y=0),v===0&&b!==0&&g[b-1].getWidth(i-1)===2&&(g[b].copyCellsFrom(g[b-1],i-1,v++,1,!1),g[b-1].setCell(i-1,a))}g[b].replaceCells(v,i,a);let w=0;for(let C=g.length-1;C>0&&(C>b||g[C].getTrimmedLength()===0);C--)w++;w>0&&(c.push(h+g.length-w),c.push(w)),h+=g.length-1}return c}function hz(e,t){let i=[],n=0,a=t[n],l=0;for(let c=0;c<e.length;c++)if(a===c){let h=t[++n];e.onDeleteEmitter.fire({index:c-l,amount:h}),c+=h-1,l+=h,a=t[++n]}else i.push(c);return{layout:i,countRemoved:l}}function fz(e,t){let i=[];for(let n=0;n<t.length;n++)i.push(e.get(t[n]));for(let n=0;n<i.length;n++)e.set(n,i[n]);e.length=t.length}function mz(e,t,i){let n=[],a=e.map((m,f)=>Pc(e,f,t)).reduce((m,f)=>m+f),l=0,c=0,h=0;for(;h<a;){if(a-h<i){n.push(a-h);break}l+=i;let m=Pc(e,c,t);l>m&&(l-=m,c++);let f=e[c].getWidth(l-1)===2;f&&l--;let g=f?i-1:i;n.push(g),h+=g}return n}function Pc(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,a=e[t+1].getWidth(0)===2;return n&&a?i-1:i}var t3=class i3{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=i3._nextId++,this._onDispose=this.register(new pe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ia(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};t3._nextId=1;var pz=t3,hi={},Ta=hi.B;hi[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:"≥","{":"π","|":"≠","}":"£","~":"·"};hi.A={"#":"£"};hi.B=void 0;hi[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};hi.C=hi[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};hi.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};hi.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};hi.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};hi.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};hi.E=hi[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};hi.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};hi.H=hi[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};hi["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var ZS=4294967295,QS=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=ti.clone(),this.savedCharset=Ta,this.markers=[],this._nullCell=Ps.fromCharData([0,vk,1,0]),this._whitespaceCell=Ps.fromCharData([0,$r,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new fh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new XS(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 ch),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 ch),this._whitespaceCell}getBlankLine(e,t){return new bc(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>ZS?ZS:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=ti);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 XS(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(ti),n=0,a=this._getCorrectBufferLength(t);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<e)for(let c=0;c<this.lines.length;c++)n+=+this.lines.get(c).resize(e,i);let l=0;if(this._rows<t)for(let c=this._rows;c<t;c++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new bc(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new bc(e,i)));else for(let c=this._rows;c>t;c--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let c=this.lines.length-a;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=a}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),l&&(this.y+=l),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 l=0;l<this.lines.length;l++)n+=+this.lines.get(l).resize(e,i);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 i=this._optionsService.rawOptions.reflowCursorLine,n=dz(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ti),i);if(n.length>0){let a=hz(this.lines,n);fz(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let n=this.getNullCell(ti),a=i;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new bc(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(ti),a=[],l=0;for(let c=this.lines.length-1;c>=0;c--){let h=this.lines.get(c);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;let m=[h];for(;h.isWrapped&&c>0;)h=this.lines.get(--c),m.unshift(h);if(!i){let D=this.ybase+this.y;if(D>=c&&D<c+m.length)continue}let f=m[m.length-1].getTrimmedLength(),g=mz(m,this._cols,e),b=g.length-m.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+b):v=Math.max(0,this.lines.length-this.lines.maxLength+b);let x=[];for(let D=0;D<b;D++){let A=this.getBlankLine(ti,!0);x.push(A)}x.length>0&&(a.push({start:c+m.length+l,newLines:x}),l+=x.length),m.push(...x);let y=g.length-1,w=g[y];w===0&&(y--,w=g[y]);let C=m.length-b-1,N=f;for(;C>=0;){let D=Math.min(N,w);if(m[y]===void 0)break;if(m[y].copyCellsFrom(m[C],N-D,w-D,D,!0),w-=D,w===0&&(y--,w=g[y]),N-=D,N===0){C--;let A=Math.max(C,0);N=Pc(m,A,this._cols)}}for(let D=0;D<m.length;D++)g[D]<e&&m[D].setCell(g[D],n);let T=b-v;for(;T-- >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+l)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+b,this.ybase+t-1)}if(a.length>0){let c=[],h=[];for(let w=0;w<this.lines.length;w++)h.push(this.lines.get(w));let m=this.lines.length,f=m-1,g=0,b=a[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let v=0;for(let w=Math.min(this.lines.maxLength-1,m+l-1);w>=0;w--)if(b&&b.start>f+v){for(let C=b.newLines.length-1;C>=0;C--)this.lines.set(w--,b.newLines[C]);w++,c.push({index:f+1,amount:b.newLines.length}),v+=b.newLines.length,b=a[++g]}else this.lines.set(w,h[f--]);let x=0;for(let w=c.length-1;w>=0;w--)c[w].index+=x,this.lines.onInsertEmitter.fire(c[w]),x+=c[w].amount;let y=Math.max(0,m+l-this.lines.maxLength);y>0&&this.lines.onTrimEmitter.fire(y)}}translateBufferLineToString(e,t,i=0,n){let a=this.lines.get(e);return a?a.translateToString(t,i,n):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new pz(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},gz=class extends Ge{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new pe),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 QS(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new QS(!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)}},s3=2,n3=1,v0=class extends Ge{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new pe),this.onResize=this._onResize.event,this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,s3),this.rows=Math.max(e.rawOptions.rows||0,n3),this.buffers=this._register(new gz(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=i.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let a=i.ybase+i.scrollTop,l=i.ybase+i.scrollBottom;if(i.scrollTop===0){let c=i.lines.isFull;l===i.lines.length-1?c?i.lines.recycle().copyFrom(n):i.lines.push(n.clone()):i.lines.splice(l+1,0,n.clone()),c?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let c=l-a+1;i.lines.shiftElements(a+1,c-1,-1),i.lines.set(l,n.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let n=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),n!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};v0=Ht([ve(0,Gi)],v0);var jo={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:hh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},_z=["normal","bold","100","200","300","400","500","600","700","800","900"],bz=class extends Ge{constructor(e){super(),this._onOptionChange=this._register(new pe),this.onOptionChange=this._onOptionChange.event;let t={...jo};for(let i in e)if(i in t)try{let n=e[i];t[i]=this._sanitizeAndValidateOption(i,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Dt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in jo))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,n)=>{if(!(i in jo))throw new Error(`No option with key "${i}"`);n=this._sanitizeAndValidateOption(i,n),this.rawOptions[i]!==n&&(this.rawOptions[i]=n,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let n={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=jo[e]),!vz(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=jo[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=_z.includes(t)?t:jo[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 vz(e){return e==="block"||e==="underline"||e==="bar"}function vc(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let n in e)i[n]=t<=1?e[n]:e[n]&&vc(e[n],t-1);return i}var JS=Object.freeze({insertMode:!1}),ew=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),x0=class extends Ge{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new pe),this.onData=this._onData.event,this._onUserInput=this._register(new pe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new pe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new pe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=vc(JS),this.decPrivateModes=vc(ew)}reset(){this.modes=vc(JS),this.decPrivateModes=vc(ew)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(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))}};x0=Ht([ve(0,Ki),ve(1,Ek),ve(2,Gi)],x0);var tw={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 wp(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var Ep=String.fromCharCode,iw={DEFAULT:e=>{let t=[wp(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Ep(t[0])}${Ep(t[1])}${Ep(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${wp(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${wp(e,!0)};${e.x};${e.y}${t}`}},y0=class extends Ge{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new pe),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(tw))this.addProtocol(n,tw[n]);for(let n of Object.keys(iw))this.addEncoding(n,iw[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,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let n=t/i,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=n+0,Math.abs(e.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};y0=Ht([ve(0,Ki),ve(1,$a),ve(2,Gi)],y0);var Cp=[[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]],xz=[[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]],ci;function yz(e,t){let i=0,n=t.length-1,a;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=i;)if(a=i+n>>1,e>t[a][1])i=a+1;else if(e<t[a][0])n=a-1;else return!0;return!1}var Sz=class{constructor(){if(this.version="6",!ci){ci=new Uint8Array(65536),ci.fill(1),ci[0]=0,ci.fill(0,1,32),ci.fill(0,127,160),ci.fill(2,4352,4448),ci[9001]=2,ci[9002]=2,ci.fill(2,11904,42192),ci[12351]=1,ci.fill(2,44032,55204),ci.fill(2,63744,64256),ci.fill(2,65040,65050),ci.fill(2,65072,65136),ci.fill(2,65280,65377),ci.fill(2,65504,65511);for(let e=0;e<Cp.length;++e)ci.fill(0,Cp[e][0],Cp[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ci[e]:yz(e,xz)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),n=i===0&&t!==0;if(n){let a=Da.extractWidth(t);a===0?n=!1:a>i&&(i=a)}return Da.createPropertyValue(0,i,n)}},Da=class Yd{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new pe,this.onChange=this._onChange.event;let t=new Sz;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,n=!1){return(t&16777215)<<3|(i&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 i=0,n=0,a=t.length;for(let l=0;l<a;++l){let c=t.charCodeAt(l);if(55296<=c&&c<=56319){if(++l>=a)return i+this.wcwidth(c);let f=t.charCodeAt(l);56320<=f&&f<=57343?c=(c-55296)*1024+f-56320+65536:i+=this.wcwidth(f)}let h=this.charProperties(c,n),m=Yd.extractWidth(h);Yd.extractShouldJoin(h)&&(m-=Yd.extractWidth(n)),i+=m,n=h}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},wz=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 sw(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var lc=2147483647,Ez=256,r3=class S0{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>Ez)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new S0;if(!t.length)return i;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let a=t[n];if(Array.isArray(a))for(let l=0;l<a.length;++l)i.addSubParam(a[l]);else i.addParam(a)}return i}clone(){let t=new S0(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let n=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,a))}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>lc?lc: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>lc?lc:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-i>0?this._subParams.subarray(i,n):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let n=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-n>0&&(t[i]=this._subParams.slice(n,a))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,a=n[i-1];n[i-1]=~a?Math.min(a*10+t,lc):t}},cc=[],Cz=class{constructor(){this._state=0,this._active=cc,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let n=i.indexOf(t);n!==-1&&i.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=cc}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=cc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||cc,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",Rh(e,t,i));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let 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&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,n=this._active.length-1,a=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,i=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&i===!1){for(;n>=0&&(i=this._active[n].end(e),i!==!0);n--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,i;n--}for(;n>=0;n--)if(i=this._active[n].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,i}this._active=cc,this._id=-1,this._state=0}}},bs=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,i,n){this._hitLimit||(this._data+=Rh(t,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let i=!1;if(this._hitLimit)i=!1;else if(t&&(i=this._handler(this._data),i instanceof Promise))return i.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,i}},uc=[],kz=class{constructor(){this._handlers=Object.create(null),this._active=uc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=uc}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let n=i.indexOf(t);n!==-1&&i.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=uc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||uc,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",Rh(e,t,i));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,n=this._active.length-1,a=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,i=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&i===!1){for(;n>=0&&(i=this._active[n].unhook(e),i!==!0);n--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,i;n--}for(;n>=0;n--)if(i=this._active[n].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,i}this._active=uc,this._ident=0}},xc=new r3;xc.addParam(0);var nw=class{constructor(e){this._handler=e,this._data="",this._params=xc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():xc,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Rh(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=xc,this._data="",this._hitLimit=!1,i));return this._params=xc,this._data="",this._hitLimit=!1,t}},Nz=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,n){this.table[t<<8|e]=i<<4|n}addMany(e,t,i,n){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=i<<4|n}},Ls=160,Tz=(function(){let e=new Nz(4095),t=Array.apply(null,Array(256)).map((h,m)=>m),i=(h,m)=>t.slice(h,m),n=i(32,127),a=i(0,24);a.push(25),a.push.apply(a,i(28,32));let l=i(0,14),c;e.setDefault(1,0),e.addMany(n,0,2,0);for(c in l)e.addMany([24,26,153,154],c,3,0),e.addMany(i(128,144),c,3,0),e.addMany(i(144,152),c,3,0),e.add(156,c,0,0),e.add(27,c,11,1),e.add(157,c,4,8),e.addMany([152,158,159],c,0,7),e.add(155,c,11,3),e.add(144,c,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,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(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(a,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(a,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(a,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(Ls,0,2,0),e.add(Ls,8,5,8),e.add(Ls,6,0,6),e.add(Ls,11,0,11),e.add(Ls,13,13,13),e})(),Az=class extends Ge{constructor(e=Tz){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 r3,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Dt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Cz),this._dcsParser=this._register(new kz),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let a=0;a<e.intermediates.length;++a){let l=e.intermediates.charCodeAt(a);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=l}}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 i<<=8,i|=n,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let n=this._escHandlers[i];return n.push(t),{dispose:()=>{let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let n=this._csiHandlers[i];return n.push(t),{dispose:()=>{let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,n,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=n,this._parseStack.chunkPos=a}parse(e,t,i){let n=0,a=0,l=0,c;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let h=this._parseStack.handlers,m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&m>-1){for(;m>=0&&(c=h[m](this._params),c!==!0);m--)if(c instanceof Promise)return this._parseStack.handlerPos=m,c}this._parseStack.handlers=[];break;case 4:if(i===!1&&m>-1){for(;m>=0&&(c=h[m](),c!==!0);m--)if(c instanceof Promise)return this._parseStack.handlerPos=m,c}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],c=this._dcsParser.unhook(n!==24&&n!==26,i),c)return c;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],c=this._oscParser.end(n!==24&&n!==26,i),c)return c;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let h=l;h<t;++h){switch(n=e[h],a=this._transitions.table[this.currentState<<8|(n<160?n:Ls)],a>>4){case 2:for(let v=h+1;;++v){if(v>=t||(n=e[v])<32||n>126&&n<Ls){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(n=e[v])<32||n>126&&n<Ls){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(n=e[v])<32||n>126&&n<Ls){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(n=e[v])<32||n>126&&n<Ls){this._printHandler(e,h,v),h=v-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:h,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let m=this._csiHandlers[this._collect<<8|n],f=m?m.length-1:-1;for(;f>=0&&(c=m[f](this._params),c!==!0);f--)if(c instanceof Promise)return this._preserveStack(3,m,f,a,h),c;f<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(++h<t&&(n=e[h])>47&&n<60);h--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let g=this._escHandlers[this._collect<<8|n],b=g?g.length-1:-1;for(;b>=0&&(c=g[b](),c!==!0);b--)if(c instanceof Promise)return this._preserveStack(4,g,b,a,h),c;b<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 v=h+1;;++v)if(v>=t||(n=e[v])===24||n===26||n===27||n>127&&n<Ls){this._dcsParser.put(e,h,v),h=v-1;break}break;case 14:if(c=this._dcsParser.unhook(n!==24&&n!==26),c)return this._preserveStack(6,[],0,a,h),c;n===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let v=h+1;;v++)if(v>=t||(n=e[v])<32||n>127&&n<Ls){this._oscParser.put(e,h,v),h=v-1;break}break;case 6:if(c=this._oscParser.end(n!==24&&n!==26),c)return this._preserveStack(5,[],0,a,h),c;n===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},Mz=/^([\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})$/,Rz=/^[\da-f]+$/;function rw(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=Mz.exec(t);if(i){let n=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/n*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/n*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),Rz.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,n=[0,0,0];for(let a=0;a<3;++a){let l=parseInt(t.slice(i*a,i*a+i),16);n[a]=i===1?l<<4:i===2?l:i===3?l>>4:l>>8}return n}}function kp(e,t){let i=e.toString(16),n=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function Dz(e,t=16){let[i,n,a]=e;return`rgb:${kp(i,t)}/${kp(n,t)}/${kp(a,t)}`}var Oz={"(":0,")":1,"*":2,"+":3,"-":1,".":2},zr=131072,aw=10;function ow(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 lw=5e3,cw=0,jz=class extends Ge{constructor(e,t,i,n,a,l,c,h,m=new Az){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=n,this._optionsService=a,this._oscLinkService=l,this._coreMouseService=c,this._unicodeService=h,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new JL,this._utf8Decoder=new e9,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ti.clone(),this._eraseAttrDataInternal=ti.clone(),this._onRequestBell=this._register(new pe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new pe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new pe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new pe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new pe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new pe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new pe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new pe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new pe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new pe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new pe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new pe),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 w0(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:g.toArray()})}),this._parser.setEscHandlerFallback(f=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(f)})}),this._parser.setExecuteHandlerFallback(f=>{this._logService.debug("Unknown EXECUTE code: ",{code:f})}),this._parser.setOscHandlerFallback((f,g,b)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:g,data:b})}),this._parser.setDcsHandlerFallback((f,g,b)=>{g==="HOOK"&&(b=b.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:g,payload:b})}),this._parser.setPrintHandler((f,g,b)=>this.print(f,g,b)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(ce.BEL,()=>this.bell()),this._parser.setExecuteHandler(ce.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ce.BS,()=>this.backspace()),this._parser.setExecuteHandler(ce.HT,()=>this.tab()),this._parser.setExecuteHandler(ce.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ce.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Gd.IND,()=>this.index()),this._parser.setExecuteHandler(Gd.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Gd.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new bs(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new bs(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new bs(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new bs(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new bs(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new bs(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new bs(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new bs(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new bs(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new bs(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new bs(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new bs(f=>this.restoreCursorColor(f))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let f in hi)this._parser.registerEscHandler({intermediates:"(",final:f},()=>this.selectCharset("("+f)),this._parser.registerEscHandler({intermediates:")",final:f},()=>this.selectCharset(")"+f)),this._parser.registerEscHandler({intermediates:"*",final:f},()=>this.selectCharset("*"+f)),this._parser.registerEscHandler({intermediates:"+",final:f},()=>this.selectCharset("+"+f)),this._parser.registerEscHandler({intermediates:"-",final:f},()=>this.selectCharset("-"+f)),this._parser.registerEscHandler({intermediates:".",final:f},()=>this.selectCharset("."+f)),this._parser.registerEscHandler({intermediates:"/",final:f},()=>this.selectCharset("/"+f));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(f=>(this._logService.error("Parsing error: ",f),f)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new nw((f,g)=>this.requestStatusString(f,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),lw))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${lw} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,n=this._activeBuffer.x,a=this._activeBuffer.y,l=0,c=this._parseStack.paused;if(c){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;n=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>zr&&(l=this._parseStack.position+zr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,f=>String.fromCharCode(f)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(f=>f.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<zr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,zr))),c||this._dirtyRowTracker.clearRange(),e.length>zr)for(let f=l;f<e.length;f+=zr){let g=f+zr<e.length?f+zr:e.length,b=typeof e=="string"?this._stringDecoder.decode(e.substring(f,g),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,g),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,b))return this._preserveStack(n,a,b,f),this._logSlowResolvingAsync(i),i}else if(!c){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,f))return this._preserveStack(n,a,f,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==n||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let h=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),m=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);m<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(m,this._bufferService.rows-1),end:Math.min(h,this._bufferService.rows-1)})}print(e,t,i){let n,a,l=this._charsetService.charset,c=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,g=this._curAttrData,b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&b.getWidth(this._activeBuffer.x-1)===2&&b.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let v=this._parser.precedingJoinState;for(let x=t;x<i;++x){if(n=e[x],n<127&&l){let N=l[String.fromCharCode(n)];N&&(n=N.charCodeAt(0))}let y=this._unicodeService.charProperties(n,v);a=Da.extractWidth(y);let w=Da.extractShouldJoin(y),C=w?Da.extractWidth(v):0;if(v=y,c&&this._onA11yChar.fire(Ur(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-C>h){if(m){let N=b,T=this._activeBuffer.x-C;for(this._activeBuffer.x=C,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),b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&b instanceof bc&&b.copyCellsFrom(N,T,0,C,!1);T<h;)N.setCellFromCodepoint(T++,0,1,g)}else if(this._activeBuffer.x=h-1,a===2)continue}if(w&&this._activeBuffer.x){let N=b.getWidth(this._activeBuffer.x-1)?1:2;b.addCodepointToCell(this._activeBuffer.x-N,n,a);for(let T=a-C;--T>=0;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(f&&(b.insertCells(this._activeBuffer.x,a-C,this._activeBuffer.getNullCell(g)),b.getWidth(h-1)===2&&b.setCellFromCodepoint(h-1,0,1,g)),b.setCellFromCodepoint(this._activeBuffer.x++,n,a,g),a>0)for(;--a;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=v,this._activeBuffer.x<h&&i-t>0&&b.getWidth(this._activeBuffer.x)===0&&!b.hasContent(this._activeBuffer.x)&&b.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>ow(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new nw(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new bs(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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,n=!1,a=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),a),n&&(l.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(i,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(ti));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);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 i=e.params[0]||1,n=Da.extractWidth(t),a=this._activeBuffer.x-n,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),c=new Uint32Array(l.length*i),h=0;for(let f=0;f<l.length;){let g=l.codePointAt(f)||0;c[h++]=g,f+=g>65535?2:1}let m=h;for(let f=1;f<i;++f)c.copyWithin(m,0,h),m+=h;return this.print(c,0,m),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ce.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ce.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ce.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ce.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ce.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,Ta),this._charsetService.setgCharset(1,Ta),this._charsetService.setgCharset(2,Ta),this._charsetService.setgCharset(3,Ta);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){let i;(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let n=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:l}=this._coreMouseService,c=this._coreService,{buffers:h,cols:m}=this._bufferService,{active:f,alt:g}=h,b=this._optionsService.rawOptions,v=(w,C)=>(c.triggerDataEvent(`${ce.ESC}[${t?"":"?"}${w};${C}$y`),!0),x=w=>w?1:2,y=e.params[0];return t?y===2?v(y,4):y===4?v(y,x(c.modes.insertMode)):y===12?v(y,3):y===20?v(y,x(b.convertEol)):v(y,0):y===1?v(y,x(n.applicationCursorKeys)):y===3?v(y,b.windowOptions.setWinLines?m===80?2:m===132?1:0:0):y===6?v(y,x(n.origin)):y===7?v(y,x(n.wraparound)):y===8?v(y,3):y===9?v(y,x(a==="X10")):y===12?v(y,x(b.cursorBlink)):y===25?v(y,x(!c.isCursorHidden)):y===45?v(y,x(n.reverseWraparound)):y===66?v(y,x(n.applicationKeypad)):y===67?v(y,4):y===1e3?v(y,x(a==="VT200")):y===1002?v(y,x(a==="DRAG")):y===1003?v(y,x(a==="ANY")):y===1004?v(y,x(n.sendFocus)):y===1005?v(y,4):y===1006?v(y,x(l==="SGR")):y===1015?v(y,4):y===1016?v(y,x(l==="SGR_PIXELS")):y===1048?v(y,1):y===47||y===1047||y===1049?v(y,x(f===g)):y===2004?v(y,x(n.bracketedPasteMode)):y===2026?v(y,x(n.synchronizedOutput)):v(y,0)}_updateAttrColor(e,t,i,n,a){return t===2?(e|=50331648,e&=-16777216,e|=Qc.fromColorRGB([i,n,a])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let n=[0,0,-1,0,0,0],a=0,l=0;do{if(n[l+a]=e.params[t+l],e.hasSubParams(t+l)){let c=e.getSubParams(t+l),h=0;do n[1]===5&&(a=1),n[l+h+1+a]=c[h];while(++h<c.length&&h+l+1+a<n.length);break}if(n[1]===5&&l+a>=2||n[1]===2&&l+a>=5)break;n[1]&&(a=1)}while(++l+t<e.length&&l+a<n.length);for(let c=2;c<n.length;++c)n[c]===-1&&(n[c]=0);switch(n[0]){case 38:i.fg=this._updateAttrColor(i.fg,n[1],n[3],n[4],n[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,n[1],n[3],n[4],n[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,n[1],n[3],n[4],n[5])}return l}_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=ti.fg,e.bg=ti.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,n=this._curAttrData;for(let a=0;a<t;a++)i=e.params[a],i>=30&&i<=37?(n.fg&=-50331904,n.fg|=16777216|i-30):i>=40&&i<=47?(n.bg&=-50331904,n.bg|=16777216|i-40):i>=90&&i<=97?(n.fg&=-50331904,n.fg|=16777216|i-90|8):i>=100&&i<=107?(n.bg&=-50331904,n.bg|=16777216|i-100|8):i===0?this._processSGR0(n):i===1?n.fg|=134217728:i===3?n.bg|=67108864:i===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,n)):i===5?n.fg|=536870912:i===7?n.fg|=67108864:i===8?n.fg|=1073741824:i===9?n.fg|=2147483648:i===2?n.bg|=134217728:i===21?this._processUnderline(2,n):i===22?(n.fg&=-134217729,n.bg&=-134217729):i===23?n.bg&=-67108865:i===24?(n.fg&=-268435457,this._processUnderline(0,n)):i===25?n.fg&=-536870913:i===27?n.fg&=-67108865:i===28?n.fg&=-1073741825:i===29?n.fg&=2147483647:i===39?(n.fg&=-67108864,n.fg|=ti.fg&16777215):i===49?(n.bg&=-67108864,n.bg|=ti.bg&16777215):i===38||i===48||i===58?a+=this._extractColor(e,a,n):i===53?n.bg|=1073741824:i===55?n.bg&=-1073741825:i===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):i===100?(n.fg&=-67108864,n.fg|=ti.fg&16777215,n.bg&=-67108864,n.bg|=ti.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ce.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[?${t};${i}R`)}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=ti.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!ow(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(`${ce.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>aw&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>aw&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let n=i.shift(),a=i.shift();if(/^\d+$/.exec(n)){let l=parseInt(n);if(uw(l))if(a==="?")t.push({type:0,index:l});else{let c=rw(a);c&&t.push({type:1,index:l,color:c})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(i,n):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),n,a=i.findIndex(l=>l.startsWith("id="));return a!==-1&&(n=i[a].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 i=e.split(";");for(let n=0;n<i.length&&!(t>=this._specialColors.length);++n,++t)if(i[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=rw(i[n]);a&&this._onColor.fire([{type:1,index:this._specialColors[t],color:a}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let n=0;n<i.length;++n)if(/^\d+$/.exec(i[n])){let a=parseInt(i[n]);uw(a)&&t.push({type:2,index:a})}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,Ta),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(Oz[e[0]],hi[e[1]]||Ta),!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=ti.clone(),this._eraseAttrDataInternal=ti.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 Ps;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(i);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=c=>(this._coreService.triggerDataEvent(`${ce.ESC}${c}${ce.ESC}\\`),!0),n=this._bufferService.buffer,a=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},w0=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&&(cw=e,e=t,t=cw),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};w0=Ht([ve(0,Ki)],w0);function uw(e){return 0<=e&&e<256}var Lz=5e7,dw=12,Bz=50,zz=class extends Ge{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 pe),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>Lz)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],a=this._action(n,t);if(a){let c=h=>performance.now()-i>=dw?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(i,h);a.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(c);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-i>=dw)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>Bz&&(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()}},E0=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let h=t.addMarker(t.ybase+t.y),m={data:e,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(m,h)),this._dataByLinkId.set(m.id,m),m.id}let i=e,n=this._getEntryIdKey(i),a=this._entriesWithId.get(n);if(a)return this.addLineToLink(a.id,t.ybase+t.y),a.id;let l=t.addMarker(t.ybase+t.y),c={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(c,l)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);i.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(i,n))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};E0=Ht([ve(0,Ki)],E0);var hw=!1,Iz=class extends Ge{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Xo),this._onBinary=this._register(new pe),this.onBinary=this._onBinary.event,this._onData=this._register(new pe),this.onData=this._onData.event,this._onLineFeed=this._register(new pe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new pe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new pe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new pe),this._instantiationService=new lz,this.optionsService=this._register(new bz(e)),this._instantiationService.setService(Gi,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(v0)),this._instantiationService.setService(Ki,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(b0)),this._instantiationService.setService(Ek,this._logService),this.coreService=this._register(this._instantiationService.createInstance(x0)),this._instantiationService.setService($a,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(y0)),this._instantiationService.setService(wk,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Da)),this._instantiationService.setService(n9,this.unicodeService),this._charsetService=this._instantiationService.createInstance(wz),this._instantiationService.setService(s9,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E0),this._instantiationService.setService(Ck,this._oscLinkService),this._inputHandler=this._register(new jz(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ti.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ti.forward(this._bufferService.onResize,this._onResize)),this._register(Ti.forward(this.coreService.onData,this._onData)),this._register(Ti.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 zz((t,i)=>this._inputHandler.parse(t,i))),this._register(Ti.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new pe),this._onScroll.event(e=>{this._onScrollApi?.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&&!hw&&(this._logService.warn("writeSync is unreliable and will be removed soon."),hw=!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,s3),t=Math.max(t,n3),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(sw.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(sw(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Dt(()=>{for(let t of e)t.dispose()})}}},Pz={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 Uz(e,t,i,n){let a={type:0,cancel:!1,key:void 0},l=(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?a.key=ce.ESC+"OA":a.key=ce.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=ce.ESC+"OD":a.key=ce.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=ce.ESC+"OC":a.key=ce.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=ce.ESC+"OB":a.key=ce.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":ce.DEL,e.altKey&&(a.key=ce.ESC+a.key);break;case 9:if(e.shiftKey){a.key=ce.ESC+"[Z";break}a.key=ce.HT,a.cancel=!0;break;case 13:a.key=e.altKey?ce.ESC+ce.CR:ce.CR,a.cancel=!0;break;case 27:a.key=ce.ESC,e.altKey&&(a.key=ce.ESC+ce.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"D":t?a.key=ce.ESC+"OD":a.key=ce.ESC+"[D";break;case 39:if(e.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"C":t?a.key=ce.ESC+"OC":a.key=ce.ESC+"[C";break;case 38:if(e.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"A":t?a.key=ce.ESC+"OA":a.key=ce.ESC+"[A";break;case 40:if(e.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"B":t?a.key=ce.ESC+"OB":a.key=ce.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=ce.ESC+"[2~");break;case 46:l?a.key=ce.ESC+"[3;"+(l+1)+"~":a.key=ce.ESC+"[3~";break;case 36:l?a.key=ce.ESC+"[1;"+(l+1)+"H":t?a.key=ce.ESC+"OH":a.key=ce.ESC+"[H";break;case 35:l?a.key=ce.ESC+"[1;"+(l+1)+"F":t?a.key=ce.ESC+"OF":a.key=ce.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=ce.ESC+"[5;"+(l+1)+"~":a.key=ce.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=ce.ESC+"[6;"+(l+1)+"~":a.key=ce.ESC+"[6~";break;case 112:l?a.key=ce.ESC+"[1;"+(l+1)+"P":a.key=ce.ESC+"OP";break;case 113:l?a.key=ce.ESC+"[1;"+(l+1)+"Q":a.key=ce.ESC+"OQ";break;case 114:l?a.key=ce.ESC+"[1;"+(l+1)+"R":a.key=ce.ESC+"OR";break;case 115:l?a.key=ce.ESC+"[1;"+(l+1)+"S":a.key=ce.ESC+"OS";break;case 116:l?a.key=ce.ESC+"[15;"+(l+1)+"~":a.key=ce.ESC+"[15~";break;case 117:l?a.key=ce.ESC+"[17;"+(l+1)+"~":a.key=ce.ESC+"[17~";break;case 118:l?a.key=ce.ESC+"[18;"+(l+1)+"~":a.key=ce.ESC+"[18~";break;case 119:l?a.key=ce.ESC+"[19;"+(l+1)+"~":a.key=ce.ESC+"[19~";break;case 120:l?a.key=ce.ESC+"[20;"+(l+1)+"~":a.key=ce.ESC+"[20~";break;case 121:l?a.key=ce.ESC+"[21;"+(l+1)+"~":a.key=ce.ESC+"[21~";break;case 122:l?a.key=ce.ESC+"[23;"+(l+1)+"~":a.key=ce.ESC+"[23~";break;case 123:l?a.key=ce.ESC+"[24;"+(l+1)+"~":a.key=ce.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?a.key=ce.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=ce.DEL:e.keyCode===219?a.key=ce.ESC:e.keyCode===220?a.key=ce.FS:e.keyCode===221&&(a.key=ce.GS);else if((!i||n)&&e.altKey&&!e.metaKey){let c=Pz[e.keyCode]?.[e.shiftKey?1:0];if(c)a.key=ce.ESC+c;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,m=String.fromCharCode(h);e.shiftKey&&(m=m.toUpperCase()),a.key=ce.ESC+m}else if(e.keyCode===32)a.key=ce.ESC+(e.ctrlKey?ce.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),a.key=ce.ESC+h,a.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(a.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?a.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(a.key=ce.US),e.key==="@"&&(a.key=ce.NUL));break}return a}var Wt=0,Hz=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new fh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new fh,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((a,l)=>this._getKey(a)-this._getKey(l)),t=0,i=0,n=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<n.length;a++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(n[a]=e[t],t++):n[a]=this._array[i++];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||(Wt=this._search(t),Wt===-1)||this._getKey(this._array[Wt])!==t)return!1;do if(this._array[Wt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Wt),!0;while(++Wt<this._array.length&&this._getKey(this._array[Wt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,l)=>a-l),t=0,i=new Array(this._array.length-e.length),n=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:i[n++]=this._array[a];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Wt=this._search(e),!(Wt<0||Wt>=this._array.length)&&this._getKey(this._array[Wt])===e))do yield this._array[Wt];while(++Wt<this._array.length&&this._getKey(this._array[Wt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Wt=this._search(e),!(Wt<0||Wt>=this._array.length)&&this._getKey(this._array[Wt])===e))do t(this._array[Wt]);while(++Wt<this._array.length&&this._getKey(this._array[Wt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let n=t+i>>1,a=this._getKey(this._array[n]);if(a>e)i=n-1;else if(a<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},Np=0,fw=0,Fz=class extends Ge{constructor(){super(),this._decorations=new Hz(e=>e?.marker.line),this._onDecorationRegistered=this._register(new pe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new pe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Dt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new $z(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let n=0,a=0;for(let l of this._decorations.getKeyIterator(t))n=l.options.x??0,a=n+(l.options.width??1),e>=n&&e<a&&(!i||(l.options.layer??"bottom")===i)&&(yield l)}forEachDecorationAtCell(e,t,i,n){this._decorations.forEachByKey(t,a=>{Np=a.options.x??0,fw=Np+(a.options.width??1),e>=Np&&e<fw&&(!i||(a.options.layer??"bottom")===i)&&n(a)})}},$z=class extends Vr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new pe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new pe),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=Bt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Bt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Vz=1e3,qz=class{constructor(e,t=Vz){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=n-this._lastRefreshMs,l=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_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)}},mw=20,mh=class extends Ge{constructor(e,t,i,n){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,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=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new qz(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(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
32
|
+
`))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Pe(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Dt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<mw+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
33
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===mw+1&&(this._liveRegion.textContent+=Vg.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,n=i.lines.length.toString();for(let a=e;a<=t;a++){let l=i.lines.get(i.ydisp+a),c=[],h=l?.translateToString(!0,void 0,void 0,c)||"",m=(i.ydisp+a+1).toString(),f=this._rowElements[a];f&&(h.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=h,this._rowColumns.set(f,c)),f.setAttribute("aria-posinset",m),f.setAttribute("aria-setsize",n),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],a=i.getAttribute("aria-posinset"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===l||e.relatedTarget!==n)return;let c,h;if(t===0?(c=i,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(c=this._rowElements.shift(),h=i,this._rowContainer.removeChild(c)),c.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{let m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}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(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let a=({node:h,offset:m})=>{let f=h instanceof Text?h.parentNode:h,g=parseInt(f?.getAttribute("aria-posinset"),10)-1;if(isNaN(g))return console.warn("row is invalid. Race condition?"),null;let b=this._rowColumns.get(f);if(!b)return console.warn("columns is null. Race condition?"),null;let v=m<b.length?b[m]:b.slice(-1)[0]+1;return v>=this._terminal.cols&&(++g,v=0),{row:g,column:v}},l=a(t),c=a(i);if(!(!l||!c)){if(l.row>c.row||l.row===c.row&&l.column>=c.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(c.row-l.row)*this._terminal.cols-l.column+c.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let n=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};mh=Ht([ve(1,y_),ve(2,ir),ve(3,sr)],mh);var C0=class extends Ge{constructor(e,t,i,n,a){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=n,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new pe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new pe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Dt(()=>{Ia(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Pe(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Pe(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Pe(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Pe(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let n=0;n<i.length;n++){let a=i[n];if(a.classList.contains("xterm"))break;if(a.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){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(n=>{n?.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[n,a]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(n)&&(i=this._checkLinkProviderResult(n,e,i)):a.provideLinks(e.y,l=>{if(this._isMouseOut)return;let c=l?.map(h=>({link:h}));this._activeProviderReplies?.set(n,c),i=this._checkLinkProviderResult(n,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let n=0;n<t.size;n++){let a=t.get(n);if(a)for(let l=0;l<a.length;l++){let c=a[l],h=c.link.range.start.y<e?0:c.link.range.start.x,m=c.link.range.end.y>e?this._bufferService.cols:c.link.range.end.x;for(let f=h;f<=m;f++){if(i.has(f)){a.splice(l--,1);break}i.add(f)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let n=this._activeProviderReplies.get(e),a=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(a=!0);if(!a&&n){let l=n.find(c=>this._linkAtPosition(c.link,t));l&&(i=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let l=0;l<this._activeProviderReplies.size;l++){let c=this._activeProviderReplies.get(l)?.find(h=>this._linkAtPosition(h.link,t));if(c){i=!0,this._handleNewLink(c);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&Kz(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,Ia(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:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let n=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(n,a),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,n=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-n-1,i.end.x,i.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,a=t.y*this._bufferService.cols+t.x;return i<=a&&a<=n}_positionFromMouseEvent(e,t,i){let n=i.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,i,n,a){return{x1:e,y1:t,x2:i,y2:n,cols:this._bufferService.cols,fg:a}}};C0=Ht([ve(1,S_),ve(2,sr),ve(3,Ki),ve(4,Nk)],C0);function Kz(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 Gz=class extends Iz{constructor(e={}){super(e),this._linkifier=this._register(new Xo),this.browser=Kk,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Xo),this._onCursorMove=this._register(new pe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new pe),this.onKey=this._onKey.event,this._onRender=this._register(new pe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new pe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new pe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new pe),this.onBell=this._onBell.event,this._onFocus=this._register(new pe),this._onBlur=this._register(new pe),this._onA11yCharEmitter=this._register(new pe),this._onA11yTabEmitter=this._register(new pe),this._onWillOpen=this._register(new pe),this._setup(),this._decorationService=this._instantiationService.createInstance(Fz),this._instantiationService.setService(Jc,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(BB),this._instantiationService.setService(Nk,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Kg)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??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(Ti.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ti.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ti.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ti.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Dt(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,n="";switch(t.index){case 256:i="foreground",n="10";break;case 257:i="background",n="11";break;case 258:i="cursor",n="12";break;default:i="ansi",n="4;"+t.index}switch(t.type){case 0:let a=Tt.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${ce.ESC}]${n};${Dz(a)}${Vk.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=ni.toColor(...t.color));else{let l=i;this._themeService.modifyColors(c=>c[l]=ni.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(mh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,a=t.getWidth(i),l=this._renderService.dimensions.css.cell.width*a,c=this.buffer.y*this._renderService.dimensions.css.cell.height,h=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=h+"px",this.textarea.style.top=c+"px",this.textarea.style.width=l+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Pe(this.element,"copy",t=>{this.hasSelection()&&ZL(t,this._selectionService)}));let e=t=>QL(t,this.textarea,this.coreService,this.optionsService);this._register(Pe(this.textarea,"paste",e)),this._register(Pe(this.element,"paste",e)),Gk?this._register(Pe(this.element,"mousedown",t=>{t.button===2&&ES(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Pe(this.element,"contextmenu",t=>{ES(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),M_&&this._register(Pe(this.element,"auxclick",t=>{t.button===1&&bk(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Pe(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Pe(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Pe(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Pe(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Pe(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Pe(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Pe(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){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"),this.element?.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(Pe(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",$g.get()),Xk||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(jB,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(ir,this._coreBrowserService),this._register(Pe(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Pe(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(f0,this._document,this._helperContainer),this._instantiationService.setService(Dh,this._charSizeService),this._themeService=this._instantiationService.createInstance(_0),this._instantiationService.setService(il,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(dh),this._instantiationService.setService(kk,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(p0,this.rows,this.screenElement)),this._instantiationService.setService(sr,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u0,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(m0),this._instantiationService.setService(S_,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(C0,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(l0,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(g0,this.element,this.screenElement,n)),this._instantiationService.setService(a9,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(Ti.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(c0,this.screenElement)),this._register(Pe(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(mh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(uh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(uh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(h0,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(l){let c=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!c)return!1;let h,m;switch(l.overrideType||l.type){case"mousemove":m=32,l.buttons===void 0?(h=3,l.button!==void 0&&(h=l.button<3?l.button:3)):h=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":m=0,h=l.button<3?l.button:3;break;case"mousedown":m=1,h=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let f=l.deltaY;if(f===0||e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;m=f<0?0:1,h=4;break;default:return!1}return m===void 0||h===void 0||h>4?!1:e.coreMouseService.triggerMouseEvent({col:c.col,row:c.row,x:c.x,y:c.y,button:h,action:m,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:l=>(i(l),l.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(l)),wheel:l=>(i(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&i(l)},mousemove:l=>{l.buttons||i(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),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()),l&8?n.mousemove||(t.addEventListener("mousemove",a.mousemove),n.mousemove=a.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),l&16?n.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),n.wheel=a.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),l&2?n.mouseup||(n.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),l&4?n.mousedrag||(n.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Pe(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return i(l),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(l)})),this._register(Pe(t,"wheel",l=>{if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(l,!0);let c=ce.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(c,!0),this.cancel(l,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.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){_k(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=Uz(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let n=this.rows-1;return this.scrollLines(i.type===2?-n:n),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===ce.ETX||i.key===ce.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Wz(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){this._charSizeService?.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(ti));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(ce.ESC+"[I"):this.coreService.triggerDataEvent(ce.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[4;${i};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),a=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[6;${a};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function Wz(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var Yz=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},Xz=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 Ps)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},pw=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 Xz(t)}getNullCell(){return new Ps}},Zz=class extends Ge{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new pe),this.onBufferChange=this._onBufferChange.event,this._normal=new pw(this._core.buffers.normal,"normal"),this._alternate=new pw(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)}},Qz=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,n)=>t(i,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)}},Jz=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}},eI=["cols","rows"],ln=0,tI=class extends Ge{constructor(e){super(),this._core=this._register(new Gz(e)),this._addonManager=this._register(new Yz),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],i=(n,a)=>{this._checkReadonlyOptions(n),this._core.options[n]=a};for(let n in this._core.options){let a={get:t.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this._publicOptions,n,a)}}_checkReadonlyOptions(e){if(eI.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 Qz(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Jz(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 Zz(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
34
|
+
`,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 $g.get()},set promptLabel(e){$g.set(e)},get tooMuchOutput(){return Vg.get()},set tooMuchOutput(e){Vg.set(e)}}}_verifyIntegers(...e){for(ln of e)if(ln===1/0||isNaN(ln)||ln%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ln of e)if(ln&&(ln===1/0||isNaN(ln)||ln%1!==0||ln<0))throw new Error("This API only accepts positive integers")}};function a3({sessionId:e,active:t,toolbarExtra:i}){const n=E.useRef(null),a=E.useRef(null),l=E.useRef(null),c=E.useRef(null),[h,m]=E.useState("Local workspace"),[f,g]=E.useState("connecting"),[b,v]=E.useState("Opening shell"),x=E.useCallback(()=>{const w=c.current,C=l.current;if(!w||w.readyState!==WebSocket.OPEN||!C)return;C.fit();const N=C.proposeDimensions();N&&w.send(JSON.stringify({cols:N.cols,rows:N.rows,type:"resize"}))},[]);E.useEffect(()=>{if(!n.current)return;const w=new tI({allowProposedApi:!0,cursorBlink:!0,fontFamily:'"SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace',fontSize:12,lineHeight:1.25,scrollback:4e3,theme:{background:"#090909",black:"#090909",blue:"#69a7ff",brightBlack:"#5f6368",brightBlue:"#8ab4f8",brightCyan:"#7ddfd7",brightGreen:"#8fdc8a",brightMagenta:"#d7a2ff",brightRed:"#ff8a80",brightWhite:"#ffffff",brightYellow:"#ffd166",cyan:"#62d0c8",foreground:"#f2f2f2",green:"#7ac77f",magenta:"#c792ea",red:"#ff6b6b",selectionBackground:"#ffffff33",white:"#e8eaed",yellow:"#f7c948"}}),C=new KL;w.loadAddon(C),w.open(n.current),a.current=w,l.current=C;const N=new WebSocket(iI(e));c.current=N;const T=w.onData(A=>{N.readyState===WebSocket.OPEN&&N.send(JSON.stringify({data:A,type:"input"}))});N.addEventListener("open",()=>{g("running"),v("Shell connected"),x()}),N.addEventListener("message",A=>{const L=sI(A.data);if(L){if(L.type==="output"){w.write(L.data);return}if(L.type==="error"){g("error"),v(L.error);return}g(L.state==="idle"?"connecting":L.state),L.cwd&&m(L.cwd),v(L.error??L.shell??"Shell connected")}}),N.addEventListener("close",()=>{g(A=>A==="exited"?A:"exited"),v("Socket closed")}),N.addEventListener("error",()=>{g("error"),v("Terminal socket error")}),window.addEventListener("resize",x),window.setTimeout(x,0);const D=new ResizeObserver(()=>x());return D.observe(n.current),()=>{window.removeEventListener("resize",x),D.disconnect(),T.dispose(),N.close(),w.dispose(),c.current=null,a.current=null,l.current=null}},[e,x]),E.useEffect(()=>{if(!t)return;const w=window.setTimeout(()=>{x(),a.current?.focus()},0);return()=>window.clearTimeout(w)},[t,x]);const y=E.useCallback(w=>{const C=c.current;if(!C||C.readyState!==WebSocket.OPEN)return;const N=l.current?.proposeDimensions();C.send(JSON.stringify({cols:N?.cols,rows:N?.rows,...w}))},[]);return u.jsxs("section",{className:fe("flex h-full min-h-0 flex-col bg-[#090909] text-white",!t&&"hidden"),children:[u.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b border-white/10 bg-[#111111] px-4 py-2",children:[u.jsx("div",{className:"min-w-0",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ke,{className:fe("border-white/15 bg-white/10 text-white shadow-none",f==="running"&&"border-emerald-400/35 text-emerald-200",f==="error"&&"border-red-400/35 text-red-200"),variant:"outline",children:f}),u.jsxs("span",{className:"truncate font-mono text-[11px] text-white/55",children:[h," · ",b]})]})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(de,{"aria-label":"Restart terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",size:"sm",variant:"outline",onClick:()=>y({type:"restart"}),type:"button",children:[u.jsx(Z2,{}),"Restart"]}),u.jsxs(de,{"aria-label":"Stop terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",size:"sm",variant:"outline",onClick:()=>y({type:"stop"}),type:"button",children:[u.jsx(Ch,{}),"Stop"]}),i]})]}),u.jsx("div",{"aria-label":"terminal viewport",className:"min-h-0 flex-1 overflow-hidden px-3 py-0.5",children:u.jsx("div",{className:"h-full w-full",ref:n})})]})}function iI(e){const t=window.location.protocol==="https:"?"wss:":"ws:",i=encodeURIComponent(e);return`${t}//${window.location.host}/api/terminal/socket?id=${i}`}function sI(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t?.type=="string"?t:null}catch{return null}}function nI({serviceName:e,active:t}){const[i,n]=E.useState(null),[a,l]=E.useState(null),[c,h]=E.useState(!1),m=E.useRef(!1);E.useEffect(()=>{if(!t||m.current)return;m.current=!0;let b=!1;return(async()=>{try{const v=await Ld({serviceName:e});b||n(v.id)}catch(v){b||l(v instanceof Error?v.message:String(v))}})(),()=>{b=!0}},[t,e]);const f=u.jsxs(de,{"aria-label":c?"Exit fullscreen terminal":"Expand terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",onClick:()=>h(b=>!b),size:"sm",type:"button",variant:"outline",children:[c?u.jsx(W2,{}):u.jsx(G2,{}),c?"Exit":"Expand"]}),g=a?u.jsxs("div",{className:"p-3 font-mono text-[11px] text-destructive",children:["Could not open terminal: ",a]}):i?u.jsx(a3,{active:t,sessionId:i,toolbarExtra:f}):u.jsx("div",{className:"p-3 font-mono text-[11px] text-muted-foreground",children:"Opening terminal…"});return c&&t?u.jsx(x_,{onClose:()=>h(!1),title:`Terminal — ${e}`,children:g}):u.jsx("div",{className:fe("h-[60vh] min-h-[24rem] overflow-hidden rounded-md border border-border",!t&&"hidden"),children:g})}const rI=500;function aI(e){const[t,i]=E.useState(),[n,a]=E.useState([]),[l,c]=E.useState(),[h,m]=E.useState(!1),f=E.useRef(void 0);E.useEffect(()=>{f.current=void 0,i(void 0),a([]);const b=new EventSource(`/api/services/${encodeURIComponent(e)}/test/stream`),v=x=>{try{const y=JSON.parse(x.data);y.run.id!==f.current&&(f.current=y.run.id,a([])),i(y.run),y.line&&a(w=>[...w,y.line].slice(-rI))}catch{}};return b.addEventListener("status",v),b.addEventListener("output",v),()=>b.close()},[e]);const g=E.useCallback(async b=>{m(!0),c(void 0);try{await DM(e,b)}catch(v){c(v instanceof Error?v.message:String(v))}finally{m(!1)}},[e]);return{run:t,lines:n,error:l,starting:h,start:g}}const oI={running:"secondary",passed:"success",failed:"error",error:"error"},lI={running:"Running",passed:"Passed",failed:"Failed",error:"Error"};function cI({serviceName:e}){const{run:t,lines:i,error:n,starting:a,start:l}=aI(e),[c,h]=E.useState(""),m=t?.status==="running"||a,f=t?.status==="failed"||t?.status==="error";return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("form",{className:"flex items-center gap-2",onSubmit:g=>{g.preventDefault(),m||l(c.trim()||void 0)},children:[u.jsx(ot,{className:"h-7 flex-1 text-[11px]",disabled:m,onChange:g=>h(g.target.value),placeholder:"Optional test pattern (e.g. config-store)",value:c}),u.jsx(de,{disabled:m,size:"sm",type:"submit",children:m?"Running…":"Run tests"})]}),n?u.jsx("div",{className:"text-red-600",children:n}):null,t?u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[u.jsx(Ke,{size:"small",variant:oI[t.status],children:lI[t.status]}),u.jsx("code",{className:"font-mono text-[11px]",children:t.command}),t.failingCount>0?u.jsxs("span",{children:["· ",t.failingCount," failing"]}):null,t.exitCode!=null?u.jsxs("span",{children:["· exit ",t.exitCode]}):null]}):u.jsx("div",{className:"text-muted-foreground",children:"No test runs yet."}),i.length>0?u.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-all rounded bg-background p-2 font-mono text-[11px]",children:i.map((g,b)=>u.jsx("div",{className:fe(g.stream==="stderr"&&"text-red-500"),children:g.text},b))}):null,f?u.jsxs("div",{className:"rounded border border-border bg-muted/40 p-2",children:["Failures were piped into the"," ",u.jsx("a",{className:"font-medium underline",href:"/errors",children:"Error Inbox"})," ","— open an incident there to copy a debugging prompt for your agent."]}):null]})}function uI({serviceName:e,status:t,health:i,timeline:n,onRefresh:a}){const[l,c]=E.useState("logs"),h=i?.processTree?.processes??[];return u.jsxs("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs",children:[u.jsxs("div",{className:"mb-2 flex gap-1",children:[u.jsx(Ca,{active:l==="logs",onClick:()=>c("logs"),children:"Logs"}),u.jsxs(Ca,{active:l==="processes",onClick:()=>c("processes"),children:["Processes ",h.length?u.jsx(Ke,{variant:"secondary",size:"small",children:h.length}):null]}),u.jsx(Ca,{active:l==="metrics",onClick:()=>c("metrics"),children:"Metrics"}),u.jsxs(Ca,{active:l==="http",onClick:()=>c("http"),children:["HTTP",t?.inspector?.enabled?u.jsx(Ke,{variant:"success",size:"small",children:"on"}):null]}),u.jsx(Ca,{active:l==="env",onClick:()=>c("env"),children:"Env"}),u.jsx(Ca,{active:l==="tests",onClick:()=>c("tests"),children:"Tests"}),u.jsx(Ca,{active:l==="terminal",onClick:()=>c("terminal"),children:"Terminal"})]}),l==="processes"?u.jsx($L,{rows:h}):null,l==="metrics"?u.jsx(IL,{serviceName:e}):null,l==="http"?u.jsx(LL,{serviceName:e,status:t,timeline:n,onRefresh:a}):null,l==="env"?u.jsx(jL,{serviceName:e}):null,l==="tests"?u.jsx(cI,{serviceName:e}):null,l==="logs"?u.jsx(kL,{serviceName:e}):null,u.jsx(nI,{active:l==="terminal",serviceName:e},e)]})}function Ca({active:e,onClick:t,children:i}){return u.jsx("button",{className:fe("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:t,type:"button",children:i})}function dI({allServices:e,group:t,onRefresh:i,ports:n,services:a,health:l,statuses:c,timeline:h,selectedService:m,onSelectService:f,onDropService:g}){const[b,v]=E.useState(!1),[x,y]=E.useState(!1),[w,C]=E.useState(!1),N=a.some(A=>Vo(c[A.name]?.state));function T(A){!g||!A.dataTransfer.types.includes(Uc)||(A.preventDefault(),A.dataTransfer.dropEffect="copy",C(!0))}function D(A){if(!g)return;A.preventDefault(),C(!1);const L=A.dataTransfer.getData(Uc);L&&g(L)}return u.jsxs("section",{className:fe("transition-colors",w&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:T,onDragLeave:()=>C(!1),onDrop:D,children:[u.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/35 px-3 py-1.5",children:[u.jsxs("button",{"aria-expanded":!x,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left",onClick:()=>y(A=>!A),type:"button",children:[u.jsx(Qs,{className:fe("size-3.5 shrink-0 text-muted-foreground transition-transform",x&&"-rotate-90")}),u.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),t.services.length?u.jsx(Ke,{size:"small",variant:"secondary",children:t.services.length}):null]}),u.jsx(Hr,{label:"Edit group",children:u.jsx(de,{"aria-expanded":b,"aria-label":`Edit ${t.name}`,className:"size-7",onClick:()=>v(A=>!A),size:"icon",type:"button",variant:"ghost",children:u.jsx(Mc,{})})}),u.jsx(v_,{active:N,baseUrl:`/api/bundles/${encodeURIComponent(t.name)}`,compact:!0,restartAction:async()=>{await rs(`/api/bundles/${encodeURIComponent(t.name)}/stop`,{}),await rs(`/api/bundles/${encodeURIComponent(t.name)}/start`,{})},solidStart:!0,targetLabel:`group ${t.name}`,onRefresh:i,onStarted:()=>{const A=a[0];A&&f(A.name)}})]}),b?u.jsx("div",{className:"border-t border-border bg-background/65 p-3",children:u.jsx(hk,{initialName:t.name,initialServices:t.services,onRefresh:i,onSaved:()=>v(!1),originalName:t.name,services:e,submitLabel:"Save Group"})}):null,x?null:u.jsx("div",{className:"divide-y divide-border border-t border-border bg-background/45",children:a.length?a.map(A=>u.jsx(o3,{service:A,status:c[A.name],health:l[A.name],ports:n,onRefresh:i,timeline:h,selected:m===A.name,onSelect:()=>f(A.name)},A.name)):u.jsx(dt,{variant:"muted",className:"m-4",children:"This group does not match any registered services."})})]})}function o3({service:e,status:t,onRefresh:i,selected:n=!1,onSelect:a}){const l=t?.state??"stopped",c=Vo(l),[h,m]=E.useState(!1);return u.jsxs("div",{"aria-selected":n,draggable:!0,onDragStart:f=>{f.dataTransfer.setData(Uc,e.name),e.cwd&&ck(f.dataTransfer,e.cwd),f.dataTransfer.effectAllowed="copyMove",m(!0)},onDragEnd:()=>m(!1),className:fe("group flex cursor-pointer items-center gap-2 border-l-2 px-3 py-1.5 transition-colors",h&&"opacity-50",n?"border-l-primary bg-primary/10":"border-l-transparent hover:bg-muted"),onClick:a,role:"option",children:[u.jsx(b_,{command:e.command??""}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),u.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[u.jsx(l3,{kind:e.kind}),e.port?u.jsxs("span",{children:[":",e.port]}):null]})]}),u.jsx(c3,{state:l}),u.jsx("span",{className:"flex items-center gap-1",onClick:f=>f.stopPropagation(),children:u.jsx(v_,{active:c,baseUrl:`/api/services/${encodeURIComponent(e.name)}`,compact:!0,targetLabel:e.name,onRefresh:i,onStarted:a})})]})}const Uc="application/x-nomoreide-service",gw={local:{label:"local",className:"border-border bg-muted text-muted-foreground"},"docker-compose":{label:"docker",className:"border-sky-500/40 bg-sky-500/10 text-sky-700 dark:text-sky-300"},ssh:{label:"ssh",className:"border-violet-500/40 bg-violet-500/10 text-violet-700 dark:text-violet-300"}};function l3({kind:e}){const t=gw[e??"local"]??gw.local;return u.jsx("span",{className:fe("rounded border px-1 py-px text-[9px] font-semibold uppercase leading-none tracking-wide",t.className),children:t.label})}function Vo(e){return e==="running"||e==="starting"}function hI({service:e,onRefresh:t}){const[i,n]=E.useState(e.port?String(e.port):""),[a,l]=E.useState(!1),{error:c,success:h}=qi(),m=i.trim()!==(e.port?String(e.port):"");E.useEffect(()=>{n(e.port?String(e.port):"")},[e.port]);async function f(g){g.preventDefault(),l(!0);try{await rs("/api/services",{name:e.name,command:e.command??"",cwd:e.cwd??"",port:i,description:e.description}),h(`Port saved for ${e.name}.`),await t()}catch(b){c(Bc("Save port",e.name,b))}finally{l(!1)}}return u.jsxs("form",{className:"flex items-center gap-1.5",onSubmit:f,children:[u.jsx(ot,{"aria-label":`Port for ${e.name}`,className:"h-8 w-20 font-mono text-xs",inputMode:"numeric",min:1,max:65535,onChange:g=>n(g.target.value),placeholder:"port",type:"number",value:i}),u.jsx(de,{"aria-label":`Save port for ${e.name}`,disabled:a||!m,className:"size-8",size:"icon",title:"Save port",type:"submit",variant:"outline",children:u.jsx(P0,{})})]})}function fI(e){return`http://127.0.0.1:${e}`}function c3({state:e}){return u.jsx(Ke,{variant:e==="running"?"success":e==="exited"?"danger":e==="starting"?"warning":"outline",className:fe(e==="running"&&"font-mono"),children:e})}function mI({data:e,onRefresh:t}){const i=e.config.services[0]?.name??"",[n,a]=E.useState(i),[l,c]=E.useState(null),[h,m]=E.useState(!1),[f,g]=E.useState(!0),[b,v]=E.useState(!1),[x,y]=E.useState(!1),[w,C]=E.useState(!1),N=E.useRef({}),{error:T,message:D,success:A}=qi(),L=E.useMemo(()=>new Set(e.config.bundles.flatMap(M=>M.services)),[e.config.bundles]),G=E.useMemo(()=>{const M=new Map;for(const $ of e.config.bundles)for(const F of $.services)M.has(F)||M.set(F,$.name);return M},[e.config.bundles]),j=E.useMemo(()=>e.config.services.filter(M=>!L.has(M.name)),[e.config.services,L]),R=e.health??{},H=e.config.bundles.length>0||j.length>0;E.useEffect(()=>{!e.config.services.some($=>$.name===n)&&i&&a(i)},[e.config.services,i,n]);const I=E.useMemo(()=>e.config.services.find(M=>M.name===n),[e.config.services,n]),W=n?e.runtime.services[n]:void 0,J=n?R[n]:void 0;async function P(M,$){if(!M.services.includes($))try{await EM(M.name,M.services,$),A(`Added ${$} to ${M.name}.`),await t()}catch(F){T(F instanceof Error?F.message:String(F))}}async function te(){if(I){if(Vo(W?.state)){T(`Stop ${I.name} before deleting it.`);return}if(window.confirm(`Delete service "${I.name}"? This removes it from your config.`))try{await wM(I.name),A(`Deleted ${I.name}.`),await t()}catch(M){T(M instanceof Error?M.message:String(M))}}}async function K(M){const $=e.config.bundles.filter(F=>F.services.includes(M));if($.length!==0)try{for(const F of $)await CM(F.name,F.services,M);D({text:`Removed ${M} from ${$.map(F=>F.name).join(", ")}.`}),await t()}catch(F){T(F instanceof Error?F.message:String(F))}}return E.useEffect(()=>{const M=Object.fromEntries(e.config.services.map(F=>[F.name,e.runtime.services[F.name]?.state??"stopped"])),$=N.current;if(Object.keys($).length){const F=new Map,V=new Map;for(const Y of e.config.services){const O=M[Y.name],ee=$[Y.name];if(!ee||ee===O)continue;const ue=e.runtime.services[Y.name],ie=G.get(Y.name);if(ie){const le=F.get(ie)??new Map;if(le.set(O,(le.get(O)??0)+1),F.set(ie,le),O==="exited"){const me=V.get(ie)??[];me.push(ue?.exitCode),V.set(ie,me)}continue}if(O==="running")A(`${Y.name} is running.`);else if(O==="stopped")D({text:`${Y.name} stopped.`});else if(O==="starting")D({text:`${Y.name} is starting.`});else if(O==="exited"){const le=ue?.exitCode===void 0||ue.exitCode===null?"":` with code ${ue.exitCode}`;T(`${Y.name} exited${le}.`)}}for(const[Y,O]of F)gI({exitCodes:V.get(Y)??[],groupName:Y,showErrorToast:T,showMessageToast:D,showSuccessToast:A,transitions:O})}N.current=M},[e.config.services,e.runtime.services,G,T,D,A]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:fe("grid h-full min-h-0 overflow-hidden bg-card/85",f?"lg:grid-cols-[320px_minmax(0,1fr)]":"lg:grid-cols-[320px_minmax(0,1fr)_340px]"),children:[u.jsx("div",{className:"min-h-0 min-w-0 overflow-auto border-r border-border",children:u.jsxs(Qn,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsx(Jn,{className:"border-b border-border px-3 py-2",children:u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(er,{className:"text-sm",children:"Services"}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(de,{"aria-haspopup":"dialog",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>m(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(Q2,{className:"size-3.5"}),"Logs"]}),u.jsx(pI,{onCreateGroup:()=>c("group"),onCreateService:()=>c("service")})]})]})}),u.jsx(tr,{className:"p-0",children:H?u.jsxs("div",{className:"divide-y divide-border",children:[e.config.bundles.map(M=>u.jsx(dI,{group:M,onRefresh:t,ports:e.ports,allServices:e.config.services,health:R,services:e.config.services.filter($=>M.services.includes($.name)),statuses:e.runtime.services,timeline:e.timeline,selectedService:n,onSelectService:a,onDropService:$=>{P(M,$)}},M.name)),j.length?u.jsxs("div",{className:fe("transition-colors",w&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:M=>{M.dataTransfer.types.includes(Uc)&&(M.preventDefault(),M.dataTransfer.dropEffect="move",C(!0))},onDragLeave:()=>C(!1),onDrop:M=>{M.preventDefault(),C(!1);const $=M.dataTransfer.getData(Uc);$&&K($)},children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 bg-muted/55 px-3 py-1 text-[10px] font-semibold uppercase text-muted-foreground",children:[u.jsx("span",{children:"Ungrouped"}),u.jsx("span",{className:"text-muted-foreground/80",children:j.length})]}),u.jsx("div",{className:"divide-y divide-border",children:j.map(M=>u.jsx(o3,{service:M,status:e.runtime.services[M.name],health:R[M.name],ports:e.ports,onRefresh:t,timeline:e.timeline,selected:n===M.name,onSelect:()=>a(M.name)},M.name))})]}):null]}):u.jsx(oh,{label:"No services registered yet."})})]})}),u.jsx("div",{className:"min-h-0 min-w-0 overflow-auto",children:I?u.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u.jsxs("div",{className:"shrink-0 space-y-2 border-b border-border bg-background/60 px-4 py-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("h2",{className:"min-w-0 truncate text-base font-semibold",children:I.name}),u.jsx(c3,{state:W?.state??"stopped"}),u.jsx(l3,{kind:I.kind}),u.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-1.5",children:[u.jsx(hI,{service:I,onRefresh:t}),(()=>{const M=W?.url??(I.port?fI(I.port):void 0);return M?u.jsx(Hr,{label:`Open ${M}`,children:u.jsx(de,{"aria-label":"Open in browser",className:"size-7",onClick:()=>window.open(M,"_blank","noopener,noreferrer"),size:"icon",type:"button",variant:"outline",children:u.jsx(F2,{})})}):null})(),J?.agentContext?u.jsx(Hr,{label:"Copy debug context for an AI agent",children:u.jsx(de,{"aria-label":"Copy agent debug context",className:"size-7",onClick:()=>v(!0),size:"icon",type:"button",variant:"outline",children:u.jsx(Tc,{})})}):null,u.jsx(v_,{active:Vo(W?.state),baseUrl:`/api/services/${encodeURIComponent(I.name)}`,compact:!0,targetLabel:I.name,onRefresh:t}),u.jsx(Hr,{label:"Edit service",children:u.jsx(de,{"aria-label":`Edit ${I.name}`,className:"size-7",onClick:()=>y(!0),size:"icon",type:"button",variant:"outline",children:u.jsx(Mc,{})})}),u.jsx(Hr,{label:Vo(W?.state)?"Stop before deleting":"Delete service",children:u.jsx(de,{"aria-label":`Delete ${I.name}`,className:"size-7",disabled:Vo(W?.state),onClick:()=>{te()},size:"icon",type:"button",variant:"outline",children:u.jsx(qc,{className:"text-destructive"})})}),u.jsx(Hr,{label:f?"Show Ports & Timeline":"Hide Ports & Timeline",side:"left",children:u.jsx(de,{"aria-label":f?"Show Ports & Timeline":"Hide Ports & Timeline",className:"size-7",onClick:()=>g(M=>!M),size:"icon",type:"button",variant:"ghost",children:f?u.jsx(VT,{}):u.jsx(Yr,{})})})]})]}),I.command?u.jsxs("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:I.command,children:["$ ",I.command]}):null,I.cwd?u.jsx("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:I.cwd,children:I.cwd}):null,u.jsx(dL,{health:J})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:u.jsx(uI,{serviceName:I.name,status:W,health:J,timeline:e.timeline??[],onRefresh:t},I.name)})]}):u.jsx(oh,{label:"Select a service to see details."})}),f?null:u.jsxs("div",{className:"min-h-0 overflow-auto border-l border-border",children:[u.jsx(gL,{ports:e.ports}),u.jsx(iL,{events:e.timeline??[]})]})]}),b&&I&&J?.agentContext?u.jsx(Xn,{icon:u.jsx(Tc,{}),onClose:()=>v(!1),title:`Agent context — ${I.name}`,children:u.jsx("div",{className:"p-4",children:u.jsx(Bj,{context:J.agentContext})})}):null,x&&I?u.jsx(Xn,{icon:u.jsx(Mc,{}),onClose:()=>y(!1),size:"lg",title:`Edit Service — ${I.name}`,children:u.jsx(gS,{cwd:e.cwd,initialService:I,onRefresh:t,onSaved:()=>y(!1)})}):null,l?u.jsx(Xn,{icon:l==="service"?u.jsx(zs,{}):u.jsx(I2,{}),onClose:()=>c(null),size:l==="service"?"lg":"md",title:l==="service"?"Add Service":"Create Group",children:l==="service"?u.jsx(gS,{cwd:e.cwd,onRefresh:t,onSaved:()=>c(null)}):u.jsx(hk,{services:j,onRefresh:t,onSaved:()=>c(null)})}):null,h?u.jsx(AL,{initialService:n||void 0,onClose:()=>m(!1),services:e.config.services.map(M=>M.name)}):null]})}function pI({onCreateService:e,onCreateGroup:t}){const[i,n]=E.useState(!1);function a(l){n(!1),l()}return u.jsxs("div",{className:"relative",children:[u.jsx(Hr,{label:"Add",side:"bottom",children:u.jsx(de,{"aria-expanded":i,"aria-haspopup":"menu","aria-label":"Add service or group",className:"size-7",onClick:()=>n(l=>!l),size:"icon",type:"button",variant:"ghost",children:u.jsx(zs,{})})}),i?u.jsxs(u.Fragment,{children:[u.jsx("button",{"aria-hidden":!0,className:"fixed inset-0 z-[40] cursor-default",onClick:()=>n(!1),tabIndex:-1,type:"button"}),u.jsxs("div",{className:"absolute right-0 z-[50] mt-1 w-44 overflow-hidden rounded-md border border-border bg-card py-1 shadow-lg",role:"menu",children:[u.jsxs("button",{className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>a(e),role:"menuitem",type:"button",children:[u.jsx(zs,{}),"Create Service"]}),u.jsxs("button",{className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>a(t),role:"menuitem",type:"button",children:[u.jsx(I2,{}),"Create Group"]})]})]}):null]})}function gI({exitCodes:e,groupName:t,showErrorToast:i,showMessageToast:n,showSuccessToast:a,transitions:l}){if(l.size===1){const[m]=l.keys();if(m==="running")a(`${t} group is running.`);else if(m==="stopped")n({text:`${t} group stopped.`});else if(m==="starting")n({text:`${t} group is starting.`});else if(m==="exited"){const f=e.filter(b=>b!=null),g=f.length?` with code ${f.join(", ")}`:"";i(`${t} group exited${g}.`)}return}const c=[...l.entries()].map(([m,f])=>`${f} ${m}`).join(", "),h=`${t} group updated: ${c}.`;l.has("exited")?i(h):n({text:h})}function _I(){const[e,t]=E.useState([]),[i,n]=E.useState(null),[a,l]=E.useState(!1);E.useEffect(()=>{let m=!1;return(async()=>{let f=await OM().catch(()=>[]);if(f.length===0){const g=await Ld().catch(()=>null);f=g?[g]:[]}m||(t(f),n(f[0]?.id??null))})(),()=>{m=!0}},[]);const c=E.useCallback(async()=>{l(!0);try{const m=await Ld();t(f=>[...f,m]),n(m.id)}finally{l(!1)}},[]),h=E.useCallback(async m=>{l(!0);try{await jM(m);const f=e.findIndex(b=>b.id===m),g=e.filter(b=>b.id!==m);if(g.length===0){const b=await Ld();t([b]),n(b.id);return}if(t(g),i===m){const b=g[Math.min(f,g.length-1)];n(b.id)}}finally{l(!1)}},[e,i]);return u.jsxs("section",{className:"flex h-full min-h-0 flex-col bg-[#090909] text-white",children:[u.jsxs("div",{"aria-label":"Terminal tabs",className:"flex shrink-0 items-center gap-1 overflow-x-auto border-b border-white/10 bg-[#111111] px-2 py-1.5",role:"tablist",children:[e.map((m,f)=>{const g=m.label??`Terminal ${f+1}`;return u.jsxs("div",{className:fe("group flex items-center gap-1 rounded-md border border-transparent px-2 py-1 text-xs",m.id===i?"border-white/15 bg-white/10 text-white":"text-white/60 hover:bg-white/5"),children:[u.jsx("button",{"aria-selected":m.id===i,className:"max-w-[160px] truncate font-medium",onClick:()=>n(m.id),role:"tab",type:"button",children:g}),u.jsx("button",{"aria-label":`Close ${g}`,className:"rounded p-0.5 text-white/40 opacity-0 transition hover:bg-white/10 hover:text-white group-hover:opacity-100",disabled:a,onClick:()=>{h(m.id)},type:"button",children:u.jsx(Js,{className:"size-3"})})]},m.id)}),u.jsx("button",{"aria-label":"New terminal",className:"ml-1 rounded-md p-1 text-white/60 transition hover:bg-white/10 hover:text-white disabled:opacity-40",disabled:a,onClick:()=>{c()},type:"button",children:u.jsx(zs,{className:"size-4"})})]}),u.jsx("div",{className:"relative min-h-0 flex-1",children:e.length===0?u.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] text-white/40",children:"Starting terminal…"}):e.map(m=>u.jsx("div",{className:"absolute inset-0",children:u.jsx(a3,{active:m.id===i,sessionId:m.id})},m.id))})]})}const bI=800;function u3({activeHunkIndex:e=0,diff:t}){const i=xI(t),n=E.useRef([]),[a,l]=E.useState(!1),c=E.useMemo(()=>i.reduce((m,f)=>Math.max(m,f.content.length),0),[i]),h=c>bI;if(E.useEffect(()=>{l(!1)},[t]),E.useEffect(()=>{if(h&&!a)return;n.current[e]?.scrollIntoView({block:"start",behavior:"smooth"})},[e,t,h,a]),h&&!a){const m=i.filter(g=>g.kind==="add").length,f=i.filter(g=>g.kind==="delete").length;return u.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-card p-6",children:u.jsxs("div",{className:"max-w-sm space-y-3 text-center",children:[u.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Diff hidden for this data file"}),u.jsxs("p",{className:"text-[12px] text-muted-foreground",children:["Rows run up to ",c.toLocaleString()," characters, so this looks like a CSV, log, or other data dump rather than source code."]}),u.jsxs("p",{className:"font-mono text-[11px]",children:[u.jsxs("span",{className:"text-emerald-700",children:["+",m]})," ",u.jsxs("span",{className:"text-red-700",children:["-",f]})," lines changed"]}),u.jsx(de,{onClick:()=>l(!0),size:"sm",type:"button",variant:"outline",children:"Show diff anyway"})]})})}return u.jsx("div",{className:"absolute inset-0 overflow-auto bg-card text-xs leading-6 text-foreground",children:u.jsx("div",{className:"min-w-full font-mono",children:i.map((m,f)=>u.jsxs("div",{className:fe("grid grid-cols-[3rem_3rem_minmax(0,1fr)]",m.kind==="add"&&"bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300",m.kind==="delete"&&"bg-red-50 text-red-800 dark:bg-red-500/15 dark:text-red-300",_w(i,f)&&m.hunkIndex===e&&"outline outline-1 outline-offset-[-1px] outline-primary/35"),ref:m.hunkIndex!==null&&_w(i,f)?g=>{n.current[m.hunkIndex??0]=g}:void 0,children:[u.jsx(bw,{value:m.oldLine}),u.jsx(bw,{value:m.newLine}),u.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-all px-2",children:m.content||" "})]},`${f}-${m.content}`))})})}function vI(e){return e.split(`
|
|
35
|
+
`).reduce((t,i)=>(i.startsWith("@@")?t.hunks+=1:i.startsWith("+")&&!i.startsWith("+++")?t.additions+=1:i.startsWith("-")&&!i.startsWith("---")&&(t.deletions+=1),t),{additions:0,deletions:0,hunks:0})}function xI(e){const t=yI(e);return t.some(i=>i.kind==="hunk")?t.filter(i=>i.kind!=="meta"&&i.kind!=="hunk"):t}function yI(e){let t=null,i=null,n=null;return e.split(`
|
|
36
|
+
`).map(a=>{if(SI(a))return t=null,i=null,n=null,{content:a,hunkIndex:n,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("@@")){const c=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(a);return c&&(t=Number(c[1]),i=Number(c[2])),n=(n??-1)+1,{content:a,hunkIndex:n,kind:"hunk",oldLine:null,newLine:null}}if(t===null||i===null)return{content:a,hunkIndex:null,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("\\ No newline"))return{content:a,hunkIndex:n,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("+")&&!a.startsWith("+++")){const c={content:a,hunkIndex:n,kind:"add",oldLine:null,newLine:i};return i+=1,c}if(a.startsWith("-")&&!a.startsWith("---")){const c={content:a,hunkIndex:n,kind:"delete",oldLine:t,newLine:null};return t+=1,c}const l={content:a,hunkIndex:n,kind:"context",oldLine:t,newLine:i};return t+=1,i+=1,l})}function _w(e,t){const i=e[t]?.hunkIndex;if(i===null)return!1;const n=e.findIndex(a=>a.hunkIndex===i&&(a.kind==="add"||a.kind==="delete"));return n!==-1?n===t:e.findIndex(a=>a.hunkIndex===i)===t}function SI(e){return e.startsWith("diff --git ")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode ")||e.startsWith("deleted file mode ")||e.startsWith("old mode ")||e.startsWith("new mode ")||e.startsWith("similarity index ")||e.startsWith("rename from ")||e.startsWith("rename to ")||e.startsWith("Binary files ")}function bw({value:e}){return u.jsx("span",{className:fe("select-none border-r border-border/70 px-2 text-right text-muted-foreground",e===null&&"text-transparent"),children:e??"-"})}function wI({branch:e,error:t,files:i,selectedFile:n,onSelectFile:a,root:l}){const c=E.useMemo(()=>NI(i).filter(f=>f.files.length),[i]),[h,m]=E.useState({staged:!1,unstaged:!1,untracked:!1});return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border bg-card/95 px-2.5 py-1.5",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[u.jsx(Ac,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:"Changes"})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[e?u.jsx(Ke,{variant:"outline",children:e}):null,u.jsx(Ke,{variant:"secondary",children:i.length})]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:c.length?c.map(f=>u.jsx(EI,{collapsed:h[f.id],group:f,onSelectFile:a,onToggle:()=>m(g=>({...g,[f.id]:!g[f.id]})),root:l,selectedFile:n},f.id)):u.jsx(dt,{variant:"muted",className:"m-3 text-center",children:t??"No changed files."})})]})}function EI({collapsed:e,group:t,onSelectFile:i,onToggle:n,root:a,selectedFile:l}){const c=e?Yr:Qs;return u.jsxs("section",{className:"border-b border-border last:border-b-0",children:[u.jsxs("button",{className:"flex w-full items-center justify-between gap-2 bg-muted/45 px-2 py-0.5 text-left text-[10px] font-semibold uppercase text-muted-foreground hover:bg-muted",onClick:n,type:"button",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(c,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:t.label})]}),u.jsx(Ke,{className:"min-w-6 justify-center font-mono shadow-none",size:"small",variant:"outline",children:t.files.length})]}),e?null:u.jsx("div",{children:t.files.map(h=>u.jsx(CI,{active:l===h.path,file:h,group:t.id,onClick:()=>i(h.path),root:a},h.path))})]})}function CI({active:e,file:t,group:i,onClick:n,root:a}){const l=t.path.split("/").pop()||t.path,c=t.path.split("/").slice(0,-1).join("/"),h=a?uk(lk(a,t.path)):{};return u.jsxs("button",{"aria-label":`Open changed file ${t.path}`,className:fe("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",e&&"bg-muted font-medium"),onClick:n,type:"button",...h,children:[u.jsx(g_,{path:t.path}),u.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-1.5 truncate",children:[u.jsx("span",{"data-testid":"changed-file-name",className:"shrink-0 truncate",children:l}),c?u.jsx("span",{"data-testid":"changed-file-dir",className:"min-w-0 truncate text-muted-foreground",children:c}):null]}),u.jsx("span",{className:fe("ml-1 shrink-0 font-mono text-[10px] font-semibold",i==="untracked"&&"text-amber-700",i==="staged"&&"text-emerald-700",i==="unstaged"&&"text-zinc-800"),children:kI(t,i)})]})}function kI(e,t){return t==="untracked"?"?":t==="staged"?e.index.trim():e.workingTree.trim()}function NI(e){return[{id:"unstaged",label:"Changes",files:e.filter(t=>!(t.index==="?"&&t.workingTree==="?")&&t.workingTree.trim())},{id:"staged",label:"Staged Changes",files:e.filter(t=>!(t.index==="?"&&t.workingTree==="?")&&t.index.trim()&&!t.workingTree.trim())},{id:"untracked",label:"Untracked Files",files:e.filter(t=>t.index==="?"&&t.workingTree==="?")}]}function TI(e){const t={name:"",path:"",children:[],isFile:!1},i=new Map;i.set("",t);const n=[...e].sort();for(const l of n){const c=l.split("/");let h="";for(let m=0;m<c.length;m+=1){const f=c[m],g=m===c.length-1,b=h?`${h}/${f}`:f;let v=i.get(b);v||(v={name:f,path:b,children:[],isFile:g},i.set(b,v),i.get(h)?.children.push(v)),h=b}}const a=l=>{l.children.sort((c,h)=>c.isFile!==h.isFile?c.isFile?1:-1:c.name.localeCompare(h.name)),l.children.forEach(a)};return a(t),t}function AI(e,t){const i={"":!0},n=a=>{for(const l of a.children)l.isFile||(i[l.path]=!0,t&&n(l))};return n(e),i}function vw({defaultExpandAll:e=!1,paths:t,status:i,selectedFile:n,onSelectFile:a,branch:l,emptyMessage:c="No tracked files.",root:h,title:m="Files"}){const f=E.useMemo(()=>TI(t),[t]),g=E.useMemo(()=>AI(f,e),[e,f]),b=E.useMemo(()=>{const N=new Map;for(const T of i)N.set(T.path,T);return N},[i]),[v,x]=E.useState(g),[y,w]=E.useState(!1);E.useEffect(()=>{y||f.children.length===0||(x(g),w(!0))},[g,y,f.children.length]);function C(N){x(T=>({...T,[N]:!T[N]}))}return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border bg-card/95 px-2.5 py-1.5",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[u.jsx(Ha,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:m})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[l?u.jsx(Ke,{variant:"outline",children:l}):null,u.jsx(Ke,{variant:"secondary",children:t.length})]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:f.children.length===0?u.jsx(dt,{variant:"muted",className:"m-3 text-center",children:c}):f.children.map(N=>u.jsx(d3,{depth:0,expanded:v,node:N,onSelectFile:a,onToggle:C,root:h,selectedFile:n,statusByPath:b},N.path))})]})}function d3({depth:e,expanded:t,node:i,onSelectFile:n,onToggle:a,root:l,selectedFile:c,statusByPath:h}){const m=t[i.path]??!1,f=6+e*12,g=l?uk(lk(l,i.path)):{};if(i.isFile){const x=h.get(i.path),y=c===i.path;return u.jsxs("button",{className:fe("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",y&&"bg-muted font-medium"),onClick:()=>n(i.path),style:{paddingLeft:f},type:"button",...g,children:[u.jsx(g_,{path:i.path}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name}),x?u.jsx(MI,{file:x}):null]})}const b=m?Qs:Yr,v=m?wh:Ha;return u.jsxs("div",{children:[u.jsxs("button",{className:"flex w-full items-center gap-1 py-0.5 text-left text-[12px] font-medium hover:bg-muted",onClick:()=>a(i.path),style:{paddingLeft:f},type:"button",...g,children:[u.jsx(b,{className:"size-3.5 shrink-0 text-muted-foreground"}),u.jsx(v,{className:"size-3.5 shrink-0 text-amber-600"}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name})]}),m?i.children.map(x=>u.jsx(d3,{depth:e+1,expanded:t,node:x,onSelectFile:n,onToggle:a,root:l,selectedFile:c,statusByPath:h},x.path)):null]})}function MI({file:e}){const t=e.workingTree.trim()||e.index.trim();if(!t)return null;const i=e.index.trim()&&!e.workingTree.trim()?"text-emerald-700":t==="?"?"text-amber-700":"text-zinc-700";return u.jsx("span",{className:fe("ml-1 shrink-0 font-mono text-[10px] font-semibold",i),children:t})}const RI="modulepreload",DI=function(e){return"/"+e},xw={},OI=function(t,i,n){let a=Promise.resolve();if(i&&i.length>0){let m=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),h=c?.nonce||c?.getAttribute("nonce");a=m(i.map(f=>{if(f=DI(f),f in xw)return;xw[f]=!0;const g=f.endsWith(".css"),b=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${b}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":RI,g||(v.as="script"),v.crossOrigin="",v.href=f,h&&v.setAttribute("nonce",h),document.head.appendChild(v),g)return new Promise((x,y)=>{v.addEventListener("load",x),v.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${f}`)))})}))}function l(c){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=c,window.dispatchEvent(h),!h.defaultPrevented)throw c}return a.then(c=>{for(const h of c||[])h.status==="rejected"&&l(h.reason);return t().catch(l)})};var Tp,yw;function jI(){if(yw)return Tp;yw=1;function e(z){return z instanceof Map?z.clear=z.delete=z.set=function(){throw new Error("map is read-only")}:z instanceof Set&&(z.add=z.clear=z.delete=function(){throw new Error("set is read-only")}),Object.freeze(z),Object.getOwnPropertyNames(z).forEach(re=>{const be=z[re],Ie=typeof be;(Ie==="object"||Ie==="function")&&!Object.isFrozen(be)&&e(be)}),z}class t{constructor(re){re.data===void 0&&(re.data={}),this.data=re.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(z){return z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function n(z,...re){const be=Object.create(null);for(const Ie in z)be[Ie]=z[Ie];return re.forEach(function(Ie){for(const Ct in Ie)be[Ct]=Ie[Ct]}),be}const a="</span>",l=z=>!!z.scope,c=(z,{prefix:re})=>{if(z.startsWith("language:"))return z.replace("language:","language-");if(z.includes(".")){const be=z.split(".");return[`${re}${be.shift()}`,...be.map((Ie,Ct)=>`${Ie}${"_".repeat(Ct+1)}`)].join(" ")}return`${re}${z}`};class h{constructor(re,be){this.buffer="",this.classPrefix=be.classPrefix,re.walk(this)}addText(re){this.buffer+=i(re)}openNode(re){if(!l(re))return;const be=c(re.scope,{prefix:this.classPrefix});this.span(be)}closeNode(re){l(re)&&(this.buffer+=a)}value(){return this.buffer}span(re){this.buffer+=`<span class="${re}">`}}const m=(z={})=>{const re={children:[]};return Object.assign(re,z),re};class f{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(re){this.top.children.push(re)}openNode(re){const be=m({scope:re});this.add(be),this.stack.push(be)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(re){return this.constructor._walk(re,this.rootNode)}static _walk(re,be){return typeof be=="string"?re.addText(be):be.children&&(re.openNode(be),be.children.forEach(Ie=>this._walk(re,Ie)),re.closeNode(be)),re}static _collapse(re){typeof re!="string"&&re.children&&(re.children.every(be=>typeof be=="string")?re.children=[re.children.join("")]:re.children.forEach(be=>{f._collapse(be)}))}}class g extends f{constructor(re){super(),this.options=re}addText(re){re!==""&&this.add(re)}startScope(re){this.openNode(re)}endScope(){this.closeNode()}__addSublanguage(re,be){const Ie=re.root;be&&(Ie.scope=`language:${be}`),this.add(Ie)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(z){return z?typeof z=="string"?z:z.source:null}function v(z){return w("(?=",z,")")}function x(z){return w("(?:",z,")*")}function y(z){return w("(?:",z,")?")}function w(...z){return z.map(be=>b(be)).join("")}function C(z){const re=z[z.length-1];return typeof re=="object"&&re.constructor===Object?(z.splice(z.length-1,1),re):{}}function N(...z){return"("+(C(z).capture?"":"?:")+z.map(Ie=>b(Ie)).join("|")+")"}function T(z){return new RegExp(z.toString()+"|").exec("").length-1}function D(z,re){const be=z&&z.exec(re);return be&&be.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(z,{joinWith:re}){let be=0;return z.map(Ie=>{be+=1;const Ct=be;let yt=b(Ie),Ne="";for(;yt.length>0;){const xe=A.exec(yt);if(!xe){Ne+=yt;break}Ne+=yt.substring(0,xe.index),yt=yt.substring(xe.index+xe[0].length),xe[0][0]==="\\"&&xe[1]?Ne+="\\"+String(Number(xe[1])+Ct):(Ne+=xe[0],xe[0]==="("&&be++)}return Ne}).map(Ie=>`(${Ie})`).join(re)}const G=/\b\B/,j="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",H="\\b\\d+(\\.\\d+)?",I="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",W="\\b(0b[01]+)",J="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",P=(z={})=>{const re=/^#![ ]*\//;return z.binary&&(z.begin=w(re,/.*\b/,z.binary,/\b.*/)),n({scope:"meta",begin:re,end:/$/,relevance:0,"on:begin":(be,Ie)=>{be.index!==0&&Ie.ignoreMatch()}},z)},te={begin:"\\\\[\\s\\S]",relevance:0},K={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[te]},M={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[te]},$={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},F=function(z,re,be={}){const Ie=n({scope:"comment",begin:z,end:re,contains:[]},be);Ie.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ct=N("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ie.contains.push({begin:w(/[ ]+/,"(",Ct,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},V=F("//","$"),Y=F("/\\*","\\*/"),O=F("#","$"),ee={scope:"number",begin:H,relevance:0},ue={scope:"number",begin:I,relevance:0},ie={scope:"number",begin:W,relevance:0},le={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[te,{begin:/\[/,end:/\]/,relevance:0,contains:[te]}]},me={scope:"title",begin:j,relevance:0},Se={scope:"title",begin:R,relevance:0},ze={begin:"\\.\\s*"+R,relevance:0};var nt=Object.freeze({__proto__:null,APOS_STRING_MODE:K,BACKSLASH_ESCAPE:te,BINARY_NUMBER_MODE:ie,BINARY_NUMBER_RE:W,COMMENT:F,C_BLOCK_COMMENT_MODE:Y,C_LINE_COMMENT_MODE:V,C_NUMBER_MODE:ue,C_NUMBER_RE:I,END_SAME_AS_BEGIN:function(z){return Object.assign(z,{"on:begin":(re,be)=>{be.data._beginMatch=re[1]},"on:end":(re,be)=>{be.data._beginMatch!==re[1]&&be.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:j,MATCH_NOTHING_RE:G,METHOD_GUARD:ze,NUMBER_MODE:ee,NUMBER_RE:H,PHRASAL_WORDS_MODE:$,QUOTE_STRING_MODE:M,REGEXP_MODE:le,RE_STARTERS_RE:J,SHEBANG:P,TITLE_MODE:me,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:Se});function lt(z,re){z.input[z.index-1]==="."&&re.ignoreMatch()}function ct(z,re){z.className!==void 0&&(z.scope=z.className,delete z.className)}function Be(z,re){re&&z.beginKeywords&&(z.begin="\\b("+z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",z.__beforeBegin=lt,z.keywords=z.keywords||z.beginKeywords,delete z.beginKeywords,z.relevance===void 0&&(z.relevance=0))}function Ft(z,re){Array.isArray(z.illegal)&&(z.illegal=N(...z.illegal))}function Jr(z,re){if(z.match){if(z.begin||z.end)throw new Error("begin & end are not supported with match");z.begin=z.match,delete z.match}}function vn(z,re){z.relevance===void 0&&(z.relevance=1)}const qa=(z,re)=>{if(!z.beforeMatch)return;if(z.starts)throw new Error("beforeMatch cannot be used with starts");const be=Object.assign({},z);Object.keys(z).forEach(Ie=>{delete z[Ie]}),z.keywords=be.keywords,z.begin=w(be.beforeMatch,v(be.begin)),z.starts={relevance:0,contains:[Object.assign(be,{endsParent:!0})]},z.relevance=0,delete be.beforeMatch},ea=["of","and","for","in","not","or","if","then","parent","list","value"],ta="keyword";function nr(z,re,be=ta){const Ie=Object.create(null);return typeof z=="string"?Ct(be,z.split(" ")):Array.isArray(z)?Ct(be,z):Object.keys(z).forEach(function(yt){Object.assign(Ie,nr(z[yt],re,yt))}),Ie;function Ct(yt,Ne){re&&(Ne=Ne.map(xe=>xe.toLowerCase())),Ne.forEach(function(xe){const Le=xe.split("|");Ie[Le[0]]=[yt,xn(Le[0],Le[1])]})}}function xn(z,re){return re?Number(re):rl(z)?0:1}function rl(z){return ea.includes(z.toLowerCase())}const Ka={},Ot=z=>{console.error(z)},yn=(z,...re)=>{console.log(`WARN: ${z}`,...re)},xi=(z,re)=>{Ka[`${z}/${re}`]||(console.log(`Deprecated as of ${z}. ${re}`),Ka[`${z}/${re}`]=!0)},Sn=new Error;function wn(z,re,{key:be}){let Ie=0;const Ct=z[be],yt={},Ne={};for(let xe=1;xe<=re.length;xe++)Ne[xe+Ie]=Ct[xe],yt[xe+Ie]=!0,Ie+=T(re[xe-1]);z[be]=Ne,z[be]._emit=yt,z[be]._multi=!0}function Ga(z){if(Array.isArray(z.begin)){if(z.skip||z.excludeBegin||z.returnBegin)throw Ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Sn;if(typeof z.beginScope!="object"||z.beginScope===null)throw Ot("beginScope must be object"),Sn;wn(z,z.begin,{key:"beginScope"}),z.begin=L(z.begin,{joinWith:""})}}function rr(z){if(Array.isArray(z.end)){if(z.skip||z.excludeEnd||z.returnEnd)throw Ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Sn;if(typeof z.endScope!="object"||z.endScope===null)throw Ot("endScope must be object"),Sn;wn(z,z.end,{key:"endScope"}),z.end=L(z.end,{joinWith:""})}}function al(z){z.scope&&typeof z.scope=="object"&&z.scope!==null&&(z.beginScope=z.scope,delete z.scope)}function Wa(z){al(z),typeof z.beginScope=="string"&&(z.beginScope={_wrap:z.beginScope}),typeof z.endScope=="string"&&(z.endScope={_wrap:z.endScope}),Ga(z),rr(z)}function En(z){function re(Ne,xe){return new RegExp(b(Ne),"m"+(z.case_insensitive?"i":"")+(z.unicodeRegex?"u":"")+(xe?"g":""))}class be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(xe,Le){Le.position=this.position++,this.matchIndexes[this.matchAt]=Le,this.regexes.push([Le,xe]),this.matchAt+=T(xe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const xe=this.regexes.map(Le=>Le[1]);this.matcherRe=re(L(xe,{joinWith:"|"}),!0),this.lastIndex=0}exec(xe){this.matcherRe.lastIndex=this.lastIndex;const Le=this.matcherRe.exec(xe);if(!Le)return null;const $t=Le.findIndex((Cn,Xa)=>Xa>0&&Cn!==void 0),Mt=this.matchIndexes[$t];return Le.splice(0,$t),Object.assign(Le,Mt)}}class Ie{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(xe){if(this.multiRegexes[xe])return this.multiRegexes[xe];const Le=new be;return this.rules.slice(xe).forEach(([$t,Mt])=>Le.addRule($t,Mt)),Le.compile(),this.multiRegexes[xe]=Le,Le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(xe,Le){this.rules.push([xe,Le]),Le.type==="begin"&&this.count++}exec(xe){const Le=this.getMatcher(this.regexIndex);Le.lastIndex=this.lastIndex;let $t=Le.exec(xe);if(this.resumingScanAtSamePosition()&&!($t&&$t.index===this.lastIndex)){const Mt=this.getMatcher(0);Mt.lastIndex=this.lastIndex+1,$t=Mt.exec(xe)}return $t&&(this.regexIndex+=$t.position+1,this.regexIndex===this.count&&this.considerAll()),$t}}function Ct(Ne){const xe=new Ie;return Ne.contains.forEach(Le=>xe.addRule(Le.begin,{rule:Le,type:"begin"})),Ne.terminatorEnd&&xe.addRule(Ne.terminatorEnd,{type:"end"}),Ne.illegal&&xe.addRule(Ne.illegal,{type:"illegal"}),xe}function yt(Ne,xe){const Le=Ne;if(Ne.isCompiled)return Le;[ct,Jr,Wa,qa].forEach(Mt=>Mt(Ne,xe)),z.compilerExtensions.forEach(Mt=>Mt(Ne,xe)),Ne.__beforeBegin=null,[Be,Ft,vn].forEach(Mt=>Mt(Ne,xe)),Ne.isCompiled=!0;let $t=null;return typeof Ne.keywords=="object"&&Ne.keywords.$pattern&&(Ne.keywords=Object.assign({},Ne.keywords),$t=Ne.keywords.$pattern,delete Ne.keywords.$pattern),$t=$t||/\w+/,Ne.keywords&&(Ne.keywords=nr(Ne.keywords,z.case_insensitive)),Le.keywordPatternRe=re($t,!0),xe&&(Ne.begin||(Ne.begin=/\B|\b/),Le.beginRe=re(Le.begin),!Ne.end&&!Ne.endsWithParent&&(Ne.end=/\B|\b/),Ne.end&&(Le.endRe=re(Le.end)),Le.terminatorEnd=b(Le.end)||"",Ne.endsWithParent&&xe.terminatorEnd&&(Le.terminatorEnd+=(Ne.end?"|":"")+xe.terminatorEnd)),Ne.illegal&&(Le.illegalRe=re(Ne.illegal)),Ne.contains||(Ne.contains=[]),Ne.contains=[].concat(...Ne.contains.map(function(Mt){return ys(Mt==="self"?Ne:Mt)})),Ne.contains.forEach(function(Mt){yt(Mt,Le)}),Ne.starts&&yt(Ne.starts,xe),Le.matcher=Ct(Le),Le}if(z.compilerExtensions||(z.compilerExtensions=[]),z.contains&&z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return z.classNameAliases=n(z.classNameAliases||{}),yt(z)}function fi(z){return z?z.endsWithParent||fi(z.starts):!1}function ys(z){return z.variants&&!z.cachedVariants&&(z.cachedVariants=z.variants.map(function(re){return n(z,{variants:null},re)})),z.cachedVariants?z.cachedVariants:fi(z)?n(z,{starts:z.starts?n(z.starts):null}):Object.isFrozen(z)?n(z):z}var yi="11.11.1";class ol extends Error{constructor(re,be){super(re),this.name="HTMLInjectionError",this.html=be}}const ia=i,Ya=n,it=Symbol("nomatch"),$s=7,os=function(z){const re=Object.create(null),be=Object.create(null),Ie=[];let Ct=!0;const yt="Could not find the language '{}', did you forget to load/include a language module?",Ne={disableAutodetect:!0,name:"Plain text",contains:[]};let xe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function Le(he){return xe.noHighlightRe.test(he)}function $t(he){let Me=he.className+" ";Me+=he.parentNode?he.parentNode.className:"";const Ye=xe.languageDetectRe.exec(Me);if(Ye){const ht=Pi(Ye[1]);return ht||(yn(yt.replace("{}",Ye[1])),yn("Falling back to no-highlight mode for this block.",he)),ht?Ye[1]:"no-highlight"}return Me.split(/\s+/).find(ht=>Le(ht)||Pi(ht))}function Mt(he,Me,Ye){let ht="",qt="";typeof Me=="object"?(ht=he,Ye=Me.ignoreIllegals,qt=Me.language):(xi("10.7.0","highlight(lang, code, ...args) has been deprecated."),xi("10.7.0",`Please use highlight(code, options) instead.
|
|
37
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),qt=he,ht=Me),Ye===void 0&&(Ye=!0);const Oi={code:ht,language:qt};na("before:highlight",Oi);const ls=Oi.result?Oi.result:Cn(Oi.language,Oi.code,Ye);return ls.code=Oi.code,na("after:highlight",ls),ls}function Cn(he,Me,Ye,ht){const qt=Object.create(null);function Oi(ge,Te){return ge.keywords[Te]}function ls(){if(!je.keywords){Xt.addText(ft);return}let ge=0;je.keywordPatternRe.lastIndex=0;let Te=je.keywordPatternRe.exec(ft),He="";for(;Te;){He+=ft.substring(ge,Te.index);const Qe=Si.case_insensitive?Te[0].toLowerCase():Te[0],jt=Oi(je,Qe);if(jt){const[Ss,fl]=jt;if(Xt.addText(He),He="",qt[Qe]=(qt[Qe]||0)+1,qt[Qe]<=$s&&(cr+=fl),Ss.startsWith("_"))He+=Te[0];else{const cu=Si.classNameAliases[Ss]||Ss;cs(Te[0],cu)}}else He+=Te[0];ge=je.keywordPatternRe.lastIndex,Te=je.keywordPatternRe.exec(ft)}He+=ft.substring(ge),Xt.addText(He)}function Wi(){if(ft==="")return;let ge=null;if(typeof je.subLanguage=="string"){if(!re[je.subLanguage]){Xt.addText(ft);return}ge=Cn(je.subLanguage,ft,!0,lu[je.subLanguage]),lu[je.subLanguage]=ge._top}else ge=Za(ft,je.subLanguage.length?je.subLanguage:null);je.relevance>0&&(cr+=ge.relevance),Xt.__addSublanguage(ge._emitter,ge.language)}function Et(){je.subLanguage!=null?Wi():ls(),ft=""}function cs(ge,Te){ge!==""&&(Xt.startScope(Te),Xt.addText(ge),Xt.endScope())}function au(ge,Te){let He=1;const Qe=Te.length-1;for(;He<=Qe;){if(!ge._emit[He]){He++;continue}const jt=Si.classNameAliases[ge[He]]||ge[He],Ss=Te[He];jt?cs(Ss,jt):(ft=Ss,ls(),ft=""),He++}}function Ja(ge,Te){return ge.scope&&typeof ge.scope=="string"&&Xt.openNode(Si.classNameAliases[ge.scope]||ge.scope),ge.beginScope&&(ge.beginScope._wrap?(cs(ft,Si.classNameAliases[ge.beginScope._wrap]||ge.beginScope._wrap),ft=""):ge.beginScope._multi&&(au(ge.beginScope,Te),ft="")),je=Object.create(ge,{parent:{value:je}}),je}function ul(ge,Te,He){let Qe=D(ge.endRe,He);if(Qe){if(ge["on:end"]){const jt=new t(ge);ge["on:end"](Te,jt),jt.isMatchIgnored&&(Qe=!1)}if(Qe){for(;ge.endsParent&&ge.parent;)ge=ge.parent;return ge}}if(ge.endsWithParent)return ul(ge.parent,Te,He)}function eo(ge){return je.matcher.regexIndex===0?(ft+=ge[0],1):(ur=!0,0)}function Ih(ge){const Te=ge[0],He=ge.rule,Qe=new t(He),jt=[He.__beforeBegin,He["on:begin"]];for(const Ss of jt)if(Ss&&(Ss(ge,Qe),Qe.isMatchIgnored))return eo(Te);return He.skip?ft+=Te:(He.excludeBegin&&(ft+=Te),Et(),!He.returnBegin&&!He.excludeBegin&&(ft=Te)),Ja(He,ge),He.returnBegin?0:Te.length}function Yi(ge){const Te=ge[0],He=Me.substring(ge.index),Qe=ul(je,ge,He);if(!Qe)return it;const jt=je;je.endScope&&je.endScope._wrap?(Et(),cs(Te,je.endScope._wrap)):je.endScope&&je.endScope._multi?(Et(),au(je.endScope,ge)):jt.skip?ft+=Te:(jt.returnEnd||jt.excludeEnd||(ft+=Te),Et(),jt.excludeEnd&&(ft=Te));do je.scope&&Xt.closeNode(),!je.skip&&!je.subLanguage&&(cr+=je.relevance),je=je.parent;while(je!==Qe.parent);return Qe.starts&&Ja(Qe.starts,ge),jt.returnEnd?0:Te.length}function dl(){const ge=[];for(let Te=je;Te!==Si;Te=Te.parent)Te.scope&&ge.unshift(Te.scope);ge.forEach(Te=>Xt.openNode(Te))}let ra={};function to(ge,Te){const He=Te&&Te[0];if(ft+=ge,He==null)return Et(),0;if(ra.type==="begin"&&Te.type==="end"&&ra.index===Te.index&&He===""){if(ft+=Me.slice(Te.index,Te.index+1),!Ct){const Qe=new Error(`0 width match regex (${he})`);throw Qe.languageName=he,Qe.badRule=ra.rule,Qe}return 1}if(ra=Te,Te.type==="begin")return Ih(Te);if(Te.type==="illegal"&&!Ye){const Qe=new Error('Illegal lexeme "'+He+'" for mode "'+(je.scope||"<unnamed>")+'"');throw Qe.mode=je,Qe}else if(Te.type==="end"){const Qe=Yi(Te);if(Qe!==it)return Qe}if(Te.type==="illegal"&&He==="")return ft+=`
|
|
38
|
+
`,1;if(hl>1e5&&hl>Te.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ft+=He,He.length}const Si=Pi(he);if(!Si)throw Ot(yt.replace("{}",he)),new Error('Unknown language: "'+he+'"');const ou=En(Si);let io="",je=ht||ou;const lu={},Xt=new xe.__emitter(xe);dl();let ft="",cr=0,Tn=0,hl=0,ur=!1;try{if(Si.__emitTokens)Si.__emitTokens(Me,Xt);else{for(je.matcher.considerAll();;){hl++,ur?ur=!1:je.matcher.considerAll(),je.matcher.lastIndex=Tn;const ge=je.matcher.exec(Me);if(!ge)break;const Te=Me.substring(Tn,ge.index),He=to(Te,ge);Tn=ge.index+He}to(Me.substring(Tn))}return Xt.finalize(),io=Xt.toHTML(),{language:he,value:io,relevance:cr,illegal:!1,_emitter:Xt,_top:je}}catch(ge){if(ge.message&&ge.message.includes("Illegal"))return{language:he,value:ia(Me),illegal:!0,relevance:0,_illegalBy:{message:ge.message,index:Tn,context:Me.slice(Tn-100,Tn+100),mode:ge.mode,resultSoFar:io},_emitter:Xt};if(Ct)return{language:he,value:ia(Me),illegal:!1,relevance:0,errorRaised:ge,_emitter:Xt,_top:je};throw ge}}function Xa(he){const Me={value:ia(he),illegal:!1,relevance:0,_top:Ne,_emitter:new xe.__emitter(xe)};return Me._emitter.addText(he),Me}function Za(he,Me){Me=Me||xe.languages||Object.keys(re);const Ye=Xa(he),ht=Me.filter(Pi).filter(or).map(Et=>Cn(Et,he,!1));ht.unshift(Ye);const qt=ht.sort((Et,cs)=>{if(Et.relevance!==cs.relevance)return cs.relevance-Et.relevance;if(Et.language&&cs.language){if(Pi(Et.language).supersetOf===cs.language)return 1;if(Pi(cs.language).supersetOf===Et.language)return-1}return 0}),[Oi,ls]=qt,Wi=Oi;return Wi.secondBest=ls,Wi}function en(he,Me,Ye){const ht=Me&&be[Me]||Ye;he.classList.add("hljs"),he.classList.add(`language-${ht}`)}function Vt(he){let Me=null;const Ye=$t(he);if(Le(Ye))return;if(na("before:highlightElement",{el:he,language:Ye}),he.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",he);return}if(he.children.length>0&&(xe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(he)),xe.throwUnescapedHTML))throw new ol("One of your code blocks includes unescaped HTML.",he.innerHTML);Me=he;const ht=Me.textContent,qt=Ye?Mt(ht,{language:Ye,ignoreIllegals:!0}):Za(ht);he.innerHTML=qt.value,he.dataset.highlighted="yes",en(he,Ye,qt.language),he.result={language:qt.language,re:qt.relevance,relevance:qt.relevance},qt.secondBest&&(he.secondBest={language:qt.secondBest.language,relevance:qt.secondBest.relevance}),na("after:highlightElement",{el:he,result:qt,text:ht})}function Di(he){xe=Ya(xe,he)}const ar=()=>{Qa(),xi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ll(){Qa(),xi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let su=!1;function Qa(){function he(){Qa()}if(document.readyState==="loading"){su||window.addEventListener("DOMContentLoaded",he,!1),su=!0;return}document.querySelectorAll(xe.cssSelector).forEach(Vt)}function nu(he,Me){let Ye=null;try{Ye=Me(z)}catch(ht){if(Ot("Language definition for '{}' could not be registered.".replace("{}",he)),Ct)Ot(ht);else throw ht;Ye=Ne}Ye.name||(Ye.name=he),re[he]=Ye,Ye.rawDefinition=Me.bind(null,z),Ye.aliases&&kn(Ye.aliases,{languageName:he})}function sa(he){delete re[he];for(const Me of Object.keys(be))be[Me]===he&&delete be[Me]}function cl(){return Object.keys(re)}function Pi(he){return he=(he||"").toLowerCase(),re[he]||re[be[he]]}function kn(he,{languageName:Me}){typeof he=="string"&&(he=[he]),he.forEach(Ye=>{be[Ye.toLowerCase()]=Me})}function or(he){const Me=Pi(he);return Me&&!Me.disableAutodetect}function lr(he){he["before:highlightBlock"]&&!he["before:highlightElement"]&&(he["before:highlightElement"]=Me=>{he["before:highlightBlock"](Object.assign({block:Me.el},Me))}),he["after:highlightBlock"]&&!he["after:highlightElement"]&&(he["after:highlightElement"]=Me=>{he["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Yt(he){lr(he),Ie.push(he)}function ru(he){const Me=Ie.indexOf(he);Me!==-1&&Ie.splice(Me,1)}function na(he,Me){const Ye=he;Ie.forEach(function(ht){ht[Ye]&&ht[Ye](Me)})}function Nn(he){return xi("10.7.0","highlightBlock will be removed entirely in v12.0"),xi("10.7.0","Please use highlightElement now."),Vt(he)}Object.assign(z,{highlight:Mt,highlightAuto:Za,highlightAll:Qa,highlightElement:Vt,highlightBlock:Nn,configure:Di,initHighlighting:ar,initHighlightingOnLoad:ll,registerLanguage:nu,unregisterLanguage:sa,listLanguages:cl,getLanguage:Pi,registerAliases:kn,autoDetection:or,inherit:Ya,addPlugin:Yt,removePlugin:ru}),z.debugMode=function(){Ct=!1},z.safeMode=function(){Ct=!0},z.versionString=yi,z.regex={concat:w,lookahead:v,either:N,optional:y,anyNumberOfTimes:x};for(const he in nt)typeof nt[he]=="object"&&e(nt[he]);return Object.assign(z,nt),z},Ri=os({});return Ri.newInstance=()=>os({}),Tp=Ri,Ri.HighlightJS=Ri,Ri.default=Ri,Tp}var Ap,Sw;function LI(){if(Sw)return Ap;Sw=1;function e(t){const i=t.regex,n=i.concat(/[\p{L}_]/u,i.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},h=t.inherit(c,{begin:/\(/,end:/\)/}),m=t.inherit(t.APOS_STRING_MODE,{className:"string"}),f=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:a,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,f,m,h,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,h,f,m]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[f]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:i.concat(/</,i.lookahead(i.concat(n,i.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:i.concat(/<\//,i.lookahead(i.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Ap=e,Ap}var Mp,ww;function BI(){if(ww)return Mp;ww=1;function e(t){const i=t.regex,n={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:i.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),h={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},m={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,l]};l.contains.push(m);const f={match:/\\"/},g={className:"string",begin:/'/,end:/'/},b={match:/\\'/},v={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},x=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],y=t.SHEBANG({binary:`(${x.join("|")})`,relevance:10}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},C=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],A=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],L=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],G=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:C,literal:N,built_in:[...D,...A,"set","shopt",...L,...G]},contains:[y,t.SHEBANG(),w,v,c,h,T,m,f,g,b,n]}}return Mp=e,Mp}var Rp,Ew;function zI(){if(Ew)return Rp;Ew=1;function e(t){const i=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",h="("+a+"|"+i.optional(l)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",m={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},g={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(g,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:i.optional(l)+t.IDENT_RE,relevance:0},y=i.optional(l)+t.IDENT_RE+"\\s*\\(",N={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},T=[v,m,n,t.C_BLOCK_COMMENT_MODE,b,g],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:T.concat([{begin:/\(/,end:/\)/,keywords:N,contains:T.concat(["self"]),relevance:0}]),relevance:0},A={begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:N,relevance:0},{begin:y,returnBegin:!0,contains:[t.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,g,b,m,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,g,b,m]}]},m,n,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(D,A,T,[v,{begin:t.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:v,strings:g,keywords:N}}}return Rp=e,Rp}var Dp,Cw;function II(){if(Cw)return Dp;Cw=1;function e(t){const i=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",h="(?!struct)("+a+"|"+i.optional(l)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",m={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},g={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(g,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:i.optional(l)+t.IDENT_RE,relevance:0},y=i.optional(l)+t.IDENT_RE+"\\s*\\(",w=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],C=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],T=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],L={type:C,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},G={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:i.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},j=[G,v,m,n,t.C_BLOCK_COMMENT_MODE,b,g],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:L,contains:j.concat([{begin:/\(/,end:/\)/,keywords:L,contains:j.concat(["self"]),relevance:0}]),relevance:0},H={className:"function",begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:L,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:L,relevance:0},{begin:y,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[g,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,g,b,m,{begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,g,b,m]}]},m,n,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:L,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,H,G,j,[v,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:L,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:L},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Dp=e,Dp}var Op,kw;function PI(){if(kw)return Op;kw=1;function e(t){const i=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],a=["default","false","null","true"],l=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],c=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],h={keyword:l.concat(c),built_in:i,literal:a},m=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},g={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},v=t.inherit(b,{illegal:/\n/}),x={className:"subst",begin:/\{/,end:/\}/,keywords:h},y=t.inherit(x,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,y]},C={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]},N=t.inherit(C,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});x.contains=[C,w,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.C_BLOCK_COMMENT_MODE],y.contains=[N,w,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[g,C,w,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},A=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",L={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:h,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},T,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},m,D,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,D,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+A+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:h,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,D],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,relevance:0,contains:[T,f,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},L]}}return Op=e,Op}var jp,Nw;function UI(){if(Nw)return jp;Nw=1;const e=f=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:f.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:f.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],i=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...t,...i],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),h=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(f){const g=f.regex,b=e(f),v={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},x="and or not only",y=/@-?\w[\w]*(-\w+)*/,w="[a-zA-Z-][a-zA-Z0-9_-]*",C=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[b.BLOCK_COMMENT,v,b.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+w,relevance:0},b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+l.join("|")+")"},{begin:":(:)?("+c.join("|")+")"}]},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[b.BLOCK_COMMENT,b.HEXCOLOR,b.IMPORTANT,b.CSS_NUMBER_MODE,...C,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...C,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},b.FUNCTION_DISPATCH]},{begin:g.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:y},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:x,attribute:a.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...C,b.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+n.join("|")+")\\b"}]}}return jp=m,jp}var Lp,Tw;function HI(){if(Tw)return Lp;Tw=1;function e(t){const i=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},h={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},m=/[A-Za-z][A-Za-z0-9+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:i.concat(/\[.+?\]\(/,m,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},v=t.inherit(g,{contains:[]}),x=t.inherit(b,{contains:[]});g.contains.push(x),b.contains.push(v);let y=[n,f];return[g,b,v,x].forEach(T=>{T.contains=T.contains.concat(y)}),y=y.concat(g,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},n,c,g,b,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},l,a,f,h,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return Lp=e,Lp}var Bp,Aw;function FI(){if(Aw)return Bp;Aw=1;function e(t){const i=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:i.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:i.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return Bp=e,Bp}var zp,Mw;function $I(){if(Mw)return zp;Mw=1;function e(t){const i=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=i.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),l=i.concat(a,/(::\w+)*/),h={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},m={className:"doctag",begin:"@[A-Za-z]+"},f={begin:"#<",end:">"},g=[t.COMMENT("#","$",{contains:[m]}),t.COMMENT("^=begin","^=end",{contains:[m],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:h},v={className:"string",contains:[t.BACKSLASH_ESCAPE,b],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:i.concat(/<<[-~]?'?/,i.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,b]})]}]},x="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${x})(\\.(${y}))?([eE][+-]?(${y})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},C={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:h}]},j=[v,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:h},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:h},{relevance:0,match:[l,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[C]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[v,{begin:n}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:h},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,b],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(f,g),relevance:0}].concat(f,g);b.contains=j,C.contains=j;const W=[{begin:/^\s*=>/,starts:{end:"$",contains:j}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:h,contains:j}}];return g.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:h,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(W).concat(g).concat(j)}}return zp=e,zp}var Ip,Rw;function VI(){if(Rw)return Ip;Rw=1;function e(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}return Ip=e,Ip}var Pp,Dw;function qI(){if(Dw)return Pp;Dw=1;function e(t){const i=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:i.concat(n,i.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return Pp=e,Pp}var Up,Ow;function KI(){if(Ow)return Up;Ow=1;function e(t){const i=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},a=t.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const l={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},m={begin:/\[/,end:/\]/,contains:[a,c,l,h,n,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,g=/"(\\"|[^"])*"/,b=/'[^']*'/,v=i.either(f,g,b),x=i.concat(v,"(\\s*\\.\\s*",v,")*",i.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:x,className:"attr",starts:{end:/$/,contains:[a,m,c,l,h,n]}}]}}return Up=e,Up}var Hp,jw;function GI(){if(jw)return Hp;jw=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,i="[0-9a-fA-F](_*[0-9a-fA-F])*",n={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${i})\\.?|(${i})?\\.(${i}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${i})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function a(c,h,m){return m===-1?"":c.replace(h,f=>a(c,h,m-1))}function l(c){const h=c.regex,m="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",f=m+a("(?:<"+m+"~~~(?:\\s*,\\s*"+m+"~~~)*>)?",/~~~/g,2),y={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},w={className:"meta",begin:"@"+m,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},C={className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[c.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:y,illegal:/<\/|#/,contains:[c.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[c.BACKSLASH_ESCAPE]},c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,m],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[h.concat(/(?!else)/,m),/\s+/,m,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,m],className:{1:"keyword",3:"title.class"},contains:[C,c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+f+"\\s+)",c.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:y,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[w,c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,n,c.C_BLOCK_COMMENT_MODE]},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},n,w]}}return Hp=l,Hp}var Fp,Lw;function WI(){if(Lw)return Fp;Lw=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],i=["true","false","null","undefined","NaN","Infinity"],n=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],a=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],h=[].concat(l,n,a);function m(f){const g=f.regex,b=(Se,{after:ze})=>{const Ee="</"+Se[0].slice(1);return Se.input.indexOf(Ee,ze)!==-1},v=e,x={begin:"<>",end:"</>"},y=/<[A-Za-z0-9\\._:-]+\s*\/>/,w={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Se,ze)=>{const Ee=Se[0].length+Se.index,nt=Se.input[Ee];if(nt==="<"||nt===","){ze.ignoreMatch();return}nt===">"&&(b(Se,{after:Ee})||ze.ignoreMatch());let lt;const ct=Se.input.substring(Ee);if(lt=ct.match(/^\s*=/)){ze.ignoreMatch();return}if((lt=ct.match(/^\s+extends\s+/))&<.index===0){ze.ignoreMatch();return}}},C={$pattern:e,keyword:t,literal:i,built_in:h,"variable.language":c},N="[0-9](_?[0-9])*",T=`\\.(${N})`,D="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",A={className:"number",variants:[{begin:`(\\b(${D})((${T})|\\.)?|(${T}))[eE][+-]?(${N})\\b`},{begin:`\\b(${D})\\b((${T})\\b|\\.)?|(${T})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},L={className:"subst",begin:"\\$\\{",end:"\\}",keywords:C,contains:[]},G={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,L],subLanguage:"xml"}},j={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,L],subLanguage:"css"}},R={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,L],subLanguage:"graphql"}},H={className:"string",begin:"`",end:"`",contains:[f.BACKSLASH_ESCAPE,L]},W={className:"comment",variants:[f.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:v+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),f.C_BLOCK_COMMENT_MODE,f.C_LINE_COMMENT_MODE]},J=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,G,j,R,H,{match:/\$\d+/},A];L.contains=J.concat({begin:/\{/,end:/\}/,keywords:C,contains:["self"].concat(J)});const P=[].concat(W,L.contains),te=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:C,contains:["self"].concat(P)}]),K={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:te},M={variants:[{match:[/class/,/\s+/,v,/\s+/,/extends/,/\s+/,g.concat(v,"(",g.concat(/\./,v),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,v],scope:{1:"keyword",3:"title.class"}}]},$={relevance:0,match:g.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...n,...a]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},V={variants:[{match:[/function/,/\s+/,v,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[K],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(Se){return g.concat("(?!",Se.join("|"),")")}const ee={match:g.concat(/\b/,O([...l,"super","import"].map(Se=>`${Se}\\s*\\(`)),v,g.lookahead(/\s*\(/)),className:"title.function",relevance:0},ue={begin:g.concat(/\./,g.lookahead(g.concat(v,/(?![0-9A-Za-z$_(])/))),end:v,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ie={match:[/get|set/,/\s+/,v,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},K]},le="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+f.UNDERSCORE_IDENT_RE+")\\s*=>",me={match:[/const|var|let/,/\s+/,v,/\s*/,/=\s*/,/(async\s*)?/,g.lookahead(le)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[K]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:C,exports:{PARAMS_CONTAINS:te,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[f.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,G,j,R,H,W,{match:/\$\d+/},A,$,{scope:"attr",match:v+g.lookahead(":"),relevance:0},me,{begin:"("+f.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[W,f.REGEXP_MODE,{className:"function",begin:le,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:f.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:te}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:x.begin,end:x.end},{match:y},{begin:w.begin,"on:begin":w.isTrulyOpeningTag,end:w.end}],subLanguage:"xml",contains:[{begin:w.begin,end:w.end,skip:!0,contains:["self"]}]}]},V,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+f.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[K,f.inherit(f.TITLE_MODE,{begin:v,className:"title.function"})]},{match:/\.\.\./,relevance:0},ue,{match:"\\$"+v,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[K]},ee,Y,M,ie,{match:/\$[(.]/}]}}return Fp=m,Fp}var $p,Bw;function YI(){if(Bw)return $p;Bw=1;function e(t){const i={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],l={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[i,n,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return $p=e,$p}var Vp,zw;function XI(){if(zw)return Vp;zw=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,i="[0-9a-fA-F](_*[0-9a-fA-F])*",n={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${i})\\.?|(${i})?\\.(${i}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${i})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function a(l){const c={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},h={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},m={className:"symbol",begin:l.UNDERSCORE_IDENT_RE+"@"},f={className:"subst",begin:/\$\{/,end:/\}/,contains:[l.C_NUMBER_MODE]},g={className:"variable",begin:"\\$"+l.UNDERSCORE_IDENT_RE},b={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[g,f]},{begin:"'",end:"'",illegal:/\n/,contains:[l.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[l.BACKSLASH_ESCAPE,g,f]}]};f.contains.push(b);const v={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+l.UNDERSCORE_IDENT_RE+")?"},x={className:"meta",begin:"@"+l.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[l.inherit(b,{className:"string"}),"self"]}]},y=n,w=l.COMMENT("/\\*","\\*/",{contains:[l.C_BLOCK_COMMENT_MODE]}),C={variants:[{className:"type",begin:l.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},N=C;return N.variants[1].contains=[C],C.variants[1].contains=[N],{name:"Kotlin",aliases:["kt","kts"],keywords:c,contains:[l.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),l.C_LINE_COMMENT_MODE,w,h,m,v,x,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:c,relevance:5,contains:[{begin:l.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[l.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[C,l.C_LINE_COMMENT_MODE,w],relevance:0},l.C_LINE_COMMENT_MODE,w,v,x,b,l.C_NUMBER_MODE]},w]},{begin:[/class|interface|trait/,/\s+/,l.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},l.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},v,x]},b,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
39
|
+
`},y]}}return Vp=a,Vp}var qp,Iw;function ZI(){if(Iw)return qp;Iw=1;const e=g=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:g.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[g.APOS_STRING_MODE,g.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:g.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],i=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...t,...i],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),h=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),m=l.concat(c).sort().reverse();function f(g){const b=e(g),v=m,x="and or not only",y="[\\w-]+",w="("+y+"|@\\{"+y+"\\})",C=[],N=[],T=function(P){return{className:"string",begin:"~?"+P+".*?"+P}},D=function(P,te,K){return{className:P,begin:te,relevance:K}},A={$pattern:/[a-z-]+/,keyword:x,attribute:a.join(" ")},L={begin:"\\(",end:"\\)",contains:N,keywords:A,relevance:0};N.push(g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,T("'"),T('"'),b.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},b.HEXCOLOR,L,D("variable","@@?"+y,10),D("variable","@\\{"+y+"\\}"),D("built_in","~?`[^`]*?`"),{className:"attribute",begin:y+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},b.IMPORTANT,{beginKeywords:"and not"},b.FUNCTION_DISPATCH);const G=N.concat({begin:/\{/,end:/\}/,contains:C}),j={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(N)},R={begin:w+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:N}}]},H={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:A,returnEnd:!0,contains:N,relevance:0}},I={className:"variable",variants:[{begin:"@"+y+"\\s*:",relevance:15},{begin:"@"+y}],starts:{end:"[;}]",returnEnd:!0,contains:G}},W={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:w,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,j,D("keyword","all\\b"),D("variable","@\\{"+y+"\\}"),{begin:"\\b("+n.join("|")+")\\b",className:"selector-tag"},b.CSS_NUMBER_MODE,D("selector-tag",w,0),D("selector-id","#"+w),D("selector-class","\\."+w,0),D("selector-tag","&",0),b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+l.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+c.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:G},{begin:"!important"},b.FUNCTION_DISPATCH]},J={begin:y+`:(:)?(${v.join("|")})`,returnBegin:!0,contains:[W]};return C.push(g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,H,I,J,R,W,j,b.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:C}}return qp=f,qp}var Kp,Pw;function QI(){if(Pw)return Kp;Pw=1;function e(t){const i="\\[=*\\[",n="\\]=*\\]",a={begin:i,end:n,contains:["self"]},l=[t.COMMENT("--(?!"+i+")","$"),t.COMMENT("--"+i,n,{contains:[a],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:l.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:l}].concat(l)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:i,end:n,contains:[a],relevance:5}])}}return Kp=e,Kp}var Gp,Uw;function JI(){if(Uw)return Gp;Uw=1;function e(t){const i={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,i]},a={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[i,n]},l={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},h={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[i]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,i,n,a,l,c,h]}}return Gp=e,Gp}var Wp,Hw;function eP(){if(Hw)return Wp;Hw=1;function e(t){const i=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],a=/[dualxmsipngr]{0,12}/,l={$pattern:/[\w.]+/,keyword:n.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:l},h={begin:/->\{/,end:/\}/},m={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},f={scope:"variable",variants:[{begin:/\$\d/},{begin:i.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[m]},g={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},b=[t.BACKSLASH_ESCAPE,c,f],v=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],x=(C,N,T="\\1")=>{const D=T==="\\1"?T:i.concat(T,N);return i.concat(i.concat("(?:",C,")"),N,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,T,a)},y=(C,N,T)=>i.concat(i.concat("(?:",C,")"),N,/(?:\\.|[^\\\/])*?/,T,a),w=[f,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),h,{className:"string",contains:b,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},g,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:x("s|tr|y",i.either(...v,{capture:!0}))},{begin:x("s|tr|y","\\(","\\)")},{begin:x("s|tr|y","\\[","\\]")},{begin:x("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:y("(?:m|qr)?",/\//,/\//)},{begin:y("m|qr",i.either(...v,{capture:!0}),/\1/)},{begin:y("m|qr",/\(/,/\)/)},{begin:y("m|qr",/\[/,/\]/)},{begin:y("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m,g]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=w,h.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:w}}return Wp=e,Wp}var Yp,Fw;function tP(){if(Fw)return Yp;Fw=1;function e(t){const i={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,m={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},f={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:m,illegal:"</",contains:[i,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+f.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:f,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return Yp=e,Yp}var Xp,$w;function iP(){if($w)return Xp;$w=1;function e(t){const i=t.regex,n=/(?![A-Za-z0-9])(?![$])/,a=i.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),l=i.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),c=i.concat(/[A-Z]+/,n),h={scope:"variable",match:"\\$+"+a},m={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},f={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},g=t.inherit(t.APOS_STRING_MODE,{illegal:null}),b=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(f)}),v={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(K,M)=>{M.data._beginMatch=K[1]||K[2]},"on:end":(K,M)=>{M.data._beginMatch!==K[1]&&M.ignoreMatch()}},x=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
|
|
40
|
+
]`,w={scope:"string",variants:[b,g,v,x]},C={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},N=["false","null","true"],T=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],D=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],L={keyword:T,literal:(K=>{const M=[];return K.forEach($=>{M.push($),$.toLowerCase()===$?M.push($.toUpperCase()):M.push($.toLowerCase())}),M})(N),built_in:D},G=K=>K.map(M=>M.replace(/\|\d+$/,"")),j={variants:[{match:[/new/,i.concat(y,"+"),i.concat("(?!",G(D).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},R=i.concat(a,"\\b(?!\\()"),H={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,i.concat(/::/,i.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[l,i.concat("::",i.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:i.concat(a,i.lookahead(":"),i.lookahead(/(?!::)/))},W={relevance:0,begin:/\(/,end:/\)/,keywords:L,contains:[I,h,H,t.C_BLOCK_COMMENT_MODE,w,C,j]},J={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",G(T).join("\\b|"),"|",G(D).join("\\b|"),"\\b)"),a,i.concat(y,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[W]};W.contains.push(J);const P=[I,H,t.C_BLOCK_COMMENT_MODE,w,C,j],te={begin:i.concat(/#\[\s*\\?/,i.either(l,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...P]},...P,{scope:"meta",variants:[{match:l},{match:c}]}]};return{case_insensitive:!1,keywords:L,contains:[te,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},m,{scope:"variable.language",match:/\$this\b/},h,J,H,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},j,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:L,contains:["self",te,h,H,t.C_BLOCK_COMMENT_MODE,w,C]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},w,C]}}return Xp=e,Xp}var Zp,Vw;function sP(){if(Vw)return Zp;Vw=1;function e(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return Zp=e,Zp}var Qp,qw;function nP(){if(qw)return Qp;qw=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return Qp=e,Qp}var Jp,Kw;function rP(){if(Kw)return Jp;Kw=1;function e(t){const i=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],m={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:m,illegal:/#/},b={begin:/\{\{/,relevance:0},v={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f,b,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},x="[0-9](_?[0-9])*",y=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,w=`\\b|${a.join("|")}`,C={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${y}))[eE][+-]?(${x})[jJ]?(?=${w})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${w})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${w})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${w})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${w})`},{begin:`\\b(${x})[jJ](?=${w})`}]},N={className:"comment",begin:i.lookahead(/# type:/),end:/$/,keywords:m,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",f,C,v,t.HASH_COMMENT_MODE]}]};return g.contains=[v,C,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[f,C,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},v,N,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[T]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[C,T,v]}]}}return Jp=e,Jp}var eg,Gw;function aP(){if(Gw)return eg;Gw=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return eg=e,eg}var tg,Ww;function oP(){if(Ww)return tg;Ww=1;function e(t){const i=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=i.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),l=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=i.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:i.lookahead(i.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[l,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[c,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:l},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return tg=e,tg}var ig,Yw;function lP(){if(Yw)return ig;Yw=1;function e(t){const i=t.regex,n=/(r#)?/,a=i.concat(n,t.UNDERSCORE_IDENT_RE),l=i.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:i.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,i.lookahead(/\s*\(/))},h="([ui](8|16|32|64|128|size)|f(32|64))?",m=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],f=["true","false","Some","None","Ok","Err"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:b,keyword:m,literal:f,built_in:g},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+h},{begin:"\\b0o([0-7_]+)"+h},{begin:"\\b0x([A-Fa-f0-9_]+)"+h},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+h}],relevance:0},{begin:[/fn/,/\s+/,a],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,a],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,a,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:b}},{className:"punctuation",begin:"->"},c]}}return ig=e,ig}var sg,Xw;function cP(){if(Xw)return sg;Xw=1;const e=f=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:f.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:f.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],i=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...t,...i],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),h=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(f){const g=e(f),b=c,v=l,x="@[a-z-]+",y="and or not only",C={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[f.C_LINE_COMMENT_MODE,f.C_BLOCK_COMMENT_MODE,g.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},g.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+n.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+v.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b.join("|")+")"},C,{begin:/\(/,end:/\)/,contains:[g.CSS_NUMBER_MODE]},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[g.BLOCK_COMMENT,C,g.HEXCOLOR,g.CSS_NUMBER_MODE,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,g.IMPORTANT,g.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:x,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:y,attribute:a.join(" ")},contains:[{begin:x,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},C,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,g.HEXCOLOR,g.CSS_NUMBER_MODE]},g.FUNCTION_DISPATCH]}}return sg=m,sg}var ng,Zw;function uP(){if(Zw)return ng;Zw=1;function e(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return ng=e,ng}var rg,Qw;function dP(){if(Qw)return rg;Qw=1;function e(t){const i=t.regex,n=t.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],h=["double precision","large object","with timezone","without timezone"],m=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],f=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],v=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],x=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],y=b,w=[...g,...f].filter(G=>!b.includes(G)),C={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:i.concat(/\b/,i.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function D(G){return i.concat(/\b/,i.either(...G.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const A={scope:"keyword",match:D(x),relevance:0};function L(G,{exceptions:j,when:R}={}){const H=R;return j=j||[],G.map(I=>I.match(/\|\d+$/)||j.includes(I)?I:H(I)?`${I}|0`:I)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(w,{when:G=>G.length<3}),literal:c,type:m,built_in:v},contains:[{scope:"type",match:D(h)},A,T,C,a,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,N]}}return rg=e,rg}var ag,Jw;function hP(){if(Jw)return ag;Jw=1;function e(R){return R?typeof R=="string"?R:R.source:null}function t(R){return i("(?=",R,")")}function i(...R){return R.map(I=>e(I)).join("")}function n(R){const H=R[R.length-1];return typeof H=="object"&&H.constructor===Object?(R.splice(R.length-1,1),H):{}}function a(...R){return"("+(n(R).capture?"":"?:")+R.map(W=>e(W)).join("|")+")"}const l=R=>i(/\b/,R,/\w$/.test(R)?/\b/:/\B/),c=["Protocol","Type"].map(l),h=["init","self"].map(l),m=["Any","Self"],f=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],g=["false","nil","true"],b=["assignment","associativity","higherThan","left","lowerThan","none","right"],v=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],x=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],y=a(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),w=a(y,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),C=i(y,w,"*"),N=a(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),T=a(N,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),D=i(N,T,"*"),A=i(/[A-Z]/,T,"*"),L=["attached","autoclosure",i(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",i(/objc\(/,D,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],G=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function j(R){const H={match:/\s+/,relevance:0},I=R.COMMENT("/\\*","\\*/",{contains:["self"]}),W=[R.C_LINE_COMMENT_MODE,I],J={match:[/\./,a(...c,...h)],className:{2:"keyword"}},P={match:i(/\./,a(...f)),relevance:0},te=f.filter(it=>typeof it=="string").concat(["_|0"]),K=f.filter(it=>typeof it!="string").concat(m).map(l),M={variants:[{className:"keyword",match:a(...K,...h)}]},$={$pattern:a(/\b\w+/,/#\w+/),keyword:te.concat(v),literal:g},F=[J,P,M],V={match:i(/\./,a(...x)),relevance:0},Y={className:"built_in",match:i(/\b/,a(...x),/(?=\()/)},O=[V,Y],ee={match:/->/,relevance:0},ue={className:"operator",relevance:0,variants:[{match:C},{match:`\\.(\\.|${w})+`}]},ie=[ee,ue],le="([0-9]_*)+",me="([0-9a-fA-F]_*)+",Se={className:"number",relevance:0,variants:[{match:`\\b(${le})(\\.(${le}))?([eE][+-]?(${le}))?\\b`},{match:`\\b0x(${me})(\\.(${me}))?([pP][+-]?(${le}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},ze=(it="")=>({className:"subst",variants:[{match:i(/\\/,it,/[0\\tnr"']/)},{match:i(/\\/,it,/u\{[0-9a-fA-F]{1,8}\}/)}]}),Ee=(it="")=>({className:"subst",match:i(/\\/,it,/[\t ]*(?:[\r\n]|\r\n)/)}),nt=(it="")=>({className:"subst",label:"interpol",begin:i(/\\/,it,/\(/),end:/\)/}),lt=(it="")=>({begin:i(it,/"""/),end:i(/"""/,it),contains:[ze(it),Ee(it),nt(it)]}),ct=(it="")=>({begin:i(it,/"/),end:i(/"/,it),contains:[ze(it),nt(it)]}),Be={className:"string",variants:[lt(),lt("#"),lt("##"),lt("###"),ct(),ct("#"),ct("##"),ct("###")]},Ft=[R.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[R.BACKSLASH_ESCAPE]}],Jr={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Ft},vn=it=>{const $s=i(it,/\//),os=i(/\//,it);return{begin:$s,end:os,contains:[...Ft,{scope:"comment",begin:`#(?!.*${os})`,end:/$/}]}},qa={scope:"regexp",variants:[vn("###"),vn("##"),vn("#"),Jr]},ea={match:i(/`/,D,/`/)},ta={className:"variable",match:/\$\d+/},nr={className:"variable",match:`\\$${T}+`},xn=[ea,ta,nr],rl={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:G,contains:[...ie,Se,Be]}]}},Ka={scope:"keyword",match:i(/@/,a(...L),t(a(/\(/,/\s+/)))},Ot={scope:"meta",match:i(/@/,D)},yn=[rl,Ka,Ot],xi={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:i(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,T,"+")},{className:"type",match:A,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,t(A)),relevance:0}]},Sn={begin:/</,end:/>/,keywords:$,contains:[...W,...F,...yn,ee,xi]};xi.contains.push(Sn);const wn={match:i(D,/\s*:/),keywords:"_|0",relevance:0},Ga={begin:/\(/,end:/\)/,relevance:0,keywords:$,contains:["self",wn,...W,qa,...F,...O,...ie,Se,Be,...xn,...yn,xi]},rr={begin:/</,end:/>/,keywords:"repeat each",contains:[...W,xi]},al={begin:a(t(i(D,/\s*:/)),t(i(D,/\s+/,D,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:D}]},Wa={begin:/\(/,end:/\)/,keywords:$,contains:[al,...W,...F,...ie,Se,Be,...yn,xi,Ga],endsParent:!0,illegal:/["']/},En={match:[/(func|macro)/,/\s+/,a(ea.match,D,C)],className:{1:"keyword",3:"title.function"},contains:[rr,Wa,H],illegal:[/\[/,/%/]},fi={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[rr,Wa,H],illegal:/\[|%/},ys={match:[/operator/,/\s+/,C],className:{1:"keyword",3:"title"}},yi={begin:[/precedencegroup/,/\s+/,A],className:{1:"keyword",3:"title"},contains:[xi],keywords:[...b,...g],end:/}/},ol={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ia={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ya={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,D,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:$,contains:[rr,...F,{begin:/:/,end:/\{/,keywords:$,contains:[{scope:"title.class.inherited",match:A},...F],relevance:0}]};for(const it of Be.variants){const $s=it.contains.find(Ri=>Ri.label==="interpol");$s.keywords=$;const os=[...F,...O,...ie,Se,Be,...xn];$s.contains=[...os,{begin:/\(/,end:/\)/,contains:["self",...os]}]}return{name:"Swift",keywords:$,contains:[...W,En,fi,ol,ia,Ya,ys,yi,{beginKeywords:"import",end:/$/,contains:[...W],relevance:0},qa,...F,...O,...ie,Se,Be,...xn,...yn,xi,Ga]}}return ag=j,ag}var og,e2;function fP(){if(e2)return og;e2=1;function e(t){const i="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},h={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,l]},m=t.inherit(h,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),x={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:i,relevance:0},w={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},C={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},N=[a,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:i,keywords:{literal:i}},x,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},w,C,c,h],T=[...N];return T.pop(),T.push(m),y.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}return og=e,og}var lg,t2;function mP(){if(t2)return lg;t2=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],i=["true","false","null","undefined","NaN","Infinity"],n=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],a=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],h=[].concat(l,n,a);function m(g){const b=g.regex,v=(ze,{after:Ee})=>{const nt="</"+ze[0].slice(1);return ze.input.indexOf(nt,Ee)!==-1},x=e,y={begin:"<>",end:"</>"},w=/<[A-Za-z0-9\\._:-]+\s*\/>/,C={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ze,Ee)=>{const nt=ze[0].length+ze.index,lt=ze.input[nt];if(lt==="<"||lt===","){Ee.ignoreMatch();return}lt===">"&&(v(ze,{after:nt})||Ee.ignoreMatch());let ct;const Be=ze.input.substring(nt);if(ct=Be.match(/^\s*=/)){Ee.ignoreMatch();return}if((ct=Be.match(/^\s+extends\s+/))&&ct.index===0){Ee.ignoreMatch();return}}},N={$pattern:e,keyword:t,literal:i,built_in:h,"variable.language":c},T="[0-9](_?[0-9])*",D=`\\.(${T})`,A="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",L={className:"number",variants:[{begin:`(\\b(${A})((${D})|\\.)?|(${D}))[eE][+-]?(${T})\\b`},{begin:`\\b(${A})\\b((${D})\\b|\\.)?|(${D})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},G={className:"subst",begin:"\\$\\{",end:"\\}",keywords:N,contains:[]},j={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,G],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,G],subLanguage:"css"}},H={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,G],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[g.BACKSLASH_ESCAPE,G]},J={className:"comment",variants:[g.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:x+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),g.C_BLOCK_COMMENT_MODE,g.C_LINE_COMMENT_MODE]},P=[g.APOS_STRING_MODE,g.QUOTE_STRING_MODE,j,R,H,I,{match:/\$\d+/},L];G.contains=P.concat({begin:/\{/,end:/\}/,keywords:N,contains:["self"].concat(P)});const te=[].concat(J,G.contains),K=te.concat([{begin:/(\s*)\(/,end:/\)/,keywords:N,contains:["self"].concat(te)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:K},$={variants:[{match:[/class/,/\s+/,x,/\s+/,/extends/,/\s+/,b.concat(x,"(",b.concat(/\./,x),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,x],scope:{1:"keyword",3:"title.class"}}]},F={relevance:0,match:b.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...n,...a]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Y={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},O={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ee(ze){return b.concat("(?!",ze.join("|"),")")}const ue={match:b.concat(/\b/,ee([...l,"super","import"].map(ze=>`${ze}\\s*\\(`)),x,b.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:b.concat(/\./,b.lookahead(b.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},le={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},me="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+g.UNDERSCORE_IDENT_RE+")\\s*=>",Se={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,b.lookahead(me)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:N,exports:{PARAMS_CONTAINS:K,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[g.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,g.APOS_STRING_MODE,g.QUOTE_STRING_MODE,j,R,H,I,J,{match:/\$\d+/},L,F,{scope:"attr",match:x+b.lookahead(":"),relevance:0},Se,{begin:"("+g.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[J,g.REGEXP_MODE,{className:"function",begin:me,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:g.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:K}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:y.begin,end:y.end},{match:w},{begin:C.begin,"on:begin":C.isTrulyOpeningTag,end:C.end}],subLanguage:"xml",contains:[{begin:C.begin,end:C.end,skip:!0,contains:["self"]}]}]},Y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+g.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,g.inherit(g.TITLE_MODE,{begin:x,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},ue,O,$,le,{match:/\$[(.]/}]}}function f(g){const b=g.regex,v=m(g),x=e,y=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],w={begin:[/namespace/,/\s+/,g.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},C={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:y},contains:[v.exports.CLASS_REFERENCE]},N={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},T=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],D={$pattern:e,keyword:t.concat(T),literal:i,built_in:h.concat(y),"variable.language":c},A={className:"meta",begin:"@"+x},L=(H,I,W)=>{const J=H.contains.findIndex(P=>P.label===I);if(J===-1)throw new Error("can not find mode to replace");H.contains.splice(J,1,W)};Object.assign(v.keywords,D),v.exports.PARAMS_CONTAINS.push(A);const G=v.contains.find(H=>H.scope==="attr"),j=Object.assign({},G,{match:b.concat(x,b.lookahead(/\s*\?:/))});v.exports.PARAMS_CONTAINS.push([v.exports.CLASS_REFERENCE,G,j]),v.contains=v.contains.concat([A,w,C,j]),L(v,"shebang",g.SHEBANG()),L(v,"use_strict",N);const R=v.contains.find(H=>H.label==="func.def");return R.relevance=0,Object.assign(v,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),v}return lg=f,lg}var cg,i2;function pP(){if(i2)return cg;i2=1;function e(t){const i=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},l=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\d{4}-\d{1,2}-\d{1,2}/,h=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,m=/\d{1,2}(:\d{1,2}){1,2}/,f={className:"literal",variants:[{begin:i.concat(/# */,i.either(c,l),/ *#/)},{begin:i.concat(/# */,m,/ *#/)},{begin:i.concat(/# */,h,/ *#/)},{begin:i.concat(/# */,i.either(c,l),/ +/,i.either(h,m),/ *#/)}]},g={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},b={className:"label",begin:/^\w+:/},v=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),x=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,a,f,g,b,v,x,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[x]}]}}return cg=e,cg}var ug,s2;function gP(){if(s2)return ug;s2=1;function e(t){t.regex;const i=t.COMMENT(/\(;/,/;\)/);i.contains.push("self");const n=t.COMMENT(/;;/,/$/),a=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],l={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={className:"variable",begin:/\$[\w_]+/},h={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},m={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},f={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},g={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:a},contains:[n,i,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},c,h,l,t.QUOTE_STRING_MODE,f,g,m]}}return ug=e,ug}var dg,n2;function _P(){if(n2)return dg;n2=1;var e=jI();return e.registerLanguage("xml",LI()),e.registerLanguage("bash",BI()),e.registerLanguage("c",zI()),e.registerLanguage("cpp",II()),e.registerLanguage("csharp",PI()),e.registerLanguage("css",UI()),e.registerLanguage("markdown",HI()),e.registerLanguage("diff",FI()),e.registerLanguage("ruby",$I()),e.registerLanguage("go",VI()),e.registerLanguage("graphql",qI()),e.registerLanguage("ini",KI()),e.registerLanguage("java",GI()),e.registerLanguage("javascript",WI()),e.registerLanguage("json",YI()),e.registerLanguage("kotlin",XI()),e.registerLanguage("less",ZI()),e.registerLanguage("lua",QI()),e.registerLanguage("makefile",JI()),e.registerLanguage("perl",eP()),e.registerLanguage("objectivec",tP()),e.registerLanguage("php",iP()),e.registerLanguage("php-template",sP()),e.registerLanguage("plaintext",nP()),e.registerLanguage("python",rP()),e.registerLanguage("python-repl",aP()),e.registerLanguage("r",oP()),e.registerLanguage("rust",lP()),e.registerLanguage("scss",cP()),e.registerLanguage("shell",uP()),e.registerLanguage("sql",dP()),e.registerLanguage("swift",hP()),e.registerLanguage("yaml",fP()),e.registerLanguage("typescript",mP()),e.registerLanguage("vbnet",pP()),e.registerLanguage("wasm",gP()),e.HighlightJS=e,e.default=e,dg=e,dg}var bP=_P();const k0=bT(bP);function R_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Va=R_();function h3(e){Va=e}var Aa={exec:()=>null};function Lo(e){let t=[];return i=>{let n=Math.max(0,Math.min(3,i-1)),a=t[n];return a||(a=e(n),t[n]=a),a}}function st(e,t=""){let i=typeof e=="string"?e:e.source,n={replace:(a,l)=>{let c=typeof l=="string"?l:l.source;return c=c.replace(zi.caret,"$1"),i=i.replace(a,c),n},getRegex:()=>new RegExp(i,t)};return n}var vP=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),zi={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Lo(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Lo(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Lo(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Lo(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Lo(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Lo(e=>new RegExp(`^ {0,${e}}>`))},xP=/^(?:[ \t]*(?:\n|$))+/,yP=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,SP=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,iu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wP=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,D_=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,f3=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,m3=st(f3).replace(/bull/g,D_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),EP=st(f3).replace(/bull/g,D_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),O_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,CP=/^[^\n]+/,j_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,kP=st(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",j_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),NP=st(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,D_).getRegex(),Lh="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",L_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,TP=st("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",L_).replace("tag",Lh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),p3=st(O_).replace("hr",iu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Lh).getRegex(),AP=st(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",p3).getRegex(),B_={blockquote:AP,code:yP,def:kP,fences:SP,heading:wP,hr:iu,html:TP,lheading:m3,list:NP,newline:xP,paragraph:p3,table:Aa,text:CP},r2=st("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",iu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Lh).getRegex(),MP={...B_,lheading:EP,table:r2,paragraph:st(O_).replace("hr",iu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",r2).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Lh).getRegex()},RP={...B_,html:st(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",L_).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Aa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:st(O_).replace("hr",iu).replace("heading",` *#{1,6} *[^
|
|
41
|
+
]`).replace("lheading",m3).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},DP=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,OP=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,g3=/^( {2,}|\\)\n(?!\s*$)/,jP=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,nl=/[\p{P}\p{S}]/u,Bh=/[\s\p{P}\p{S}]/u,z_=/[^\s\p{P}\p{S}]/u,LP=st(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Bh).getRegex(),_3=/(?!~)[\p{P}\p{S}]/u,BP=/(?!~)[\s\p{P}\p{S}]/u,zP=/(?:[^\s\p{P}\p{S}]|~)/u,IP=st(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",vP?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),b3=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,PP=st(b3,"u").replace(/punct/g,nl).getRegex(),UP=st(b3,"u").replace(/punct/g,_3).getRegex(),v3="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",HP=st(v3,"gu").replace(/notPunctSpace/g,z_).replace(/punctSpace/g,Bh).replace(/punct/g,nl).getRegex(),FP=st(v3,"gu").replace(/notPunctSpace/g,zP).replace(/punctSpace/g,BP).replace(/punct/g,_3).getRegex(),$P=st("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,z_).replace(/punctSpace/g,Bh).replace(/punct/g,nl).getRegex(),VP=st(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,nl).getRegex(),qP="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",KP=st(qP,"gu").replace(/notPunctSpace/g,z_).replace(/punctSpace/g,Bh).replace(/punct/g,nl).getRegex(),GP=st(/\\(punct)/,"gu").replace(/punct/g,nl).getRegex(),WP=st(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),YP=st(L_).replace("(?:-->|$)","-->").getRegex(),XP=st("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",YP).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ph=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ZP=st(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ph).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),x3=st(/^!?\[(label)\]\[(ref)\]/).replace("label",ph).replace("ref",j_).getRegex(),y3=st(/^!?\[(ref)\](?:\[\])?/).replace("ref",j_).getRegex(),QP=st("reflink|nolink(?!\\()","g").replace("reflink",x3).replace("nolink",y3).getRegex(),a2=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,I_={_backpedal:Aa,anyPunctuation:GP,autolink:WP,blockSkip:IP,br:g3,code:OP,del:Aa,delLDelim:Aa,delRDelim:Aa,emStrongLDelim:PP,emStrongRDelimAst:HP,emStrongRDelimUnd:$P,escape:DP,link:ZP,nolink:y3,punctuation:LP,reflink:x3,reflinkSearch:QP,tag:XP,text:jP,url:Aa},JP={...I_,link:st(/^!?\[(label)\]\((.*?)\)/).replace("label",ph).getRegex(),reflink:st(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ph).getRegex()},N0={...I_,emStrongRDelimAst:FP,emStrongLDelim:UP,delLDelim:VP,delRDelim:KP,url:st(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",a2).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:st(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",a2).getRegex()},eU={...N0,br:st(g3).replace("{2,}","*").getRegex(),text:st(N0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},jd={normal:B_,gfm:MP,pedantic:RP},dc={normal:I_,gfm:N0,breaks:eU,pedantic:JP},tU={"&":"&","<":"<",">":">",'"':""","'":"'"},o2=e=>tU[e];function un(e,t){if(t){if(zi.escapeTest.test(e))return e.replace(zi.escapeReplace,o2)}else if(zi.escapeTestNoEncode.test(e))return e.replace(zi.escapeReplaceNoEncode,o2);return e}function l2(e){try{e=encodeURI(e).replace(zi.percentDecode,"%")}catch{return null}return e}function c2(e,t){let i=e.replace(zi.findPipe,(l,c,h)=>{let m=!1,f=c;for(;--f>=0&&h[f]==="\\";)m=!m;return m?"|":" |"}),n=i.split(zi.splitPipe),a=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;a<n.length;a++)n[a]=n[a].trim().replace(zi.slashPipe,"|");return n}function Ir(e,t,i){let n=e.length;if(n===0)return"";let a=0;for(;a<n&&e.charAt(n-a-1)===t;)a++;return e.slice(0,n-a)}function u2(e){let t=e.split(`
|
|
42
|
+
`),i=t.length-1;for(;i>=0&&zi.blankLine.test(t[i]);)i--;return t.length-i<=2?e:t.slice(0,i+1).join(`
|
|
43
|
+
`)}function iU(e,t){if(e.indexOf(t[1])===-1)return-1;let i=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])i++;else if(e[n]===t[1]&&(i--,i<0))return n;return i>0?-2:-1}function sU(e,t=0){let i=t,n="";for(let a of e)if(a===" "){let l=4-i%4;n+=" ".repeat(l),i+=l}else n+=a,i++;return n}function d2(e,t,i,n,a){let l=t.href,c=t.title||null,h=e[1].replace(a.other.outputLinkReplace,"$1");n.state.inLink=!0;let m={type:e[0].charAt(0)==="!"?"image":"link",raw:i,href:l,title:c,text:h,tokens:n.inlineTokens(h)};return n.state.inLink=!1,m}function nU(e,t,i){let n=e.match(i.other.indentCodeCompensation);if(n===null)return t;let a=n[1];return t.split(`
|
|
44
|
+
`).map(l=>{let c=l.match(i.other.beginningSpace);if(c===null)return l;let[h]=c;return h.length>=a.length?l.slice(a.length):l}).join(`
|
|
45
|
+
`)}var gh=class{options;rules;lexer;constructor(e){this.options=e||Va}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let i=this.options.pedantic?t[0]:u2(t[0]),n=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],n=nU(i,t[3]||"",this.rules);return{type:"code",raw:i,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(this.rules.other.endingHash.test(i)){let n=Ir(i,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(i=n.trim())}return{type:"heading",raw:Ir(t[0],`
|
|
46
|
+
`),depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ir(t[0],`
|
|
47
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=Ir(t[0],`
|
|
48
|
+
`).split(`
|
|
49
|
+
`),n="",a="",l=[];for(;i.length>0;){let c=!1,h=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))h.push(i[m]),c=!0;else if(!c)h.push(i[m]);else break;i=i.slice(m);let f=h.join(`
|
|
50
|
+
`),g=f.replace(this.rules.other.blockquoteSetextReplace,`
|
|
51
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
52
|
+
${f}`:f,a=a?`${a}
|
|
53
|
+
${g}`:g;let b=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,l,!0),this.lexer.state.top=b,i.length===0)break;let v=l.at(-1);if(v?.type==="code")break;if(v?.type==="blockquote"){let x=v,y=x.raw+`
|
|
54
|
+
`+i.join(`
|
|
55
|
+
`),w=this.blockquote(y);l[l.length-1]=w,n=n.substring(0,n.length-x.raw.length)+w.raw,a=a.substring(0,a.length-x.text.length)+w.text;break}else if(v?.type==="list"){let x=v,y=x.raw+`
|
|
56
|
+
`+i.join(`
|
|
57
|
+
`),w=this.list(y);l[l.length-1]=w,n=n.substring(0,n.length-v.raw.length)+w.raw,a=a.substring(0,a.length-x.raw.length)+w.raw,i=y.substring(l.at(-1).raw.length).split(`
|
|
58
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:l,text:a}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim(),n=i.length>1,a={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;e;){let m=!1,f="",g="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let b=sU(t[2].split(`
|
|
59
|
+
`,1)[0],t[1].length),v=e.split(`
|
|
60
|
+
`,1)[0],x=!b.trim(),y=0;if(this.options.pedantic?(y=2,g=b.trimStart()):x?y=t[1].length+1:(y=b.search(this.rules.other.nonSpaceChar),y=y>4?1:y,g=b.slice(y),y+=t[1].length),x&&this.rules.other.blankLine.test(v)&&(f+=v+`
|
|
61
|
+
`,e=e.substring(v.length+1),m=!0),!m){let w=this.rules.other.nextBulletRegex(y),C=this.rules.other.hrRegex(y),N=this.rules.other.fencesBeginRegex(y),T=this.rules.other.headingBeginRegex(y),D=this.rules.other.htmlBeginRegex(y),A=this.rules.other.blockquoteBeginRegex(y);for(;e;){let L=e.split(`
|
|
62
|
+
`,1)[0],G;if(v=L,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),G=v):G=v.replace(this.rules.other.tabCharGlobal," "),N.test(v)||T.test(v)||D.test(v)||A.test(v)||w.test(v)||C.test(v))break;if(G.search(this.rules.other.nonSpaceChar)>=y||!v.trim())g+=`
|
|
63
|
+
`+G.slice(y);else{if(x||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||N.test(b)||T.test(b)||C.test(b))break;g+=`
|
|
64
|
+
`+v}x=!v.trim(),f+=L+`
|
|
65
|
+
`,e=e.substring(L.length+1),b=G.slice(y)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(c=!0)),a.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),a.raw+=f}let h=a.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let m of a.items){this.lexer.state.top=!1,m.tokens=this.lexer.blockTokens(m.text,[]);let f=m.tokens[0];if(m.task&&(f?.type==="text"||f?.type==="paragraph")){m.text=m.text.replace(this.rules.other.listReplaceTask,""),f.raw=f.raw.replace(this.rules.other.listReplaceTask,""),f.text=f.text.replace(this.rules.other.listReplaceTask,"");for(let b=this.lexer.inlineQueue.length-1;b>=0;b--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)){this.lexer.inlineQueue[b].src=this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask,"");break}let g=this.rules.other.listTaskCheckbox.exec(m.raw);if(g){let b={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};m.checked=b.checked,a.loose?m.tokens[0]&&["paragraph","text"].includes(m.tokens[0].type)&&"tokens"in m.tokens[0]&&m.tokens[0].tokens?(m.tokens[0].raw=b.raw+m.tokens[0].raw,m.tokens[0].text=b.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(b)):m.tokens.unshift({type:"paragraph",raw:b.raw,text:b.raw,tokens:[b]}):m.tokens.unshift(b)}}else m.task&&(m.task=!1);if(!a.loose){let g=m.tokens.filter(v=>v.type==="space"),b=g.length>0&&g.some(v=>this.rules.other.anyLine.test(v.raw));a.loose=b}}if(a.loose)for(let m of a.items){m.loose=!0;for(let f of m.tokens)f.type==="text"&&(f.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t){let i=u2(t[0]);return{type:"html",block:!0,raw:i,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:i}}}def(e){let t=this.rules.block.def.exec(e);if(t){let i=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:i,raw:Ir(t[0],`
|
|
66
|
+
`),href:n,title:a}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let i=c2(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
67
|
+
`):[],l={type:"table",raw:Ir(t[0],`
|
|
68
|
+
`),header:[],align:[],rows:[]};if(i.length===n.length){for(let c of n)this.rules.other.tableAlignRight.test(c)?l.align.push("right"):this.rules.other.tableAlignCenter.test(c)?l.align.push("center"):this.rules.other.tableAlignLeft.test(c)?l.align.push("left"):l.align.push(null);for(let c=0;c<i.length;c++)l.header.push({text:i[c],tokens:this.lexer.inline(i[c]),header:!0,align:l.align[c]});for(let c of a)l.rows.push(c2(c,l.header.length).map((h,m)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:l.align[m]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let i=t[1].trim();return{type:"heading",raw:Ir(t[0],`
|
|
69
|
+
`),depth:t[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let i=t[1].charAt(t[1].length-1)===`
|
|
70
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let i=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let l=Ir(i.slice(0,-1),"\\");if((i.length-l.length)%2===0)return}else{let l=iU(t[2],"()");if(l===-2)return;if(l>-1){let c=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let n=t[2],a="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(n);l&&(n=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?n=n.slice(1):n=n.slice(1,-1)),d2(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let n=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[n.toLowerCase()];if(!a){let l=i[0].charAt(0);return{type:"text",raw:l,text:l}}return d2(i,a,i[0],this.lexer,this.rules)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!i||this.rules.inline.punctuation.exec(i))){let a=[...n[0]].length-1,l,c,h=a,m=0,f=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+a);(n=f.exec(t))!==null;){if(l=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!l)continue;if(c=[...l].length,n[3]||n[4]){h+=c;continue}else if((n[5]||n[6])&&a%3&&!((a+c)%3)){m+=c;continue}if(h-=c,h>0)continue;c=Math.min(c,c+h+m);let g=[...n[0]][0].length,b=e.slice(0,a+n.index+g+c);if(Math.min(a,c)%2){let x=b.slice(1,-1);return{type:"em",raw:b,text:x,tokens:this.lexer.inlineTokens(x)}}let v=b.slice(2,-2);return{type:"strong",raw:b,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(i),a=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return n&&a&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,i=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!i||this.rules.inline.punctuation.exec(i))){let a=[...n[0]].length-1,l,c,h=a,m=this.rules.inline.delRDelim;for(m.lastIndex=0,t=t.slice(-1*e.length+a);(n=m.exec(t))!==null;){if(l=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!l||(c=[...l].length,c!==a))continue;if(n[3]||n[4]){h+=c;continue}if(h-=c,h>0)continue;c=Math.min(c,c+h);let f=[...n[0]][0].length,g=e.slice(0,a+n.index+f+c),b=g.slice(a,-a);return{type:"del",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let i,n;return t[2]==="@"?(i=t[1],n="mailto:"+i):(i=t[1],n=i),{type:"link",raw:t[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let i,n;if(t[2]==="@")i=t[0],n="mailto:"+i;else{let a;do a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(a!==t[0]);i=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let i=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:i}}}},Ys=class T0{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Va,this.options.tokenizer=this.options.tokenizer||new gh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={other:zi,block:jd.normal,inline:dc.normal};this.options.pedantic?(i.block=jd.pedantic,i.inline=dc.pedantic):this.options.gfm&&(i.block=jd.gfm,this.options.breaks?i.inline=dc.breaks:i.inline=dc.gfm),this.tokenizer.rules=i}static get rules(){return{block:jd,inline:dc}}static lex(t,i){return new T0(i).lex(t)}static lexInline(t,i){return new T0(i).inlineTokens(t)}lex(t){t=t.replace(zi.carriageReturn,`
|
|
71
|
+
`),this.blockTokens(t,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let n=this.inlineQueue[i];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,i=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(zi.tabCharGlobal," ").replace(zi.spaceLine,""));let a=1/0;for(;t;){if(t.length<a)a=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let l;if(this.options.extensions?.block?.some(h=>(l=h.call({lexer:this},t,i))?(t=t.substring(l.raw.length),i.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let h=i.at(-1);l.raw.length===1&&h!==void 0?h.raw+=`
|
|
72
|
+
`:i.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let h=i.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
|
|
73
|
+
`)?"":`
|
|
74
|
+
`)+l.raw,h.text+=`
|
|
75
|
+
`+l.text,this.inlineQueue.at(-1).src=h.text):i.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let h=i.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
|
|
76
|
+
`)?"":`
|
|
77
|
+
`)+l.raw,h.text+=`
|
|
78
|
+
`+l.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},i.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),i.push(l);continue}let c=t;if(this.options.extensions?.startBlock){let h=1/0,m=t.slice(1),f;this.options.extensions.startBlock.forEach(g=>{f=g.call({lexer:this},m),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){let h=i.at(-1);n&&h?.type==="paragraph"?(h.raw+=(h.raw.endsWith(`
|
|
79
|
+
`)?"":`
|
|
80
|
+
`)+l.raw,h.text+=`
|
|
81
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):i.push(l),n=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let h=i.at(-1);h?.type==="text"?(h.raw+=(h.raw.endsWith(`
|
|
82
|
+
`)?"":`
|
|
83
|
+
`)+l.raw,h.text+=`
|
|
84
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):i.push(l);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,i}inline(t,i=[]){return this.inlineQueue.push({src:t,tokens:i}),i}inlineTokens(t,i=[]){this.tokenizer.lexer=this;let n=t,a=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)f.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,a.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)l=a[2]?a[2].length:0,n=n.slice(0,a.index+l)+"["+"a".repeat(a[0].length-l-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let c=!1,h="",m=1/0;for(;t;){if(t.length<m)m=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}c||(h=""),c=!1;let f;if(this.options.extensions?.inline?.some(b=>(f=b.call({lexer:this},t,i))?(t=t.substring(f.raw.length),i.push(f),!0):!1))continue;if(f=this.tokenizer.escape(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.tag(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.link(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(f.raw.length);let b=i.at(-1);f.type==="text"&&b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):i.push(f);continue}if(f=this.tokenizer.emStrong(t,n,h)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.codespan(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.br(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.del(t,n,h)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.autolink(t)){t=t.substring(f.raw.length),i.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(t))){t=t.substring(f.raw.length),i.push(f);continue}let g=t;if(this.options.extensions?.startInline){let b=1/0,v=t.slice(1),x;this.options.extensions.startInline.forEach(y=>{x=y.call({lexer:this},v),typeof x=="number"&&x>=0&&(b=Math.min(b,x))}),b<1/0&&b>=0&&(g=t.substring(0,b+1))}if(f=this.tokenizer.inlineText(g)){t=t.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(h=f.raw.slice(-1)),c=!0;let b=i.at(-1);b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):i.push(f);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return i}infiniteLoopError(t){let i="Infinite loop on byte: "+t;if(this.options.silent)console.error(i);else throw new Error(i)}},_h=class{options;parser;constructor(e){this.options=e||Va}space(e){return""}code({text:e,lang:t,escaped:i}){let n=(t||"").match(zi.notSpaceStart)?.[0],a=e.replace(zi.endingNewline,"")+`
|
|
85
|
+
`;return n?'<pre><code class="language-'+un(n)+'">'+(i?a:un(a,!0))+`</code></pre>
|
|
86
|
+
`:"<pre><code>"+(i?a:un(a,!0))+`</code></pre>
|
|
87
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
88
|
+
${this.parser.parse(e)}</blockquote>
|
|
89
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
90
|
+
`}hr(e){return`<hr>
|
|
91
|
+
`}list(e){let t=e.ordered,i=e.start,n="";for(let c=0;c<e.items.length;c++){let h=e.items[c];n+=this.listitem(h)}let a=t?"ol":"ul",l=t&&i!==1?' start="'+i+'"':"";return"<"+a+l+`>
|
|
92
|
+
`+n+"</"+a+`>
|
|
93
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
94
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
95
|
+
`}table(e){let t="",i="";for(let a=0;a<e.header.length;a++)i+=this.tablecell(e.header[a]);t+=this.tablerow({text:i});let n="";for(let a=0;a<e.rows.length;a++){let l=e.rows[a];i="";for(let c=0;c<l.length;c++)i+=this.tablecell(l[c]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
96
|
+
<thead>
|
|
97
|
+
`+t+`</thead>
|
|
98
|
+
`+n+`</table>
|
|
99
|
+
`}tablerow({text:e}){return`<tr>
|
|
100
|
+
${e}</tr>
|
|
101
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
|
|
102
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${un(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:i}){let n=this.parser.parseInline(i),a=l2(e);if(a===null)return n;e=a;let l='<a href="'+e+'"';return t&&(l+=' title="'+un(t)+'"'),l+=">"+n+"</a>",l}image({href:e,title:t,text:i,tokens:n}){n&&(i=this.parser.parseInline(n,this.parser.textRenderer));let a=l2(e);if(a===null)return un(i);e=a;let l=`<img src="${e}" alt="${un(i)}"`;return t&&(l+=` title="${un(t)}"`),l+=">",l}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:un(e.text)}},P_=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Xs=class A0{options;renderer;textRenderer;constructor(t){this.options=t||Va,this.options.renderer=this.options.renderer||new _h,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new P_}static parse(t,i){return new A0(i).parse(t)}static parseInline(t,i){return new A0(i).parseInline(t)}parse(t){this.renderer.parser=this;let i="";for(let n=0;n<t.length;n++){let a=t[n];if(this.options.extensions?.renderers?.[a.type]){let c=a,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){i+=h||"";continue}}let l=a;switch(l.type){case"space":{i+=this.renderer.space(l);break}case"hr":{i+=this.renderer.hr(l);break}case"heading":{i+=this.renderer.heading(l);break}case"code":{i+=this.renderer.code(l);break}case"table":{i+=this.renderer.table(l);break}case"blockquote":{i+=this.renderer.blockquote(l);break}case"list":{i+=this.renderer.list(l);break}case"checkbox":{i+=this.renderer.checkbox(l);break}case"html":{i+=this.renderer.html(l);break}case"def":{i+=this.renderer.def(l);break}case"paragraph":{i+=this.renderer.paragraph(l);break}case"text":{i+=this.renderer.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}parseInline(t,i=this.renderer){this.renderer.parser=this;let n="";for(let a=0;a<t.length;a++){let l=t[a];if(this.options.extensions?.renderers?.[l.type]){let h=this.options.extensions.renderers[l.type].call({parser:this},l);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=h||"";continue}}let c=l;switch(c.type){case"escape":{n+=i.text(c);break}case"html":{n+=i.html(c);break}case"link":{n+=i.link(c);break}case"image":{n+=i.image(c);break}case"checkbox":{n+=i.checkbox(c);break}case"strong":{n+=i.strong(c);break}case"em":{n+=i.em(c);break}case"codespan":{n+=i.codespan(c);break}case"br":{n+=i.br(c);break}case"del":{n+=i.del(c);break}case"text":{n+=i.text(c);break}default:{let h='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return n}},yc=class{options;block;constructor(e){this.options=e||Va}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ys.lex:Ys.lexInline}provideParser(e=this.block){return e?Xs.parse:Xs.parseInline}},rU=class{defaults=R_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Xs;Renderer=_h;TextRenderer=P_;Lexer=Ys;Tokenizer=gh;Hooks=yc;constructor(...e){this.use(...e)}walkTokens(e,t){let i=[];for(let n of e)switch(i=i.concat(t.call(this,n)),n.type){case"table":{let a=n;for(let l of a.header)i=i.concat(this.walkTokens(l.tokens,t));for(let l of a.rows)for(let c of l)i=i.concat(this.walkTokens(c.tokens,t));break}case"list":{let a=n;i=i.concat(this.walkTokens(a.items,t));break}default:{let a=n;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);i=i.concat(this.walkTokens(c,t))}):a.tokens&&(i=i.concat(this.walkTokens(a.tokens,t)))}}return i}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let l=t.renderers[a.name];l?t.renderers[a.name]=function(...c){let h=a.renderer.apply(this,c);return h===!1&&(h=l.apply(this,c)),h}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=t[a.level];l?l.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),n.extensions=t),i.renderer){let a=this.defaults.renderer||new _h(this.defaults);for(let l in i.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let c=l,h=i.renderer[c],m=a[c];a[c]=(...f)=>{let g=h.apply(a,f);return g===!1&&(g=m.apply(a,f)),g||""}}n.renderer=a}if(i.tokenizer){let a=this.defaults.tokenizer||new gh(this.defaults);for(let l in i.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let c=l,h=i.tokenizer[c],m=a[c];a[c]=(...f)=>{let g=h.apply(a,f);return g===!1&&(g=m.apply(a,f)),g}}n.tokenizer=a}if(i.hooks){let a=this.defaults.hooks||new yc;for(let l in i.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let c=l,h=i.hooks[c],m=a[c];yc.passThroughHooks.has(l)?a[c]=f=>{if(this.defaults.async&&yc.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await h.call(a,f);return m.call(a,b)})();let g=h.call(a,f);return m.call(a,g)}:a[c]=(...f)=>{if(this.defaults.async)return(async()=>{let b=await h.apply(a,f);return b===!1&&(b=await m.apply(a,f)),b})();let g=h.apply(a,f);return g===!1&&(g=m.apply(a,f)),g}}n.hooks=a}if(i.walkTokens){let a=this.defaults.walkTokens,l=i.walkTokens;n.walkTokens=function(c){let h=[];return h.push(l.call(this,c)),a&&(h=h.concat(a.call(this,c))),h}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ys.lex(e,t??this.defaults)}parser(e,t){return Xs.parse(e,t??this.defaults)}parseMarkdown(e){return(t,i)=>{let n={...i},a={...this.defaults,...n},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&n.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let c=a.hooks?await a.hooks.preprocess(t):t,h=await(a.hooks?await a.hooks.provideLexer(e):e?Ys.lex:Ys.lexInline)(c,a),m=a.hooks?await a.hooks.processAllTokens(h):h;a.walkTokens&&await Promise.all(this.walkTokens(m,a.walkTokens));let f=await(a.hooks?await a.hooks.provideParser(e):e?Xs.parse:Xs.parseInline)(m,a);return a.hooks?await a.hooks.postprocess(f):f})().catch(l);try{a.hooks&&(t=a.hooks.preprocess(t));let c=(a.hooks?a.hooks.provideLexer(e):e?Ys.lex:Ys.lexInline)(t,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let h=(a.hooks?a.hooks.provideParser(e):e?Xs.parse:Xs.parseInline)(c,a);return a.hooks&&(h=a.hooks.postprocess(h)),h}catch(c){return l(c)}}}onError(e,t){return i=>{if(i.message+=`
|
|
103
|
+
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+un(i.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(i);throw i}}},Ua=new rU;function gt(e,t){return Ua.parse(e,t)}gt.options=gt.setOptions=function(e){return Ua.setOptions(e),gt.defaults=Ua.defaults,h3(gt.defaults),gt};gt.getDefaults=R_;gt.defaults=Va;gt.use=function(...e){return Ua.use(...e),gt.defaults=Ua.defaults,h3(gt.defaults),gt};gt.walkTokens=function(e,t){return Ua.walkTokens(e,t)};gt.parseInline=Ua.parseInline;gt.Parser=Xs;gt.parser=Xs.parse;gt.Renderer=_h;gt.TextRenderer=P_;gt.Lexer=Ys;gt.lexer=Ys.lex;gt.Tokenizer=gh;gt.Hooks=yc;gt.parse=gt;gt.options;gt.setOptions;gt.use;gt.walkTokens;gt.parseInline;Xs.parse;Ys.lex;function aU(e){return e.replace(/<\/?(script|style|iframe|object|embed)\b[^>]*>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/(href|src)\s*=\s*("|')\s*javascript:[^"']*\2/gi,"$1=$2#$2")}function oU({content:e}){const t=E.useMemo(()=>{const n=gt.parse(e,{async:!1,gfm:!0,breaks:!1});return aU(n)},[e]),i=E.useRef(null);return E.useEffect(()=>{const n=i.current;n&&n.querySelectorAll("pre code").forEach(a=>{k0.highlightElement(a)})},[t]),u.jsx("div",{ref:i,className:"md-preview min-w-0 px-6 py-5",dangerouslySetInnerHTML:{__html:t}})}function S3(e){return typeof e>"u"||e===null}function lU(e){return typeof e=="object"&&e!==null}function cU(e){return Array.isArray(e)?e:S3(e)?[]:[e]}function uU(e,t){var i,n,a,l;if(t)for(l=Object.keys(t),i=0,n=l.length;i<n;i+=1)a=l[i],e[a]=t[a];return e}function dU(e,t){var i="",n;for(n=0;n<t;n+=1)i+=e;return i}function hU(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var fU=S3,mU=lU,pU=cU,gU=dU,_U=hU,bU=uU,di={isNothing:fU,isObject:mU,toArray:pU,repeat:gU,isNegativeZero:_U,extend:bU};function w3(e,t){var i="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(i+=`
|
|
104
|
+
|
|
105
|
+
`+e.mark.snippet),n+" "+i):n}function Hc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=w3(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Hc.prototype=Object.create(Error.prototype);Hc.prototype.constructor=Hc;Hc.prototype.toString=function(t){return this.name+": "+w3(this,t)};var Fi=Hc;function hg(e,t,i,n,a){var l="",c="",h=Math.floor(a/2)-1;return n-t>h&&(l=" ... ",t=n-h+l.length),i-n>h&&(c=" ...",i=n+h-c.length),{str:l+e.slice(t,i).replace(/\t/g,"→")+c,pos:n-t+l.length}}function fg(e,t){return di.repeat(" ",t-e.length)+e}function vU(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var i=/\r?\n|\r|\0/g,n=[0],a=[],l,c=-1;l=i.exec(e.buffer);)a.push(l.index),n.push(l.index+l[0].length),e.position<=l.index&&c<0&&(c=n.length-2);c<0&&(c=n.length-1);var h="",m,f,g=Math.min(e.line+t.linesAfter,a.length).toString().length,b=t.maxLength-(t.indent+g+3);for(m=1;m<=t.linesBefore&&!(c-m<0);m++)f=hg(e.buffer,n[c-m],a[c-m],e.position-(n[c]-n[c-m]),b),h=di.repeat(" ",t.indent)+fg((e.line-m+1).toString(),g)+" | "+f.str+`
|
|
106
|
+
`+h;for(f=hg(e.buffer,n[c],a[c],e.position,b),h+=di.repeat(" ",t.indent)+fg((e.line+1).toString(),g)+" | "+f.str+`
|
|
107
|
+
`,h+=di.repeat("-",t.indent+g+3+f.pos)+`^
|
|
108
|
+
`,m=1;m<=t.linesAfter&&!(c+m>=a.length);m++)f=hg(e.buffer,n[c+m],a[c+m],e.position-(n[c]-n[c+m]),b),h+=di.repeat(" ",t.indent)+fg((e.line+m+1).toString(),g)+" | "+f.str+`
|
|
109
|
+
`;return h.replace(/\n$/,"")}var xU=vU,yU=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],SU=["scalar","sequence","mapping"];function wU(e){var t={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(n){t[String(n)]=i})}),t}function EU(e,t){if(t=t||{},Object.keys(t).forEach(function(i){if(yU.indexOf(i)===-1)throw new Fi('Unknown option "'+i+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(i){return i},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=wU(t.styleAliases||null),SU.indexOf(this.kind)===-1)throw new Fi('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Mi=EU;function h2(e,t){var i=[];return e[t].forEach(function(n){var a=i.length;i.forEach(function(l,c){l.tag===n.tag&&l.kind===n.kind&&l.multi===n.multi&&(a=c)}),i[a]=n}),i}function CU(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,i;function n(a){a.multi?(e.multi[a.kind].push(a),e.multi.fallback.push(a)):e[a.kind][a.tag]=e.fallback[a.tag]=a}for(t=0,i=arguments.length;t<i;t+=1)arguments[t].forEach(n);return e}function M0(e){return this.extend(e)}M0.prototype.extend=function(t){var i=[],n=[];if(t instanceof Mi)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(i=i.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new Fi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(l){if(!(l instanceof Mi))throw new Fi("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new Fi("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new Fi("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(l){if(!(l instanceof Mi))throw new Fi("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(M0.prototype);return a.implicit=(this.implicit||[]).concat(i),a.explicit=(this.explicit||[]).concat(n),a.compiledImplicit=h2(a,"implicit"),a.compiledExplicit=h2(a,"explicit"),a.compiledTypeMap=CU(a.compiledImplicit,a.compiledExplicit),a};var E3=M0,C3=new Mi("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),k3=new Mi("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),N3=new Mi("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),T3=new E3({explicit:[C3,k3,N3]});function kU(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function NU(){return null}function TU(e){return e===null}var A3=new Mi("tag:yaml.org,2002:null",{kind:"scalar",resolve:kU,construct:NU,predicate:TU,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function AU(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function MU(e){return e==="true"||e==="True"||e==="TRUE"}function RU(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var M3=new Mi("tag:yaml.org,2002:bool",{kind:"scalar",resolve:AU,construct:MU,predicate:RU,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function DU(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function OU(e){return 48<=e&&e<=55}function jU(e){return 48<=e&&e<=57}function LU(e){if(e===null)return!1;var t=e.length,i=0,n=!1,a;if(!t)return!1;if(a=e[i],(a==="-"||a==="+")&&(a=e[++i]),a==="0"){if(i+1===t)return!0;if(a=e[++i],a==="b"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(a!=="0"&&a!=="1")return!1;n=!0}return n&&a!=="_"}if(a==="x"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(!DU(e.charCodeAt(i)))return!1;n=!0}return n&&a!=="_"}if(a==="o"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(!OU(e.charCodeAt(i)))return!1;n=!0}return n&&a!=="_"}}if(a==="_")return!1;for(;i<t;i++)if(a=e[i],a!=="_"){if(!jU(e.charCodeAt(i)))return!1;n=!0}return!(!n||a==="_")}function BU(e){var t=e,i=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(i=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return i*parseInt(t.slice(2),2);if(t[1]==="x")return i*parseInt(t.slice(2),16);if(t[1]==="o")return i*parseInt(t.slice(2),8)}return i*parseInt(t,10)}function zU(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!di.isNegativeZero(e)}var R3=new Mi("tag:yaml.org,2002:int",{kind:"scalar",resolve:LU,construct:BU,predicate:zU,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),IU=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function PU(e){return!(e===null||!IU.test(e)||e[e.length-1]==="_")}function UU(e){var t,i;return t=e.replace(/_/g,"").toLowerCase(),i=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:i*parseFloat(t,10)}var HU=/^[-+]?[0-9]+e/;function FU(e,t){var i;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(di.isNegativeZero(e))return"-0.0";return i=e.toString(10),HU.test(i)?i.replace("e",".e"):i}function $U(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||di.isNegativeZero(e))}var D3=new Mi("tag:yaml.org,2002:float",{kind:"scalar",resolve:PU,construct:UU,predicate:$U,represent:FU,defaultStyle:"lowercase"}),O3=T3.extend({implicit:[A3,M3,R3,D3]}),j3=O3,L3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),B3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function VU(e){return e===null?!1:L3.exec(e)!==null||B3.exec(e)!==null}function qU(e){var t,i,n,a,l,c,h,m=0,f=null,g,b,v;if(t=L3.exec(e),t===null&&(t=B3.exec(e)),t===null)throw new Error("Date resolve error");if(i=+t[1],n=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(i,n,a));if(l=+t[4],c=+t[5],h=+t[6],t[7]){for(m=t[7].slice(0,3);m.length<3;)m+="0";m=+m}return t[9]&&(g=+t[10],b=+(t[11]||0),f=(g*60+b)*6e4,t[9]==="-"&&(f=-f)),v=new Date(Date.UTC(i,n,a,l,c,h,m)),f&&v.setTime(v.getTime()-f),v}function KU(e){return e.toISOString()}var z3=new Mi("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:VU,construct:qU,instanceOf:Date,represent:KU});function GU(e){return e==="<<"||e===null}var I3=new Mi("tag:yaml.org,2002:merge",{kind:"scalar",resolve:GU}),U_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
110
|
+
\r`;function WU(e){if(e===null)return!1;var t,i,n=0,a=e.length,l=U_;for(i=0;i<a;i++)if(t=l.indexOf(e.charAt(i)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function YU(e){var t,i,n=e.replace(/[\r\n=]/g,""),a=n.length,l=U_,c=0,h=[];for(t=0;t<a;t++)t%4===0&&t&&(h.push(c>>16&255),h.push(c>>8&255),h.push(c&255)),c=c<<6|l.indexOf(n.charAt(t));return i=a%4*6,i===0?(h.push(c>>16&255),h.push(c>>8&255),h.push(c&255)):i===18?(h.push(c>>10&255),h.push(c>>2&255)):i===12&&h.push(c>>4&255),new Uint8Array(h)}function XU(e){var t="",i=0,n,a,l=e.length,c=U_;for(n=0;n<l;n++)n%3===0&&n&&(t+=c[i>>18&63],t+=c[i>>12&63],t+=c[i>>6&63],t+=c[i&63]),i=(i<<8)+e[n];return a=l%3,a===0?(t+=c[i>>18&63],t+=c[i>>12&63],t+=c[i>>6&63],t+=c[i&63]):a===2?(t+=c[i>>10&63],t+=c[i>>4&63],t+=c[i<<2&63],t+=c[64]):a===1&&(t+=c[i>>2&63],t+=c[i<<4&63],t+=c[64],t+=c[64]),t}function ZU(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var P3=new Mi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:WU,construct:YU,predicate:ZU,represent:XU}),QU=Object.prototype.hasOwnProperty,JU=Object.prototype.toString;function eH(e){if(e===null)return!0;var t=[],i,n,a,l,c,h=e;for(i=0,n=h.length;i<n;i+=1){if(a=h[i],c=!1,JU.call(a)!=="[object Object]")return!1;for(l in a)if(QU.call(a,l))if(!c)c=!0;else return!1;if(!c)return!1;if(t.indexOf(l)===-1)t.push(l);else return!1}return!0}function tH(e){return e!==null?e:[]}var U3=new Mi("tag:yaml.org,2002:omap",{kind:"sequence",resolve:eH,construct:tH}),iH=Object.prototype.toString;function sH(e){if(e===null)return!0;var t,i,n,a,l,c=e;for(l=new Array(c.length),t=0,i=c.length;t<i;t+=1){if(n=c[t],iH.call(n)!=="[object Object]"||(a=Object.keys(n),a.length!==1))return!1;l[t]=[a[0],n[a[0]]]}return!0}function nH(e){if(e===null)return[];var t,i,n,a,l,c=e;for(l=new Array(c.length),t=0,i=c.length;t<i;t+=1)n=c[t],a=Object.keys(n),l[t]=[a[0],n[a[0]]];return l}var H3=new Mi("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:sH,construct:nH}),rH=Object.prototype.hasOwnProperty;function aH(e){if(e===null)return!0;var t,i=e;for(t in i)if(rH.call(i,t)&&i[t]!==null)return!1;return!0}function oH(e){return e!==null?e:{}}var F3=new Mi("tag:yaml.org,2002:set",{kind:"mapping",resolve:aH,construct:oH}),H_=j3.extend({implicit:[z3,I3],explicit:[P3,U3,H3,F3]}),Wr=Object.prototype.hasOwnProperty,bh=1,$3=2,V3=3,vh=4,mg=1,lH=2,f2=3,cH=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,uH=/[\x85\u2028\u2029]/,dH=/[,\[\]\{\}]/,q3=/^(?:!|!!|![a-z\-]+!)$/i,K3=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function m2(e){return Object.prototype.toString.call(e)}function gn(e){return e===10||e===13}function Ba(e){return e===9||e===32}function ns(e){return e===9||e===32||e===10||e===13}function qo(e){return e===44||e===91||e===93||e===123||e===125}function hH(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function fH(e){return e===120?2:e===117?4:e===85?8:0}function mH(e){return 48<=e&&e<=57?e-48:-1}function p2(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
111
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function pH(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function G3(e,t,i){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[t]=i}var W3=new Array(256),Y3=new Array(256);for(var Bo=0;Bo<256;Bo++)W3[Bo]=p2(Bo)?1:0,Y3[Bo]=p2(Bo);function gH(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||H_,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function X3(e,t){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=xU(i),new Fi(t,i)}function Re(e,t){throw X3(e,t)}function xh(e,t){e.onWarning&&e.onWarning.call(null,X3(e,t))}var g2={YAML:function(t,i,n){var a,l,c;t.version!==null&&Re(t,"duplication of %YAML directive"),n.length!==1&&Re(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),a===null&&Re(t,"ill-formed argument of the YAML directive"),l=parseInt(a[1],10),c=parseInt(a[2],10),l!==1&&Re(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=c<2,c!==1&&c!==2&&xh(t,"unsupported YAML version of the document")},TAG:function(t,i,n){var a,l;n.length!==2&&Re(t,"TAG directive accepts exactly two arguments"),a=n[0],l=n[1],q3.test(a)||Re(t,"ill-formed tag handle (first argument) of the TAG directive"),Wr.call(t.tagMap,a)&&Re(t,'there is a previously declared suffix for "'+a+'" tag handle'),K3.test(l)||Re(t,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{Re(t,"tag prefix is malformed: "+l)}t.tagMap[a]=l}};function qr(e,t,i,n){var a,l,c,h;if(t<i){if(h=e.input.slice(t,i),n)for(a=0,l=h.length;a<l;a+=1)c=h.charCodeAt(a),c===9||32<=c&&c<=1114111||Re(e,"expected valid JSON character");else cH.test(h)&&Re(e,"the stream contains non-printable characters");e.result+=h}}function _2(e,t,i,n){var a,l,c,h;for(di.isObject(i)||Re(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(i),c=0,h=a.length;c<h;c+=1)l=a[c],Wr.call(t,l)||(G3(t,l,i[l]),n[l]=!0)}function Ko(e,t,i,n,a,l,c,h,m){var f,g;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),f=0,g=a.length;f<g;f+=1)Array.isArray(a[f])&&Re(e,"nested arrays are not supported inside keys"),typeof a=="object"&&m2(a[f])==="[object Object]"&&(a[f]="[object Object]");if(typeof a=="object"&&m2(a)==="[object Object]"&&(a="[object Object]"),a=String(a),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(f=0,g=l.length;f<g;f+=1)_2(e,t,l[f],i);else _2(e,t,l,i);else!e.json&&!Wr.call(i,a)&&Wr.call(t,a)&&(e.line=c||e.line,e.lineStart=h||e.lineStart,e.position=m||e.position,Re(e,"duplicated mapping key")),G3(t,a,l),delete i[a];return t}function F_(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Re(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ri(e,t,i){for(var n=0,a=e.input.charCodeAt(e.position);a!==0;){for(;Ba(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(t&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(gn(a))for(F_(e),a=e.input.charCodeAt(e.position),n++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return i!==-1&&n!==0&&e.lineIndent<i&&xh(e,"deficient indentation"),n}function zh(e){var t=e.position,i;return i=e.input.charCodeAt(t),!!((i===45||i===46)&&i===e.input.charCodeAt(t+1)&&i===e.input.charCodeAt(t+2)&&(t+=3,i=e.input.charCodeAt(t),i===0||ns(i)))}function $_(e,t){t===1?e.result+=" ":t>1&&(e.result+=di.repeat(`
|
|
112
|
+
`,t-1))}function _H(e,t,i){var n,a,l,c,h,m,f,g,b=e.kind,v=e.result,x;if(x=e.input.charCodeAt(e.position),ns(x)||qo(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(a=e.input.charCodeAt(e.position+1),ns(a)||i&&qo(a)))return!1;for(e.kind="scalar",e.result="",l=c=e.position,h=!1;x!==0;){if(x===58){if(a=e.input.charCodeAt(e.position+1),ns(a)||i&&qo(a))break}else if(x===35){if(n=e.input.charCodeAt(e.position-1),ns(n))break}else{if(e.position===e.lineStart&&zh(e)||i&&qo(x))break;if(gn(x))if(m=e.line,f=e.lineStart,g=e.lineIndent,ri(e,!1,-1),e.lineIndent>=t){h=!0,x=e.input.charCodeAt(e.position);continue}else{e.position=c,e.line=m,e.lineStart=f,e.lineIndent=g;break}}h&&(qr(e,l,c,!1),$_(e,e.line-m),l=c=e.position,h=!1),Ba(x)||(c=e.position+1),x=e.input.charCodeAt(++e.position)}return qr(e,l,c,!1),e.result?!0:(e.kind=b,e.result=v,!1)}function bH(e,t){var i,n,a;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=a=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(qr(e,n,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)n=e.position,e.position++,a=e.position;else return!0;else gn(i)?(qr(e,n,a,!0),$_(e,ri(e,!1,t)),n=a=e.position):e.position===e.lineStart&&zh(e)?Re(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);Re(e,"unexpected end of the stream within a single quoted scalar")}function vH(e,t){var i,n,a,l,c,h;if(h=e.input.charCodeAt(e.position),h!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=n=e.position;(h=e.input.charCodeAt(e.position))!==0;){if(h===34)return qr(e,i,e.position,!0),e.position++,!0;if(h===92){if(qr(e,i,e.position,!0),h=e.input.charCodeAt(++e.position),gn(h))ri(e,!1,t);else if(h<256&&W3[h])e.result+=Y3[h],e.position++;else if((c=fH(h))>0){for(a=c,l=0;a>0;a--)h=e.input.charCodeAt(++e.position),(c=hH(h))>=0?l=(l<<4)+c:Re(e,"expected hexadecimal character");e.result+=pH(l),e.position++}else Re(e,"unknown escape sequence");i=n=e.position}else gn(h)?(qr(e,i,n,!0),$_(e,ri(e,!1,t)),i=n=e.position):e.position===e.lineStart&&zh(e)?Re(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Re(e,"unexpected end of the stream within a double quoted scalar")}function xH(e,t){var i=!0,n,a,l,c=e.tag,h,m=e.anchor,f,g,b,v,x,y=Object.create(null),w,C,N,T;if(T=e.input.charCodeAt(e.position),T===91)g=93,x=!1,h=[];else if(T===123)g=125,x=!0,h={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),T=e.input.charCodeAt(++e.position);T!==0;){if(ri(e,!0,t),T=e.input.charCodeAt(e.position),T===g)return e.position++,e.tag=c,e.anchor=m,e.kind=x?"mapping":"sequence",e.result=h,!0;i?T===44&&Re(e,"expected the node content, but found ','"):Re(e,"missed comma between flow collection entries"),C=w=N=null,b=v=!1,T===63&&(f=e.input.charCodeAt(e.position+1),ns(f)&&(b=v=!0,e.position++,ri(e,!0,t))),n=e.line,a=e.lineStart,l=e.position,Zo(e,t,bh,!1,!0),C=e.tag,w=e.result,ri(e,!0,t),T=e.input.charCodeAt(e.position),(v||e.line===n)&&T===58&&(b=!0,T=e.input.charCodeAt(++e.position),ri(e,!0,t),Zo(e,t,bh,!1,!0),N=e.result),x?Ko(e,h,y,C,w,N,n,a,l):b?h.push(Ko(e,null,y,C,w,N,n,a,l)):h.push(w),ri(e,!0,t),T=e.input.charCodeAt(e.position),T===44?(i=!0,T=e.input.charCodeAt(++e.position)):i=!1}Re(e,"unexpected end of the stream within a flow collection")}function yH(e,t){var i,n,a=mg,l=!1,c=!1,h=t,m=0,f=!1,g,b;if(b=e.input.charCodeAt(e.position),b===124)n=!1;else if(b===62)n=!0;else return!1;for(e.kind="scalar",e.result="";b!==0;)if(b=e.input.charCodeAt(++e.position),b===43||b===45)mg===a?a=b===43?f2:lH:Re(e,"repeat of a chomping mode identifier");else if((g=mH(b))>=0)g===0?Re(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Re(e,"repeat of an indentation width identifier"):(h=t+g-1,c=!0);else break;if(Ba(b)){do b=e.input.charCodeAt(++e.position);while(Ba(b));if(b===35)do b=e.input.charCodeAt(++e.position);while(!gn(b)&&b!==0)}for(;b!==0;){for(F_(e),e.lineIndent=0,b=e.input.charCodeAt(e.position);(!c||e.lineIndent<h)&&b===32;)e.lineIndent++,b=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>h&&(h=e.lineIndent),gn(b)){m++;continue}if(e.lineIndent<h){a===f2?e.result+=di.repeat(`
|
|
113
|
+
`,l?1+m:m):a===mg&&l&&(e.result+=`
|
|
114
|
+
`);break}for(n?Ba(b)?(f=!0,e.result+=di.repeat(`
|
|
115
|
+
`,l?1+m:m)):f?(f=!1,e.result+=di.repeat(`
|
|
116
|
+
`,m+1)):m===0?l&&(e.result+=" "):e.result+=di.repeat(`
|
|
117
|
+
`,m):e.result+=di.repeat(`
|
|
118
|
+
`,l?1+m:m),l=!0,c=!0,m=0,i=e.position;!gn(b)&&b!==0;)b=e.input.charCodeAt(++e.position);qr(e,i,e.position,!1)}return!0}function b2(e,t){var i,n=e.tag,a=e.anchor,l=[],c,h=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),m=e.input.charCodeAt(e.position);m!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Re(e,"tab characters must not be used in indentation")),!(m!==45||(c=e.input.charCodeAt(e.position+1),!ns(c))));){if(h=!0,e.position++,ri(e,!0,-1)&&e.lineIndent<=t){l.push(null),m=e.input.charCodeAt(e.position);continue}if(i=e.line,Zo(e,t,V3,!1,!0),l.push(e.result),ri(e,!0,-1),m=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&m!==0)Re(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return h?(e.tag=n,e.anchor=a,e.kind="sequence",e.result=l,!0):!1}function SH(e,t,i){var n,a,l,c,h,m,f=e.tag,g=e.anchor,b={},v=Object.create(null),x=null,y=null,w=null,C=!1,N=!1,T;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=b),T=e.input.charCodeAt(e.position);T!==0;){if(!C&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Re(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),l=e.line,(T===63||T===58)&&ns(n))T===63?(C&&(Ko(e,b,v,x,y,null,c,h,m),x=y=w=null),N=!0,C=!0,a=!0):C?(C=!1,a=!0):Re(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,T=n;else{if(c=e.line,h=e.lineStart,m=e.position,!Zo(e,i,$3,!1,!0))break;if(e.line===l){for(T=e.input.charCodeAt(e.position);Ba(T);)T=e.input.charCodeAt(++e.position);if(T===58)T=e.input.charCodeAt(++e.position),ns(T)||Re(e,"a whitespace character is expected after the key-value separator within a block mapping"),C&&(Ko(e,b,v,x,y,null,c,h,m),x=y=w=null),N=!0,C=!1,a=!1,x=e.tag,y=e.result;else if(N)Re(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=g,!0}else if(N)Re(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=g,!0}if((e.line===l||e.lineIndent>t)&&(C&&(c=e.line,h=e.lineStart,m=e.position),Zo(e,t,vh,!0,a)&&(C?y=e.result:w=e.result),C||(Ko(e,b,v,x,y,w,c,h,m),x=y=w=null),ri(e,!0,-1),T=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>t)&&T!==0)Re(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return C&&Ko(e,b,v,x,y,null,c,h,m),N&&(e.tag=f,e.anchor=g,e.kind="mapping",e.result=b),N}function wH(e){var t,i=!1,n=!1,a,l,c;if(c=e.input.charCodeAt(e.position),c!==33)return!1;if(e.tag!==null&&Re(e,"duplication of a tag property"),c=e.input.charCodeAt(++e.position),c===60?(i=!0,c=e.input.charCodeAt(++e.position)):c===33?(n=!0,a="!!",c=e.input.charCodeAt(++e.position)):a="!",t=e.position,i){do c=e.input.charCodeAt(++e.position);while(c!==0&&c!==62);e.position<e.length?(l=e.input.slice(t,e.position),c=e.input.charCodeAt(++e.position)):Re(e,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!ns(c);)c===33&&(n?Re(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),q3.test(a)||Re(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),c=e.input.charCodeAt(++e.position);l=e.input.slice(t,e.position),dH.test(l)&&Re(e,"tag suffix cannot contain flow indicator characters")}l&&!K3.test(l)&&Re(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{Re(e,"tag name is malformed: "+l)}return i?e.tag=l:Wr.call(e.tagMap,a)?e.tag=e.tagMap[a]+l:a==="!"?e.tag="!"+l:a==="!!"?e.tag="tag:yaml.org,2002:"+l:Re(e,'undeclared tag handle "'+a+'"'),!0}function EH(e){var t,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&Re(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!ns(i)&&!qo(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Re(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function CH(e){var t,i,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!ns(n)&&!qo(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Re(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),Wr.call(e.anchorMap,i)||Re(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],ri(e,!0,-1),!0}function Zo(e,t,i,n,a){var l,c,h,m=1,f=!1,g=!1,b,v,x,y,w,C;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=c=h=vh===i||V3===i,n&&ri(e,!0,-1)&&(f=!0,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)),m===1)for(;wH(e)||EH(e);)ri(e,!0,-1)?(f=!0,h=l,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)):h=!1;if(h&&(h=f||a),(m===1||vh===i)&&(bh===i||$3===i?w=t:w=t+1,C=e.position-e.lineStart,m===1?h&&(b2(e,C)||SH(e,C,w))||xH(e,w)?g=!0:(c&&yH(e,w)||bH(e,w)||vH(e,w)?g=!0:CH(e)?(g=!0,(e.tag!==null||e.anchor!==null)&&Re(e,"alias node should not have any properties")):_H(e,w,bh===i)&&(g=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m===0&&(g=h&&b2(e,C))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Re(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),b=0,v=e.implicitTypes.length;b<v;b+=1)if(y=e.implicitTypes[b],y.resolve(e.result)){e.result=y.construct(e.result),e.tag=y.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Wr.call(e.typeMap[e.kind||"fallback"],e.tag))y=e.typeMap[e.kind||"fallback"][e.tag];else for(y=null,x=e.typeMap.multi[e.kind||"fallback"],b=0,v=x.length;b<v;b+=1)if(e.tag.slice(0,x[b].tag.length)===x[b].tag){y=x[b];break}y||Re(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&Re(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+y.kind+'", not "'+e.kind+'"'),y.resolve(e.result,e.tag)?(e.result=y.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Re(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||g}function kH(e){var t=e.position,i,n,a,l=!1,c;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(c=e.input.charCodeAt(e.position))!==0&&(ri(e,!0,-1),c=e.input.charCodeAt(e.position),!(e.lineIndent>0||c!==37));){for(l=!0,c=e.input.charCodeAt(++e.position),i=e.position;c!==0&&!ns(c);)c=e.input.charCodeAt(++e.position);for(n=e.input.slice(i,e.position),a=[],n.length<1&&Re(e,"directive name must not be less than one character in length");c!==0;){for(;Ba(c);)c=e.input.charCodeAt(++e.position);if(c===35){do c=e.input.charCodeAt(++e.position);while(c!==0&&!gn(c));break}if(gn(c))break;for(i=e.position;c!==0&&!ns(c);)c=e.input.charCodeAt(++e.position);a.push(e.input.slice(i,e.position))}c!==0&&F_(e),Wr.call(g2,n)?g2[n](e,n,a):xh(e,'unknown document directive "'+n+'"')}if(ri(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ri(e,!0,-1)):l&&Re(e,"directives end mark is expected"),Zo(e,e.lineIndent-1,vh,!1,!0),ri(e,!0,-1),e.checkLineBreaks&&uH.test(e.input.slice(t,e.position))&&xh(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&zh(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ri(e,!0,-1));return}if(e.position<e.length-1)Re(e,"end of the stream or a document separator is expected");else return}function Z3(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
119
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new gH(e,t),n=e.indexOf("\0");for(n!==-1&&(i.position=n,Re(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)kH(i);return i.documents}function NH(e,t,i){t!==null&&typeof t=="object"&&typeof i>"u"&&(i=t,t=null);var n=Z3(e,i);if(typeof t!="function")return n;for(var a=0,l=n.length;a<l;a+=1)t(n[a])}function TH(e,t){var i=Z3(e,t);if(i.length!==0){if(i.length===1)return i[0];throw new Fi("expected a single document in the stream, but found more")}}var AH=NH,MH=TH,Q3={loadAll:AH,load:MH},J3=Object.prototype.toString,eN=Object.prototype.hasOwnProperty,V_=65279,RH=9,Fc=10,DH=13,OH=32,jH=33,LH=34,R0=35,BH=37,zH=38,IH=39,PH=42,tN=44,UH=45,yh=58,HH=61,FH=62,$H=63,VH=64,iN=91,sN=93,qH=96,nN=123,KH=124,rN=125,Ii={};Ii[0]="\\0";Ii[7]="\\a";Ii[8]="\\b";Ii[9]="\\t";Ii[10]="\\n";Ii[11]="\\v";Ii[12]="\\f";Ii[13]="\\r";Ii[27]="\\e";Ii[34]='\\"';Ii[92]="\\\\";Ii[133]="\\N";Ii[160]="\\_";Ii[8232]="\\L";Ii[8233]="\\P";var GH=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],WH=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function YH(e,t){var i,n,a,l,c,h,m;if(t===null)return{};for(i={},n=Object.keys(t),a=0,l=n.length;a<l;a+=1)c=n[a],h=String(t[c]),c.slice(0,2)==="!!"&&(c="tag:yaml.org,2002:"+c.slice(2)),m=e.compiledTypeMap.fallback[c],m&&eN.call(m.styleAliases,h)&&(h=m.styleAliases[h]),i[c]=h;return i}function XH(e){var t,i,n;if(t=e.toString(16).toUpperCase(),e<=255)i="x",n=2;else if(e<=65535)i="u",n=4;else if(e<=4294967295)i="U",n=8;else throw new Fi("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+di.repeat("0",n-t.length)+t}var ZH=1,$c=2;function QH(e){this.schema=e.schema||H_,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=di.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=YH(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?$c:ZH,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function v2(e,t){for(var i=di.repeat(" ",t),n=0,a=-1,l="",c,h=e.length;n<h;)a=e.indexOf(`
|
|
120
|
+
`,n),a===-1?(c=e.slice(n),n=h):(c=e.slice(n,a+1),n=a+1),c.length&&c!==`
|
|
121
|
+
`&&(l+=i),l+=c;return l}function D0(e,t){return`
|
|
122
|
+
`+di.repeat(" ",e.indent*t)}function JH(e,t){var i,n,a;for(i=0,n=e.implicitTypes.length;i<n;i+=1)if(a=e.implicitTypes[i],a.resolve(t))return!0;return!1}function Sh(e){return e===OH||e===RH}function Vc(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==V_||65536<=e&&e<=1114111}function x2(e){return Vc(e)&&e!==V_&&e!==DH&&e!==Fc}function y2(e,t,i){var n=x2(e),a=n&&!Sh(e);return(i?n:n&&e!==tN&&e!==iN&&e!==sN&&e!==nN&&e!==rN)&&e!==R0&&!(t===yh&&!a)||x2(t)&&!Sh(t)&&e===R0||t===yh&&a}function eF(e){return Vc(e)&&e!==V_&&!Sh(e)&&e!==UH&&e!==$H&&e!==yh&&e!==tN&&e!==iN&&e!==sN&&e!==nN&&e!==rN&&e!==R0&&e!==zH&&e!==PH&&e!==jH&&e!==KH&&e!==HH&&e!==FH&&e!==IH&&e!==LH&&e!==BH&&e!==VH&&e!==qH}function tF(e){return!Sh(e)&&e!==yh}function Sc(e,t){var i=e.charCodeAt(t),n;return i>=55296&&i<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(i-55296)*1024+n-56320+65536:i}function aN(e){var t=/^\n* /;return t.test(e)}var oN=1,O0=2,lN=3,cN=4,Po=5;function iF(e,t,i,n,a,l,c,h){var m,f=0,g=null,b=!1,v=!1,x=n!==-1,y=-1,w=eF(Sc(e,0))&&tF(Sc(e,e.length-1));if(t||c)for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Sc(e,m),!Vc(f))return Po;w=w&&y2(f,g,h),g=f}else{for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Sc(e,m),f===Fc)b=!0,x&&(v=v||m-y-1>n&&e[y+1]!==" ",y=m);else if(!Vc(f))return Po;w=w&&y2(f,g,h),g=f}v=v||x&&m-y-1>n&&e[y+1]!==" "}return!b&&!v?w&&!c&&!a(e)?oN:l===$c?Po:O0:i>9&&aN(e)?Po:c?l===$c?Po:O0:v?cN:lN}function sF(e,t,i,n,a){e.dump=(function(){if(t.length===0)return e.quotingType===$c?'""':"''";if(!e.noCompatMode&&(GH.indexOf(t)!==-1||WH.test(t)))return e.quotingType===$c?'"'+t+'"':"'"+t+"'";var l=e.indent*Math.max(1,i),c=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),h=n||e.flowLevel>-1&&i>=e.flowLevel;function m(f){return JH(e,f)}switch(iF(t,h,e.indent,c,m,e.quotingType,e.forceQuotes&&!n,a)){case oN:return t;case O0:return"'"+t.replace(/'/g,"''")+"'";case lN:return"|"+S2(t,e.indent)+w2(v2(t,l));case cN:return">"+S2(t,e.indent)+w2(v2(nF(t,c),l));case Po:return'"'+rF(t)+'"';default:throw new Fi("impossible error: invalid scalar style")}})()}function S2(e,t){var i=aN(e)?String(t):"",n=e[e.length-1]===`
|
|
123
|
+
`,a=n&&(e[e.length-2]===`
|
|
124
|
+
`||e===`
|
|
125
|
+
`),l=a?"+":n?"":"-";return i+l+`
|
|
126
|
+
`}function w2(e){return e[e.length-1]===`
|
|
127
|
+
`?e.slice(0,-1):e}function nF(e,t){for(var i=/(\n+)([^\n]*)/g,n=(function(){var f=e.indexOf(`
|
|
128
|
+
`);return f=f!==-1?f:e.length,i.lastIndex=f,E2(e.slice(0,f),t)})(),a=e[0]===`
|
|
129
|
+
`||e[0]===" ",l,c;c=i.exec(e);){var h=c[1],m=c[2];l=m[0]===" ",n+=h+(!a&&!l&&m!==""?`
|
|
130
|
+
`:"")+E2(m,t),a=l}return n}function E2(e,t){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,n,a=0,l,c=0,h=0,m="";n=i.exec(e);)h=n.index,h-a>t&&(l=c>a?c:h,m+=`
|
|
131
|
+
`+e.slice(a,l),a=l+1),c=h;return m+=`
|
|
132
|
+
`,e.length-a>t&&c>a?m+=e.slice(a,c)+`
|
|
133
|
+
`+e.slice(c+1):m+=e.slice(a),m.slice(1)}function rF(e){for(var t="",i=0,n,a=0;a<e.length;i>=65536?a+=2:a++)i=Sc(e,a),n=Ii[i],!n&&Vc(i)?(t+=e[a],i>=65536&&(t+=e[a+1])):t+=n||XH(i);return t}function aF(e,t,i){var n="",a=e.tag,l,c,h;for(l=0,c=i.length;l<c;l+=1)h=i[l],e.replacer&&(h=e.replacer.call(i,String(l),h)),(Zn(e,t,h,!1,!1)||typeof h>"u"&&Zn(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=a,e.dump="["+n+"]"}function C2(e,t,i,n){var a="",l=e.tag,c,h,m;for(c=0,h=i.length;c<h;c+=1)m=i[c],e.replacer&&(m=e.replacer.call(i,String(c),m)),(Zn(e,t+1,m,!0,!0,!1,!0)||typeof m>"u"&&Zn(e,t+1,null,!0,!0,!1,!0))&&((!n||a!=="")&&(a+=D0(e,t)),e.dump&&Fc===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=l,e.dump=a||"[]"}function oF(e,t,i){var n="",a=e.tag,l=Object.keys(i),c,h,m,f,g;for(c=0,h=l.length;c<h;c+=1)g="",n!==""&&(g+=", "),e.condenseFlow&&(g+='"'),m=l[c],f=i[m],e.replacer&&(f=e.replacer.call(i,m,f)),Zn(e,t,m,!1,!1)&&(e.dump.length>1024&&(g+="? "),g+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Zn(e,t,f,!1,!1)&&(g+=e.dump,n+=g));e.tag=a,e.dump="{"+n+"}"}function lF(e,t,i,n){var a="",l=e.tag,c=Object.keys(i),h,m,f,g,b,v;if(e.sortKeys===!0)c.sort();else if(typeof e.sortKeys=="function")c.sort(e.sortKeys);else if(e.sortKeys)throw new Fi("sortKeys must be a boolean or a function");for(h=0,m=c.length;h<m;h+=1)v="",(!n||a!=="")&&(v+=D0(e,t)),f=c[h],g=i[f],e.replacer&&(g=e.replacer.call(i,f,g)),Zn(e,t+1,f,!0,!0,!0)&&(b=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,b&&(e.dump&&Fc===e.dump.charCodeAt(0)?v+="?":v+="? "),v+=e.dump,b&&(v+=D0(e,t)),Zn(e,t+1,g,!0,b)&&(e.dump&&Fc===e.dump.charCodeAt(0)?v+=":":v+=": ",v+=e.dump,a+=v));e.tag=l,e.dump=a||"{}"}function k2(e,t,i){var n,a,l,c,h,m;for(a=i?e.explicitTypes:e.implicitTypes,l=0,c=a.length;l<c;l+=1)if(h=a[l],(h.instanceOf||h.predicate)&&(!h.instanceOf||typeof t=="object"&&t instanceof h.instanceOf)&&(!h.predicate||h.predicate(t))){if(i?h.multi&&h.representName?e.tag=h.representName(t):e.tag=h.tag:e.tag="?",h.represent){if(m=e.styleMap[h.tag]||h.defaultStyle,J3.call(h.represent)==="[object Function]")n=h.represent(t,m);else if(eN.call(h.represent,m))n=h.represent[m](t,m);else throw new Fi("!<"+h.tag+'> tag resolver accepts not "'+m+'" style');e.dump=n}return!0}return!1}function Zn(e,t,i,n,a,l,c){e.tag=null,e.dump=i,k2(e,i,!1)||k2(e,i,!0);var h=J3.call(e.dump),m=n,f;n&&(n=e.flowLevel<0||e.flowLevel>t);var g=h==="[object Object]"||h==="[object Array]",b,v;if(g&&(b=e.duplicates.indexOf(i),v=b!==-1),(e.tag!==null&&e.tag!=="?"||v||e.indent!==2&&t>0)&&(a=!1),v&&e.usedDuplicates[b])e.dump="*ref_"+b;else{if(g&&v&&!e.usedDuplicates[b]&&(e.usedDuplicates[b]=!0),h==="[object Object]")n&&Object.keys(e.dump).length!==0?(lF(e,t,e.dump,a),v&&(e.dump="&ref_"+b+e.dump)):(oF(e,t,e.dump),v&&(e.dump="&ref_"+b+" "+e.dump));else if(h==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!c&&t>0?C2(e,t-1,e.dump,a):C2(e,t,e.dump,a),v&&(e.dump="&ref_"+b+e.dump)):(aF(e,t,e.dump),v&&(e.dump="&ref_"+b+" "+e.dump));else if(h==="[object String]")e.tag!=="?"&&sF(e,e.dump,t,l,m);else{if(h==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Fi("unacceptable kind of an object to dump "+h)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function cF(e,t){var i=[],n=[],a,l;for(j0(e,i,n),a=0,l=n.length;a<l;a+=1)t.duplicates.push(i[n[a]]);t.usedDuplicates=new Array(l)}function j0(e,t,i){var n,a,l;if(e!==null&&typeof e=="object")if(a=t.indexOf(e),a!==-1)i.indexOf(a)===-1&&i.push(a);else if(t.push(e),Array.isArray(e))for(a=0,l=e.length;a<l;a+=1)j0(e[a],t,i);else for(n=Object.keys(e),a=0,l=n.length;a<l;a+=1)j0(e[n[a]],t,i)}function uF(e,t){t=t||{};var i=new QH(t);i.noRefs||cF(e,i);var n=e;return i.replacer&&(n=i.replacer.call({"":n},"",n)),Zn(i,0,n,!0,!0)?i.dump+`
|
|
134
|
+
`:""}var dF=uF,hF={dump:dF};function q_(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var fF=Mi,mF=E3,pF=T3,gF=O3,_F=j3,bF=H_,vF=Q3.load,xF=Q3.loadAll,yF=hF.dump,SF=Fi,wF={binary:P3,float:D3,map:N3,null:A3,pairs:H3,set:F3,timestamp:z3,bool:M3,int:R3,merge:I3,omap:U3,seq:k3,str:C3},EF=q_("safeLoad","load"),CF=q_("safeLoadAll","loadAll"),kF=q_("safeDump","dump"),NF={Type:fF,Schema:mF,FAILSAFE_SCHEMA:pF,JSON_SCHEMA:gF,CORE_SCHEMA:_F,DEFAULT_SCHEMA:bF,load:vF,loadAll:xF,dump:yF,YAMLException:SF,types:wF,safeLoad:EF,safeLoadAll:CF,safeDump:kF};function uN(e){return e!==null&&typeof e=="object"}function dN(e){return typeof e=="string"?"text-rose-700":typeof e=="number"?"text-emerald-700":typeof e=="boolean"?"text-blue-700":e==null?"text-zinc-400 italic":"text-zinc-800"}function hN(e){return e==null?"null":typeof e=="string"?e===""?'""':e:String(e)}function fN({label:e,value:t,depth:i,defaultOpen:n}){const[a,l]=E.useState(n),c={paddingLeft:`${i*1.1}rem`};if(!uN(t))return u.jsxs("div",{className:"flex items-baseline gap-2 py-[1px]",style:c,children:[u.jsxs("span",{className:"text-zinc-500",children:[e,":"]}),u.jsx("span",{className:fe("whitespace-pre-wrap break-words",dN(t)),children:hN(t)})]});const h=Array.isArray(t)?t.map((f,g)=>[String(g),f]):Object.entries(t),m=Array.isArray(t)?`[${h.length}]`:`{${h.length}}`;return u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>l(f=>!f),className:"flex w-full items-center gap-1 py-[1px] text-left hover:bg-zinc-100",style:c,children:[a?u.jsx(Qs,{className:"size-3.5 shrink-0 text-zinc-400"}):u.jsx(Yr,{className:"size-3.5 shrink-0 text-zinc-400"}),u.jsx("span",{className:"font-medium text-zinc-700",children:e}),u.jsx("span",{className:"text-zinc-400",children:m})]}),a?h.map(([f,g])=>u.jsx(fN,{label:f,value:g,depth:i+1,defaultOpen:i<1},f)):null]})}function TF({content:e}){const t=E.useMemo(()=>{try{const n=NF.loadAll(e);return{value:n.length<=1?n[0]:n,error:null}}catch(n){return{value:null,error:n instanceof Error?n.message:String(n)}}},[e]);if(t.error)return u.jsx("div",{className:"p-4",children:u.jsxs(dt,{variant:"destructive",children:["Could not parse YAML: ",t.error]})});if(!uN(t.value))return u.jsx("div",{className:"p-4 font-mono text-[12px]",children:u.jsx("span",{className:dN(t.value),children:hN(t.value)})});const i=Array.isArray(t.value)?t.value.map((n,a)=>[String(a),n]):Object.entries(t.value);return u.jsx("div",{className:"min-w-max px-4 py-3 font-mono text-[12px] leading-[1.6]",children:i.map(([n,a])=>u.jsx(fN,{label:n,value:a,depth:0,defaultOpen:!0},n))})}const AF=E.lazy(()=>OI(()=>import("./code-editor-BJd-TJLv.js"),[]).then(e=>({default:e.CodeEditor})));function MF(e){const t=e.split("/").pop()?.toLowerCase().split(".").pop()??"";return t==="md"||t==="mdx"||t==="markdown"?"markdown":t==="yml"||t==="yaml"?"yaml":null}function RF(e){const t=e.split("/").pop()?.toLowerCase()??"",i=t.includes(".")?t.split(".").pop()??"":"",n={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",toml:"ini",ini:"ini",md:"markdown",mdx:"markdown",css:"css",scss:"scss",less:"less",html:"xml",xml:"xml",sql:"sql",dockerfile:"dockerfile"};return n[i]?n[i]:t==="dockerfile"?"dockerfile":null}function DF(e,t){const i=e.endsWith(`
|
|
135
|
+
`)?e.slice(0,-1):e;return!t||!k0.getLanguage(t)?i.split(`
|
|
136
|
+
`).map(N2):i.split(`
|
|
137
|
+
`).map(n=>{if(!n)return"";try{return k0.highlight(n,{language:t,ignoreIllegals:!0}).value}catch{return N2(n)}})}function N2(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function OF({content:e,path:t}){const i=E.useMemo(()=>RF(t),[t]),n=E.useMemo(()=>DF(e,i),[e,i]),a=`${Math.max(2,String(n.length).length)}ch`;return u.jsx("div",{className:"min-w-max font-mono text-[12px] leading-[1.5]",children:n.map((l,c)=>u.jsxs("div",{className:"flex",children:[u.jsx("span",{className:"shrink-0 select-none border-r border-zinc-200 bg-zinc-100 px-2 text-right text-zinc-400",style:{minWidth:`calc(${a} + 1rem)`},children:c+1}),u.jsx("span",{className:"hljs whitespace-pre px-3 text-zinc-800",dangerouslySetInnerHTML:{__html:l||" "}})]},c))})}function jF({path:e,isModified:t,onViewDiff:i,onFileSaved:n}){const[a,l]=E.useState(null),[c,h]=E.useState(""),[m,f]=E.useState(!1),[g,b]=E.useState(null),[v,x]=E.useState(!1),[y,w]=E.useState(!1),{success:C,error:N}=qi(),T=E.useMemo(()=>MF(e),[e]),[D,A]=E.useState("preview"),L=!!(a&&!a.binary&&!a.truncated),G=a?c!==a.content:!1;E.useEffect(()=>{A(T?"preview":"source"),f(!1)},[T]),E.useEffect(()=>{if(!e){l(null);return}let H=!0;return x(!0),b(null),f(!1),gM(e).then(I=>{H&&(l(I),h(I.content),x(!1))}).catch(I=>{H&&(b(I instanceof Error?I.message:String(I)),x(!1))}),()=>{H=!1}},[e]);async function j(){if(!(!e||!a||!G||y)){w(!0);try{await _M(e,c);const H={...a,content:c,size:new TextEncoder().encode(c).length};l(H),f(!1),C(`Saved ${e}.`),n?.(e)}catch(H){N(H instanceof Error?H.message:String(H))}finally{w(!1)}}}function R(){h(a?.content??""),f(!1)}return e?u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:e}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{children:"Read-only view of tracked file."}),a?.truncated?u.jsx("span",{className:"text-amber-700",children:"Truncated — file exceeds 1MB."}):null,a?.binary?u.jsx("span",{className:"text-amber-700",children:"Binary file."}):null]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[T&&!a?.binary?u.jsxs("div",{className:"flex items-center rounded-md border border-border p-0.5",children:[u.jsxs("button",{type:"button",onClick:()=>A("preview"),"aria-pressed":D==="preview",className:fe("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",D==="preview"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[u.jsx(I0,{className:"size-3.5"}),"Preview"]}),u.jsxs("button",{type:"button",onClick:()=>A("source"),"aria-pressed":D==="source",className:fe("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",D==="source"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[u.jsx(U2,{className:"size-3.5"}),"Source"]})]}):null,t?u.jsx(de,{onClick:i,size:"sm",type:"button",variant:"outline",children:"View diff"}):null,m?u.jsxs(u.Fragment,{children:[u.jsxs(de,{disabled:!G||y,onClick:()=>{j()},size:"sm",type:"button",children:[u.jsx(P0,{}),"Apply"]}),u.jsxs(de,{disabled:y,onClick:R,size:"sm",type:"button",variant:"outline",children:[u.jsx(Js,{}),"Cancel"]})]}):L?u.jsxs(de,{onClick:()=>{A("source"),f(!0)},size:"sm",type:"button",variant:"outline",children:[u.jsx(Mc,{}),"Edit"]}):null]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-zinc-50",children:g?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"destructive",children:g})}):v?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading…"}):a?.binary?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Cannot display binary content."}):a?m?u.jsx(E.Suspense,{fallback:u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading editor…"}),children:u.jsx(AF,{path:e,value:c,onChange:h})}):T&&D==="preview"?T==="markdown"?u.jsx(oU,{content:a.content}):u.jsx(TF,{content:a.content}):u.jsx(OF,{content:a.content,path:e}):null})]}):u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a file to view its contents."})})}function LF({activeHunkIndex:e,filePaths:t,hunkCount:i,pendingNextFilePath:n,selectedFile:a}){if(i>0&&e<i-1)return{kind:"hunk",activeHunkIndex:e+1};const l=t.indexOf(a),c=t[l+1];return c?n===c?{kind:"file",filePath:c}:{kind:"confirm-next-file",filePath:c}:{kind:"none"}}function T2(e){const t={name:"",fullPath:"",children:new Map};for(const i of e){const n=i.name.split("/");let a=t;n.forEach((l,c)=>{let h=a.children.get(l);h||(h={name:l,fullPath:n.slice(0,c+1).join("/"),children:new Map},a.children.set(l,h)),a=h}),a.branch=i}return t}function A2({label:e,tree:t,onSelect:i,defaultOpen:n,forceOpen:a}){const[l,c]=E.useState(n??!1),h=a||l,m=t.children.size===0;return u.jsxs("div",{className:"mb-1",children:[u.jsxs("button",{type:"button",onClick:()=>c(f=>!f),className:"flex w-full items-center gap-1 px-2 py-0.5 text-left text-[11px] font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",children:[h?u.jsx(Qs,{size:12}):u.jsx(Yr,{size:12}),e,m?null:u.jsxs("span",{className:"ml-1 text-[10px] font-normal",children:["(",t.children.size,")"]})]}),h&&!m?u.jsx("ul",{children:Array.from(t.children.values()).map(f=>u.jsx(mN,{node:f,depth:1,onSelect:i,forceOpen:a},f.fullPath))}):null]})}function mN({node:e,depth:t,onSelect:i,forceOpen:n}){const[a,l]=E.useState(!0),c=n||a,h=e.children.size>0,m=e.branch,f={paddingLeft:`${t*10}px`};return!h&&m?u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>i(m),style:f,title:m.name,className:`flex w-full items-center gap-1.5 py-0.5 pr-2 text-left text-[12px] hover:bg-muted/60 ${m.current?"font-semibold text-emerald-700":""}`,children:[u.jsx(Ac,{size:11,className:"shrink-0 opacity-70"}),u.jsx("span",{className:"truncate",children:e.name}),m.current?u.jsx("span",{className:"text-[10px]",children:"●"}):null]})}):u.jsxs("li",{children:[u.jsxs("button",{type:"button",onClick:()=>{m?i(m):l(g=>!g)},style:f,className:"flex w-full items-center gap-1 py-0.5 pr-2 text-left text-[12px] hover:bg-muted/60",children:[h?c?u.jsx(Qs,{size:11}):u.jsx(Yr,{size:11}):u.jsx("span",{className:"inline-block w-[11px]"}),u.jsx("span",{className:"truncate",children:e.name})]}),c&&h?u.jsx("ul",{children:Array.from(e.children.values()).map(g=>u.jsx(mN,{node:g,depth:t+1,onSelect:i,forceOpen:n},g.fullPath))}):null]})}function BF({selectedCommit:e,selectedFile:t,diff:i,diffLoading:n,diffError:a}){return u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col bg-card border-b border-border",children:[u.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:t??(e?e.subject:"Commit")}),e?u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{className:"font-mono",children:e.hash.slice(0,12)}),u.jsxs("span",{children:[e.author," <",e.email,">"]}),u.jsx("span",{children:new Date(e.timestamp*1e3).toLocaleString()})]}):null]})}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:a?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"destructive",children:a})}):e?n?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading diff…"}):i?u.jsx(u3,{activeHunkIndex:0,diff:i}):u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-dashed p-6 text-center",children:e.parents.length>1?"Merge commit with no conflict resolution — no diff against the first parent.":"No textual changes in this commit."})}):u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a commit to inspect its diff."})})})]})}function zF({files:e,filesError:t,selectedHash:i,selectedFile:n,onSelect:a}){return u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsx("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:u.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Files",e.length?u.jsx("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:e.length}):null]})}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:t?u.jsx("div",{className:"p-3",children:u.jsx(dt,{variant:"destructive",children:t})}):i?e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No file changes."}):u.jsx("ul",{className:"divide-y divide-border",children:e.map(l=>u.jsx("li",{children:u.jsxs("button",{onClick:()=>a(l.path),type:"button",title:l.path,className:`flex w-full items-center gap-2 px-2 py-1 text-left text-[12px] transition-colors hover:bg-muted/60 ${n===l.path?"bg-muted":""}`,children:[u.jsx("span",{className:IF(l.index),children:l.index.trim()||"·"}),u.jsx("span",{className:"truncate font-mono",children:l.path})]})},l.path))}):u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Select a commit to see its files."})})]})}function IF(e){const t="inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-[10px] font-bold";switch(e.trim().toUpperCase()){case"A":return`${t} bg-emerald-100 text-emerald-800`;case"D":return`${t} bg-red-100 text-red-800`;case"M":return`${t} bg-amber-100 text-amber-800`;case"R":return`${t} bg-blue-100 text-blue-800`;case"C":return`${t} bg-indigo-100 text-indigo-800`;default:return`${t} bg-slate-100 text-slate-700`}}const M2=["#3b82f6","#10b981","#f59e0b","#ec4899","#8b5cf6","#14b8a6","#ef4444","#84cc16"];function hc(e){return M2[e%M2.length]}function PF({lane:e,laneCount:t,edges:i,throughLanes:n,isMerge:a,height:l=28,laneWidth:c=14}){const m=Math.max(e+1,t,1)*c,f=l/2,g=fc(e,c),b=a?4:3.5;return u.jsxs("svg",{width:m,height:l,viewBox:`0 0 ${m} ${l}`,style:{flex:"0 0 auto",display:"block"},children:[n.map(v=>u.jsx("line",{x1:fc(v,c),y1:0,x2:fc(v,c),y2:l,stroke:hc(v),strokeWidth:1.5},`t-${v}`)),u.jsx("line",{x1:g,y1:0,x2:g,y2:f,stroke:hc(e),strokeWidth:1.5}),i.map((v,x)=>{const y=fc(v.fromLane,c),w=fc(v.toLane,c);if(y===w)return u.jsx("line",{x1:y,y1:f,x2:w,y2:l,stroke:hc(v.toLane),strokeWidth:1.5},`e-${x}`);const C=f+(l-f)/2;return u.jsx("path",{d:`M ${y} ${f} C ${y} ${C}, ${w} ${C}, ${w} ${l}`,fill:"none",stroke:hc(v.toLane),strokeWidth:1.5},`e-${x}`)}),u.jsx("circle",{cx:g,cy:f,r:b,fill:hc(e),stroke:"var(--background, #fff)",strokeWidth:1.5})]})}function fc(e,t){return e*t+t/2}const R2=28;function UF({commits:e,loading:t,error:i,selectedHash:n,maxLanes:a,rowRefs:l,onSelect:c,onLoadMore:h}){return u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[u.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Commit tree",e.length?u.jsxs("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:[e.length," commits"]}):null]}),u.jsx(de,{disabled:t,onClick:h,size:"sm",type:"button",variant:"outline",children:"Load more"})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:i?u.jsx("div",{className:"p-3",children:u.jsx(dt,{variant:"destructive",children:i})}):t&&e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Loading commits…"}):e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No commits."}):u.jsx("ul",{className:"divide-y divide-border",children:e.map(m=>u.jsx("li",{ref:f=>{f?l.current.set(m.hash,f):l.current.delete(m.hash)},children:u.jsxs("button",{onClick:()=>c(m.hash),type:"button",className:`flex w-full items-center gap-2 px-2 py-0.5 text-left transition-colors hover:bg-muted/60 ${n===m.hash?"bg-muted":""}`,style:{minHeight:R2},title:`${m.hash}
|
|
138
|
+
${m.author} <${m.email}>
|
|
139
|
+
${m.subject}`,children:[u.jsx(PF,{lane:m.lane,laneCount:Math.max(m.laneCount,a),edges:m.edges,throughLanes:m.throughLanes,isMerge:m.parents.length>1,height:R2}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:m.hash.slice(0,7)}),u.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[m.refs.map(f=>u.jsx("span",{className:FF(f.kind),children:f.name},`${f.kind}-${f.name}`)),u.jsx("span",{className:"truncate text-[12px]",children:m.subject})]}),u.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:m.author}),u.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70",title:new Date(m.timestamp*1e3).toLocaleString(),children:HF(m.timestamp)})]})},m.hash))})})]})}function HF(e){if(!e)return"";const t=Math.max(0,Math.floor(Date.now()/1e3-e));if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m`;const n=Math.floor(i/60);if(n<24)return`${n}h`;const a=Math.floor(n/24);if(a<30)return`${a}d`;const l=Math.floor(a/30);return l<12?`${l}mo`:`${Math.floor(l/12)}y`}function FF(e){const t="rounded px-1.5 py-px text-[10px] font-medium";switch(e){case"head":return`${t} bg-emerald-100 text-emerald-800`;case"branch":return`${t} bg-blue-100 text-blue-800`;case"remote":return`${t} bg-slate-100 text-slate-700`;case"tag":return`${t} bg-amber-100 text-amber-800`}}const D2=200;function $F(){const[e,t]=E.useState([]),[i,n]=E.useState(D2),[a,l]=E.useState(!0),[c,h]=E.useState(null),[m,f]=E.useState(null),[g,b]=E.useState([]),[v,x]=E.useState(null),[y,w]=E.useState(null),[C,N]=E.useState(""),[T,D]=E.useState(!1),[A,L]=E.useState(null);E.useEffect(()=>{let R=!0;return l(!0),h(null),dM(i).then(H=>{R&&(t(H),H.length>0&&!H.some(I=>I.hash===m)&&f(H[0].hash))}).catch(H=>{R&&h(H instanceof Error?H.message:String(H))}).finally(()=>{R&&l(!1)}),()=>{R=!1}},[i]),E.useEffect(()=>{if(!m){b([]),w(null);return}let R=!0;return x(null),fM(m).then(H=>{R&&(b(H),w(H[0]?.path??null))}).catch(H=>{R&&x(H instanceof Error?H.message:String(H))}),()=>{R=!1}},[m]),E.useEffect(()=>{if(!m){N("");return}let R=!0;return L(null),D(!0),hM(m,y??void 0).then(H=>{R&&N(H)}).catch(H=>{R&&L(H instanceof Error?H.message:String(H))}).finally(()=>{R&&D(!1)}),()=>{R=!1}},[m,y]);const G=E.useMemo(()=>e.reduce((R,H)=>Math.max(R,H.laneCount),1),[e]),j=e.find(R=>R.hash===m)??null;return{commits:e,loading:a,error:c,selectedHash:m,setSelectedHash:f,files:g,filesError:v,selectedFile:y,setSelectedFile:w,diff:C,diffLoading:T,diffError:A,maxLanes:G,selectedCommit:j,loadMore:()=>n(R=>R+D2)}}function VF({branches:e=[]}){const{commits:t,loading:i,error:n,selectedHash:a,setSelectedHash:l,files:c,filesError:h,selectedFile:m,setSelectedFile:f,diff:g,diffLoading:b,diffError:v,maxLanes:x,selectedCommit:y,loadMore:w}=$F(),[C,N]=E.useState(""),T=E.useMemo(()=>{const R=C.trim().toLowerCase();return R?e.filter(H=>H.name.toLowerCase().includes(R)):e},[e,C]),D=E.useMemo(()=>T2(T.filter(R=>!R.remote)),[T]),A=E.useMemo(()=>T2(T.filter(R=>R.remote)),[T]),L=C.trim().length>0,G=E.useRef(new Map);function j(R){const H=R.remote?"remote":"branch",I=t.find(J=>J.refs.some(P=>P.kind===H&&P.name===R.name));if(!I)return;l(I.hash);const W=G.current.get(I.hash);W&&W.scrollIntoView({block:"center",behavior:"smooth"})}return u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 grid-cols-[220px_minmax(0,1fr)]",children:[u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 flex-col gap-1 border-b border-border px-3 py-1.5",children:[u.jsx("h2",{className:"text-[13px] font-semibold tracking-tight",children:"Branches"}),u.jsx("input",{type:"search",value:C,onChange:R=>N(R.target.value),placeholder:"Search branches…",className:"w-full rounded border border-border bg-background px-2 py-1 text-[11px] outline-none focus:border-foreground"})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:[u.jsx(A2,{label:"Local",tree:D,onSelect:j,defaultOpen:!0,forceOpen:L}),u.jsx(A2,{label:"Remote",tree:A,onSelect:j,forceOpen:L})]})]}),u.jsxs("div",{className:"grid min-h-0 min-w-0 grid-rows-[minmax(0,3fr)_minmax(0,2fr)]",children:[u.jsx(BF,{selectedCommit:y,selectedFile:m,diff:g,diffLoading:b,diffError:v}),u.jsxs("div",{className:"grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)_280px]",children:[u.jsx(UF,{commits:t,loading:i,error:n,selectedHash:a,maxLanes:x,rowRefs:G,onSelect:l,onLoadMore:w}),u.jsx(zF,{files:c,filesError:h,selectedHash:a,selectedFile:m,onSelect:f})]})]})]})}const L0=300,qF=600,KF=new Set(["md","mdx","markdown","txt","rst","adoc","json","jsonc","json5","yaml","yml","toml","xml","ini","cfg","conf","env","properties","csv","tsv","lock","svg","map","snap","png","jpg","jpeg","gif","ico","webp"]);function GF(e){const t=e.toLowerCase();if(t.endsWith(".d.ts")||t.endsWith(".min.js")||t.endsWith(".min.css"))return!1;const i=t.lastIndexOf(".");return i<0?!0:!KF.has(t.slice(i+1))}function WF(e){return e>=qF?"danger":e>=L0?"warn":"ok"}const YF={ok:"bg-emerald-500/60",warn:"bg-amber-500/70",danger:"bg-destructive/70"},XF={ok:"text-muted-foreground",warn:"text-amber-600 dark:text-amber-400",danger:"text-destructive"};function ZF({onOpenFile:e}){const[t,i]=E.useState([]),[n,a]=E.useState(!0),[l,c]=E.useState(null),[h,m]=E.useState(!0);function f(){a(!0),c(null),pM().then(i).catch(y=>c(y instanceof Error?y.message:String(y))).finally(()=>a(!1))}E.useEffect(()=>{f()},[]);const g=E.useMemo(()=>h?t.filter(y=>GF(y.path)):t,[t,h]),b=t.length-g.length,v=g[0]?.lines??1,x=g.filter(y=>y.lines>=L0).length;return u.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[u.jsx(V2,{className:"size-4"}),u.jsx("span",{className:"font-semibold text-foreground",children:"Largest files"}),!n&&!l?u.jsxs("span",{children:[g.length," files · ",x," over ",L0," lines",h&&b>0?` · ${b} data/docs hidden`:""]}):null]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs(de,{size:"sm",variant:h?"default":"outline",className:"h-7",onClick:()=>m(y=>!y),title:"Hide docs, data, config and generated files",type:"button",children:[u.jsx(U2,{}),"Code only"]}),u.jsxs(de,{size:"sm",variant:"outline",className:"h-7",onClick:f,disabled:n,type:"button",children:[n?u.jsx(as,{className:"animate-spin"}):u.jsx(Eh,{}),"Refresh"]})]})]}),l?u.jsx(dt,{variant:"destructive",className:"m-3",children:l}):n&&t.length===0?u.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[u.jsx(as,{className:"mr-2 size-4 animate-spin"}),"Scanning tracked files…"]}):g.length===0?u.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:t.length===0?"No tracked text files found.":"No code files — toggle off “Code only” to see data & docs."}):u.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border/60 overflow-auto",children:g.map((y,w)=>{const C=WF(y.lines);return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>e(y.path),className:"group flex w-full items-center gap-3 px-3 py-1.5 text-left transition-colors hover:bg-muted/50",children:[u.jsx("span",{className:"w-6 shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:w+1}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("span",{className:"truncate font-mono text-[11px]",children:y.path}),u.jsxs("span",{className:fe("shrink-0 font-mono text-[11px] tabular-nums",XF[C]),children:[y.truncated?"≥":"",y.lines.toLocaleString()," lines"]})]}),u.jsx("div",{className:"mt-1 h-1 w-full overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:fe("h-full rounded-full",YF[C]),style:{width:`${Math.max(2,y.lines/v*100)}%`}})})]})]})},y.path)})})]})}function QF({data:e}){const[t,i]=E.useState("changes"),[n,a]=E.useState("changes"),[l,c]=E.useState(e.git.status?.files[0]?.path??""),[h,m]=E.useState(""),[f,g]=E.useState([]),[b,v]=E.useState(null),[x,y]=E.useState(""),[w,C]=E.useState(null),[N,T]=E.useState(0),[D,A]=E.useState(null),[L,G]=E.useState(()=>new Set),j=e.git.status?.files??[],R=E.useMemo(()=>{const ie=new Set(j.map(me=>me.path)),le=[...L].filter(me=>!ie.has(me)).sort().map(me=>({path:me,index:" ",workingTree:"M"}));return[...j,...le]},[j,L]),H=E.useMemo(()=>R.map(ie=>ie.path),[R]),I=E.useMemo(()=>vI(x),[x]);E.useEffect(()=>{const ie=R[0]?.path??"";c(le=>le&&R.some(me=>me.path===le)?le:ie)},[R]),E.useEffect(()=>{if(t!=="all"||f.length>0)return;let ie=!0;return v(null),mM().then(le=>{ie&&g(le)}).catch(le=>{ie&&v(le instanceof Error?le.message:String(le))}),()=>{ie=!1}},[t,f.length]),E.useEffect(()=>{if(!l){y("");return}let ie=!0;return C(null),bM(l).then(le=>{ie&&(y(le),T(0),A(null))}).catch(le=>{ie&&C(le instanceof Error?le.message:String(le))}),()=>{ie=!1}},[l]);function W(ie){T(0),A(null),c(ie)}function J(){const ie=LF({activeHunkIndex:N,filePaths:H,hunkCount:I.hunks,pendingNextFilePath:D,selectedFile:l});ie.kind==="hunk"?(A(null),T(ie.activeHunkIndex)):ie.kind==="confirm-next-file"?A(ie.filePath):ie.kind==="file"?W(ie.filePath):A(null)}function P(){if(A(null),N>0){T(me=>me-1);return}const ie=R.findIndex(me=>me.path===l),le=R[ie-1];le&&W(le.path)}const te=R.findIndex(ie=>ie.path===l),K=!!(I.hunks&&N<I.hunks-1||R[te+1]),M=!!(N>0||R[te-1]),$=D?`End of file. Click Next again to open ${D}.`:null,F=ie=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${ie?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,V=ie=>`flex-1 px-2 py-0.5 text-[11px] font-medium transition-colors ${ie?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,Y=E.useMemo(()=>{const ie=new Set(R.map(le=>le.path));for(const le of L)ie.add(le);return ie},[R,L]);if(!e.git.selectedRepository)return u.jsx(JF,{});function O(){h&&(i("changes"),a("changes"),W(h))}function ee(ie){G(le=>new Set(le).add(ie)),m(ie),i("changes"),a("changes"),W(ie)}function ue(ie){m(ie),i("all")}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-card/85",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/95 px-3 py-1",children:[u.jsx("button",{type:"button",className:F(t==="changes"),onClick:()=>i("changes"),children:"Changes"}),u.jsx("button",{type:"button","aria-label":"Open all tracked files",className:F(t==="all"),onClick:()=>i("all"),children:"All files"}),u.jsx("button",{type:"button",className:F(t==="graph"),onClick:()=>i("graph"),children:"Tree"}),u.jsx("button",{type:"button",className:F(t==="largest"),onClick:()=>i("largest"),children:"Largest files"})]}),u.jsx("div",{className:"min-h-0 flex-1",children:t==="graph"?u.jsx(VF,{branches:e.git.branches??[]}):t==="largest"?u.jsx(ZF,{onOpenFile:ue}):t==="all"?u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[u.jsx("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:b?u.jsx(dt,{variant:"destructive",className:"m-3",children:b}):u.jsx(vw,{branch:e.git.status?.branch||void 0,onSelectFile:m,paths:f,root:e.git.cwd,selectedFile:h,status:R})}),u.jsx(jF,{isModified:Y.has(h),onFileSaved:ee,onViewDiff:O,path:h})]}):u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 gap-0.5 border-b border-border bg-card/95 p-1",children:[u.jsx("button",{"aria-label":"Show changed files as a list",className:V(n==="changes"),onClick:()=>a("changes"),type:"button",children:"Changes"}),u.jsx("button",{"aria-label":"Show changed files as a tree",className:V(n==="tree"),onClick:()=>a("tree"),type:"button",children:"Tree"})]}),n==="changes"?u.jsx(wI,{branch:e.git.status?.branch||void 0,error:e.git.error,files:R,selectedFile:l,onSelectFile:W,root:e.git.cwd}):u.jsx(vw,{branch:e.git.status?.branch||void 0,defaultExpandAll:!0,emptyMessage:e.git.error??"No changed files.",onSelectFile:W,paths:H,root:e.git.cwd,selectedFile:l,status:R,title:"Changes"})]}),u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:l||"Diff"}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{children:"Long rows wrap inside the editor pane."}),I.additions||I.deletions?u.jsxs("span",{className:"flex items-center gap-1 font-mono",children:[u.jsxs("span",{className:"text-emerald-700",children:["+",I.additions]}),u.jsxs("span",{className:"text-red-700",children:["-",I.deletions]})]}):null]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[$?u.jsx("span",{className:"max-w-72 truncate rounded border border-amber-200 bg-amber-50 px-2 py-1 text-[11px] text-amber-900",children:$}):null,u.jsxs(de,{disabled:!l||!M,onClick:P,size:"sm",type:"button",variant:"outline",children:[u.jsx(zT,{}),"Previous"]}),u.jsxs(de,{disabled:!l||!K,onClick:J,size:"sm",type:"button",variant:"outline",children:[u.jsx(LT,{}),"Next"]})]})]}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:w?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"destructive",children:w})}):l?u.jsx(u3,{activeHunkIndex:N,diff:x||"No unstaged diff for this file."}):u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a changed file to inspect its diff."})})})]})]})})]})}function JF(){return u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(xA,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No Git project registered"}),u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Add a folder that is a Git worktree to review changes, browse files, and inspect history. Use the project picker in the header to add one."})]})})}function e$({initialPath:e,onSelect:t,selectedPath:i}){const[n,a]=E.useState(e),[l,c]=E.useState(null),[h,m]=E.useState(null),[f,g]=E.useState(!1),b=t$(l);return E.useEffect(()=>{a(e)},[e]),E.useEffect(()=>{let v=!0;return g(!0),m(null),sE(n).then(x=>{v&&(c(x),t(x.path))}).catch(x=>{v&&m(x instanceof Error?x.message:String(x))}).finally(()=>{v&&g(!1)}),()=>{v=!1}},[n,t]),u.jsxs("div",{className:"rounded-md border border-border bg-background",children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border p-2",children:[b?u.jsx(de,{"aria-label":"Open parent folder",onClick:()=>l&&a(l.parent),size:"icon",type:"button",variant:"ghost",children:u.jsx(Qs,{className:"rotate-90"})}):null,u.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:l?.path??n}),f?u.jsx(as,{className:"size-4 animate-spin text-muted-foreground"}):null]}),u.jsxs("div",{className:"max-h-56 overflow-auto p-1",children:[h?u.jsx(dt,{variant:"destructive",className:"m-1",children:h}):null,!h&&l?.entries.length===0?u.jsx(dt,{variant:"muted",className:"m-1 text-center",children:"No folders here."}):null,l?.entries.map(v=>u.jsxs(de,{className:fe("h-8 w-full justify-start rounded-sm px-2 text-left",i===v.path&&"bg-muted"),onClick:()=>a(v.path),title:v.path,type:"button",variant:"ghost",children:[u.jsx(Ha,{className:"text-accent"}),u.jsx("span",{className:"truncate",children:v.name})]},v.path))]})]})}function t$(e){return!!(e&&e.parent!==e.path)}function O2(e){return e.split(/[\\/]/).filter(Boolean).pop()??"project"}function i$({data:e,onRefresh:t}){const[i,n]=E.useState(!1),[a,l]=E.useState(e.git.cwd),[c,h]=E.useState(null),[m,f]=E.useState(!1),[g,b]=E.useState(e.git.cwd),v=E.useRef(null),x=e.git.selectedRepository,y=x?.name??(e.git.cwd?O2(e.git.cwd):"Add Git project"),{error:w,success:C}=qi(),N=n$({gitCwd:e.git.cwd});E.useEffect(()=>{l(e.git.cwd),b(e.git.cwd)},[e.git.cwd]),E.useEffect(()=>{if(!i)return;function j(R){v.current&&R.target instanceof Node&&!v.current.contains(R.target)&&n(!1)}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[i]);async function T(j){try{await rs("/api/git/select",{name:j}),n(!1),await t(),C(`Switched to ${j}.`)}catch(R){w(R instanceof Error?R.message:String(R))}}async function D(j){const R=j.trim();if(!s$(R)){const H="Please add an absolute path. Paths beginning with ~ are not expanded here.";return h(H),w(H),!1}try{const H=O2(R);return await rs("/api/git/repositories",{name:H,path:R}),h(null),await t(),C(`Added Git project ${H}.`),!0}catch(H){const I=H instanceof Error?H.message:String(H);return h(I),w(I),!1}}async function A(j){try{await vM(j),await t(),C(`Removed Git project ${j}.`)}catch(R){w(R instanceof Error?R.message:String(R))}}async function L(j){j.preventDefault(),await D(a)&&n(!1)}function G(){h(null),b(N.selectedPath),f(!0)}return u.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:v,children:[u.jsxs(de,{className:"max-w-[220px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>n(j=>!j),size:"sm",type:"button",variant:"outline",children:[u.jsx(Ha,{className:"text-muted-foreground"}),u.jsx("span",{className:"truncate",children:y}),u.jsx(Qs,{className:fe("ml-auto transition-transform",i&&"rotate-180")})]}),u.jsx(de,{"aria-label":"Add Git project",onClick:G,size:"sm",type:"button",variant:"outline",children:u.jsx(zs,{})}),i?u.jsxs("div",{className:"absolute right-0 top-10 z-50 w-[min(380px,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(oA,{className:"size-3.5 text-muted-foreground"}),u.jsx("div",{className:"text-xs font-semibold",children:"Git Projects"}),u.jsx(Ke,{className:"ml-auto h-5 px-1.5 text-[10px]",variant:"outline",children:e.config.gitRepositories.length})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.config.gitRepositories.length?u.jsx("div",{className:"divide-y divide-border",children:e.config.gitRepositories.map(j=>{const R=j.name===x?.name;return u.jsxs("div",{className:fe("group grid w-full grid-cols-[1fr_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",R&&"bg-muted/70"),children:[u.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{T(j.name)},type:"button",children:[u.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:j.name}),u.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:j.path})]}),R?u.jsx(Qo,{className:"size-3.5"}):u.jsx("span",{className:"size-3.5"}),u.jsx(de,{"aria-label":`Remove ${j.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{A(j.name)},size:"icon",title:`Remove ${j.name}`,type:"button",variant:"ghost",children:u.jsx(qc,{className:"size-3.5 text-destructive"})})]},j.name)})}):u.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved Git projects yet."})}),u.jsxs("div",{className:"border-t border-border bg-muted/20 p-2",children:[u.jsxs("form",{className:"flex gap-1.5",onSubmit:L,children:[u.jsx(ot,{"aria-label":"Paste absolute path",className:"h-7 flex-1 px-2 font-mono text-[11px]",onChange:j=>{l(j.target.value),h(null)},placeholder:"/absolute/path",value:a}),u.jsxs(de,{className:"h-7 px-2 text-[11px]",size:"sm",type:"submit",children:[u.jsx(zs,{className:"size-3"}),"Add"]}),u.jsx(de,{"aria-label":"Browse and add Git project",className:"h-7 px-2",onClick:G,size:"sm",type:"button",variant:"outline",children:u.jsx(wA,{className:"size-3"})})]}),c?u.jsx("div",{className:"mt-1.5 truncate text-[10px] text-destructive",children:c}):null]})]}):null,m?u.jsx(r$,{confirmLabel:N.confirmLabel,errorMessage:c,initialPath:N.initialPath,selectedPath:g,title:"Add Git Project",onCancel:()=>f(!1),onSelect:b,onUse:async()=>{await D(g)&&(f(!1),n(!1))}}):null]})}function s$(e){return e.startsWith("/")}function n$({gitCwd:e}){return{confirmLabel:"Add Git project",initialPath:e,selectedPath:e}}function r$({confirmLabel:e="Use this folder",errorMessage:t,initialPath:i,onCancel:n,onSelect:a,onUse:l,selectedPath:c,title:h="Choose Git Project Folder"}){return __.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",children:u.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-border bg-card p-4 shadow-xl",children:[u.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-background",children:u.jsx(Ha,{className:"size-4"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("div",{className:"text-sm font-semibold",children:h}),u.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:c})]}),u.jsx(de,{"aria-label":"Close folder picker",onClick:n,size:"icon",variant:"ghost",children:u.jsx(Js,{})})]}),u.jsx(e$,{initialPath:i,onSelect:a,selectedPath:c}),t?u.jsx("div",{className:"mt-3 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:t}):null,u.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[u.jsx(de,{onClick:n,type:"button",variant:"outline",children:"Cancel"}),u.jsx(de,{onClick:()=>{l()},type:"button",children:e})]})]})}),document.body)}function a$({branches:e,currentBranch:t,disabled:i,onRefresh:n}){const[a,l]=E.useState(!1),[c,h]=E.useState(""),[m,f]=E.useState(null),[g,b]=E.useState(null),[v,x]=E.useState(null),y=e.filter(A=>!A.remote),w=e.filter(A=>A.remote);async function C(A,L){f(A),x(null),b(null);try{await L(),await n()}catch(G){x(G instanceof Error?G.message:String(G))}finally{f(null)}}async function N(A){await C(`switch:${A}`,async()=>{await rs("/api/git/branches/switch",{name:A}),l(!1)})}async function T(){await C("fetch",async()=>{await rs("/api/git/fetch",{}),b("Fetched latest branch refs.")})}async function D(A){A.preventDefault();const L=c.trim();if(!L){x("Branch name is required.");return}await C("create",async()=>{await rs("/api/git/branches",{name:L}),h(""),l(!1)})}return u.jsxs("div",{className:"fixed bottom-12 right-4 z-50 flex items-end",children:[a?u.jsxs("div",{"aria-label":"Switch Git branch",className:"mb-11 w-[min(460px,calc(100vw-2rem))] rounded-lg border border-border bg-card shadow-xl",role:"dialog",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border p-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Ac,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"truncate text-sm font-semibold",children:t||"Branches"})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(de,{"aria-label":"Fetch branches",disabled:i||m!==null,onClick:()=>{T()},size:"icon",title:"Fetch branches",type:"button",variant:"ghost",children:u.jsx(Eh,{className:fe(m==="fetch"&&"animate-spin")})}),u.jsx(de,{"aria-label":"Close branch dialog",onClick:()=>l(!1),size:"icon",type:"button",variant:"ghost",children:u.jsx(Js,{})})]})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?u.jsxs(u.Fragment,{children:[u.jsx(j2,{branches:y,busy:m!==null,disabled:i,label:"Local",onSwitch:N}),u.jsx(j2,{branches:w,busy:m!==null,disabled:i,label:"Remote",onSwitch:N})]}):u.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No branches found."})}),u.jsxs("div",{className:"border-t border-border p-3",children:[u.jsxs("form",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",onSubmit:D,children:[u.jsx(ot,{"aria-label":"New branch name",disabled:i||m!==null,onChange:A=>{h(A.target.value),x(null),b(null)},placeholder:"feature/new-work",value:c}),u.jsxs(de,{disabled:i||m!==null,type:"submit",children:[u.jsx(MA,{}),"Create"]})]}),v||g?u.jsx(dt,{className:"mt-3 px-3 py-2 text-xs",variant:v?"destructive":"muted",children:v??g}):null]})]}):null,u.jsxs(de,{className:"h-8 max-w-[260px] gap-2 rounded-md shadow-lg",disabled:i,onClick:()=>l(A=>!A),size:"sm",title:"Switch Git branch",type:"button",variant:"default",children:[u.jsx(Ac,{className:"size-4"}),u.jsx("span",{className:"truncate font-mono text-xs",children:t||"No branch"}),u.jsx(Qs,{className:fe("size-4 transition-transform",a&&"rotate-180")})]})]})}function j2({branches:e,busy:t,disabled:i,label:n,onSwitch:a}){return u.jsxs("section",{children:[u.jsx("div",{className:"border-b border-border bg-muted/60 px-3 py-1.5 text-[11px] font-semibold uppercase text-muted-foreground",children:n}),e.length?e.map(l=>u.jsxs("button",{className:fe("grid w-full grid-cols-[1fr_auto] items-center gap-2 border-b border-border px-3 py-2 text-left text-sm last:border-b-0 hover:bg-muted",l.current&&"bg-muted/70"),disabled:i||t||l.current,onClick:()=>{a(l.name)},type:"button",children:[u.jsxs("span",{className:"min-w-0",children:[u.jsx("span",{className:"block truncate font-medium",children:l.name}),l.upstream?u.jsxs("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:["tracks ",l.upstream]}):null]}),u.jsx(Ke,{variant:l.current?"success":l.remote?"outline":"secondary",children:l.current?"current":l.remote?"remote":"local"})]},`${l.remote?"remote":"local"}:${l.name}`)):u.jsxs("div",{className:"border-b border-border px-3 py-3 text-sm text-muted-foreground",children:["No ",n.toLowerCase()," branches."]})]})}const pN="nomoreide-theme";function o$(){if(typeof window>"u")return"light";const e=window.localStorage.getItem(pN);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function l$(e){const t=document.documentElement;t.classList.toggle("dark",e==="dark"),t.style.colorScheme=e}function c$(){const[e,t]=E.useState(()=>o$()),i=E.useRef(null);E.useEffect(()=>{l$(e),window.localStorage.setItem(pN,e)},[e]);const n=E.useCallback(()=>{const a=e==="dark"?"light":"dark",l=i.current,c=document;if(!l||!c.startViewTransition||window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(a);return}const h=l.getBoundingClientRect(),m=h.left+h.width/2,f=h.top+h.height/2,g=Math.hypot(Math.max(m,window.innerWidth-m),Math.max(f,window.innerHeight-f));c.startViewTransition(()=>{t(a)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${m}px ${f}px)`,`circle(${g}px at ${m}px ${f}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},[e]);return u.jsx("button",{ref:i,onClick:n,title:e==="dark"?"Switch to light mode":"Switch to dark mode","aria-label":"Toggle theme",className:fe(yE({variant:"outline",size:"sm"}),"px-2"),children:e==="dark"?u.jsx(D4,{}):u.jsx(KA,{})})}function u$(e=!1){return fe("group/sidebar hidden h-full shrink-0 overflow-x-hidden overflow-y-auto border-r border-border bg-card/85 py-5 backdrop-blur transition-[width,padding] duration-200 md:flex md:flex-col",e?"w-64 px-4":"w-16 px-2 hover:w-64 hover:px-4")}function d$(e,t=!1){return fe("relative grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center justify-start gap-0 overflow-hidden rounded-md px-0 text-[15px] font-medium transition-[background-color,color,width] duration-150",t?"w-full":"w-12 group-hover/sidebar:w-full",e?"bg-primary text-primary-foreground hover:bg-primary/90":"hover:bg-muted")}function h$(e=!1,t=!1){return fe("min-w-0 overflow-hidden text-left text-current transition duration-150 whitespace-pre",e?"translate-x-1 opacity-100":"opacity-0 group-hover/sidebar:translate-x-1 group-hover/sidebar:opacity-100",t?"pr-10":"pr-3")}function f$(e=!1){return fe("flex size-12 items-center justify-center text-current transition-transform duration-150 [&_svg]:size-5",e?"translate-x-0":"-translate-x-px group-hover/sidebar:translate-x-0")}function m$({docked:e,onToggleDock:t}){return u.jsxs("div",{className:fe("mt-auto flex h-10 min-w-0 items-center overflow-hidden border-t border-border/60 text-[11px] text-muted-foreground transition-[height,opacity,width] duration-150",e?"w-full justify-start opacity-100":"w-12 justify-center group-hover/sidebar:w-full group-hover/sidebar:justify-start group-hover/sidebar:opacity-100"),children:[u.jsxs("span",{className:fe("flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-pre transition-[opacity,width] duration-150",e?"flex-1 opacity-100":"w-0 flex-none opacity-0 group-hover/sidebar:w-auto group-hover/sidebar:flex-1 group-hover/sidebar:opacity-100"),children:[u.jsx("span",{children:"Made with"}),u.jsx(DA,{"aria-label":"love",className:"size-3 shrink-0 fill-red-500 text-red-500"}),u.jsx("span",{children:"by Robert Wang"}),u.jsx("a",{"aria-label":"Robert Wang on LinkedIn",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-[#0A66C2]",href:"https://www.linkedin.com/in/robert-wang-cs/",rel:"noopener noreferrer",target:"_blank",title:"LinkedIn",children:u.jsx("svg",{"aria-hidden":!0,className:"size-3 fill-current",role:"img",viewBox:"0 0 24 24",children:u.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.063 2.063 0 1 1 0-4.126 2.063 2.063 0 0 1 0 4.126zM7.119 20.452H3.554V9h3.565v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.225 0z"})})})]}),u.jsx("button",{"aria-label":e?"Undock sidebar":"Dock sidebar","aria-pressed":e,className:fe("flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-4",e?"ml-auto bg-muted text-foreground":"group-hover/sidebar:ml-auto"),onClick:t,title:e?"Undock sidebar":"Dock sidebar",type:"button",children:e?u.jsx(e4,{}):u.jsx(i4,{})})]})}function p$({className:e}){return u.jsxs("div",{className:fe("min-w-0",e),children:[u.jsxs("div",{className:"flex items-baseline gap-1.5",children:[u.jsx("div",{className:"text-sm font-semibold",children:"NoMoreIDE"}),u.jsxs("div",{className:"font-mono text-[10px] text-muted-foreground",children:["v","0.1.39"]})]}),u.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:"127.0.0.1 console"})]})}function g$(){const[e,t]=E.useState(()=>window.location.pathname.startsWith("/agent")?"agent":window.location.pathname.startsWith("/errors")?"errors":window.location.pathname.startsWith("/database")?"database":window.location.pathname.startsWith("/terminal")?"terminal":window.location.pathname.startsWith("/git")?"git":"services"),[i,n]=E.useState(null),[a,l]=E.useState(null),[c,h]=E.useState(!0),{error:m,success:f}=qi(),[g,b]=E.useState(()=>window.localStorage.getItem("nomoreide:sidebar-docked")==="true"),v=E.useCallback(async(y={})=>{y.silent||h(!0),l(null);try{n(await SM()),y.notify&&f("Dashboard refreshed.")}catch(w){const C=w instanceof Error?w.message:String(w);l(C),m(C)}finally{h(!1)}},[m,f]);E.useEffect(()=>{v()},[v]),E.useEffect(()=>{function y(){document.visibilityState==="visible"&&v({silent:!0})}const w=window.setInterval(y,5e3);return window.addEventListener("focus",y),document.addEventListener("visibilitychange",y),()=>{window.clearInterval(w),window.removeEventListener("focus",y),document.removeEventListener("visibilitychange",y)}},[e,v]),E.useEffect(()=>{const y=e==="git"?"/git":e==="agent"?"/agent":e==="errors"?"/errors":e==="database"?"/database":e==="terminal"?"/terminal":"/";window.location.pathname!==y&&window.history.pushState(null,"",y)},[e]),E.useEffect(()=>{window.localStorage.setItem("nomoreide:sidebar-docked",String(g))},[g]);const x=E.useMemo(()=>i?Object.values(i.runtime.services).filter(y=>y.state==="running").length:0,[i]);return u.jsxs("div",{className:"h-screen overflow-hidden pb-9",children:[u.jsxs("div",{className:"mx-auto flex h-full max-w-[1500px]",children:[u.jsxs("aside",{className:u$(g),children:[u.jsxs("div",{className:fe("grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center overflow-hidden transition-[width] duration-150",g?"w-full":"w-12 group-hover/sidebar:w-full"),children:[u.jsx("div",{className:"flex size-12 items-center justify-center",children:u.jsx("div",{className:"flex size-9 items-center justify-center overflow-hidden rounded-md bg-primary text-primary-foreground",children:u.jsxs("svg",{"aria-label":"NoMoreIDE",className:"size-6",fill:"none",role:"img",viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M5 17C5 13.69 7.69 11 11 11H25L31 17H53C56.31 17 59 19.69 59 23V53C59 56.31 56.31 59 53 59H11C7.69 59 5 56.31 5 53V17Z",fill:"currentColor"}),u.jsx("path",{d:"M22 31L30 39L22 47",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4.5"}),u.jsx("path",{d:"M36 47H48",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeWidth:"4.5"})]})})}),u.jsx(p$,{className:fe("min-w-0 translate-x-1 overflow-hidden transition-opacity duration-200",g?"opacity-100":"opacity-0 group-hover/sidebar:opacity-100")})]}),u.jsxs("nav",{className:"mt-5 grid flex-1 content-start gap-1",children:[u.jsx(zo,{active:e==="services",badge:x,docked:g,icon:u.jsx(S4,{}),label:"Services",onClick:()=>t("services")}),u.jsx(zo,{active:e==="git",docked:g,icon:u.jsx(Ac,{}),label:"Git Review",onClick:()=>t("git")}),u.jsx(zo,{active:e==="errors",docked:g,icon:u.jsx(pg,{}),label:"Error Inbox",onClick:()=>t("errors")}),u.jsx(zo,{active:e==="database",docked:g,icon:u.jsx(za,{}),label:"Database",onClick:()=>t("database")}),u.jsx(zo,{active:e==="terminal",docked:g,icon:u.jsx(A4,{}),label:"Terminal",onClick:()=>t("terminal")}),u.jsx(zo,{active:e==="agent",docked:g,icon:u.jsx(Tc,{}),label:"Agent",onClick:()=>t("agent")})]}),u.jsx(m$,{docked:g,onToggleDock:()=>b(y=>!y)})]}),u.jsxs("main",{className:"flex h-full min-w-0 flex-1 flex-col px-0 py-0",children:[u.jsxs("header",{className:fe("relative z-40 flex shrink-0 flex-wrap items-center justify-between gap-3 border border-border bg-card/90 px-4 py-3 backdrop-blur","border-x-0 border-t-0 border-b"),children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(n4,{className:"size-4 text-muted-foreground md:hidden"}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:e==="git"?"Git Review":e==="agent"?"Agent":e==="errors"?"Error Inbox":e==="database"?"Database":e==="terminal"?"Terminal":"Services"}),u.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:i?.git.selectedRepository?.name??i?.git.cwd??"Local workspace"})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[a?u.jsx(Ke,{variant:"danger",children:a}):null,i&&e==="git"?u.jsx(i$,{data:i,onRefresh:v}):null,u.jsxs(de,{onClick:()=>{v({notify:!0})},size:"sm",title:"Refresh dashboard",variant:"outline",children:[u.jsx(Eh,{className:fe(c&&"animate-spin")}),"Refresh"]}),u.jsx(c$,{})]})]}),c&&!i?u.jsx(dt,{variant:"muted",children:"Loading NoMoreIDE state..."}):null,u.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[i&&e==="services"?u.jsx(mI,{data:i,onRefresh:v}):null,i&&e==="git"?u.jsx(QF,{data:i}):null,e==="agent"?u.jsx(X7,{}):null,e==="errors"?u.jsx(jj,{}):null,e==="database"?u.jsx(Aj,{}):null,e==="terminal"?u.jsx(_I,{}):null]})]})]}),i&&e==="git"?u.jsx(a$,{branches:i.git.branches,currentBranch:i.git.status?.branch||void 0,disabled:!i.git.status,onRefresh:v}):null,u.jsx(fj,{onOpenAgentPage:e==="agent"?void 0:()=>t("agent")})]})}function zo({active:e,badge:t,docked:i,icon:n,label:a,onClick:l}){const c=t!==void 0&&t>0;return u.jsxs(de,{"aria-label":a,title:a,className:d$(e,i),variant:"ghost",onClick:l,type:"button",children:[u.jsx("span",{className:f$(i),children:n}),u.jsx("span",{className:h$(i,c),children:a}),t!==void 0&&t>0?u.jsx(Ke,{appearance:t>0?"solid":"outline",className:fe("min-w-6 justify-center px-1.5 font-mono shadow-none",e?"border-primary-foreground/40 bg-primary-foreground/15 text-primary-foreground":t>0?"":"border-border bg-background text-muted-foreground","absolute right-1.5 top-1.5 h-4 min-w-4 rounded-full px-1 text-[10px] leading-none shadow-none group-hover/sidebar:right-2 group-hover/sidebar:top-1/2 group-hover/sidebar:-translate-y-1/2 group-hover/sidebar:text-xs",i&&"right-2 top-1/2 -translate-y-1/2 text-xs"),size:"small",variant:t>0?"success":"outline",children:t}):null]})}B2.createRoot(document.getElementById("root")).render(u.jsx(E.StrictMode,{children:u.jsx(g$,{})}));export{u as j,E as r};
|