@jean2/client 0.7.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/ServerContext-D9RfmQC6.js +1 -0
- package/dist/assets/SessionContent-DAoBLNGO.js +9 -0
- package/dist/assets/SessionMenuButton-B9RQW_iM.css +1 -0
- package/dist/assets/SessionMenuButton-BRiMfAN5.js +9 -0
- package/dist/assets/ThemeProvider-JPllbGvS.js +1 -0
- package/dist/assets/_serverId-Bd-hxE5e.js +2 -0
- package/dist/assets/_serverId-CsnPjy9K.js +12 -0
- package/dist/assets/_serverId-XYC72_6_.js +1 -0
- package/dist/assets/_sessionId-C96NK5UN.js +1 -0
- package/dist/assets/_sessionId-DdW2fnoe.js +1 -0
- package/dist/assets/alert-DeW1kArF.js +31 -0
- package/dist/assets/badge-DUoauaaV.js +45 -0
- package/dist/assets/confirmation-dialog-DeIbHoOu.js +1 -0
- package/dist/assets/core-CblztWA2.js +1 -0
- package/dist/assets/createLucideIcon-BaO6wACO.js +1 -0
- package/dist/assets/dropdown-menu-kSrbs3Xk.js +1 -0
- package/dist/assets/event-qUXFERHS.js +1 -0
- package/dist/assets/index-0foRHKn1.js +10 -0
- package/dist/assets/index-Bv9FJWM6.css +2 -0
- package/dist/assets/jsx-runtime-D-oznMWL.js +1 -0
- package/dist/assets/overview-ZVTPIcDN.js +1 -0
- package/dist/assets/overview-b6wqapV-.js +1 -0
- package/dist/assets/platform-Bn4qAxt4.js +1 -0
- package/dist/assets/popover-DqniPNsl.js +1 -0
- package/dist/assets/preload-helper-CYlqXMwt.js +1 -0
- package/dist/assets/react-DcCgrBX5.js +1 -0
- package/dist/assets/routes-BbfnvJnQ.js +1 -0
- package/dist/assets/scroll-area-DVew28V6.js +1 -0
- package/dist/assets/server-BNi58bIU.js +1 -0
- package/dist/assets/servers-CGl9kUR2.js +1 -0
- package/dist/assets/src-w2G0llvL.js +1 -0
- package/dist/assets/triangle-alert-DxjucLze.js +1 -0
- package/dist/assets/useNavigate-5b_LZg00.js +1 -0
- package/dist/assets/useParams-BODsv_8k.js +1 -0
- package/dist/assets/useRouterState-FezJSBQO.js +1 -0
- package/dist/assets/workspace-B2-0-561.js +1 -0
- package/dist/assets/workspace-BfFnK9TP.js +1 -0
- package/dist/index.html +13 -2
- package/package.json +1 -1
- package/dist/assets/index-D7f1FQwE.js +0 -630
- package/dist/assets/index-DaA31Q4k.css +0 -32
|
@@ -1,630 +0,0 @@
|
|
|
1
|
-
function F4(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(t,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function sf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sm={exports:{}},nc={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var kb;function H4(){if(kb)return nc;kb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,l){var c=null;if(l!==void 0&&(c=""+l),i.key!==void 0&&(c=""+i.key),"key"in i){l={};for(var a in i)a!=="key"&&(l[a]=i[a])}else l=i;return i=l.ref,{$$typeof:t,type:r,key:c,ref:i!==void 0?i:null,props:l}}return nc.Fragment=e,nc.jsx=n,nc.jsxs=n,nc}var Eb;function $4(){return Eb||(Eb=1,sm.exports=H4()),sm.exports}var h=$4(),im={exports:{}},at={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ab;function U4(){if(Ab)return at;Ab=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=g&&P[g]||P["@@iterator"],typeof P=="function"?P:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,y={};function S(P,B,F){this.props=P,this.context=B,this.refs=y,this.updater=F||w}S.prototype.isReactComponent={},S.prototype.setState=function(P,B){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,B,"setState")},S.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function b(){}b.prototype=S.prototype;function _(P,B,F){this.props=P,this.context=B,this.refs=y,this.updater=F||w}var k=_.prototype=new b;k.constructor=_,C(k,S.prototype),k.isPureReactComponent=!0;var j=Array.isArray;function N(){}var D={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function O(P,B,F){var Q=F.ref;return{$$typeof:t,type:P,key:B,ref:Q!==void 0?Q:null,props:F}}function L(P,B){return O(P.type,B,P.props)}function z(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function H(P){var B={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(F){return B[F]})}var $=/\/+/g;function q(P,B){return typeof P=="object"&&P!==null&&P.key!=null?H(""+P.key):B.toString(36)}function G(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(N,N):(P.status="pending",P.then(function(B){P.status==="pending"&&(P.status="fulfilled",P.value=B)},function(B){P.status==="pending"&&(P.status="rejected",P.reason=B)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function W(P,B,F,Q,J){var ee=typeof P;(ee==="undefined"||ee==="boolean")&&(P=null);var K=!1;if(P===null)K=!0;else switch(ee){case"bigint":case"string":case"number":K=!0;break;case"object":switch(P.$$typeof){case t:case e:K=!0;break;case m:return K=P._init,W(K(P._payload),B,F,Q,J)}}if(K)return J=J(P),K=Q===""?"."+q(P,0):Q,j(J)?(F="",K!=null&&(F=K.replace($,"$&/")+"/"),W(J,B,F,"",function(re){return re})):J!=null&&(z(J)&&(J=L(J,F+(J.key==null||P&&P.key===J.key?"":(""+J.key).replace($,"$&/")+"/")+K)),B.push(J)),1;K=0;var V=Q===""?".":Q+":";if(j(P))for(var te=0;te<P.length;te++)Q=P[te],ee=V+q(Q,te),K+=W(Q,B,F,ee,J);else if(te=x(P),typeof te=="function")for(P=te.call(P),te=0;!(Q=P.next()).done;)Q=Q.value,ee=V+q(Q,te++),K+=W(Q,B,F,ee,J);else if(ee==="object"){if(typeof P.then=="function")return W(G(P),B,F,Q,J);throw B=String(P),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return K}function X(P,B,F){if(P==null)return P;var Q=[],J=0;return W(P,Q,"","",function(ee){return B.call(F,ee,J++)}),Q}function Y(P){if(P._status===-1){var B=P._result;B=B(),B.then(function(F){(P._status===0||P._status===-1)&&(P._status=1,P._result=F)},function(F){(P._status===0||P._status===-1)&&(P._status=2,P._result=F)}),P._status===-1&&(P._status=0,P._result=B)}if(P._status===1)return P._result.default;throw P._result}var I=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},M={map:X,forEach:function(P,B,F){X(P,function(){B.apply(this,arguments)},F)},count:function(P){var B=0;return X(P,function(){B++}),B},toArray:function(P){return X(P,function(B){return B})||[]},only:function(P){if(!z(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return at.Activity=p,at.Children=M,at.Component=S,at.Fragment=n,at.Profiler=i,at.PureComponent=_,at.StrictMode=r,at.Suspense=u,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,at.__COMPILER_RUNTIME={__proto__:null,c:function(P){return D.H.useMemoCache(P)}},at.cache=function(P){return function(){return P.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(P,B,F){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var Q=C({},P.props),J=P.key;if(B!=null)for(ee in B.key!==void 0&&(J=""+B.key),B)!E.call(B,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&B.ref===void 0||(Q[ee]=B[ee]);var ee=arguments.length-2;if(ee===1)Q.children=F;else if(1<ee){for(var K=Array(ee),V=0;V<ee;V++)K[V]=arguments[V+2];Q.children=K}return O(P.type,J,Q)},at.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:l,_context:P},P},at.createElement=function(P,B,F){var Q,J={},ee=null;if(B!=null)for(Q in B.key!==void 0&&(ee=""+B.key),B)E.call(B,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(J[Q]=B[Q]);var K=arguments.length-2;if(K===1)J.children=F;else if(1<K){for(var V=Array(K),te=0;te<K;te++)V[te]=arguments[te+2];J.children=V}if(P&&P.defaultProps)for(Q in K=P.defaultProps,K)J[Q]===void 0&&(J[Q]=K[Q]);return O(P,ee,J)},at.createRef=function(){return{current:null}},at.forwardRef=function(P){return{$$typeof:a,render:P}},at.isValidElement=z,at.lazy=function(P){return{$$typeof:m,_payload:{_status:-1,_result:P},_init:Y}},at.memo=function(P,B){return{$$typeof:d,type:P,compare:B===void 0?null:B}},at.startTransition=function(P){var B=D.T,F={};D.T=F;try{var Q=P(),J=D.S;J!==null&&J(F,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(N,I)}catch(ee){I(ee)}finally{B!==null&&F.types!==null&&(B.types=F.types),D.T=B}},at.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},at.use=function(P){return D.H.use(P)},at.useActionState=function(P,B,F){return D.H.useActionState(P,B,F)},at.useCallback=function(P,B){return D.H.useCallback(P,B)},at.useContext=function(P){return D.H.useContext(P)},at.useDebugValue=function(){},at.useDeferredValue=function(P,B){return D.H.useDeferredValue(P,B)},at.useEffect=function(P,B){return D.H.useEffect(P,B)},at.useEffectEvent=function(P){return D.H.useEffectEvent(P)},at.useId=function(){return D.H.useId()},at.useImperativeHandle=function(P,B,F){return D.H.useImperativeHandle(P,B,F)},at.useInsertionEffect=function(P,B){return D.H.useInsertionEffect(P,B)},at.useLayoutEffect=function(P,B){return D.H.useLayoutEffect(P,B)},at.useMemo=function(P,B){return D.H.useMemo(P,B)},at.useOptimistic=function(P,B){return D.H.useOptimistic(P,B)},at.useReducer=function(P,B,F){return D.H.useReducer(P,B,F)},at.useRef=function(P){return D.H.useRef(P)},at.useState=function(P){return D.H.useState(P)},at.useSyncExternalStore=function(P,B,F){return D.H.useSyncExternalStore(P,B,F)},at.useTransition=function(){return D.H.useTransition()},at.version="19.2.4",at}var Nb;function of(){return Nb||(Nb=1,im.exports=U4()),im.exports}var R=of();const In=sf(R),dS=F4({__proto__:null,default:In},[R]);var om={exports:{}},rc={},am={exports:{}},lm={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Rb;function V4(){return Rb||(Rb=1,(function(t){function e(W,X){var Y=W.length;W.push(X);e:for(;0<Y;){var I=Y-1>>>1,M=W[I];if(0<i(M,X))W[I]=X,W[Y]=M,Y=I;else break e}}function n(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var X=W[0],Y=W.pop();if(Y!==X){W[0]=Y;e:for(var I=0,M=W.length,P=M>>>1;I<P;){var B=2*(I+1)-1,F=W[B],Q=B+1,J=W[Q];if(0>i(F,Y))Q<M&&0>i(J,F)?(W[I]=J,W[Q]=Y,I=Q):(W[I]=F,W[B]=Y,I=B);else if(Q<M&&0>i(J,Y))W[I]=J,W[Q]=Y,I=Q;else break e}}return X}function i(W,X){var Y=W.sortIndex-X.sortIndex;return Y!==0?Y:W.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var c=Date,a=c.now();t.unstable_now=function(){return c.now()-a}}var u=[],d=[],m=1,p=null,g=3,x=!1,w=!1,C=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function k(W){for(var X=n(d);X!==null;){if(X.callback===null)r(d);else if(X.startTime<=W)r(d),X.sortIndex=X.expirationTime,e(u,X);else break;X=n(d)}}function j(W){if(C=!1,k(W),!w)if(n(u)!==null)w=!0,N||(N=!0,H());else{var X=n(d);X!==null&&G(j,X.startTime-W)}}var N=!1,D=-1,E=5,O=-1;function L(){return y?!0:!(t.unstable_now()-O<E)}function z(){if(y=!1,N){var W=t.unstable_now();O=W;var X=!0;try{e:{w=!1,C&&(C=!1,b(D),D=-1),x=!0;var Y=g;try{t:{for(k(W),p=n(u);p!==null&&!(p.expirationTime>W&&L());){var I=p.callback;if(typeof I=="function"){p.callback=null,g=p.priorityLevel;var M=I(p.expirationTime<=W);if(W=t.unstable_now(),typeof M=="function"){p.callback=M,k(W),X=!0;break t}p===n(u)&&r(u),k(W)}else r(u);p=n(u)}if(p!==null)X=!0;else{var P=n(d);P!==null&&G(j,P.startTime-W),X=!1}}break e}finally{p=null,g=Y,x=!1}X=void 0}}finally{X?H():N=!1}}}var H;if(typeof _=="function")H=function(){_(z)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,q=$.port2;$.port1.onmessage=z,H=function(){q.postMessage(null)}}else H=function(){S(z,0)};function G(W,X){D=S(function(){W(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(W){W.callback=null},t.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<W?Math.floor(1e3/W):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(W){switch(g){case 1:case 2:case 3:var X=3;break;default:X=g}var Y=g;g=X;try{return W()}finally{g=Y}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(W,X){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Y=g;g=W;try{return X()}finally{g=Y}},t.unstable_scheduleCallback=function(W,X,Y){var I=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?I+Y:I):Y=I,W){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=Y+M,W={id:m++,callback:X,priorityLevel:W,startTime:Y,expirationTime:M,sortIndex:-1},Y>I?(W.sortIndex=Y,e(d,W),n(u)===null&&W===n(d)&&(C?(b(D),D=-1):C=!0,G(j,Y-I))):(W.sortIndex=M,e(u,W),w||x||(w=!0,N||(N=!0,H()))),W},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(W){var X=g;return function(){var Y=g;g=X;try{return W.apply(this,arguments)}finally{g=Y}}}})(lm)),lm}var jb;function q4(){return jb||(jb=1,am.exports=V4()),am.exports}var cm={exports:{}},$n={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Tb;function W4(){if(Tb)return $n;Tb=1;var t=of();function e(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(u,d,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:u,containerInfo:d,implementation:m}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return $n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$n.createPortal=function(u,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return l(u,d,null,m)},$n.flushSync=function(u){var d=c.T,m=r.p;try{if(c.T=null,r.p=2,u)return u()}finally{c.T=d,r.p=m,r.d.f()}},$n.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},$n.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},$n.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var m=d.as,p=a(m,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:x}):m==="script"&&r.d.X(u,{crossOrigin:p,integrity:g,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},$n.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=a(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},$n.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,p=a(m,d.crossOrigin);r.d.L(u,m,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},$n.preloadModule=function(u,d){if(typeof u=="string")if(d){var m=a(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},$n.requestFormReset=function(u){r.d.r(u)},$n.unstable_batchedUpdates=function(u,d){return u(d)},$n.useFormState=function(u,d,m){return c.H.useFormState(u,d,m)},$n.useFormStatus=function(){return c.H.useHostTransitionStatus()},$n.version="19.2.4",$n}var Db;function fS(){if(Db)return cm.exports;Db=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),cm.exports=W4(),cm.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var Mb;function G4(){if(Mb)return rc;Mb=1;var t=q4(),e=of(),n=fS();function r(s){var o="https://react.dev/errors/"+s;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+s+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function l(s){var o=s,f=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,(o.flags&4098)!==0&&(f=o.return),s=o.return;while(s)}return o.tag===3?f:null}function c(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function a(s){if(s.tag===31){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function u(s){if(l(s)!==s)throw Error(r(188))}function d(s){var o=s.alternate;if(!o){if(o=l(s),o===null)throw Error(r(188));return o!==s?null:s}for(var f=s,v=o;;){var A=f.return;if(A===null)break;var T=A.alternate;if(T===null){if(v=A.return,v!==null){f=v;continue}break}if(A.child===T.child){for(T=A.child;T;){if(T===f)return u(A),s;if(T===v)return u(A),o;T=T.sibling}throw Error(r(188))}if(f.return!==v.return)f=A,v=T;else{for(var U=!1,Z=A.child;Z;){if(Z===f){U=!0,f=A,v=T;break}if(Z===v){U=!0,v=A,f=T;break}Z=Z.sibling}if(!U){for(Z=T.child;Z;){if(Z===f){U=!0,f=T,v=A;break}if(Z===v){U=!0,v=T,f=A;break}Z=Z.sibling}if(!U)throw Error(r(189))}}if(f.alternate!==v)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?s:o}function m(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s;for(s=s.child;s!==null;){if(o=m(s),o!==null)return o;s=s.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),_=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function H(s){return s===null||typeof s!="object"?null:(s=z&&s[z]||s["@@iterator"],typeof s=="function"?s:null)}var $=Symbol.for("react.client.reference");function q(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===$?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case C:return"Fragment";case S:return"Profiler";case y:return"StrictMode";case j:return"Suspense";case N:return"SuspenseList";case O:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case _:return s.displayName||"Context";case b:return(s._context.displayName||"Context")+".Consumer";case k:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return o=s.displayName||null,o!==null?o:q(s.type)||"Memo";case E:o=s._payload,s=s._init;try{return q(s(o))}catch{}}return null}var G=Array.isArray,W=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},I=[],M=-1;function P(s){return{current:s}}function B(s){0>M||(s.current=I[M],I[M]=null,M--)}function F(s,o){M++,I[M]=s.current,s.current=o}var Q=P(null),J=P(null),ee=P(null),K=P(null);function V(s,o){switch(F(ee,o),F(J,s),F(Q,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?Ky(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=Ky(o),s=Yy(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}B(Q),F(Q,s)}function te(){B(Q),B(J),B(ee)}function re(s){s.memoizedState!==null&&F(K,s);var o=Q.current,f=Yy(o,s.type);o!==f&&(F(J,s),F(Q,f))}function ae(s){J.current===s&&(B(Q),B(J)),K.current===s&&(B(K),Zl._currentValue=Y)}var se,Se;function Ae(s){if(se===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);se=o&&o[1]||"",Se=-1<f.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+se+s+Se}var De=!1;function Ue(s,o){if(!s||De)return"";De=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(o){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(ye){var pe=ye}Reflect.construct(s,[],Ce)}else{try{Ce.call()}catch(ye){pe=ye}s.call(Ce.prototype)}}else{try{throw Error()}catch(ye){pe=ye}(Ce=s())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(ye){if(ye&&pe&&typeof ye.stack=="string")return[ye.stack,pe.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var A=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");A&&A.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=v.DetermineComponentFrameRoot(),U=T[0],Z=T[1];if(U&&Z){var ne=U.split(`
|
|
44
|
-
`),fe=Z.split(`
|
|
45
|
-
`);for(A=v=0;v<ne.length&&!ne[v].includes("DetermineComponentFrameRoot");)v++;for(;A<fe.length&&!fe[A].includes("DetermineComponentFrameRoot");)A++;if(v===ne.length||A===fe.length)for(v=ne.length-1,A=fe.length-1;1<=v&&0<=A&&ne[v]!==fe[A];)A--;for(;1<=v&&0<=A;v--,A--)if(ne[v]!==fe[A]){if(v!==1||A!==1)do if(v--,A--,0>A||ne[v]!==fe[A]){var _e=`
|
|
46
|
-
`+ne[v].replace(" at new "," at ");return s.displayName&&_e.includes("<anonymous>")&&(_e=_e.replace("<anonymous>",s.displayName)),_e}while(1<=v&&0<=A);break}}}finally{De=!1,Error.prepareStackTrace=f}return(f=s?s.displayName||s.name:"")?Ae(f):""}function ce(s,o){switch(s.tag){case 26:case 27:case 5:return Ae(s.type);case 16:return Ae("Lazy");case 13:return s.child!==o&&o!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return Ue(s.type,!1);case 11:return Ue(s.type.render,!1);case 1:return Ue(s.type,!0);case 31:return Ae("Activity");default:return""}}function je(s){try{var o="",f=null;do o+=ce(s,f),f=s,s=s.return;while(s);return o}catch(v){return`
|
|
47
|
-
Error generating stack: `+v.message+`
|
|
48
|
-
`+v.stack}}var xe=Object.prototype.hasOwnProperty,Ve=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,it=t.unstable_shouldYield,ge=t.unstable_requestPaint,Re=t.unstable_now,be=t.unstable_getCurrentPriorityLevel,oe=t.unstable_ImmediatePriority,me=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Fe=t.unstable_IdlePriority,Ge=t.log,Ze=t.unstable_setDisableYieldValue,lt=null,ze=null;function qe(s){if(typeof Ge=="function"&&Ze(s),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(lt,s)}catch{}}var Pe=Math.clz32?Math.clz32:mn,nt=Math.log,kt=Math.LN2;function mn(s){return s>>>=0,s===0?32:31-(nt(s)/kt|0)|0}var gn=256,Zt=262144,rn=4194304;function Jt(s){var o=s&42;if(o!==0)return o;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 ve(s,o,f){var v=s.pendingLanes;if(v===0)return 0;var A=0,T=s.suspendedLanes,U=s.pingedLanes;s=s.warmLanes;var Z=v&134217727;return Z!==0?(v=Z&~T,v!==0?A=Jt(v):(U&=Z,U!==0?A=Jt(U):f||(f=Z&~s,f!==0&&(A=Jt(f))))):(Z=v&~T,Z!==0?A=Jt(Z):U!==0?A=Jt(U):f||(f=v&~s,f!==0&&(A=Jt(f)))),A===0?0:o!==0&&o!==A&&(o&T)===0&&(T=A&-A,f=o&-o,T>=f||T===32&&(f&4194048)!==0)?o:A}function He(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function et(s,o){switch(s){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Me(){var s=rn;return rn<<=1,(rn&62914560)===0&&(rn=4194304),s}function Oe(s){for(var o=[],f=0;31>f;f++)o.push(s);return o}function ot(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Tt(s,o,f,v,A,T){var U=s.pendingLanes;s.pendingLanes=f,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=f,s.entangledLanes&=f,s.errorRecoveryDisabledLanes&=f,s.shellSuspendCounter=0;var Z=s.entanglements,ne=s.expirationTimes,fe=s.hiddenUpdates;for(f=U&~f;0<f;){var _e=31-Pe(f),Ce=1<<_e;Z[_e]=0,ne[_e]=-1;var pe=fe[_e];if(pe!==null)for(fe[_e]=null,_e=0;_e<pe.length;_e++){var ye=pe[_e];ye!==null&&(ye.lane&=-536870913)}f&=~Ce}v!==0&&Gt(s,v,0),T!==0&&A===0&&s.tag!==0&&(s.suspendedLanes|=T&~(U&~o))}function Gt(s,o,f){s.pendingLanes|=o,s.suspendedLanes&=~o;var v=31-Pe(o);s.entangledLanes|=o,s.entanglements[v]=s.entanglements[v]|1073741824|f&261930}function Kt(s,o){var f=s.entangledLanes|=o;for(s=s.entanglements;f;){var v=31-Pe(f),A=1<<v;A&o|s[v]&o&&(s[v]|=o),f&=~A}}function lr(s,o){var f=o&-o;return f=(f&42)!==0?1:An(f),(f&(s.suspendedLanes|o))!==0?0:f}function An(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 vn(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Nn(){var s=X.p;return s!==0?s:(s=window.event,s===void 0?32:yb(s.type))}function Rn(s,o){var f=X.p;try{return X.p=s,o()}finally{X.p=f}}var Mt=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Mt,Dt="__reactProps$"+Mt,jn="__reactContainer$"+Mt,bs="__reactEvents$"+Mt,Zs="__reactListeners$"+Mt,Js="__reactHandles$"+Mt,xs="__reactResources$"+Mt,kr="__reactMarker$"+Mt;function Er(s){delete s[Nt],delete s[Dt],delete s[bs],delete s[Zs],delete s[Js]}function Bn(s){var o=s[Nt];if(o)return o;for(var f=s.parentNode;f;){if(o=f[jn]||f[Nt]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(s=nb(s);s!==null;){if(f=s[Nt])return f;s=nb(s)}return o}s=f,f=s.parentNode}return null}function Wn(s){if(s=s[Nt]||s[jn]){var o=s.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return s}return null}function Gn(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s.stateNode;throw Error(r(33))}function wn(s){var o=s[xs];return o||(o=s[xs]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function en(s){s[kr]=!0}var Ur=new Set,_s={};function Zn(s,o){cr(s,o),cr(s+"Capture",o)}function cr(s,o){for(_s[s]=o,s=0;s<o.length;s++)Ur.add(o[s])}var rs=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]*$"),Jn={},ur={};function ul(s){return xe.call(ur,s)?!0:xe.call(Jn,s)?!1:rs.test(s)?ur[s]=!0:(Jn[s]=!0,!1)}function dr(s,o,f){if(ul(o))if(f===null)s.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":s.removeAttribute(o);return;case"boolean":var v=o.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){s.removeAttribute(o);return}}s.setAttribute(o,""+f)}}function Ar(s,o,f){if(f===null)s.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttribute(o,""+f)}}function yn(s,o,f,v){if(v===null)s.removeAttribute(f);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(f);return}s.setAttributeNS(o,f,""+v)}}function Tn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Vr(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Qc(s,o,f){var v=Object.getOwnPropertyDescriptor(s.constructor.prototype,o);if(!s.hasOwnProperty(o)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var A=v.get,T=v.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return A.call(this)},set:function(U){f=""+U,T.call(this,U)}}),Object.defineProperty(s,o,{enumerable:v.enumerable}),{getValue:function(){return f},setValue:function(U){f=""+U},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function qo(s){if(!s._valueTracker){var o=Vr(s)?"checked":"value";s._valueTracker=Qc(s,o,""+s[o])}}function dl(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var f=o.getValue(),v="";return s&&(v=Vr(s)?s.checked?"true":"false":s.value),s=v,s!==f?(o.setValue(s),!0):!1}function Ss(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 Zc=/[\n"\\]/g;function Fn(s){return s.replace(Zc,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Wo(s,o,f,v,A,T,U,Z){s.name="",U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?s.type=U:s.removeAttribute("type"),o!=null?U==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+Tn(o)):s.value!==""+Tn(o)&&(s.value=""+Tn(o)):U!=="submit"&&U!=="reset"||s.removeAttribute("value"),o!=null?Yt(s,U,Tn(o)):f!=null?Yt(s,U,Tn(f)):v!=null&&s.removeAttribute("value"),A==null&&T!=null&&(s.defaultChecked=!!T),A!=null&&(s.checked=A&&typeof A!="function"&&typeof A!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?s.name=""+Tn(Z):s.removeAttribute("name")}function Jc(s,o,f,v,A,T,U,Z){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.type=T),o!=null||f!=null){if(!(T!=="submit"&&T!=="reset"||o!=null)){qo(s);return}f=f!=null?""+Tn(f):"",o=o!=null?""+Tn(o):f,Z||o===s.value||(s.value=o),s.defaultValue=o}v=v!=null?v:A,v=typeof v!="function"&&typeof v!="symbol"&&!!v,s.checked=Z?s.checked:!!v,s.defaultChecked=!!v,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(s.name=U),qo(s)}function Yt(s,o,f){o==="number"&&Ss(s.ownerDocument)===s||s.defaultValue===""+f||(s.defaultValue=""+f)}function It(s,o,f,v){if(s=s.options,o){o={};for(var A=0;A<f.length;A++)o["$"+f[A]]=!0;for(f=0;f<s.length;f++)A=o.hasOwnProperty("$"+s[f].value),s[f].selected!==A&&(s[f].selected=A),A&&v&&(s[f].defaultSelected=!0)}else{for(f=""+Tn(f),o=null,A=0;A<s.length;A++){if(s[A].value===f){s[A].selected=!0,v&&(s[A].defaultSelected=!0);return}o!==null||s[A].disabled||(o=s[A])}o!==null&&(o.selected=!0)}}function Ji(s,o,f){if(o!=null&&(o=""+Tn(o),o!==s.value&&(s.value=o),f==null)){s.defaultValue!==o&&(s.defaultValue=o);return}s.defaultValue=f!=null?""+Tn(f):""}function Go(s,o,f,v){if(o==null){if(v!=null){if(f!=null)throw Error(r(92));if(G(v)){if(1<v.length)throw Error(r(93));v=v[0]}f=v}f==null&&(f=""),o=f}f=Tn(o),s.defaultValue=f,v=s.textContent,v===f&&v!==""&&v!==null&&(s.value=v),qo(s)}function ei(s,o){if(o){var f=s.firstChild;if(f&&f===s.lastChild&&f.nodeType===3){f.nodeValue=o;return}}s.textContent=o}var nh=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 ti(s,o,f){var v=o.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?v?s.setProperty(o,""):o==="float"?s.cssFloat="":s[o]="":v?s.setProperty(o,f):typeof f!="number"||f===0||nh.has(o)?o==="float"?s.cssFloat=f:s[o]=(""+f).trim():s[o]=f+"px"}function eu(s,o,f){if(o!=null&&typeof o!="object")throw Error(r(62));if(s=s.style,f!=null){for(var v in f)!f.hasOwnProperty(v)||o!=null&&o.hasOwnProperty(v)||(v.indexOf("--")===0?s.setProperty(v,""):v==="float"?s.cssFloat="":s[v]="");for(var A in o)v=o[A],o.hasOwnProperty(A)&&f[A]!==v&&ti(s,A,v)}else for(var T in o)o.hasOwnProperty(T)&&ti(s,T,o[T])}function ni(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 ri=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"]]),rh=/^[\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 eo(s){return rh.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function qr(){}var fl=null;function hl(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var si=null,ii=null;function oi(s){var o=Wn(s);if(o&&(s=o.stateNode)){var f=s[Dt]||null;e:switch(s=o.stateNode,o.type){case"input":if(Wo(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),o=f.name,f.type==="radio"&&o!=null){for(f=s;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Fn(""+o)+'"][type="radio"]'),o=0;o<f.length;o++){var v=f[o];if(v!==s&&v.form===s.form){var A=v[Dt]||null;if(!A)throw Error(r(90));Wo(v,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name)}}for(o=0;o<f.length;o++)v=f[o],v.form===s.form&&dl(v)}break e;case"textarea":Ji(s,f.value,f.defaultValue);break e;case"select":o=f.value,o!=null&&It(s,!!f.multiple,o,!1)}}}var Ko=!1;function to(s,o,f){if(Ko)return s(o,f);Ko=!0;try{var v=s(o);return v}finally{if(Ko=!1,(si!==null||ii!==null)&&(qu(),si&&(o=si,s=ii,ii=si=null,oi(o),s)))for(o=0;o<s.length;o++)oi(s[o])}}function ai(s,o){var f=s.stateNode;if(f===null)return null;var v=f[Dt]||null;if(v===null)return null;f=v[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(s=s.type,v=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!v;break e;default:s=!1}if(s)return null;if(f&&typeof f!="function")throw Error(r(231,o,typeof f));return f}var Nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yo=!1;if(Nr)try{var no={};Object.defineProperty(no,"passive",{get:function(){Yo=!0}}),window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{Yo=!1}var ss=null,pl=null,ro=null;function tu(){if(ro)return ro;var s,o=pl,f=o.length,v,A="value"in ss?ss.value:ss.textContent,T=A.length;for(s=0;s<f&&o[s]===A[s];s++);var U=f-s;for(v=1;v<=U&&o[f-v]===A[T-v];v++);return ro=A.slice(s,1<v?1-v:void 0)}function Xo(s){var o=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&o===13&&(s=13)):s=o,s===10&&(s=13),32<=s||s===13?s:0}function Qo(){return!0}function nu(){return!1}function Hn(s){function o(f,v,A,T,U){this._reactName=f,this._targetInst=A,this.type=v,this.nativeEvent=T,this.target=U,this.currentTarget=null;for(var Z in s)s.hasOwnProperty(Z)&&(f=s[Z],this[Z]=f?f(T):T[Z]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Qo:nu,this.isPropagationStopped=nu,this}return p(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Qo)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),o}var ws={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},so=Hn(ws),io=p({},ws,{view:0,detail:0}),sh=Hn(io),ml,gl,oo,Zo=p({},io,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ft,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!==oo&&(oo&&s.type==="mousemove"?(ml=s.screenX-oo.screenX,gl=s.screenY-oo.screenY):gl=ml=0,oo=s),ml)},movementY:function(s){return"movementY"in s?s.movementY:gl}}),ru=Hn(Zo),ih=p({},Zo,{dataTransfer:0}),oh=Hn(ih),ah=p({},io,{relatedTarget:0}),Jo=Hn(ah),lh=p({},ws,{animationName:0,elapsedTime:0,pseudoElement:0}),su=Hn(lh),ch=p({},ws,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),li=Hn(ch),iu=p({},ws,{data:0}),vl=Hn(iu),ou={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},au={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"},lu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function de(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=lu[s])?!!o[s]:!1}function ft(){return de}var Ht=p({},io,{key:function(s){if(s.key){var o=ou[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=Xo(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?au[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ft,charCode:function(s){return s.type==="keypress"?Xo(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Xo(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),_t=Hn(Ht),nn=p({},Zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),St=Hn(nn),Rt=p({},io,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ft}),ao=Hn(Rt),yl=p({},ws,{propertyName:0,elapsedTime:0,pseudoElement:0}),lo=Hn(yl),cu=p({},Zo,{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}),i3=Hn(cu),o3=p({},ws,{newState:0,oldState:0}),a3=Hn(o3),l3=[9,13,27,32],uh=Nr&&"CompositionEvent"in window,bl=null;Nr&&"documentMode"in document&&(bl=document.documentMode);var c3=Nr&&"TextEvent"in window&&!bl,e1=Nr&&(!uh||bl&&8<bl&&11>=bl),t1=" ",n1=!1;function r1(s,o){switch(s){case"keyup":return l3.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function s1(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ea=!1;function u3(s,o){switch(s){case"compositionend":return s1(o);case"keypress":return o.which!==32?null:(n1=!0,t1);case"textInput":return s=o.data,s===t1&&n1?null:s;default:return null}}function d3(s,o){if(ea)return s==="compositionend"||!uh&&r1(s,o)?(s=tu(),ro=pl=ss=null,ea=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return e1&&o.locale!=="ko"?null:o.data;default:return null}}var f3={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 i1(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!f3[s.type]:o==="textarea"}function o1(s,o,f,v){si?ii?ii.push(v):ii=[v]:si=v,o=Zu(o,"onChange"),0<o.length&&(f=new so("onChange","change",null,f,v),s.push({event:f,listeners:o}))}var xl=null,_l=null;function h3(s){$y(s,0)}function uu(s){var o=Gn(s);if(dl(o))return s}function a1(s,o){if(s==="change")return o}var l1=!1;if(Nr){var dh;if(Nr){var fh="oninput"in document;if(!fh){var c1=document.createElement("div");c1.setAttribute("oninput","return;"),fh=typeof c1.oninput=="function"}dh=fh}else dh=!1;l1=dh&&(!document.documentMode||9<document.documentMode)}function u1(){xl&&(xl.detachEvent("onpropertychange",d1),_l=xl=null)}function d1(s){if(s.propertyName==="value"&&uu(_l)){var o=[];o1(o,_l,s,hl(s)),to(h3,o)}}function p3(s,o,f){s==="focusin"?(u1(),xl=o,_l=f,xl.attachEvent("onpropertychange",d1)):s==="focusout"&&u1()}function m3(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return uu(_l)}function g3(s,o){if(s==="click")return uu(o)}function v3(s,o){if(s==="input"||s==="change")return uu(o)}function y3(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var fr=typeof Object.is=="function"?Object.is:y3;function Sl(s,o){if(fr(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var f=Object.keys(s),v=Object.keys(o);if(f.length!==v.length)return!1;for(v=0;v<f.length;v++){var A=f[v];if(!xe.call(o,A)||!fr(s[A],o[A]))return!1}return!0}function f1(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function h1(s,o){var f=f1(s);s=0;for(var v;f;){if(f.nodeType===3){if(v=s+f.textContent.length,s<=o&&v>=o)return{node:f,offset:o-s};s=v}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=f1(f)}}function p1(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?p1(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function m1(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=Ss(s.document);o instanceof s.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)s=o.contentWindow;else break;o=Ss(s.document)}return o}function hh(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var b3=Nr&&"documentMode"in document&&11>=document.documentMode,ta=null,ph=null,wl=null,mh=!1;function g1(s,o,f){var v=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;mh||ta==null||ta!==Ss(v)||(v=ta,"selectionStart"in v&&hh(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),wl&&Sl(wl,v)||(wl=v,v=Zu(ph,"onSelect"),0<v.length&&(o=new so("onSelect","select",null,o,f),s.push({event:o,listeners:v}),o.target=ta)))}function co(s,o){var f={};return f[s.toLowerCase()]=o.toLowerCase(),f["Webkit"+s]="webkit"+o,f["Moz"+s]="moz"+o,f}var na={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionrun:co("Transition","TransitionRun"),transitionstart:co("Transition","TransitionStart"),transitioncancel:co("Transition","TransitionCancel"),transitionend:co("Transition","TransitionEnd")},gh={},v1={};Nr&&(v1=document.createElement("div").style,"AnimationEvent"in window||(delete na.animationend.animation,delete na.animationiteration.animation,delete na.animationstart.animation),"TransitionEvent"in window||delete na.transitionend.transition);function uo(s){if(gh[s])return gh[s];if(!na[s])return s;var o=na[s],f;for(f in o)if(o.hasOwnProperty(f)&&f in v1)return gh[s]=o[f];return s}var y1=uo("animationend"),b1=uo("animationiteration"),x1=uo("animationstart"),x3=uo("transitionrun"),_3=uo("transitionstart"),S3=uo("transitioncancel"),_1=uo("transitionend"),S1=new Map,vh="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(" ");vh.push("scrollEnd");function Wr(s,o){S1.set(s,o),Zn(o,[s])}var du=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=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(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Rr=[],ra=0,yh=0;function fu(){for(var s=ra,o=yh=ra=0;o<s;){var f=Rr[o];Rr[o++]=null;var v=Rr[o];Rr[o++]=null;var A=Rr[o];Rr[o++]=null;var T=Rr[o];if(Rr[o++]=null,v!==null&&A!==null){var U=v.pending;U===null?A.next=A:(A.next=U.next,U.next=A),v.pending=A}T!==0&&w1(f,A,T)}}function hu(s,o,f,v){Rr[ra++]=s,Rr[ra++]=o,Rr[ra++]=f,Rr[ra++]=v,yh|=v,s.lanes|=v,s=s.alternate,s!==null&&(s.lanes|=v)}function bh(s,o,f,v){return hu(s,o,f,v),pu(s)}function fo(s,o){return hu(s,null,null,o),pu(s)}function w1(s,o,f){s.lanes|=f;var v=s.alternate;v!==null&&(v.lanes|=f);for(var A=!1,T=s.return;T!==null;)T.childLanes|=f,v=T.alternate,v!==null&&(v.childLanes|=f),T.tag===22&&(s=T.stateNode,s===null||s._visibility&1||(A=!0)),s=T,T=T.return;return s.tag===3?(T=s.stateNode,A&&o!==null&&(A=31-Pe(f),s=T.hiddenUpdates,v=s[A],v===null?s[A]=[o]:v.push(o),o.lane=f|536870912),T):null}function pu(s){if(50<ql)throw ql=0,Np=null,Error(r(185));for(var o=s.return;o!==null;)s=o,o=s.return;return s.tag===3?s.stateNode:null}var sa={};function w3(s,o,f,v){this.tag=s,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hr(s,o,f,v){return new w3(s,o,f,v)}function xh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Cs(s,o){var f=s.alternate;return f===null?(f=hr(s.tag,o,s.key,s.mode),f.elementType=s.elementType,f.type=s.type,f.stateNode=s.stateNode,f.alternate=s,s.alternate=f):(f.pendingProps=o,f.type=s.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=s.flags&65011712,f.childLanes=s.childLanes,f.lanes=s.lanes,f.child=s.child,f.memoizedProps=s.memoizedProps,f.memoizedState=s.memoizedState,f.updateQueue=s.updateQueue,o=s.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=s.sibling,f.index=s.index,f.ref=s.ref,f.refCleanup=s.refCleanup,f}function C1(s,o){s.flags&=65011714;var f=s.alternate;return f===null?(s.childLanes=0,s.lanes=o,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=f.childLanes,s.lanes=f.lanes,s.child=f.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=f.memoizedProps,s.memoizedState=f.memoizedState,s.updateQueue=f.updateQueue,s.type=f.type,o=f.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),s}function mu(s,o,f,v,A,T){var U=0;if(v=s,typeof s=="function")xh(s)&&(U=1);else if(typeof s=="string")U=N4(s,f,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case O:return s=hr(31,f,o,A),s.elementType=O,s.lanes=T,s;case C:return ho(f.children,A,T,o);case y:U=8,A|=24;break;case S:return s=hr(12,f,o,A|2),s.elementType=S,s.lanes=T,s;case j:return s=hr(13,f,o,A),s.elementType=j,s.lanes=T,s;case N:return s=hr(19,f,o,A),s.elementType=N,s.lanes=T,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:U=10;break e;case b:U=9;break e;case k:U=11;break e;case D:U=14;break e;case E:U=16,v=null;break e}U=29,f=Error(r(130,s===null?"null":typeof s,"")),v=null}return o=hr(U,f,o,A),o.elementType=s,o.type=v,o.lanes=T,o}function ho(s,o,f,v){return s=hr(7,s,v,o),s.lanes=f,s}function _h(s,o,f){return s=hr(6,s,null,o),s.lanes=f,s}function k1(s){var o=hr(18,null,null,0);return o.stateNode=s,o}function Sh(s,o,f){return o=hr(4,s.children!==null?s.children:[],s.key,o),o.lanes=f,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}var E1=new WeakMap;function jr(s,o){if(typeof s=="object"&&s!==null){var f=E1.get(s);return f!==void 0?f:(o={value:s,source:o,stack:je(o)},E1.set(s,o),o)}return{value:s,source:o,stack:je(o)}}var ia=[],oa=0,gu=null,Cl=0,Tr=[],Dr=0,ci=null,is=1,os="";function ks(s,o){ia[oa++]=Cl,ia[oa++]=gu,gu=s,Cl=o}function A1(s,o,f){Tr[Dr++]=is,Tr[Dr++]=os,Tr[Dr++]=ci,ci=s;var v=is;s=os;var A=32-Pe(v)-1;v&=~(1<<A),f+=1;var T=32-Pe(o)+A;if(30<T){var U=A-A%5;T=(v&(1<<U)-1).toString(32),v>>=U,A-=U,is=1<<32-Pe(o)+A|f<<A|v,os=T+s}else is=1<<T|f<<A|v,os=s}function wh(s){s.return!==null&&(ks(s,1),A1(s,1,0))}function Ch(s){for(;s===gu;)gu=ia[--oa],ia[oa]=null,Cl=ia[--oa],ia[oa]=null;for(;s===ci;)ci=Tr[--Dr],Tr[Dr]=null,os=Tr[--Dr],Tr[Dr]=null,is=Tr[--Dr],Tr[Dr]=null}function N1(s,o){Tr[Dr++]=is,Tr[Dr++]=os,Tr[Dr++]=ci,is=o.id,os=o.overflow,ci=s}var Dn=null,Xt=null,wt=!1,ui=null,Mr=!1,kh=Error(r(519));function di(s){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kl(jr(o,s)),kh}function R1(s){var o=s.stateNode,f=s.type,v=s.memoizedProps;switch(o[Nt]=s,o[Dt]=v,f){case"dialog":gt("cancel",o),gt("close",o);break;case"iframe":case"object":case"embed":gt("load",o);break;case"video":case"audio":for(f=0;f<Gl.length;f++)gt(Gl[f],o);break;case"source":gt("error",o);break;case"img":case"image":case"link":gt("error",o),gt("load",o);break;case"details":gt("toggle",o);break;case"input":gt("invalid",o),Jc(o,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0);break;case"select":gt("invalid",o);break;case"textarea":gt("invalid",o),Go(o,v.value,v.defaultValue,v.children)}f=v.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||o.textContent===""+f||v.suppressHydrationWarning===!0||Wy(o.textContent,f)?(v.popover!=null&&(gt("beforetoggle",o),gt("toggle",o)),v.onScroll!=null&>("scroll",o),v.onScrollEnd!=null&>("scrollend",o),v.onClick!=null&&(o.onclick=qr),o=!0):o=!1,o||di(s,!0)}function j1(s){for(Dn=s.return;Dn;)switch(Dn.tag){case 5:case 31:case 13:Mr=!1;return;case 27:case 3:Mr=!0;return;default:Dn=Dn.return}}function aa(s){if(s!==Dn)return!1;if(!wt)return j1(s),wt=!0,!1;var o=s.tag,f;if((f=o!==3&&o!==27)&&((f=o===5)&&(f=s.type,f=!(f!=="form"&&f!=="button")||Up(s.type,s.memoizedProps)),f=!f),f&&Xt&&di(s),j1(s),o===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Xt=tb(s)}else if(o===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Xt=tb(s)}else o===27?(o=Xt,ki(s.type)?(s=Kp,Kp=null,Xt=s):Xt=o):Xt=Dn?Lr(s.stateNode.nextSibling):null;return!0}function po(){Xt=Dn=null,wt=!1}function Eh(){var s=ui;return s!==null&&(rr===null?rr=s:rr.push.apply(rr,s),ui=null),s}function kl(s){ui===null?ui=[s]:ui.push(s)}var Ah=P(null),mo=null,Es=null;function fi(s,o,f){F(Ah,o._currentValue),o._currentValue=f}function As(s){s._currentValue=Ah.current,B(Ah)}function Nh(s,o,f){for(;s!==null;){var v=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,v!==null&&(v.childLanes|=o)):v!==null&&(v.childLanes&o)!==o&&(v.childLanes|=o),s===f)break;s=s.return}}function Rh(s,o,f,v){var A=s.child;for(A!==null&&(A.return=s);A!==null;){var T=A.dependencies;if(T!==null){var U=A.child;T=T.firstContext;e:for(;T!==null;){var Z=T;T=A;for(var ne=0;ne<o.length;ne++)if(Z.context===o[ne]){T.lanes|=f,Z=T.alternate,Z!==null&&(Z.lanes|=f),Nh(T.return,f,s),v||(U=null);break e}T=Z.next}}else if(A.tag===18){if(U=A.return,U===null)throw Error(r(341));U.lanes|=f,T=U.alternate,T!==null&&(T.lanes|=f),Nh(U,f,s),U=null}else U=A.child;if(U!==null)U.return=A;else for(U=A;U!==null;){if(U===s){U=null;break}if(A=U.sibling,A!==null){A.return=U.return,U=A;break}U=U.return}A=U}}function la(s,o,f,v){s=null;for(var A=o,T=!1;A!==null;){if(!T){if((A.flags&524288)!==0)T=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var U=A.alternate;if(U===null)throw Error(r(387));if(U=U.memoizedProps,U!==null){var Z=A.type;fr(A.pendingProps.value,U.value)||(s!==null?s.push(Z):s=[Z])}}else if(A===K.current){if(U=A.alternate,U===null)throw Error(r(387));U.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(s!==null?s.push(Zl):s=[Zl])}A=A.return}s!==null&&Rh(o,s,f,v),o.flags|=262144}function vu(s){for(s=s.firstContext;s!==null;){if(!fr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function go(s){mo=s,Es=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Mn(s){return T1(mo,s)}function yu(s,o){return mo===null&&go(s),T1(s,o)}function T1(s,o){var f=o._currentValue;if(o={context:o,memoizedValue:f,next:null},Es===null){if(s===null)throw Error(r(308));Es=o,s.dependencies={lanes:0,firstContext:o},s.flags|=524288}else Es=Es.next=o;return f}var C3=typeof AbortController<"u"?AbortController:function(){var s=[],o=this.signal={aborted:!1,addEventListener:function(f,v){s.push(v)}};this.abort=function(){o.aborted=!0,s.forEach(function(f){return f()})}},k3=t.unstable_scheduleCallback,E3=t.unstable_NormalPriority,un={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jh(){return{controller:new C3,data:new Map,refCount:0}}function El(s){s.refCount--,s.refCount===0&&k3(E3,function(){s.controller.abort()})}var Al=null,Th=0,ca=0,ua=null;function A3(s,o){if(Al===null){var f=Al=[];Th=0,ca=Op(),ua={status:"pending",value:void 0,then:function(v){f.push(v)}}}return Th++,o.then(D1,D1),o}function D1(){if(--Th===0&&Al!==null){ua!==null&&(ua.status="fulfilled");var s=Al;Al=null,ca=0,ua=null;for(var o=0;o<s.length;o++)(0,s[o])()}}function N3(s,o){var f=[],v={status:"pending",value:null,reason:null,then:function(A){f.push(A)}};return s.then(function(){v.status="fulfilled",v.value=o;for(var A=0;A<f.length;A++)(0,f[A])(o)},function(A){for(v.status="rejected",v.reason=A,A=0;A<f.length;A++)(0,f[A])(void 0)}),v}var M1=W.S;W.S=function(s,o){gy=Re(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&A3(s,o),M1!==null&&M1(s,o)};var vo=P(null);function Dh(){var s=vo.current;return s!==null?s:$t.pooledCache}function bu(s,o){o===null?F(vo,vo.current):F(vo,o.pool)}function O1(){var s=Dh();return s===null?null:{parent:un._currentValue,pool:s}}var da=Error(r(460)),Mh=Error(r(474)),xu=Error(r(542)),_u={then:function(){}};function L1(s){return s=s.status,s==="fulfilled"||s==="rejected"}function I1(s,o,f){switch(f=s[f],f===void 0?s.push(o):f!==o&&(o.then(qr,qr),o=f),o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,z1(s),s;default:if(typeof o.status=="string")o.then(qr,qr);else{if(s=$t,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=o,s.status="pending",s.then(function(v){if(o.status==="pending"){var A=o;A.status="fulfilled",A.value=v}},function(v){if(o.status==="pending"){var A=o;A.status="rejected",A.reason=v}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,z1(s),s}throw bo=o,da}}function yo(s){try{var o=s._init;return o(s._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(bo=f,da):f}}var bo=null;function P1(){if(bo===null)throw Error(r(459));var s=bo;return bo=null,s}function z1(s){if(s===da||s===xu)throw Error(r(483))}var fa=null,Nl=0;function Su(s){var o=Nl;return Nl+=1,fa===null&&(fa=[]),I1(fa,s,o)}function Rl(s,o){o=o.props.ref,s.ref=o!==void 0?o:null}function wu(s,o){throw o.$$typeof===g?Error(r(525)):(s=Object.prototype.toString.call(o),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s)))}function B1(s){function o(le,ie){if(s){var ue=le.deletions;ue===null?(le.deletions=[ie],le.flags|=16):ue.push(ie)}}function f(le,ie){if(!s)return null;for(;ie!==null;)o(le,ie),ie=ie.sibling;return null}function v(le){for(var ie=new Map;le!==null;)le.key!==null?ie.set(le.key,le):ie.set(le.index,le),le=le.sibling;return ie}function A(le,ie){return le=Cs(le,ie),le.index=0,le.sibling=null,le}function T(le,ie,ue){return le.index=ue,s?(ue=le.alternate,ue!==null?(ue=ue.index,ue<ie?(le.flags|=67108866,ie):ue):(le.flags|=67108866,ie)):(le.flags|=1048576,ie)}function U(le){return s&&le.alternate===null&&(le.flags|=67108866),le}function Z(le,ie,ue,we){return ie===null||ie.tag!==6?(ie=_h(ue,le.mode,we),ie.return=le,ie):(ie=A(ie,ue),ie.return=le,ie)}function ne(le,ie,ue,we){var tt=ue.type;return tt===C?_e(le,ie,ue.props.children,we,ue.key):ie!==null&&(ie.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===E&&yo(tt)===ie.type)?(ie=A(ie,ue.props),Rl(ie,ue),ie.return=le,ie):(ie=mu(ue.type,ue.key,ue.props,null,le.mode,we),Rl(ie,ue),ie.return=le,ie)}function fe(le,ie,ue,we){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==ue.containerInfo||ie.stateNode.implementation!==ue.implementation?(ie=Sh(ue,le.mode,we),ie.return=le,ie):(ie=A(ie,ue.children||[]),ie.return=le,ie)}function _e(le,ie,ue,we,tt){return ie===null||ie.tag!==7?(ie=ho(ue,le.mode,we,tt),ie.return=le,ie):(ie=A(ie,ue),ie.return=le,ie)}function Ce(le,ie,ue){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=_h(""+ie,le.mode,ue),ie.return=le,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return ue=mu(ie.type,ie.key,ie.props,null,le.mode,ue),Rl(ue,ie),ue.return=le,ue;case w:return ie=Sh(ie,le.mode,ue),ie.return=le,ie;case E:return ie=yo(ie),Ce(le,ie,ue)}if(G(ie)||H(ie))return ie=ho(ie,le.mode,ue,null),ie.return=le,ie;if(typeof ie.then=="function")return Ce(le,Su(ie),ue);if(ie.$$typeof===_)return Ce(le,yu(le,ie),ue);wu(le,ie)}return null}function pe(le,ie,ue,we){var tt=ie!==null?ie.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return tt!==null?null:Z(le,ie,""+ue,we);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return ue.key===tt?ne(le,ie,ue,we):null;case w:return ue.key===tt?fe(le,ie,ue,we):null;case E:return ue=yo(ue),pe(le,ie,ue,we)}if(G(ue)||H(ue))return tt!==null?null:_e(le,ie,ue,we,null);if(typeof ue.then=="function")return pe(le,ie,Su(ue),we);if(ue.$$typeof===_)return pe(le,ie,yu(le,ue),we);wu(le,ue)}return null}function ye(le,ie,ue,we,tt){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return le=le.get(ue)||null,Z(ie,le,""+we,tt);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case x:return le=le.get(we.key===null?ue:we.key)||null,ne(ie,le,we,tt);case w:return le=le.get(we.key===null?ue:we.key)||null,fe(ie,le,we,tt);case E:return we=yo(we),ye(le,ie,ue,we,tt)}if(G(we)||H(we))return le=le.get(ue)||null,_e(ie,le,we,tt,null);if(typeof we.then=="function")return ye(le,ie,ue,Su(we),tt);if(we.$$typeof===_)return ye(le,ie,ue,yu(ie,we),tt);wu(ie,we)}return null}function Ke(le,ie,ue,we){for(var tt=null,Et=null,Je=ie,ut=ie=0,bt=null;Je!==null&&ut<ue.length;ut++){Je.index>ut?(bt=Je,Je=null):bt=Je.sibling;var At=pe(le,Je,ue[ut],we);if(At===null){Je===null&&(Je=bt);break}s&&Je&&At.alternate===null&&o(le,Je),ie=T(At,ie,ut),Et===null?tt=At:Et.sibling=At,Et=At,Je=bt}if(ut===ue.length)return f(le,Je),wt&&ks(le,ut),tt;if(Je===null){for(;ut<ue.length;ut++)Je=Ce(le,ue[ut],we),Je!==null&&(ie=T(Je,ie,ut),Et===null?tt=Je:Et.sibling=Je,Et=Je);return wt&&ks(le,ut),tt}for(Je=v(Je);ut<ue.length;ut++)bt=ye(Je,le,ut,ue[ut],we),bt!==null&&(s&&bt.alternate!==null&&Je.delete(bt.key===null?ut:bt.key),ie=T(bt,ie,ut),Et===null?tt=bt:Et.sibling=bt,Et=bt);return s&&Je.forEach(function(ji){return o(le,ji)}),wt&&ks(le,ut),tt}function st(le,ie,ue,we){if(ue==null)throw Error(r(151));for(var tt=null,Et=null,Je=ie,ut=ie=0,bt=null,At=ue.next();Je!==null&&!At.done;ut++,At=ue.next()){Je.index>ut?(bt=Je,Je=null):bt=Je.sibling;var ji=pe(le,Je,At.value,we);if(ji===null){Je===null&&(Je=bt);break}s&&Je&&ji.alternate===null&&o(le,Je),ie=T(ji,ie,ut),Et===null?tt=ji:Et.sibling=ji,Et=ji,Je=bt}if(At.done)return f(le,Je),wt&&ks(le,ut),tt;if(Je===null){for(;!At.done;ut++,At=ue.next())At=Ce(le,At.value,we),At!==null&&(ie=T(At,ie,ut),Et===null?tt=At:Et.sibling=At,Et=At);return wt&&ks(le,ut),tt}for(Je=v(Je);!At.done;ut++,At=ue.next())At=ye(Je,le,ut,At.value,we),At!==null&&(s&&At.alternate!==null&&Je.delete(At.key===null?ut:At.key),ie=T(At,ie,ut),Et===null?tt=At:Et.sibling=At,Et=At);return s&&Je.forEach(function(B4){return o(le,B4)}),wt&&ks(le,ut),tt}function Bt(le,ie,ue,we){if(typeof ue=="object"&&ue!==null&&ue.type===C&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:e:{for(var tt=ue.key;ie!==null;){if(ie.key===tt){if(tt=ue.type,tt===C){if(ie.tag===7){f(le,ie.sibling),we=A(ie,ue.props.children),we.return=le,le=we;break e}}else if(ie.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===E&&yo(tt)===ie.type){f(le,ie.sibling),we=A(ie,ue.props),Rl(we,ue),we.return=le,le=we;break e}f(le,ie);break}else o(le,ie);ie=ie.sibling}ue.type===C?(we=ho(ue.props.children,le.mode,we,ue.key),we.return=le,le=we):(we=mu(ue.type,ue.key,ue.props,null,le.mode,we),Rl(we,ue),we.return=le,le=we)}return U(le);case w:e:{for(tt=ue.key;ie!==null;){if(ie.key===tt)if(ie.tag===4&&ie.stateNode.containerInfo===ue.containerInfo&&ie.stateNode.implementation===ue.implementation){f(le,ie.sibling),we=A(ie,ue.children||[]),we.return=le,le=we;break e}else{f(le,ie);break}else o(le,ie);ie=ie.sibling}we=Sh(ue,le.mode,we),we.return=le,le=we}return U(le);case E:return ue=yo(ue),Bt(le,ie,ue,we)}if(G(ue))return Ke(le,ie,ue,we);if(H(ue)){if(tt=H(ue),typeof tt!="function")throw Error(r(150));return ue=tt.call(ue),st(le,ie,ue,we)}if(typeof ue.then=="function")return Bt(le,ie,Su(ue),we);if(ue.$$typeof===_)return Bt(le,ie,yu(le,ue),we);wu(le,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ie!==null&&ie.tag===6?(f(le,ie.sibling),we=A(ie,ue),we.return=le,le=we):(f(le,ie),we=_h(ue,le.mode,we),we.return=le,le=we),U(le)):f(le,ie)}return function(le,ie,ue,we){try{Nl=0;var tt=Bt(le,ie,ue,we);return fa=null,tt}catch(Je){if(Je===da||Je===xu)throw Je;var Et=hr(29,Je,null,le.mode);return Et.lanes=we,Et.return=le,Et}finally{}}}var xo=B1(!0),F1=B1(!1),hi=!1;function Oh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lh(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function pi(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function mi(s,o,f){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(jt&2)!==0){var A=v.pending;return A===null?o.next=o:(o.next=A.next,A.next=o),v.pending=o,o=pu(s),w1(s,null,f),o}return hu(s,v,o,f),pu(s)}function jl(s,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194048)!==0)){var v=o.lanes;v&=s.pendingLanes,f|=v,o.lanes=f,Kt(s,f)}}function Ih(s,o){var f=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,f===v)){var A=null,T=null;if(f=f.firstBaseUpdate,f!==null){do{var U={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};T===null?A=T=U:T=T.next=U,f=f.next}while(f!==null);T===null?A=T=o:T=T.next=o}else A=T=o;f={baseState:v.baseState,firstBaseUpdate:A,lastBaseUpdate:T,shared:v.shared,callbacks:v.callbacks},s.updateQueue=f;return}s=f.lastBaseUpdate,s===null?f.firstBaseUpdate=o:s.next=o,f.lastBaseUpdate=o}var Ph=!1;function Tl(){if(Ph){var s=ua;if(s!==null)throw s}}function Dl(s,o,f,v){Ph=!1;var A=s.updateQueue;hi=!1;var T=A.firstBaseUpdate,U=A.lastBaseUpdate,Z=A.shared.pending;if(Z!==null){A.shared.pending=null;var ne=Z,fe=ne.next;ne.next=null,U===null?T=fe:U.next=fe,U=ne;var _e=s.alternate;_e!==null&&(_e=_e.updateQueue,Z=_e.lastBaseUpdate,Z!==U&&(Z===null?_e.firstBaseUpdate=fe:Z.next=fe,_e.lastBaseUpdate=ne))}if(T!==null){var Ce=A.baseState;U=0,_e=fe=ne=null,Z=T;do{var pe=Z.lane&-536870913,ye=pe!==Z.lane;if(ye?(yt&pe)===pe:(v&pe)===pe){pe!==0&&pe===ca&&(Ph=!0),_e!==null&&(_e=_e.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var Ke=s,st=Z;pe=o;var Bt=f;switch(st.tag){case 1:if(Ke=st.payload,typeof Ke=="function"){Ce=Ke.call(Bt,Ce,pe);break e}Ce=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=st.payload,pe=typeof Ke=="function"?Ke.call(Bt,Ce,pe):Ke,pe==null)break e;Ce=p({},Ce,pe);break e;case 2:hi=!0}}pe=Z.callback,pe!==null&&(s.flags|=64,ye&&(s.flags|=8192),ye=A.callbacks,ye===null?A.callbacks=[pe]:ye.push(pe))}else ye={lane:pe,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},_e===null?(fe=_e=ye,ne=Ce):_e=_e.next=ye,U|=pe;if(Z=Z.next,Z===null){if(Z=A.shared.pending,Z===null)break;ye=Z,Z=ye.next,ye.next=null,A.lastBaseUpdate=ye,A.shared.pending=null}}while(!0);_e===null&&(ne=Ce),A.baseState=ne,A.firstBaseUpdate=fe,A.lastBaseUpdate=_e,T===null&&(A.shared.lanes=0),xi|=U,s.lanes=U,s.memoizedState=Ce}}function H1(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function $1(s,o){var f=s.callbacks;if(f!==null)for(s.callbacks=null,s=0;s<f.length;s++)H1(f[s],o)}var ha=P(null),Cu=P(0);function U1(s,o){s=Is,F(Cu,s),F(ha,o),Is=s|o.baseLanes}function zh(){F(Cu,Is),F(ha,ha.current)}function Bh(){Is=Cu.current,B(ha),B(Cu)}var pr=P(null),Or=null;function gi(s){var o=s.alternate;F(ln,ln.current&1),F(pr,s),Or===null&&(o===null||ha.current!==null||o.memoizedState!==null)&&(Or=s)}function Fh(s){F(ln,ln.current),F(pr,s),Or===null&&(Or=s)}function V1(s){s.tag===22?(F(ln,ln.current),F(pr,s),Or===null&&(Or=s)):vi()}function vi(){F(ln,ln.current),F(pr,pr.current)}function mr(s){B(pr),Or===s&&(Or=null),B(ln)}var ln=P(0);function ku(s){for(var o=s;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||Wp(f)||Gp(f)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Ns=0,ct=null,Pt=null,dn=null,Eu=!1,pa=!1,_o=!1,Au=0,Ml=0,ma=null,R3=0;function sn(){throw Error(r(321))}function Hh(s,o){if(o===null)return!1;for(var f=0;f<o.length&&f<s.length;f++)if(!fr(s[f],o[f]))return!1;return!0}function $h(s,o,f,v,A,T){return Ns=T,ct=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,W.H=s===null||s.memoizedState===null?A0:rp,_o=!1,T=f(v,A),_o=!1,pa&&(T=W1(o,f,v,A)),q1(s),T}function q1(s){W.H=Il;var o=Pt!==null&&Pt.next!==null;if(Ns=0,dn=Pt=ct=null,Eu=!1,Ml=0,ma=null,o)throw Error(r(300));s===null||fn||(s=s.dependencies,s!==null&&vu(s)&&(fn=!0))}function W1(s,o,f,v){ct=s;var A=0;do{if(pa&&(ma=null),Ml=0,pa=!1,25<=A)throw Error(r(301));if(A+=1,dn=Pt=null,s.updateQueue!=null){var T=s.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}W.H=N0,T=o(f,v)}while(pa);return T}function j3(){var s=W.H,o=s.useState()[0];return o=typeof o.then=="function"?Ol(o):o,s=s.useState()[0],(Pt!==null?Pt.memoizedState:null)!==s&&(ct.flags|=1024),o}function Uh(){var s=Au!==0;return Au=0,s}function Vh(s,o,f){o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~f}function qh(s){if(Eu){for(s=s.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}Eu=!1}Ns=0,dn=Pt=ct=null,pa=!1,Ml=Au=0,ma=null}function Kn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?ct.memoizedState=dn=s:dn=dn.next=s,dn}function cn(){if(Pt===null){var s=ct.alternate;s=s!==null?s.memoizedState:null}else s=Pt.next;var o=dn===null?ct.memoizedState:dn.next;if(o!==null)dn=o,Pt=s;else{if(s===null)throw ct.alternate===null?Error(r(467)):Error(r(310));Pt=s,s={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},dn===null?ct.memoizedState=dn=s:dn=dn.next=s}return dn}function Nu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ol(s){var o=Ml;return Ml+=1,ma===null&&(ma=[]),s=I1(ma,s,o),o=ct,(dn===null?o.memoizedState:dn.next)===null&&(o=o.alternate,W.H=o===null||o.memoizedState===null?A0:rp),s}function Ru(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Ol(s);if(s.$$typeof===_)return Mn(s)}throw Error(r(438,String(s)))}function Wh(s){var o=null,f=ct.updateQueue;if(f!==null&&(o=f.memoCache),o==null){var v=ct.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(o={data:v.data.map(function(A){return A.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),f===null&&(f=Nu(),ct.updateQueue=f),f.memoCache=o,f=o.data[o.index],f===void 0)for(f=o.data[o.index]=Array(s),v=0;v<s;v++)f[v]=L;return o.index++,f}function Rs(s,o){return typeof o=="function"?o(s):o}function ju(s){var o=cn();return Gh(o,Pt,s)}function Gh(s,o,f){var v=s.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=f;var A=s.baseQueue,T=v.pending;if(T!==null){if(A!==null){var U=A.next;A.next=T.next,T.next=U}o.baseQueue=A=T,v.pending=null}if(T=s.baseState,A===null)s.memoizedState=T;else{o=A.next;var Z=U=null,ne=null,fe=o,_e=!1;do{var Ce=fe.lane&-536870913;if(Ce!==fe.lane?(yt&Ce)===Ce:(Ns&Ce)===Ce){var pe=fe.revertLane;if(pe===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ce===ca&&(_e=!0);else if((Ns&pe)===pe){fe=fe.next,pe===ca&&(_e=!0);continue}else Ce={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},ne===null?(Z=ne=Ce,U=T):ne=ne.next=Ce,ct.lanes|=pe,xi|=pe;Ce=fe.action,_o&&f(T,Ce),T=fe.hasEagerState?fe.eagerState:f(T,Ce)}else pe={lane:Ce,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},ne===null?(Z=ne=pe,U=T):ne=ne.next=pe,ct.lanes|=Ce,xi|=Ce;fe=fe.next}while(fe!==null&&fe!==o);if(ne===null?U=T:ne.next=Z,!fr(T,s.memoizedState)&&(fn=!0,_e&&(f=ua,f!==null)))throw f;s.memoizedState=T,s.baseState=U,s.baseQueue=ne,v.lastRenderedState=T}return A===null&&(v.lanes=0),[s.memoizedState,v.dispatch]}function Kh(s){var o=cn(),f=o.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=s;var v=f.dispatch,A=f.pending,T=o.memoizedState;if(A!==null){f.pending=null;var U=A=A.next;do T=s(T,U.action),U=U.next;while(U!==A);fr(T,o.memoizedState)||(fn=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),f.lastRenderedState=T}return[T,v]}function G1(s,o,f){var v=ct,A=cn(),T=wt;if(T){if(f===void 0)throw Error(r(407));f=f()}else f=o();var U=!fr((Pt||A).memoizedState,f);if(U&&(A.memoizedState=f,fn=!0),A=A.queue,Qh(X1.bind(null,v,A,s),[s]),A.getSnapshot!==o||U||dn!==null&&dn.memoizedState.tag&1){if(v.flags|=2048,ga(9,{destroy:void 0},Y1.bind(null,v,A,f,o),null),$t===null)throw Error(r(349));T||(Ns&127)!==0||K1(v,o,f)}return f}function K1(s,o,f){s.flags|=16384,s={getSnapshot:o,value:f},o=ct.updateQueue,o===null?(o=Nu(),ct.updateQueue=o,o.stores=[s]):(f=o.stores,f===null?o.stores=[s]:f.push(s))}function Y1(s,o,f,v){o.value=f,o.getSnapshot=v,Q1(o)&&Z1(s)}function X1(s,o,f){return f(function(){Q1(o)&&Z1(s)})}function Q1(s){var o=s.getSnapshot;s=s.value;try{var f=o();return!fr(s,f)}catch{return!0}}function Z1(s){var o=fo(s,2);o!==null&&sr(o,s,2)}function Yh(s){var o=Kn();if(typeof s=="function"){var f=s;if(s=f(),_o){qe(!0);try{f()}finally{qe(!1)}}}return o.memoizedState=o.baseState=s,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:s},o}function J1(s,o,f,v){return s.baseState=f,Gh(s,Pt,typeof v=="function"?v:Rs)}function T3(s,o,f,v,A){if(Mu(s))throw Error(r(485));if(s=o.action,s!==null){var T={payload:A,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){T.listeners.push(U)}};W.T!==null?f(!0):T.isTransition=!1,v(T),f=o.pending,f===null?(T.next=o.pending=T,e0(o,T)):(T.next=f.next,o.pending=f.next=T)}}function e0(s,o){var f=o.action,v=o.payload,A=s.state;if(o.isTransition){var T=W.T,U={};W.T=U;try{var Z=f(A,v),ne=W.S;ne!==null&&ne(U,Z),t0(s,o,Z)}catch(fe){Xh(s,o,fe)}finally{T!==null&&U.types!==null&&(T.types=U.types),W.T=T}}else try{T=f(A,v),t0(s,o,T)}catch(fe){Xh(s,o,fe)}}function t0(s,o,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(v){n0(s,o,v)},function(v){return Xh(s,o,v)}):n0(s,o,f)}function n0(s,o,f){o.status="fulfilled",o.value=f,r0(o),s.state=f,o=s.pending,o!==null&&(f=o.next,f===o?s.pending=null:(f=f.next,o.next=f,e0(s,f)))}function Xh(s,o,f){var v=s.pending;if(s.pending=null,v!==null){v=v.next;do o.status="rejected",o.reason=f,r0(o),o=o.next;while(o!==v)}s.action=null}function r0(s){s=s.listeners;for(var o=0;o<s.length;o++)(0,s[o])()}function s0(s,o){return o}function i0(s,o){if(wt){var f=$t.formState;if(f!==null){e:{var v=ct;if(wt){if(Xt){t:{for(var A=Xt,T=Mr;A.nodeType!==8;){if(!T){A=null;break t}if(A=Lr(A.nextSibling),A===null){A=null;break t}}T=A.data,A=T==="F!"||T==="F"?A:null}if(A){Xt=Lr(A.nextSibling),v=A.data==="F!";break e}}di(v)}v=!1}v&&(o=f[0])}}return f=Kn(),f.memoizedState=f.baseState=o,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s0,lastRenderedState:o},f.queue=v,f=C0.bind(null,ct,v),v.dispatch=f,v=Yh(!1),T=np.bind(null,ct,!1,v.queue),v=Kn(),A={state:o,dispatch:null,action:s,pending:null},v.queue=A,f=T3.bind(null,ct,A,T,f),A.dispatch=f,v.memoizedState=s,[o,f,!1]}function o0(s){var o=cn();return a0(o,Pt,s)}function a0(s,o,f){if(o=Gh(s,o,s0)[0],s=ju(Rs)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var v=Ol(o)}catch(U){throw U===da?xu:U}else v=o;o=cn();var A=o.queue,T=A.dispatch;return f!==o.memoizedState&&(ct.flags|=2048,ga(9,{destroy:void 0},D3.bind(null,A,f),null)),[v,T,s]}function D3(s,o){s.action=o}function l0(s){var o=cn(),f=Pt;if(f!==null)return a0(o,f,s);cn(),o=o.memoizedState,f=cn();var v=f.queue.dispatch;return f.memoizedState=s,[o,v,!1]}function ga(s,o,f,v){return s={tag:s,create:f,deps:v,inst:o,next:null},o=ct.updateQueue,o===null&&(o=Nu(),ct.updateQueue=o),f=o.lastEffect,f===null?o.lastEffect=s.next=s:(v=f.next,f.next=s,s.next=v,o.lastEffect=s),s}function c0(){return cn().memoizedState}function Tu(s,o,f,v){var A=Kn();ct.flags|=s,A.memoizedState=ga(1|o,{destroy:void 0},f,v===void 0?null:v)}function Du(s,o,f,v){var A=cn();v=v===void 0?null:v;var T=A.memoizedState.inst;Pt!==null&&v!==null&&Hh(v,Pt.memoizedState.deps)?A.memoizedState=ga(o,T,f,v):(ct.flags|=s,A.memoizedState=ga(1|o,T,f,v))}function u0(s,o){Tu(8390656,8,s,o)}function Qh(s,o){Du(2048,8,s,o)}function M3(s){ct.flags|=4;var o=ct.updateQueue;if(o===null)o=Nu(),ct.updateQueue=o,o.events=[s];else{var f=o.events;f===null?o.events=[s]:f.push(s)}}function d0(s){var o=cn().memoizedState;return M3({ref:o,nextImpl:s}),function(){if((jt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function f0(s,o){return Du(4,2,s,o)}function h0(s,o){return Du(4,4,s,o)}function p0(s,o){if(typeof o=="function"){s=s();var f=o(s);return function(){typeof f=="function"?f():o(null)}}if(o!=null)return s=s(),o.current=s,function(){o.current=null}}function m0(s,o,f){f=f!=null?f.concat([s]):null,Du(4,4,p0.bind(null,o,s),f)}function Zh(){}function g0(s,o){var f=cn();o=o===void 0?null:o;var v=f.memoizedState;return o!==null&&Hh(o,v[1])?v[0]:(f.memoizedState=[s,o],s)}function v0(s,o){var f=cn();o=o===void 0?null:o;var v=f.memoizedState;if(o!==null&&Hh(o,v[1]))return v[0];if(v=s(),_o){qe(!0);try{s()}finally{qe(!1)}}return f.memoizedState=[v,o],v}function Jh(s,o,f){return f===void 0||(Ns&1073741824)!==0&&(yt&261930)===0?s.memoizedState=o:(s.memoizedState=f,s=yy(),ct.lanes|=s,xi|=s,f)}function y0(s,o,f,v){return fr(f,o)?f:ha.current!==null?(s=Jh(s,f,v),fr(s,o)||(fn=!0),s):(Ns&42)===0||(Ns&1073741824)!==0&&(yt&261930)===0?(fn=!0,s.memoizedState=f):(s=yy(),ct.lanes|=s,xi|=s,o)}function b0(s,o,f,v,A){var T=X.p;X.p=T!==0&&8>T?T:8;var U=W.T,Z={};W.T=Z,np(s,!1,o,f);try{var ne=A(),fe=W.S;if(fe!==null&&fe(Z,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var _e=N3(ne,v);Ll(s,o,_e,yr(s))}else Ll(s,o,v,yr(s))}catch(Ce){Ll(s,o,{then:function(){},status:"rejected",reason:Ce},yr())}finally{X.p=T,U!==null&&Z.types!==null&&(U.types=Z.types),W.T=U}}function O3(){}function ep(s,o,f,v){if(s.tag!==5)throw Error(r(476));var A=x0(s).queue;b0(s,A,o,Y,f===null?O3:function(){return _0(s),f(v)})}function x0(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:Y},next:null};var f={};return o.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:f},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function _0(s){var o=x0(s);o.next===null&&(o=s.alternate.memoizedState),Ll(s,o.next.queue,{},yr())}function tp(){return Mn(Zl)}function S0(){return cn().memoizedState}function w0(){return cn().memoizedState}function L3(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var f=yr();s=pi(f);var v=mi(o,s,f);v!==null&&(sr(v,o,f),jl(v,o,f)),o={cache:jh()},s.payload=o;return}o=o.return}}function I3(s,o,f){var v=yr();f={lane:v,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Mu(s)?k0(o,f):(f=bh(s,o,f,v),f!==null&&(sr(f,s,v),E0(f,o,v)))}function C0(s,o,f){var v=yr();Ll(s,o,f,v)}function Ll(s,o,f,v){var A={lane:v,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Mu(s))k0(o,A);else{var T=s.alternate;if(s.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var U=o.lastRenderedState,Z=T(U,f);if(A.hasEagerState=!0,A.eagerState=Z,fr(Z,U))return hu(s,o,A,0),$t===null&&fu(),!1}catch{}finally{}if(f=bh(s,o,A,v),f!==null)return sr(f,s,v),E0(f,o,v),!0}return!1}function np(s,o,f,v){if(v={lane:2,revertLane:Op(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Mu(s)){if(o)throw Error(r(479))}else o=bh(s,f,v,2),o!==null&&sr(o,s,2)}function Mu(s){var o=s.alternate;return s===ct||o!==null&&o===ct}function k0(s,o){pa=Eu=!0;var f=s.pending;f===null?o.next=o:(o.next=f.next,f.next=o),s.pending=o}function E0(s,o,f){if((f&4194048)!==0){var v=o.lanes;v&=s.pendingLanes,f|=v,o.lanes=f,Kt(s,f)}}var Il={readContext:Mn,use:Ru,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useLayoutEffect:sn,useInsertionEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useSyncExternalStore:sn,useId:sn,useHostTransitionStatus:sn,useFormState:sn,useActionState:sn,useOptimistic:sn,useMemoCache:sn,useCacheRefresh:sn};Il.useEffectEvent=sn;var A0={readContext:Mn,use:Ru,useCallback:function(s,o){return Kn().memoizedState=[s,o===void 0?null:o],s},useContext:Mn,useEffect:u0,useImperativeHandle:function(s,o,f){f=f!=null?f.concat([s]):null,Tu(4194308,4,p0.bind(null,o,s),f)},useLayoutEffect:function(s,o){return Tu(4194308,4,s,o)},useInsertionEffect:function(s,o){Tu(4,2,s,o)},useMemo:function(s,o){var f=Kn();o=o===void 0?null:o;var v=s();if(_o){qe(!0);try{s()}finally{qe(!1)}}return f.memoizedState=[v,o],v},useReducer:function(s,o,f){var v=Kn();if(f!==void 0){var A=f(o);if(_o){qe(!0);try{f(o)}finally{qe(!1)}}}else A=o;return v.memoizedState=v.baseState=A,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:A},v.queue=s,s=s.dispatch=I3.bind(null,ct,s),[v.memoizedState,s]},useRef:function(s){var o=Kn();return s={current:s},o.memoizedState=s},useState:function(s){s=Yh(s);var o=s.queue,f=C0.bind(null,ct,o);return o.dispatch=f,[s.memoizedState,f]},useDebugValue:Zh,useDeferredValue:function(s,o){var f=Kn();return Jh(f,s,o)},useTransition:function(){var s=Yh(!1);return s=b0.bind(null,ct,s.queue,!0,!1),Kn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,f){var v=ct,A=Kn();if(wt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=o(),$t===null)throw Error(r(349));(yt&127)!==0||K1(v,o,f)}A.memoizedState=f;var T={value:f,getSnapshot:o};return A.queue=T,u0(X1.bind(null,v,T,s),[s]),v.flags|=2048,ga(9,{destroy:void 0},Y1.bind(null,v,T,f,o),null),f},useId:function(){var s=Kn(),o=$t.identifierPrefix;if(wt){var f=os,v=is;f=(v&~(1<<32-Pe(v)-1)).toString(32)+f,o="_"+o+"R_"+f,f=Au++,0<f&&(o+="H"+f.toString(32)),o+="_"}else f=R3++,o="_"+o+"r_"+f.toString(32)+"_";return s.memoizedState=o},useHostTransitionStatus:tp,useFormState:i0,useActionState:i0,useOptimistic:function(s){var o=Kn();o.memoizedState=o.baseState=s;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=f,o=np.bind(null,ct,!0,f),f.dispatch=o,[s,o]},useMemoCache:Wh,useCacheRefresh:function(){return Kn().memoizedState=L3.bind(null,ct)},useEffectEvent:function(s){var o=Kn(),f={impl:s};return o.memoizedState=f,function(){if((jt&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},rp={readContext:Mn,use:Ru,useCallback:g0,useContext:Mn,useEffect:Qh,useImperativeHandle:m0,useInsertionEffect:f0,useLayoutEffect:h0,useMemo:v0,useReducer:ju,useRef:c0,useState:function(){return ju(Rs)},useDebugValue:Zh,useDeferredValue:function(s,o){var f=cn();return y0(f,Pt.memoizedState,s,o)},useTransition:function(){var s=ju(Rs)[0],o=cn().memoizedState;return[typeof s=="boolean"?s:Ol(s),o]},useSyncExternalStore:G1,useId:S0,useHostTransitionStatus:tp,useFormState:o0,useActionState:o0,useOptimistic:function(s,o){var f=cn();return J1(f,Pt,s,o)},useMemoCache:Wh,useCacheRefresh:w0};rp.useEffectEvent=d0;var N0={readContext:Mn,use:Ru,useCallback:g0,useContext:Mn,useEffect:Qh,useImperativeHandle:m0,useInsertionEffect:f0,useLayoutEffect:h0,useMemo:v0,useReducer:Kh,useRef:c0,useState:function(){return Kh(Rs)},useDebugValue:Zh,useDeferredValue:function(s,o){var f=cn();return Pt===null?Jh(f,s,o):y0(f,Pt.memoizedState,s,o)},useTransition:function(){var s=Kh(Rs)[0],o=cn().memoizedState;return[typeof s=="boolean"?s:Ol(s),o]},useSyncExternalStore:G1,useId:S0,useHostTransitionStatus:tp,useFormState:l0,useActionState:l0,useOptimistic:function(s,o){var f=cn();return Pt!==null?J1(f,Pt,s,o):(f.baseState=s,[s,f.queue.dispatch])},useMemoCache:Wh,useCacheRefresh:w0};N0.useEffectEvent=d0;function sp(s,o,f,v){o=s.memoizedState,f=f(v,o),f=f==null?o:p({},o,f),s.memoizedState=f,s.lanes===0&&(s.updateQueue.baseState=f)}var ip={enqueueSetState:function(s,o,f){s=s._reactInternals;var v=yr(),A=pi(v);A.payload=o,f!=null&&(A.callback=f),o=mi(s,A,v),o!==null&&(sr(o,s,v),jl(o,s,v))},enqueueReplaceState:function(s,o,f){s=s._reactInternals;var v=yr(),A=pi(v);A.tag=1,A.payload=o,f!=null&&(A.callback=f),o=mi(s,A,v),o!==null&&(sr(o,s,v),jl(o,s,v))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var f=yr(),v=pi(f);v.tag=2,o!=null&&(v.callback=o),o=mi(s,v,f),o!==null&&(sr(o,s,f),jl(o,s,f))}};function R0(s,o,f,v,A,T,U){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(v,T,U):o.prototype&&o.prototype.isPureReactComponent?!Sl(f,v)||!Sl(A,T):!0}function j0(s,o,f,v){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,v),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,v),o.state!==s&&ip.enqueueReplaceState(o,o.state,null)}function So(s,o){var f=o;if("ref"in o){f={};for(var v in o)v!=="ref"&&(f[v]=o[v])}if(s=s.defaultProps){f===o&&(f=p({},f));for(var A in s)f[A]===void 0&&(f[A]=s[A])}return f}function T0(s){du(s)}function D0(s){console.error(s)}function M0(s){du(s)}function Ou(s,o){try{var f=s.onUncaughtError;f(o.value,{componentStack:o.stack})}catch(v){setTimeout(function(){throw v})}}function O0(s,o,f){try{var v=s.onCaughtError;v(f.value,{componentStack:f.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function op(s,o,f){return f=pi(f),f.tag=3,f.payload={element:null},f.callback=function(){Ou(s,o)},f}function L0(s){return s=pi(s),s.tag=3,s}function I0(s,o,f,v){var A=f.type.getDerivedStateFromError;if(typeof A=="function"){var T=v.value;s.payload=function(){return A(T)},s.callback=function(){O0(o,f,v)}}var U=f.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(s.callback=function(){O0(o,f,v),typeof A!="function"&&(_i===null?_i=new Set([this]):_i.add(this));var Z=v.stack;this.componentDidCatch(v.value,{componentStack:Z!==null?Z:""})})}function P3(s,o,f,v,A){if(f.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(o=f.alternate,o!==null&&la(o,f,A,!0),f=pr.current,f!==null){switch(f.tag){case 31:case 13:return Or===null?Wu():f.alternate===null&&on===0&&(on=3),f.flags&=-257,f.flags|=65536,f.lanes=A,v===_u?f.flags|=16384:(o=f.updateQueue,o===null?f.updateQueue=new Set([v]):o.add(v),Tp(s,v,A)),!1;case 22:return f.flags|=65536,v===_u?f.flags|=16384:(o=f.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([v])},f.updateQueue=o):(f=o.retryQueue,f===null?o.retryQueue=new Set([v]):f.add(v)),Tp(s,v,A)),!1}throw Error(r(435,f.tag))}return Tp(s,v,A),Wu(),!1}if(wt)return o=pr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=A,v!==kh&&(s=Error(r(422),{cause:v}),kl(jr(s,f)))):(v!==kh&&(o=Error(r(423),{cause:v}),kl(jr(o,f))),s=s.current.alternate,s.flags|=65536,A&=-A,s.lanes|=A,v=jr(v,f),A=op(s.stateNode,v,A),Ih(s,A),on!==4&&(on=2)),!1;var T=Error(r(520),{cause:v});if(T=jr(T,f),Vl===null?Vl=[T]:Vl.push(T),on!==4&&(on=2),o===null)return!0;v=jr(v,f),f=o;do{switch(f.tag){case 3:return f.flags|=65536,s=A&-A,f.lanes|=s,s=op(f.stateNode,v,s),Ih(f,s),!1;case 1:if(o=f.type,T=f.stateNode,(f.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(_i===null||!_i.has(T))))return f.flags|=65536,A&=-A,f.lanes|=A,A=L0(A),I0(A,s,f,v),Ih(f,A),!1}f=f.return}while(f!==null);return!1}var ap=Error(r(461)),fn=!1;function On(s,o,f,v){o.child=s===null?F1(o,null,f,v):xo(o,s.child,f,v)}function P0(s,o,f,v,A){f=f.render;var T=o.ref;if("ref"in v){var U={};for(var Z in v)Z!=="ref"&&(U[Z]=v[Z])}else U=v;return go(o),v=$h(s,o,f,U,T,A),Z=Uh(),s!==null&&!fn?(Vh(s,o,A),js(s,o,A)):(wt&&Z&&wh(o),o.flags|=1,On(s,o,v,A),o.child)}function z0(s,o,f,v,A){if(s===null){var T=f.type;return typeof T=="function"&&!xh(T)&&T.defaultProps===void 0&&f.compare===null?(o.tag=15,o.type=T,B0(s,o,T,v,A)):(s=mu(f.type,null,v,o,o.mode,A),s.ref=o.ref,s.return=o,o.child=s)}if(T=s.child,!mp(s,A)){var U=T.memoizedProps;if(f=f.compare,f=f!==null?f:Sl,f(U,v)&&s.ref===o.ref)return js(s,o,A)}return o.flags|=1,s=Cs(T,v),s.ref=o.ref,s.return=o,o.child=s}function B0(s,o,f,v,A){if(s!==null){var T=s.memoizedProps;if(Sl(T,v)&&s.ref===o.ref)if(fn=!1,o.pendingProps=v=T,mp(s,A))(s.flags&131072)!==0&&(fn=!0);else return o.lanes=s.lanes,js(s,o,A)}return lp(s,o,f,v,A)}function F0(s,o,f,v){var A=v.children,T=s!==null?s.memoizedState:null;if(s===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((o.flags&128)!==0){if(T=T!==null?T.baseLanes|f:f,s!==null){for(v=o.child=s.child,A=0;v!==null;)A=A|v.lanes|v.childLanes,v=v.sibling;v=A&~T}else v=0,o.child=null;return H0(s,o,T,f,v)}if((f&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},s!==null&&bu(o,T!==null?T.cachePool:null),T!==null?U1(o,T):zh(),V1(o);else return v=o.lanes=536870912,H0(s,o,T!==null?T.baseLanes|f:f,f,v)}else T!==null?(bu(o,T.cachePool),U1(o,T),vi(),o.memoizedState=null):(s!==null&&bu(o,null),zh(),vi());return On(s,o,A,f),o.child}function Pl(s,o){return s!==null&&s.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function H0(s,o,f,v,A){var T=Dh();return T=T===null?null:{parent:un._currentValue,pool:T},o.memoizedState={baseLanes:f,cachePool:T},s!==null&&bu(o,null),zh(),V1(o),s!==null&&la(s,o,v,!0),o.childLanes=A,null}function Lu(s,o){return o=Pu({mode:o.mode,children:o.children},s.mode),o.ref=s.ref,s.child=o,o.return=s,o}function $0(s,o,f){return xo(o,s.child,null,f),s=Lu(o,o.pendingProps),s.flags|=2,mr(o),o.memoizedState=null,s}function z3(s,o,f){var v=o.pendingProps,A=(o.flags&128)!==0;if(o.flags&=-129,s===null){if(wt){if(v.mode==="hidden")return s=Lu(o,v),o.lanes=536870912,Pl(null,s);if(Fh(o),(s=Xt)?(s=eb(s,Mr),s=s!==null&&s.data==="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:ci!==null?{id:is,overflow:os}:null,retryLane:536870912,hydrationErrors:null},f=k1(s),f.return=o,o.child=f,Dn=o,Xt=null)):s=null,s===null)throw di(o);return o.lanes=536870912,null}return Lu(o,v)}var T=s.memoizedState;if(T!==null){var U=T.dehydrated;if(Fh(o),A)if(o.flags&256)o.flags&=-257,o=$0(s,o,f);else if(o.memoizedState!==null)o.child=s.child,o.flags|=128,o=null;else throw Error(r(558));else if(fn||la(s,o,f,!1),A=(f&s.childLanes)!==0,fn||A){if(v=$t,v!==null&&(U=lr(v,f),U!==0&&U!==T.retryLane))throw T.retryLane=U,fo(s,U),sr(v,s,U),ap;Wu(),o=$0(s,o,f)}else s=T.treeContext,Xt=Lr(U.nextSibling),Dn=o,wt=!0,ui=null,Mr=!1,s!==null&&N1(o,s),o=Lu(o,v),o.flags|=4096;return o}return s=Cs(s.child,{mode:v.mode,children:v.children}),s.ref=o.ref,o.child=s,s.return=o,s}function Iu(s,o){var f=o.ref;if(f===null)s!==null&&s.ref!==null&&(o.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(s===null||s.ref!==f)&&(o.flags|=4194816)}}function lp(s,o,f,v,A){return go(o),f=$h(s,o,f,v,void 0,A),v=Uh(),s!==null&&!fn?(Vh(s,o,A),js(s,o,A)):(wt&&v&&wh(o),o.flags|=1,On(s,o,f,A),o.child)}function U0(s,o,f,v,A,T){return go(o),o.updateQueue=null,f=W1(o,v,f,A),q1(s),v=Uh(),s!==null&&!fn?(Vh(s,o,T),js(s,o,T)):(wt&&v&&wh(o),o.flags|=1,On(s,o,f,T),o.child)}function V0(s,o,f,v,A){if(go(o),o.stateNode===null){var T=sa,U=f.contextType;typeof U=="object"&&U!==null&&(T=Mn(U)),T=new f(v,T),o.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=ip,o.stateNode=T,T._reactInternals=o,T=o.stateNode,T.props=v,T.state=o.memoizedState,T.refs={},Oh(o),U=f.contextType,T.context=typeof U=="object"&&U!==null?Mn(U):sa,T.state=o.memoizedState,U=f.getDerivedStateFromProps,typeof U=="function"&&(sp(o,f,U,v),T.state=o.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(U=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),U!==T.state&&ip.enqueueReplaceState(T,T.state,null),Dl(o,v,T,A),Tl(),T.state=o.memoizedState),typeof T.componentDidMount=="function"&&(o.flags|=4194308),v=!0}else if(s===null){T=o.stateNode;var Z=o.memoizedProps,ne=So(f,Z);T.props=ne;var fe=T.context,_e=f.contextType;U=sa,typeof _e=="object"&&_e!==null&&(U=Mn(_e));var Ce=f.getDerivedStateFromProps;_e=typeof Ce=="function"||typeof T.getSnapshotBeforeUpdate=="function",Z=o.pendingProps!==Z,_e||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(Z||fe!==U)&&j0(o,T,v,U),hi=!1;var pe=o.memoizedState;T.state=pe,Dl(o,v,T,A),Tl(),fe=o.memoizedState,Z||pe!==fe||hi?(typeof Ce=="function"&&(sp(o,f,Ce,v),fe=o.memoizedState),(ne=hi||R0(o,f,ne,v,pe,fe,U))?(_e||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=v,o.memoizedState=fe),T.props=v,T.state=fe,T.context=U,v=ne):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),v=!1)}else{T=o.stateNode,Lh(s,o),U=o.memoizedProps,_e=So(f,U),T.props=_e,Ce=o.pendingProps,pe=T.context,fe=f.contextType,ne=sa,typeof fe=="object"&&fe!==null&&(ne=Mn(fe)),Z=f.getDerivedStateFromProps,(fe=typeof Z=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(U!==Ce||pe!==ne)&&j0(o,T,v,ne),hi=!1,pe=o.memoizedState,T.state=pe,Dl(o,v,T,A),Tl();var ye=o.memoizedState;U!==Ce||pe!==ye||hi||s!==null&&s.dependencies!==null&&vu(s.dependencies)?(typeof Z=="function"&&(sp(o,f,Z,v),ye=o.memoizedState),(_e=hi||R0(o,f,_e,v,pe,ye,ne)||s!==null&&s.dependencies!==null&&vu(s.dependencies))?(fe||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(v,ye,ne),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(v,ye,ne)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(o.flags|=1024),o.memoizedProps=v,o.memoizedState=ye),T.props=v,T.state=ye,T.context=ne,v=_e):(typeof T.componentDidUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(o.flags|=1024),v=!1)}return T=v,Iu(s,o),v=(o.flags&128)!==0,T||v?(T=o.stateNode,f=v&&typeof f.getDerivedStateFromError!="function"?null:T.render(),o.flags|=1,s!==null&&v?(o.child=xo(o,s.child,null,A),o.child=xo(o,null,f,A)):On(s,o,f,A),o.memoizedState=T.state,s=o.child):s=js(s,o,A),s}function q0(s,o,f,v){return po(),o.flags|=256,On(s,o,f,v),o.child}var cp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function up(s){return{baseLanes:s,cachePool:O1()}}function dp(s,o,f){return s=s!==null?s.childLanes&~f:0,o&&(s|=vr),s}function W0(s,o,f){var v=o.pendingProps,A=!1,T=(o.flags&128)!==0,U;if((U=T)||(U=s!==null&&s.memoizedState===null?!1:(ln.current&2)!==0),U&&(A=!0,o.flags&=-129),U=(o.flags&32)!==0,o.flags&=-33,s===null){if(wt){if(A?gi(o):vi(),(s=Xt)?(s=eb(s,Mr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:ci!==null?{id:is,overflow:os}:null,retryLane:536870912,hydrationErrors:null},f=k1(s),f.return=o,o.child=f,Dn=o,Xt=null)):s=null,s===null)throw di(o);return Gp(s)?o.lanes=32:o.lanes=536870912,null}var Z=v.children;return v=v.fallback,A?(vi(),A=o.mode,Z=Pu({mode:"hidden",children:Z},A),v=ho(v,A,f,null),Z.return=o,v.return=o,Z.sibling=v,o.child=Z,v=o.child,v.memoizedState=up(f),v.childLanes=dp(s,U,f),o.memoizedState=cp,Pl(null,v)):(gi(o),fp(o,Z))}var ne=s.memoizedState;if(ne!==null&&(Z=ne.dehydrated,Z!==null)){if(T)o.flags&256?(gi(o),o.flags&=-257,o=hp(s,o,f)):o.memoizedState!==null?(vi(),o.child=s.child,o.flags|=128,o=null):(vi(),Z=v.fallback,A=o.mode,v=Pu({mode:"visible",children:v.children},A),Z=ho(Z,A,f,null),Z.flags|=2,v.return=o,Z.return=o,v.sibling=Z,o.child=v,xo(o,s.child,null,f),v=o.child,v.memoizedState=up(f),v.childLanes=dp(s,U,f),o.memoizedState=cp,o=Pl(null,v));else if(gi(o),Gp(Z)){if(U=Z.nextSibling&&Z.nextSibling.dataset,U)var fe=U.dgst;U=fe,v=Error(r(419)),v.stack="",v.digest=U,kl({value:v,source:null,stack:null}),o=hp(s,o,f)}else if(fn||la(s,o,f,!1),U=(f&s.childLanes)!==0,fn||U){if(U=$t,U!==null&&(v=lr(U,f),v!==0&&v!==ne.retryLane))throw ne.retryLane=v,fo(s,v),sr(U,s,v),ap;Wp(Z)||Wu(),o=hp(s,o,f)}else Wp(Z)?(o.flags|=192,o.child=s.child,o=null):(s=ne.treeContext,Xt=Lr(Z.nextSibling),Dn=o,wt=!0,ui=null,Mr=!1,s!==null&&N1(o,s),o=fp(o,v.children),o.flags|=4096);return o}return A?(vi(),Z=v.fallback,A=o.mode,ne=s.child,fe=ne.sibling,v=Cs(ne,{mode:"hidden",children:v.children}),v.subtreeFlags=ne.subtreeFlags&65011712,fe!==null?Z=Cs(fe,Z):(Z=ho(Z,A,f,null),Z.flags|=2),Z.return=o,v.return=o,v.sibling=Z,o.child=v,Pl(null,v),v=o.child,Z=s.child.memoizedState,Z===null?Z=up(f):(A=Z.cachePool,A!==null?(ne=un._currentValue,A=A.parent!==ne?{parent:ne,pool:ne}:A):A=O1(),Z={baseLanes:Z.baseLanes|f,cachePool:A}),v.memoizedState=Z,v.childLanes=dp(s,U,f),o.memoizedState=cp,Pl(s.child,v)):(gi(o),f=s.child,s=f.sibling,f=Cs(f,{mode:"visible",children:v.children}),f.return=o,f.sibling=null,s!==null&&(U=o.deletions,U===null?(o.deletions=[s],o.flags|=16):U.push(s)),o.child=f,o.memoizedState=null,f)}function fp(s,o){return o=Pu({mode:"visible",children:o},s.mode),o.return=s,s.child=o}function Pu(s,o){return s=hr(22,s,null,o),s.lanes=0,s}function hp(s,o,f){return xo(o,s.child,null,f),s=fp(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function G0(s,o,f){s.lanes|=o;var v=s.alternate;v!==null&&(v.lanes|=o),Nh(s.return,o,f)}function pp(s,o,f,v,A,T){var U=s.memoizedState;U===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:v,tail:f,tailMode:A,treeForkCount:T}:(U.isBackwards=o,U.rendering=null,U.renderingStartTime=0,U.last=v,U.tail=f,U.tailMode=A,U.treeForkCount=T)}function K0(s,o,f){var v=o.pendingProps,A=v.revealOrder,T=v.tail;v=v.children;var U=ln.current,Z=(U&2)!==0;if(Z?(U=U&1|2,o.flags|=128):U&=1,F(ln,U),On(s,o,v,f),v=wt?Cl:0,!Z&&s!==null&&(s.flags&128)!==0)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&G0(s,f,o);else if(s.tag===19)G0(s,f,o);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(A){case"forwards":for(f=o.child,A=null;f!==null;)s=f.alternate,s!==null&&ku(s)===null&&(A=f),f=f.sibling;f=A,f===null?(A=o.child,o.child=null):(A=f.sibling,f.sibling=null),pp(o,!1,A,f,T,v);break;case"backwards":case"unstable_legacy-backwards":for(f=null,A=o.child,o.child=null;A!==null;){if(s=A.alternate,s!==null&&ku(s)===null){o.child=A;break}s=A.sibling,A.sibling=f,f=A,A=s}pp(o,!0,f,null,T,v);break;case"together":pp(o,!1,null,null,void 0,v);break;default:o.memoizedState=null}return o.child}function js(s,o,f){if(s!==null&&(o.dependencies=s.dependencies),xi|=o.lanes,(f&o.childLanes)===0)if(s!==null){if(la(s,o,f,!1),(f&o.childLanes)===0)return null}else return null;if(s!==null&&o.child!==s.child)throw Error(r(153));if(o.child!==null){for(s=o.child,f=Cs(s,s.pendingProps),o.child=f,f.return=o;s.sibling!==null;)s=s.sibling,f=f.sibling=Cs(s,s.pendingProps),f.return=o;f.sibling=null}return o.child}function mp(s,o){return(s.lanes&o)!==0?!0:(s=s.dependencies,!!(s!==null&&vu(s)))}function B3(s,o,f){switch(o.tag){case 3:V(o,o.stateNode.containerInfo),fi(o,un,s.memoizedState.cache),po();break;case 27:case 5:re(o);break;case 4:V(o,o.stateNode.containerInfo);break;case 10:fi(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Fh(o),null;break;case 13:var v=o.memoizedState;if(v!==null)return v.dehydrated!==null?(gi(o),o.flags|=128,null):(f&o.child.childLanes)!==0?W0(s,o,f):(gi(o),s=js(s,o,f),s!==null?s.sibling:null);gi(o);break;case 19:var A=(s.flags&128)!==0;if(v=(f&o.childLanes)!==0,v||(la(s,o,f,!1),v=(f&o.childLanes)!==0),A){if(v)return K0(s,o,f);o.flags|=128}if(A=o.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),F(ln,ln.current),v)break;return null;case 22:return o.lanes=0,F0(s,o,f,o.pendingProps);case 24:fi(o,un,s.memoizedState.cache)}return js(s,o,f)}function Y0(s,o,f){if(s!==null)if(s.memoizedProps!==o.pendingProps)fn=!0;else{if(!mp(s,f)&&(o.flags&128)===0)return fn=!1,B3(s,o,f);fn=(s.flags&131072)!==0}else fn=!1,wt&&(o.flags&1048576)!==0&&A1(o,Cl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var v=o.pendingProps;if(s=yo(o.elementType),o.type=s,typeof s=="function")xh(s)?(v=So(s,v),o.tag=1,o=V0(null,o,s,v,f)):(o.tag=0,o=lp(null,o,s,v,f));else{if(s!=null){var A=s.$$typeof;if(A===k){o.tag=11,o=P0(null,o,s,v,f);break e}else if(A===D){o.tag=14,o=z0(null,o,s,v,f);break e}}throw o=q(s)||s,Error(r(306,o,""))}}return o;case 0:return lp(s,o,o.type,o.pendingProps,f);case 1:return v=o.type,A=So(v,o.pendingProps),V0(s,o,v,A,f);case 3:e:{if(V(o,o.stateNode.containerInfo),s===null)throw Error(r(387));v=o.pendingProps;var T=o.memoizedState;A=T.element,Lh(s,o),Dl(o,v,null,f);var U=o.memoizedState;if(v=U.cache,fi(o,un,v),v!==T.cache&&Rh(o,[un],f,!0),Tl(),v=U.element,T.isDehydrated)if(T={element:v,isDehydrated:!1,cache:U.cache},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){o=q0(s,o,v,f);break e}else if(v!==A){A=jr(Error(r(424)),o),kl(A),o=q0(s,o,v,f);break e}else{switch(s=o.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Xt=Lr(s.firstChild),Dn=o,wt=!0,ui=null,Mr=!0,f=F1(o,null,v,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(po(),v===A){o=js(s,o,f);break e}On(s,o,v,f)}o=o.child}return o;case 26:return Iu(s,o),s===null?(f=ob(o.type,null,o.pendingProps,null))?o.memoizedState=f:wt||(f=o.type,s=o.pendingProps,v=Ju(ee.current).createElement(f),v[Nt]=o,v[Dt]=s,Ln(v,f,s),en(v),o.stateNode=v):o.memoizedState=ob(o.type,s.memoizedProps,o.pendingProps,s.memoizedState),null;case 27:return re(o),s===null&&wt&&(v=o.stateNode=rb(o.type,o.pendingProps,ee.current),Dn=o,Mr=!0,A=Xt,ki(o.type)?(Kp=A,Xt=Lr(v.firstChild)):Xt=A),On(s,o,o.pendingProps.children,f),Iu(s,o),s===null&&(o.flags|=4194304),o.child;case 5:return s===null&&wt&&((A=v=Xt)&&(v=m4(v,o.type,o.pendingProps,Mr),v!==null?(o.stateNode=v,Dn=o,Xt=Lr(v.firstChild),Mr=!1,A=!0):A=!1),A||di(o)),re(o),A=o.type,T=o.pendingProps,U=s!==null?s.memoizedProps:null,v=T.children,Up(A,T)?v=null:U!==null&&Up(A,U)&&(o.flags|=32),o.memoizedState!==null&&(A=$h(s,o,j3,null,null,f),Zl._currentValue=A),Iu(s,o),On(s,o,v,f),o.child;case 6:return s===null&&wt&&((s=f=Xt)&&(f=g4(f,o.pendingProps,Mr),f!==null?(o.stateNode=f,Dn=o,Xt=null,s=!0):s=!1),s||di(o)),null;case 13:return W0(s,o,f);case 4:return V(o,o.stateNode.containerInfo),v=o.pendingProps,s===null?o.child=xo(o,null,v,f):On(s,o,v,f),o.child;case 11:return P0(s,o,o.type,o.pendingProps,f);case 7:return On(s,o,o.pendingProps,f),o.child;case 8:return On(s,o,o.pendingProps.children,f),o.child;case 12:return On(s,o,o.pendingProps.children,f),o.child;case 10:return v=o.pendingProps,fi(o,o.type,v.value),On(s,o,v.children,f),o.child;case 9:return A=o.type._context,v=o.pendingProps.children,go(o),A=Mn(A),v=v(A),o.flags|=1,On(s,o,v,f),o.child;case 14:return z0(s,o,o.type,o.pendingProps,f);case 15:return B0(s,o,o.type,o.pendingProps,f);case 19:return K0(s,o,f);case 31:return z3(s,o,f);case 22:return F0(s,o,f,o.pendingProps);case 24:return go(o),v=Mn(un),s===null?(A=Dh(),A===null&&(A=$t,T=jh(),A.pooledCache=T,T.refCount++,T!==null&&(A.pooledCacheLanes|=f),A=T),o.memoizedState={parent:v,cache:A},Oh(o),fi(o,un,A)):((s.lanes&f)!==0&&(Lh(s,o),Dl(o,null,null,f),Tl()),A=s.memoizedState,T=o.memoizedState,A.parent!==v?(A={parent:v,cache:v},o.memoizedState=A,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=A),fi(o,un,v)):(v=T.cache,fi(o,un,v),v!==A.cache&&Rh(o,[un],f,!0))),On(s,o,o.pendingProps.children,f),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Ts(s){s.flags|=4}function gp(s,o,f,v,A){if((o=(s.mode&32)!==0)&&(o=!1),o){if(s.flags|=16777216,(A&335544128)===A)if(s.stateNode.complete)s.flags|=8192;else if(Sy())s.flags|=8192;else throw bo=_u,Mh}else s.flags&=-16777217}function X0(s,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!db(o))if(Sy())s.flags|=8192;else throw bo=_u,Mh}function zu(s,o){o!==null&&(s.flags|=4),s.flags&16384&&(o=s.tag!==22?Me():536870912,s.lanes|=o,xa|=o)}function zl(s,o){if(!wt)switch(s.tailMode){case"hidden":o=s.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?s.tail=null:f.sibling=null;break;case"collapsed":f=s.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:v.sibling=null}}function Qt(s){var o=s.alternate!==null&&s.alternate.child===s.child,f=0,v=0;if(o)for(var A=s.child;A!==null;)f|=A.lanes|A.childLanes,v|=A.subtreeFlags&65011712,v|=A.flags&65011712,A.return=s,A=A.sibling;else for(A=s.child;A!==null;)f|=A.lanes|A.childLanes,v|=A.subtreeFlags,v|=A.flags,A.return=s,A=A.sibling;return s.subtreeFlags|=v,s.childLanes=f,o}function F3(s,o,f){var v=o.pendingProps;switch(Ch(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(o),null;case 1:return Qt(o),null;case 3:return f=o.stateNode,v=null,s!==null&&(v=s.memoizedState.cache),o.memoizedState.cache!==v&&(o.flags|=2048),As(un),te(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(s===null||s.child===null)&&(aa(o)?Ts(o):s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Eh())),Qt(o),null;case 26:var A=o.type,T=o.memoizedState;return s===null?(Ts(o),T!==null?(Qt(o),X0(o,T)):(Qt(o),gp(o,A,null,v,f))):T?T!==s.memoizedState?(Ts(o),Qt(o),X0(o,T)):(Qt(o),o.flags&=-16777217):(s=s.memoizedProps,s!==v&&Ts(o),Qt(o),gp(o,A,s,v,f)),null;case 27:if(ae(o),f=ee.current,A=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==v&&Ts(o);else{if(!v){if(o.stateNode===null)throw Error(r(166));return Qt(o),null}s=Q.current,aa(o)?R1(o):(s=rb(A,v,f),o.stateNode=s,Ts(o))}return Qt(o),null;case 5:if(ae(o),A=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==v&&Ts(o);else{if(!v){if(o.stateNode===null)throw Error(r(166));return Qt(o),null}if(T=Q.current,aa(o))R1(o);else{var U=Ju(ee.current);switch(T){case 1:T=U.createElementNS("http://www.w3.org/2000/svg",A);break;case 2:T=U.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;default:switch(A){case"svg":T=U.createElementNS("http://www.w3.org/2000/svg",A);break;case"math":T=U.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;case"script":T=U.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof v.is=="string"?U.createElement("select",{is:v.is}):U.createElement("select"),v.multiple?T.multiple=!0:v.size&&(T.size=v.size);break;default:T=typeof v.is=="string"?U.createElement(A,{is:v.is}):U.createElement(A)}}T[Nt]=o,T[Dt]=v;e:for(U=o.child;U!==null;){if(U.tag===5||U.tag===6)T.appendChild(U.stateNode);else if(U.tag!==4&&U.tag!==27&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===o)break e;for(;U.sibling===null;){if(U.return===null||U.return===o)break e;U=U.return}U.sibling.return=U.return,U=U.sibling}o.stateNode=T;e:switch(Ln(T,A,v),A){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Ts(o)}}return Qt(o),gp(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,f),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==v&&Ts(o);else{if(typeof v!="string"&&o.stateNode===null)throw Error(r(166));if(s=ee.current,aa(o)){if(s=o.stateNode,f=o.memoizedProps,v=null,A=Dn,A!==null)switch(A.tag){case 27:case 5:v=A.memoizedProps}s[Nt]=o,s=!!(s.nodeValue===f||v!==null&&v.suppressHydrationWarning===!0||Wy(s.nodeValue,f)),s||di(o,!0)}else s=Ju(s).createTextNode(v),s[Nt]=o,o.stateNode=s}return Qt(o),null;case 31:if(f=o.memoizedState,s===null||s.memoizedState!==null){if(v=aa(o),f!==null){if(s===null){if(!v)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Nt]=o}else po(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Qt(o),s=!1}else f=Eh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=f),s=!0;if(!s)return o.flags&256?(mr(o),o):(mr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Qt(o),null;case 13:if(v=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(A=aa(o),v!==null&&v.dehydrated!==null){if(s===null){if(!A)throw Error(r(318));if(A=o.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[Nt]=o}else po(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Qt(o),A=!1}else A=Eh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=A),A=!0;if(!A)return o.flags&256?(mr(o),o):(mr(o),null)}return mr(o),(o.flags&128)!==0?(o.lanes=f,o):(f=v!==null,s=s!==null&&s.memoizedState!==null,f&&(v=o.child,A=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(A=v.alternate.memoizedState.cachePool.pool),T=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(T=v.memoizedState.cachePool.pool),T!==A&&(v.flags|=2048)),f!==s&&f&&(o.child.flags|=8192),zu(o,o.updateQueue),Qt(o),null);case 4:return te(),s===null&&zp(o.stateNode.containerInfo),Qt(o),null;case 10:return As(o.type),Qt(o),null;case 19:if(B(ln),v=o.memoizedState,v===null)return Qt(o),null;if(A=(o.flags&128)!==0,T=v.rendering,T===null)if(A)zl(v,!1);else{if(on!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(T=ku(s),T!==null){for(o.flags|=128,zl(v,!1),s=T.updateQueue,o.updateQueue=s,zu(o,s),o.subtreeFlags=0,s=f,f=o.child;f!==null;)C1(f,s),f=f.sibling;return F(ln,ln.current&1|2),wt&&ks(o,v.treeForkCount),o.child}s=s.sibling}v.tail!==null&&Re()>Uu&&(o.flags|=128,A=!0,zl(v,!1),o.lanes=4194304)}else{if(!A)if(s=ku(T),s!==null){if(o.flags|=128,A=!0,s=s.updateQueue,o.updateQueue=s,zu(o,s),zl(v,!0),v.tail===null&&v.tailMode==="hidden"&&!T.alternate&&!wt)return Qt(o),null}else 2*Re()-v.renderingStartTime>Uu&&f!==536870912&&(o.flags|=128,A=!0,zl(v,!1),o.lanes=4194304);v.isBackwards?(T.sibling=o.child,o.child=T):(s=v.last,s!==null?s.sibling=T:o.child=T,v.last=T)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=Re(),s.sibling=null,f=ln.current,F(ln,A?f&1|2:f&1),wt&&ks(o,v.treeForkCount),s):(Qt(o),null);case 22:case 23:return mr(o),Bh(),v=o.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(o.flags|=8192):v&&(o.flags|=8192),v?(f&536870912)!==0&&(o.flags&128)===0&&(Qt(o),o.subtreeFlags&6&&(o.flags|=8192)):Qt(o),f=o.updateQueue,f!==null&&zu(o,f.retryQueue),f=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),v=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(v=o.memoizedState.cachePool.pool),v!==f&&(o.flags|=2048),s!==null&&B(vo),null;case 24:return f=null,s!==null&&(f=s.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),As(un),Qt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function H3(s,o){switch(Ch(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return As(un),te(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return ae(o),null;case 31:if(o.memoizedState!==null){if(mr(o),o.alternate===null)throw Error(r(340));po()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(mr(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));po()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return B(ln),null;case 4:return te(),null;case 10:return As(o.type),null;case 22:case 23:return mr(o),Bh(),s!==null&&B(vo),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return As(un),null;case 25:return null;default:return null}}function Q0(s,o){switch(Ch(o),o.tag){case 3:As(un),te();break;case 26:case 27:case 5:ae(o);break;case 4:te();break;case 31:o.memoizedState!==null&&mr(o);break;case 13:mr(o);break;case 19:B(ln);break;case 10:As(o.type);break;case 22:case 23:mr(o),Bh(),s!==null&&B(vo);break;case 24:As(un)}}function Bl(s,o){try{var f=o.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var A=v.next;f=A;do{if((f.tag&s)===s){v=void 0;var T=f.create,U=f.inst;v=T(),U.destroy=v}f=f.next}while(f!==A)}}catch(Z){Lt(o,o.return,Z)}}function yi(s,o,f){try{var v=o.updateQueue,A=v!==null?v.lastEffect:null;if(A!==null){var T=A.next;v=T;do{if((v.tag&s)===s){var U=v.inst,Z=U.destroy;if(Z!==void 0){U.destroy=void 0,A=o;var ne=f,fe=Z;try{fe()}catch(_e){Lt(A,ne,_e)}}}v=v.next}while(v!==T)}}catch(_e){Lt(o,o.return,_e)}}function Z0(s){var o=s.updateQueue;if(o!==null){var f=s.stateNode;try{$1(o,f)}catch(v){Lt(s,s.return,v)}}}function J0(s,o,f){f.props=So(s.type,s.memoizedProps),f.state=s.memoizedState;try{f.componentWillUnmount()}catch(v){Lt(s,o,v)}}function Fl(s,o){try{var f=s.ref;if(f!==null){switch(s.tag){case 26:case 27:case 5:var v=s.stateNode;break;case 30:v=s.stateNode;break;default:v=s.stateNode}typeof f=="function"?s.refCleanup=f(v):f.current=v}}catch(A){Lt(s,o,A)}}function as(s,o){var f=s.ref,v=s.refCleanup;if(f!==null)if(typeof v=="function")try{v()}catch(A){Lt(s,o,A)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(A){Lt(s,o,A)}else f.current=null}function ey(s){var o=s.type,f=s.memoizedProps,v=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":f.autoFocus&&v.focus();break e;case"img":f.src?v.src=f.src:f.srcSet&&(v.srcset=f.srcSet)}}catch(A){Lt(s,s.return,A)}}function vp(s,o,f){try{var v=s.stateNode;c4(v,s.type,f,o),v[Dt]=o}catch(A){Lt(s,s.return,A)}}function ty(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ki(s.type)||s.tag===4}function yp(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||ty(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&&ki(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 bp(s,o,f){var v=s.tag;if(v===5||v===6)s=s.stateNode,o?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(s,o):(o=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,o.appendChild(s),f=f._reactRootContainer,f!=null||o.onclick!==null||(o.onclick=qr));else if(v!==4&&(v===27&&ki(s.type)&&(f=s.stateNode,o=null),s=s.child,s!==null))for(bp(s,o,f),s=s.sibling;s!==null;)bp(s,o,f),s=s.sibling}function Bu(s,o,f){var v=s.tag;if(v===5||v===6)s=s.stateNode,o?f.insertBefore(s,o):f.appendChild(s);else if(v!==4&&(v===27&&ki(s.type)&&(f=s.stateNode),s=s.child,s!==null))for(Bu(s,o,f),s=s.sibling;s!==null;)Bu(s,o,f),s=s.sibling}function ny(s){var o=s.stateNode,f=s.memoizedProps;try{for(var v=s.type,A=o.attributes;A.length;)o.removeAttributeNode(A[0]);Ln(o,v,f),o[Nt]=s,o[Dt]=f}catch(T){Lt(s,s.return,T)}}var Ds=!1,hn=!1,xp=!1,ry=typeof WeakSet=="function"?WeakSet:Set,Cn=null;function $3(s,o){if(s=s.containerInfo,Hp=od,s=m1(s),hh(s)){if("selectionStart"in s)var f={start:s.selectionStart,end:s.selectionEnd};else e:{f=(f=s.ownerDocument)&&f.defaultView||window;var v=f.getSelection&&f.getSelection();if(v&&v.rangeCount!==0){f=v.anchorNode;var A=v.anchorOffset,T=v.focusNode;v=v.focusOffset;try{f.nodeType,T.nodeType}catch{f=null;break e}var U=0,Z=-1,ne=-1,fe=0,_e=0,Ce=s,pe=null;t:for(;;){for(var ye;Ce!==f||A!==0&&Ce.nodeType!==3||(Z=U+A),Ce!==T||v!==0&&Ce.nodeType!==3||(ne=U+v),Ce.nodeType===3&&(U+=Ce.nodeValue.length),(ye=Ce.firstChild)!==null;)pe=Ce,Ce=ye;for(;;){if(Ce===s)break t;if(pe===f&&++fe===A&&(Z=U),pe===T&&++_e===v&&(ne=U),(ye=Ce.nextSibling)!==null)break;Ce=pe,pe=Ce.parentNode}Ce=ye}f=Z===-1||ne===-1?null:{start:Z,end:ne}}else f=null}f=f||{start:0,end:0}}else f=null;for($p={focusedElem:s,selectionRange:f},od=!1,Cn=o;Cn!==null;)if(o=Cn,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,Cn=s;else for(;Cn!==null;){switch(o=Cn,T=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(f=0;f<s.length;f++)A=s[f],A.ref.impl=A.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&T!==null){s=void 0,f=o,A=T.memoizedProps,T=T.memoizedState,v=f.stateNode;try{var Ke=So(f.type,A);s=v.getSnapshotBeforeUpdate(Ke,T),v.__reactInternalSnapshotBeforeUpdate=s}catch(st){Lt(f,f.return,st)}}break;case 3:if((s&1024)!==0){if(s=o.stateNode.containerInfo,f=s.nodeType,f===9)qp(s);else if(f===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":qp(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(r(163))}if(s=o.sibling,s!==null){s.return=o.return,Cn=s;break}Cn=o.return}}function sy(s,o,f){var v=f.flags;switch(f.tag){case 0:case 11:case 15:Os(s,f),v&4&&Bl(5,f);break;case 1:if(Os(s,f),v&4)if(s=f.stateNode,o===null)try{s.componentDidMount()}catch(U){Lt(f,f.return,U)}else{var A=So(f.type,o.memoizedProps);o=o.memoizedState;try{s.componentDidUpdate(A,o,s.__reactInternalSnapshotBeforeUpdate)}catch(U){Lt(f,f.return,U)}}v&64&&Z0(f),v&512&&Fl(f,f.return);break;case 3:if(Os(s,f),v&64&&(s=f.updateQueue,s!==null)){if(o=null,f.child!==null)switch(f.child.tag){case 27:case 5:o=f.child.stateNode;break;case 1:o=f.child.stateNode}try{$1(s,o)}catch(U){Lt(f,f.return,U)}}break;case 27:o===null&&v&4&&ny(f);case 26:case 5:Os(s,f),o===null&&v&4&&ey(f),v&512&&Fl(f,f.return);break;case 12:Os(s,f);break;case 31:Os(s,f),v&4&&ay(s,f);break;case 13:Os(s,f),v&4&&ly(s,f),v&64&&(s=f.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(f=Q3.bind(null,f),v4(s,f))));break;case 22:if(v=f.memoizedState!==null||Ds,!v){o=o!==null&&o.memoizedState!==null||hn,A=Ds;var T=hn;Ds=v,(hn=o)&&!T?Ls(s,f,(f.subtreeFlags&8772)!==0):Os(s,f),Ds=A,hn=T}break;case 30:break;default:Os(s,f)}}function iy(s){var o=s.alternate;o!==null&&(s.alternate=null,iy(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&Er(o)),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 tn=null,er=!1;function Ms(s,o,f){for(f=f.child;f!==null;)oy(s,o,f),f=f.sibling}function oy(s,o,f){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(lt,f)}catch{}switch(f.tag){case 26:hn||as(f,o),Ms(s,o,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:hn||as(f,o);var v=tn,A=er;ki(f.type)&&(tn=f.stateNode,er=!1),Ms(s,o,f),Yl(f.stateNode),tn=v,er=A;break;case 5:hn||as(f,o);case 6:if(v=tn,A=er,tn=null,Ms(s,o,f),tn=v,er=A,tn!==null)if(er)try{(tn.nodeType===9?tn.body:tn.nodeName==="HTML"?tn.ownerDocument.body:tn).removeChild(f.stateNode)}catch(T){Lt(f,o,T)}else try{tn.removeChild(f.stateNode)}catch(T){Lt(f,o,T)}break;case 18:tn!==null&&(er?(s=tn,Zy(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,f.stateNode),Na(s)):Zy(tn,f.stateNode));break;case 4:v=tn,A=er,tn=f.stateNode.containerInfo,er=!0,Ms(s,o,f),tn=v,er=A;break;case 0:case 11:case 14:case 15:yi(2,f,o),hn||yi(4,f,o),Ms(s,o,f);break;case 1:hn||(as(f,o),v=f.stateNode,typeof v.componentWillUnmount=="function"&&J0(f,o,v)),Ms(s,o,f);break;case 21:Ms(s,o,f);break;case 22:hn=(v=hn)||f.memoizedState!==null,Ms(s,o,f),hn=v;break;default:Ms(s,o,f)}}function ay(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Na(s)}catch(f){Lt(o,o.return,f)}}}function ly(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Na(s)}catch(f){Lt(o,o.return,f)}}function U3(s){switch(s.tag){case 31:case 13:case 19:var o=s.stateNode;return o===null&&(o=s.stateNode=new ry),o;case 22:return s=s.stateNode,o=s._retryCache,o===null&&(o=s._retryCache=new ry),o;default:throw Error(r(435,s.tag))}}function Fu(s,o){var f=U3(s);o.forEach(function(v){if(!f.has(v)){f.add(v);var A=Z3.bind(null,s,v);v.then(A,A)}})}function tr(s,o){var f=o.deletions;if(f!==null)for(var v=0;v<f.length;v++){var A=f[v],T=s,U=o,Z=U;e:for(;Z!==null;){switch(Z.tag){case 27:if(ki(Z.type)){tn=Z.stateNode,er=!1;break e}break;case 5:tn=Z.stateNode,er=!1;break e;case 3:case 4:tn=Z.stateNode.containerInfo,er=!0;break e}Z=Z.return}if(tn===null)throw Error(r(160));oy(T,U,A),tn=null,er=!1,T=A.alternate,T!==null&&(T.return=null),A.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)cy(o,s),o=o.sibling}var Gr=null;function cy(s,o){var f=s.alternate,v=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:tr(o,s),nr(s),v&4&&(yi(3,s,s.return),Bl(3,s),yi(5,s,s.return));break;case 1:tr(o,s),nr(s),v&512&&(hn||f===null||as(f,f.return)),v&64&&Ds&&(s=s.updateQueue,s!==null&&(v=s.callbacks,v!==null&&(f=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=f===null?v:f.concat(v))));break;case 26:var A=Gr;if(tr(o,s),nr(s),v&512&&(hn||f===null||as(f,f.return)),v&4){var T=f!==null?f.memoizedState:null;if(v=s.memoizedState,f===null)if(v===null)if(s.stateNode===null){e:{v=s.type,f=s.memoizedProps,A=A.ownerDocument||A;t:switch(v){case"title":T=A.getElementsByTagName("title")[0],(!T||T[kr]||T[Nt]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=A.createElement(v),A.head.insertBefore(T,A.querySelector("head > title"))),Ln(T,v,f),T[Nt]=s,en(T),v=T;break e;case"link":var U=cb("link","href",A).get(v+(f.href||""));if(U){for(var Z=0;Z<U.length;Z++)if(T=U[Z],T.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&T.getAttribute("rel")===(f.rel==null?null:f.rel)&&T.getAttribute("title")===(f.title==null?null:f.title)&&T.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){U.splice(Z,1);break t}}T=A.createElement(v),Ln(T,v,f),A.head.appendChild(T);break;case"meta":if(U=cb("meta","content",A).get(v+(f.content||""))){for(Z=0;Z<U.length;Z++)if(T=U[Z],T.getAttribute("content")===(f.content==null?null:""+f.content)&&T.getAttribute("name")===(f.name==null?null:f.name)&&T.getAttribute("property")===(f.property==null?null:f.property)&&T.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&T.getAttribute("charset")===(f.charSet==null?null:f.charSet)){U.splice(Z,1);break t}}T=A.createElement(v),Ln(T,v,f),A.head.appendChild(T);break;default:throw Error(r(468,v))}T[Nt]=s,en(T),v=T}s.stateNode=v}else ub(A,s.type,s.stateNode);else s.stateNode=lb(A,v,s.memoizedProps);else T!==v?(T===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):T.count--,v===null?ub(A,s.type,s.stateNode):lb(A,v,s.memoizedProps)):v===null&&s.stateNode!==null&&vp(s,s.memoizedProps,f.memoizedProps)}break;case 27:tr(o,s),nr(s),v&512&&(hn||f===null||as(f,f.return)),f!==null&&v&4&&vp(s,s.memoizedProps,f.memoizedProps);break;case 5:if(tr(o,s),nr(s),v&512&&(hn||f===null||as(f,f.return)),s.flags&32){A=s.stateNode;try{ei(A,"")}catch(Ke){Lt(s,s.return,Ke)}}v&4&&s.stateNode!=null&&(A=s.memoizedProps,vp(s,A,f!==null?f.memoizedProps:A)),v&1024&&(xp=!0);break;case 6:if(tr(o,s),nr(s),v&4){if(s.stateNode===null)throw Error(r(162));v=s.memoizedProps,f=s.stateNode;try{f.nodeValue=v}catch(Ke){Lt(s,s.return,Ke)}}break;case 3:if(nd=null,A=Gr,Gr=ed(o.containerInfo),tr(o,s),Gr=A,nr(s),v&4&&f!==null&&f.memoizedState.isDehydrated)try{Na(o.containerInfo)}catch(Ke){Lt(s,s.return,Ke)}xp&&(xp=!1,uy(s));break;case 4:v=Gr,Gr=ed(s.stateNode.containerInfo),tr(o,s),nr(s),Gr=v;break;case 12:tr(o,s),nr(s);break;case 31:tr(o,s),nr(s),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Fu(s,v)));break;case 13:tr(o,s),nr(s),s.child.flags&8192&&s.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&($u=Re()),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Fu(s,v)));break;case 22:A=s.memoizedState!==null;var ne=f!==null&&f.memoizedState!==null,fe=Ds,_e=hn;if(Ds=fe||A,hn=_e||ne,tr(o,s),hn=_e,Ds=fe,nr(s),v&8192)e:for(o=s.stateNode,o._visibility=A?o._visibility&-2:o._visibility|1,A&&(f===null||ne||Ds||hn||wo(s)),f=null,o=s;;){if(o.tag===5||o.tag===26){if(f===null){ne=f=o;try{if(T=ne.stateNode,A)U=T.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none";else{Z=ne.stateNode;var Ce=ne.memoizedProps.style,pe=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;Z.style.display=pe==null||typeof pe=="boolean"?"":(""+pe).trim()}}catch(Ke){Lt(ne,ne.return,Ke)}}}else if(o.tag===6){if(f===null){ne=o;try{ne.stateNode.nodeValue=A?"":ne.memoizedProps}catch(Ke){Lt(ne,ne.return,Ke)}}}else if(o.tag===18){if(f===null){ne=o;try{var ye=ne.stateNode;A?Jy(ye,!0):Jy(ne.stateNode,!1)}catch(Ke){Lt(ne,ne.return,Ke)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===s)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;o.sibling===null;){if(o.return===null||o.return===s)break e;f===o&&(f=null),o=o.return}f===o&&(f=null),o.sibling.return=o.return,o=o.sibling}v&4&&(v=s.updateQueue,v!==null&&(f=v.retryQueue,f!==null&&(v.retryQueue=null,Fu(s,f))));break;case 19:tr(o,s),nr(s),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Fu(s,v)));break;case 30:break;case 21:break;default:tr(o,s),nr(s)}}function nr(s){var o=s.flags;if(o&2){try{for(var f,v=s.return;v!==null;){if(ty(v)){f=v;break}v=v.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var A=f.stateNode,T=yp(s);Bu(s,T,A);break;case 5:var U=f.stateNode;f.flags&32&&(ei(U,""),f.flags&=-33);var Z=yp(s);Bu(s,Z,U);break;case 3:case 4:var ne=f.stateNode.containerInfo,fe=yp(s);bp(s,fe,ne);break;default:throw Error(r(161))}}catch(_e){Lt(s,s.return,_e)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function uy(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var o=s;uy(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),s=s.sibling}}function Os(s,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)sy(s,o.alternate,o),o=o.sibling}function wo(s){for(s=s.child;s!==null;){var o=s;switch(o.tag){case 0:case 11:case 14:case 15:yi(4,o,o.return),wo(o);break;case 1:as(o,o.return);var f=o.stateNode;typeof f.componentWillUnmount=="function"&&J0(o,o.return,f),wo(o);break;case 27:Yl(o.stateNode);case 26:case 5:as(o,o.return),wo(o);break;case 22:o.memoizedState===null&&wo(o);break;case 30:wo(o);break;default:wo(o)}s=s.sibling}}function Ls(s,o,f){for(f=f&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var v=o.alternate,A=s,T=o,U=T.flags;switch(T.tag){case 0:case 11:case 15:Ls(A,T,f),Bl(4,T);break;case 1:if(Ls(A,T,f),v=T,A=v.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(fe){Lt(v,v.return,fe)}if(v=T,A=v.updateQueue,A!==null){var Z=v.stateNode;try{var ne=A.shared.hiddenCallbacks;if(ne!==null)for(A.shared.hiddenCallbacks=null,A=0;A<ne.length;A++)H1(ne[A],Z)}catch(fe){Lt(v,v.return,fe)}}f&&U&64&&Z0(T),Fl(T,T.return);break;case 27:ny(T);case 26:case 5:Ls(A,T,f),f&&v===null&&U&4&&ey(T),Fl(T,T.return);break;case 12:Ls(A,T,f);break;case 31:Ls(A,T,f),f&&U&4&&ay(A,T);break;case 13:Ls(A,T,f),f&&U&4&&ly(A,T);break;case 22:T.memoizedState===null&&Ls(A,T,f),Fl(T,T.return);break;case 30:break;default:Ls(A,T,f)}o=o.sibling}}function _p(s,o){var f=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),s=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(s=o.memoizedState.cachePool.pool),s!==f&&(s!=null&&s.refCount++,f!=null&&El(f))}function Sp(s,o){s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&El(s))}function Kr(s,o,f,v){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)dy(s,o,f,v),o=o.sibling}function dy(s,o,f,v){var A=o.flags;switch(o.tag){case 0:case 11:case 15:Kr(s,o,f,v),A&2048&&Bl(9,o);break;case 1:Kr(s,o,f,v);break;case 3:Kr(s,o,f,v),A&2048&&(s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&El(s)));break;case 12:if(A&2048){Kr(s,o,f,v),s=o.stateNode;try{var T=o.memoizedProps,U=T.id,Z=T.onPostCommit;typeof Z=="function"&&Z(U,o.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(ne){Lt(o,o.return,ne)}}else Kr(s,o,f,v);break;case 31:Kr(s,o,f,v);break;case 13:Kr(s,o,f,v);break;case 23:break;case 22:T=o.stateNode,U=o.alternate,o.memoizedState!==null?T._visibility&2?Kr(s,o,f,v):Hl(s,o):T._visibility&2?Kr(s,o,f,v):(T._visibility|=2,va(s,o,f,v,(o.subtreeFlags&10256)!==0||!1)),A&2048&&_p(U,o);break;case 24:Kr(s,o,f,v),A&2048&&Sp(o.alternate,o);break;default:Kr(s,o,f,v)}}function va(s,o,f,v,A){for(A=A&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var T=s,U=o,Z=f,ne=v,fe=U.flags;switch(U.tag){case 0:case 11:case 15:va(T,U,Z,ne,A),Bl(8,U);break;case 23:break;case 22:var _e=U.stateNode;U.memoizedState!==null?_e._visibility&2?va(T,U,Z,ne,A):Hl(T,U):(_e._visibility|=2,va(T,U,Z,ne,A)),A&&fe&2048&&_p(U.alternate,U);break;case 24:va(T,U,Z,ne,A),A&&fe&2048&&Sp(U.alternate,U);break;default:va(T,U,Z,ne,A)}o=o.sibling}}function Hl(s,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var f=s,v=o,A=v.flags;switch(v.tag){case 22:Hl(f,v),A&2048&&_p(v.alternate,v);break;case 24:Hl(f,v),A&2048&&Sp(v.alternate,v);break;default:Hl(f,v)}o=o.sibling}}var $l=8192;function ya(s,o,f){if(s.subtreeFlags&$l)for(s=s.child;s!==null;)fy(s,o,f),s=s.sibling}function fy(s,o,f){switch(s.tag){case 26:ya(s,o,f),s.flags&$l&&s.memoizedState!==null&&R4(f,Gr,s.memoizedState,s.memoizedProps);break;case 5:ya(s,o,f);break;case 3:case 4:var v=Gr;Gr=ed(s.stateNode.containerInfo),ya(s,o,f),Gr=v;break;case 22:s.memoizedState===null&&(v=s.alternate,v!==null&&v.memoizedState!==null?(v=$l,$l=16777216,ya(s,o,f),$l=v):ya(s,o,f));break;default:ya(s,o,f)}}function hy(s){var o=s.alternate;if(o!==null&&(s=o.child,s!==null)){o.child=null;do o=s.sibling,s.sibling=null,s=o;while(s!==null)}}function Ul(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var v=o[f];Cn=v,my(v,s)}hy(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)py(s),s=s.sibling}function py(s){switch(s.tag){case 0:case 11:case 15:Ul(s),s.flags&2048&&yi(9,s,s.return);break;case 3:Ul(s);break;case 12:Ul(s);break;case 22:var o=s.stateNode;s.memoizedState!==null&&o._visibility&2&&(s.return===null||s.return.tag!==13)?(o._visibility&=-3,Hu(s)):Ul(s);break;default:Ul(s)}}function Hu(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var v=o[f];Cn=v,my(v,s)}hy(s)}for(s=s.child;s!==null;){switch(o=s,o.tag){case 0:case 11:case 15:yi(8,o,o.return),Hu(o);break;case 22:f=o.stateNode,f._visibility&2&&(f._visibility&=-3,Hu(o));break;default:Hu(o)}s=s.sibling}}function my(s,o){for(;Cn!==null;){var f=Cn;switch(f.tag){case 0:case 11:case 15:yi(8,f,o);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var v=f.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:El(f.memoizedState.cache)}if(v=f.child,v!==null)v.return=f,Cn=v;else e:for(f=s;Cn!==null;){v=Cn;var A=v.sibling,T=v.return;if(iy(v),v===f){Cn=null;break e}if(A!==null){A.return=T,Cn=A;break e}Cn=T}}}var V3={getCacheForType:function(s){var o=Mn(un),f=o.data.get(s);return f===void 0&&(f=s(),o.data.set(s,f)),f},cacheSignal:function(){return Mn(un).controller.signal}},q3=typeof WeakMap=="function"?WeakMap:Map,jt=0,$t=null,mt=null,yt=0,Ot=0,gr=null,bi=!1,ba=!1,wp=!1,Is=0,on=0,xi=0,Co=0,Cp=0,vr=0,xa=0,Vl=null,rr=null,kp=!1,$u=0,gy=0,Uu=1/0,Vu=null,_i=null,bn=0,Si=null,_a=null,Ps=0,Ep=0,Ap=null,vy=null,ql=0,Np=null;function yr(){return(jt&2)!==0&&yt!==0?yt&-yt:W.T!==null?Op():Nn()}function yy(){if(vr===0)if((yt&536870912)===0||wt){var s=Zt;Zt<<=1,(Zt&3932160)===0&&(Zt=262144),vr=s}else vr=536870912;return s=pr.current,s!==null&&(s.flags|=32),vr}function sr(s,o,f){(s===$t&&(Ot===2||Ot===9)||s.cancelPendingCommit!==null)&&(Sa(s,0),wi(s,yt,vr,!1)),ot(s,f),((jt&2)===0||s!==$t)&&(s===$t&&((jt&2)===0&&(Co|=f),on===4&&wi(s,yt,vr,!1)),ls(s))}function by(s,o,f){if((jt&6)!==0)throw Error(r(327));var v=!f&&(o&127)===0&&(o&s.expiredLanes)===0||He(s,o),A=v?K3(s,o):jp(s,o,!0),T=v;do{if(A===0){ba&&!v&&wi(s,o,0,!1);break}else{if(f=s.current.alternate,T&&!W3(f)){A=jp(s,o,!1),T=!1;continue}if(A===2){if(T=o,s.errorRecoveryDisabledLanes&T)var U=0;else U=s.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){o=U;e:{var Z=s;A=Vl;var ne=Z.current.memoizedState.isDehydrated;if(ne&&(Sa(Z,U).flags|=256),U=jp(Z,U,!1),U!==2){if(wp&&!ne){Z.errorRecoveryDisabledLanes|=T,Co|=T,A=4;break e}T=rr,rr=A,T!==null&&(rr===null?rr=T:rr.push.apply(rr,T))}A=U}if(T=!1,A!==2)continue}}if(A===1){Sa(s,0),wi(s,o,0,!0);break}e:{switch(v=s,T=A,T){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:wi(v,o,vr,!bi);break e;case 2:rr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(A=$u+300-Re(),10<A)){if(wi(v,o,vr,!bi),ve(v,0,!0)!==0)break e;Ps=o,v.timeoutHandle=Xy(xy.bind(null,v,f,rr,Vu,kp,o,vr,Co,xa,bi,T,"Throttled",-0,0),A);break e}xy(v,f,rr,Vu,kp,o,vr,Co,xa,bi,T,null,-0,0)}}break}while(!0);ls(s)}function xy(s,o,f,v,A,T,U,Z,ne,fe,_e,Ce,pe,ye){if(s.timeoutHandle=-1,Ce=o.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qr},fy(o,T,Ce);var Ke=(T&62914560)===T?$u-Re():(T&4194048)===T?gy-Re():0;if(Ke=j4(Ce,Ke),Ke!==null){Ps=T,s.cancelPendingCommit=Ke(Ny.bind(null,s,o,T,f,v,A,U,Z,ne,_e,Ce,null,pe,ye)),wi(s,T,U,!fe);return}}Ny(s,o,T,f,v,A,U,Z,ne)}function W3(s){for(var o=s;;){var f=o.tag;if((f===0||f===11||f===15)&&o.flags&16384&&(f=o.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var v=0;v<f.length;v++){var A=f[v],T=A.getSnapshot;A=A.value;try{if(!fr(T(),A))return!1}catch{return!1}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function wi(s,o,f,v){o&=~Cp,o&=~Co,s.suspendedLanes|=o,s.pingedLanes&=~o,v&&(s.warmLanes|=o),v=s.expirationTimes;for(var A=o;0<A;){var T=31-Pe(A),U=1<<T;v[T]=-1,A&=~U}f!==0&&Gt(s,f,o)}function qu(){return(jt&6)===0?(Wl(0),!1):!0}function Rp(){if(mt!==null){if(Ot===0)var s=mt.return;else s=mt,Es=mo=null,qh(s),fa=null,Nl=0,s=mt;for(;s!==null;)Q0(s.alternate,s),s=s.return;mt=null}}function Sa(s,o){var f=s.timeoutHandle;f!==-1&&(s.timeoutHandle=-1,f4(f)),f=s.cancelPendingCommit,f!==null&&(s.cancelPendingCommit=null,f()),Ps=0,Rp(),$t=s,mt=f=Cs(s.current,null),yt=o,Ot=0,gr=null,bi=!1,ba=He(s,o),wp=!1,xa=vr=Cp=Co=xi=on=0,rr=Vl=null,kp=!1,(o&8)!==0&&(o|=o&32);var v=s.entangledLanes;if(v!==0)for(s=s.entanglements,v&=o;0<v;){var A=31-Pe(v),T=1<<A;o|=s[A],v&=~T}return Is=o,fu(),f}function _y(s,o){ct=null,W.H=Il,o===da||o===xu?(o=P1(),Ot=3):o===Mh?(o=P1(),Ot=4):Ot=o===ap?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,gr=o,mt===null&&(on=1,Ou(s,jr(o,s.current)))}function Sy(){var s=pr.current;return s===null?!0:(yt&4194048)===yt?Or===null:(yt&62914560)===yt||(yt&536870912)!==0?s===Or:!1}function wy(){var s=W.H;return W.H=Il,s===null?Il:s}function Cy(){var s=W.A;return W.A=V3,s}function Wu(){on=4,bi||(yt&4194048)!==yt&&pr.current!==null||(ba=!0),(xi&134217727)===0&&(Co&134217727)===0||$t===null||wi($t,yt,vr,!1)}function jp(s,o,f){var v=jt;jt|=2;var A=wy(),T=Cy();($t!==s||yt!==o)&&(Vu=null,Sa(s,o)),o=!1;var U=on;e:do try{if(Ot!==0&&mt!==null){var Z=mt,ne=gr;switch(Ot){case 8:Rp(),U=6;break e;case 3:case 2:case 9:case 6:pr.current===null&&(o=!0);var fe=Ot;if(Ot=0,gr=null,wa(s,Z,ne,fe),f&&ba){U=0;break e}break;default:fe=Ot,Ot=0,gr=null,wa(s,Z,ne,fe)}}G3(),U=on;break}catch(_e){_y(s,_e)}while(!0);return o&&s.shellSuspendCounter++,Es=mo=null,jt=v,W.H=A,W.A=T,mt===null&&($t=null,yt=0,fu()),U}function G3(){for(;mt!==null;)ky(mt)}function K3(s,o){var f=jt;jt|=2;var v=wy(),A=Cy();$t!==s||yt!==o?(Vu=null,Uu=Re()+500,Sa(s,o)):ba=He(s,o);e:do try{if(Ot!==0&&mt!==null){o=mt;var T=gr;t:switch(Ot){case 1:Ot=0,gr=null,wa(s,o,T,1);break;case 2:case 9:if(L1(T)){Ot=0,gr=null,Ey(o);break}o=function(){Ot!==2&&Ot!==9||$t!==s||(Ot=7),ls(s)},T.then(o,o);break e;case 3:Ot=7;break e;case 4:Ot=5;break e;case 7:L1(T)?(Ot=0,gr=null,Ey(o)):(Ot=0,gr=null,wa(s,o,T,7));break;case 5:var U=null;switch(mt.tag){case 26:U=mt.memoizedState;case 5:case 27:var Z=mt;if(U?db(U):Z.stateNode.complete){Ot=0,gr=null;var ne=Z.sibling;if(ne!==null)mt=ne;else{var fe=Z.return;fe!==null?(mt=fe,Gu(fe)):mt=null}break t}}Ot=0,gr=null,wa(s,o,T,5);break;case 6:Ot=0,gr=null,wa(s,o,T,6);break;case 8:Rp(),on=6;break e;default:throw Error(r(462))}}Y3();break}catch(_e){_y(s,_e)}while(!0);return Es=mo=null,W.H=v,W.A=A,jt=f,mt!==null?0:($t=null,yt=0,fu(),on)}function Y3(){for(;mt!==null&&!it();)ky(mt)}function ky(s){var o=Y0(s.alternate,s,Is);s.memoizedProps=s.pendingProps,o===null?Gu(s):mt=o}function Ey(s){var o=s,f=o.alternate;switch(o.tag){case 15:case 0:o=U0(f,o,o.pendingProps,o.type,void 0,yt);break;case 11:o=U0(f,o,o.pendingProps,o.type.render,o.ref,yt);break;case 5:qh(o);default:Q0(f,o),o=mt=C1(o,Is),o=Y0(f,o,Is)}s.memoizedProps=s.pendingProps,o===null?Gu(s):mt=o}function wa(s,o,f,v){Es=mo=null,qh(o),fa=null,Nl=0;var A=o.return;try{if(P3(s,A,o,f,yt)){on=1,Ou(s,jr(f,s.current)),mt=null;return}}catch(T){if(A!==null)throw mt=A,T;on=1,Ou(s,jr(f,s.current)),mt=null;return}o.flags&32768?(wt||v===1?s=!0:ba||(yt&536870912)!==0?s=!1:(bi=s=!0,(v===2||v===9||v===3||v===6)&&(v=pr.current,v!==null&&v.tag===13&&(v.flags|=16384))),Ay(o,s)):Gu(o)}function Gu(s){var o=s;do{if((o.flags&32768)!==0){Ay(o,bi);return}s=o.return;var f=F3(o.alternate,o,Is);if(f!==null){mt=f;return}if(o=o.sibling,o!==null){mt=o;return}mt=o=s}while(o!==null);on===0&&(on=5)}function Ay(s,o){do{var f=H3(s.alternate,s);if(f!==null){f.flags&=32767,mt=f;return}if(f=s.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!o&&(s=s.sibling,s!==null)){mt=s;return}mt=s=f}while(s!==null);on=6,mt=null}function Ny(s,o,f,v,A,T,U,Z,ne){s.cancelPendingCommit=null;do Ku();while(bn!==0);if((jt&6)!==0)throw Error(r(327));if(o!==null){if(o===s.current)throw Error(r(177));if(T=o.lanes|o.childLanes,T|=yh,Tt(s,f,T,U,Z,ne),s===$t&&(mt=$t=null,yt=0),_a=o,Si=s,Ps=f,Ep=T,Ap=A,vy=v,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,J3(Ee,function(){return My(),null})):(s.callbackNode=null,s.callbackPriority=0),v=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||v){v=W.T,W.T=null,A=X.p,X.p=2,U=jt,jt|=4;try{$3(s,o,f)}finally{jt=U,X.p=A,W.T=v}}bn=1,Ry(),jy(),Ty()}}function Ry(){if(bn===1){bn=0;var s=Si,o=_a,f=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||f){f=W.T,W.T=null;var v=X.p;X.p=2;var A=jt;jt|=4;try{cy(o,s);var T=$p,U=m1(s.containerInfo),Z=T.focusedElem,ne=T.selectionRange;if(U!==Z&&Z&&Z.ownerDocument&&p1(Z.ownerDocument.documentElement,Z)){if(ne!==null&&hh(Z)){var fe=ne.start,_e=ne.end;if(_e===void 0&&(_e=fe),"selectionStart"in Z)Z.selectionStart=fe,Z.selectionEnd=Math.min(_e,Z.value.length);else{var Ce=Z.ownerDocument||document,pe=Ce&&Ce.defaultView||window;if(pe.getSelection){var ye=pe.getSelection(),Ke=Z.textContent.length,st=Math.min(ne.start,Ke),Bt=ne.end===void 0?st:Math.min(ne.end,Ke);!ye.extend&&st>Bt&&(U=Bt,Bt=st,st=U);var le=h1(Z,st),ie=h1(Z,Bt);if(le&&ie&&(ye.rangeCount!==1||ye.anchorNode!==le.node||ye.anchorOffset!==le.offset||ye.focusNode!==ie.node||ye.focusOffset!==ie.offset)){var ue=Ce.createRange();ue.setStart(le.node,le.offset),ye.removeAllRanges(),st>Bt?(ye.addRange(ue),ye.extend(ie.node,ie.offset)):(ue.setEnd(ie.node,ie.offset),ye.addRange(ue))}}}}for(Ce=[],ye=Z;ye=ye.parentNode;)ye.nodeType===1&&Ce.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<Ce.length;Z++){var we=Ce[Z];we.element.scrollLeft=we.left,we.element.scrollTop=we.top}}od=!!Hp,$p=Hp=null}finally{jt=A,X.p=v,W.T=f}}s.current=o,bn=2}}function jy(){if(bn===2){bn=0;var s=Si,o=_a,f=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||f){f=W.T,W.T=null;var v=X.p;X.p=2;var A=jt;jt|=4;try{sy(s,o.alternate,o)}finally{jt=A,X.p=v,W.T=f}}bn=3}}function Ty(){if(bn===4||bn===3){bn=0,ge();var s=Si,o=_a,f=Ps,v=vy;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?bn=5:(bn=0,_a=Si=null,Dy(s,s.pendingLanes));var A=s.pendingLanes;if(A===0&&(_i=null),vn(f),o=o.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(lt,o,void 0,(o.current.flags&128)===128)}catch{}if(v!==null){o=W.T,A=X.p,X.p=2,W.T=null;try{for(var T=s.onRecoverableError,U=0;U<v.length;U++){var Z=v[U];T(Z.value,{componentStack:Z.stack})}}finally{W.T=o,X.p=A}}(Ps&3)!==0&&Ku(),ls(s),A=s.pendingLanes,(f&261930)!==0&&(A&42)!==0?s===Np?ql++:(ql=0,Np=s):ql=0,Wl(0)}}function Dy(s,o){(s.pooledCacheLanes&=o)===0&&(o=s.pooledCache,o!=null&&(s.pooledCache=null,El(o)))}function Ku(){return Ry(),jy(),Ty(),My()}function My(){if(bn!==5)return!1;var s=Si,o=Ep;Ep=0;var f=vn(Ps),v=W.T,A=X.p;try{X.p=32>f?32:f,W.T=null,f=Ap,Ap=null;var T=Si,U=Ps;if(bn=0,_a=Si=null,Ps=0,(jt&6)!==0)throw Error(r(331));var Z=jt;if(jt|=4,py(T.current),dy(T,T.current,U,f),jt=Z,Wl(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(lt,T)}catch{}return!0}finally{X.p=A,W.T=v,Dy(s,o)}}function Oy(s,o,f){o=jr(f,o),o=op(s.stateNode,o,2),s=mi(s,o,2),s!==null&&(ot(s,2),ls(s))}function Lt(s,o,f){if(s.tag===3)Oy(s,s,f);else for(;o!==null;){if(o.tag===3){Oy(o,s,f);break}else if(o.tag===1){var v=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(_i===null||!_i.has(v))){s=jr(f,s),f=L0(2),v=mi(o,f,2),v!==null&&(I0(f,v,o,s),ot(v,2),ls(v));break}}o=o.return}}function Tp(s,o,f){var v=s.pingCache;if(v===null){v=s.pingCache=new q3;var A=new Set;v.set(o,A)}else A=v.get(o),A===void 0&&(A=new Set,v.set(o,A));A.has(f)||(wp=!0,A.add(f),s=X3.bind(null,s,o,f),o.then(s,s))}function X3(s,o,f){var v=s.pingCache;v!==null&&v.delete(o),s.pingedLanes|=s.suspendedLanes&f,s.warmLanes&=~f,$t===s&&(yt&f)===f&&(on===4||on===3&&(yt&62914560)===yt&&300>Re()-$u?(jt&2)===0&&Sa(s,0):Cp|=f,xa===yt&&(xa=0)),ls(s)}function Ly(s,o){o===0&&(o=Me()),s=fo(s,o),s!==null&&(ot(s,o),ls(s))}function Q3(s){var o=s.memoizedState,f=0;o!==null&&(f=o.retryLane),Ly(s,f)}function Z3(s,o){var f=0;switch(s.tag){case 31:case 13:var v=s.stateNode,A=s.memoizedState;A!==null&&(f=A.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(o),Ly(s,f)}function J3(s,o){return Ve(s,o)}var Yu=null,Ca=null,Dp=!1,Xu=!1,Mp=!1,Ci=0;function ls(s){s!==Ca&&s.next===null&&(Ca===null?Yu=Ca=s:Ca=Ca.next=s),Xu=!0,Dp||(Dp=!0,t4())}function Wl(s,o){if(!Mp&&Xu){Mp=!0;do for(var f=!1,v=Yu;v!==null;){if(s!==0){var A=v.pendingLanes;if(A===0)var T=0;else{var U=v.suspendedLanes,Z=v.pingedLanes;T=(1<<31-Pe(42|s)+1)-1,T&=A&~(U&~Z),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(f=!0,By(v,T))}else T=yt,T=ve(v,v===$t?T:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(T&3)===0||He(v,T)||(f=!0,By(v,T));v=v.next}while(f);Mp=!1}}function e4(){Iy()}function Iy(){Xu=Dp=!1;var s=0;Ci!==0&&d4()&&(s=Ci);for(var o=Re(),f=null,v=Yu;v!==null;){var A=v.next,T=Py(v,o);T===0?(v.next=null,f===null?Yu=A:f.next=A,A===null&&(Ca=f)):(f=v,(s!==0||(T&3)!==0)&&(Xu=!0)),v=A}bn!==0&&bn!==5||Wl(s),Ci!==0&&(Ci=0)}function Py(s,o){for(var f=s.suspendedLanes,v=s.pingedLanes,A=s.expirationTimes,T=s.pendingLanes&-62914561;0<T;){var U=31-Pe(T),Z=1<<U,ne=A[U];ne===-1?((Z&f)===0||(Z&v)!==0)&&(A[U]=et(Z,o)):ne<=o&&(s.expiredLanes|=Z),T&=~Z}if(o=$t,f=yt,f=ve(s,s===o?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),v=s.callbackNode,f===0||s===o&&(Ot===2||Ot===9)||s.cancelPendingCommit!==null)return v!==null&&v!==null&&We(v),s.callbackNode=null,s.callbackPriority=0;if((f&3)===0||He(s,f)){if(o=f&-f,o===s.callbackPriority)return o;switch(v!==null&&We(v),vn(f)){case 2:case 8:f=me;break;case 32:f=Ee;break;case 268435456:f=Fe;break;default:f=Ee}return v=zy.bind(null,s),f=Ve(f,v),s.callbackPriority=o,s.callbackNode=f,o}return v!==null&&v!==null&&We(v),s.callbackPriority=2,s.callbackNode=null,2}function zy(s,o){if(bn!==0&&bn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var f=s.callbackNode;if(Ku()&&s.callbackNode!==f)return null;var v=yt;return v=ve(s,s===$t?v:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),v===0?null:(by(s,v,o),Py(s,Re()),s.callbackNode!=null&&s.callbackNode===f?zy.bind(null,s):null)}function By(s,o){if(Ku())return null;by(s,o,!0)}function t4(){h4(function(){(jt&6)!==0?Ve(oe,e4):Iy()})}function Op(){if(Ci===0){var s=ca;s===0&&(s=gn,gn<<=1,(gn&261888)===0&&(gn=256)),Ci=s}return Ci}function Fy(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:eo(""+s)}function Hy(s,o){var f=o.ownerDocument.createElement("input");return f.name=o.name,f.value=o.value,s.id&&f.setAttribute("form",s.id),o.parentNode.insertBefore(f,o),s=new FormData(s),f.parentNode.removeChild(f),s}function n4(s,o,f,v,A){if(o==="submit"&&f&&f.stateNode===A){var T=Fy((A[Dt]||null).action),U=v.submitter;U&&(o=(o=U[Dt]||null)?Fy(o.formAction):U.getAttribute("formAction"),o!==null&&(T=o,U=null));var Z=new so("action","action",null,v,A);s.push({event:Z,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(Ci!==0){var ne=U?Hy(A,U):new FormData(A);ep(f,{pending:!0,data:ne,method:A.method,action:T},null,ne)}}else typeof T=="function"&&(Z.preventDefault(),ne=U?Hy(A,U):new FormData(A),ep(f,{pending:!0,data:ne,method:A.method,action:T},T,ne))},currentTarget:A}]})}}for(var Lp=0;Lp<vh.length;Lp++){var Ip=vh[Lp],r4=Ip.toLowerCase(),s4=Ip[0].toUpperCase()+Ip.slice(1);Wr(r4,"on"+s4)}Wr(y1,"onAnimationEnd"),Wr(b1,"onAnimationIteration"),Wr(x1,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(x3,"onTransitionRun"),Wr(_3,"onTransitionStart"),Wr(S3,"onTransitionCancel"),Wr(_1,"onTransitionEnd"),cr("onMouseEnter",["mouseout","mouseover"]),cr("onMouseLeave",["mouseout","mouseover"]),cr("onPointerEnter",["pointerout","pointerover"]),cr("onPointerLeave",["pointerout","pointerover"]),Zn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gl="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(" "),i4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gl));function $y(s,o){o=(o&4)!==0;for(var f=0;f<s.length;f++){var v=s[f],A=v.event;v=v.listeners;e:{var T=void 0;if(o)for(var U=v.length-1;0<=U;U--){var Z=v[U],ne=Z.instance,fe=Z.currentTarget;if(Z=Z.listener,ne!==T&&A.isPropagationStopped())break e;T=Z,A.currentTarget=fe;try{T(A)}catch(_e){du(_e)}A.currentTarget=null,T=ne}else for(U=0;U<v.length;U++){if(Z=v[U],ne=Z.instance,fe=Z.currentTarget,Z=Z.listener,ne!==T&&A.isPropagationStopped())break e;T=Z,A.currentTarget=fe;try{T(A)}catch(_e){du(_e)}A.currentTarget=null,T=ne}}}}function gt(s,o){var f=o[bs];f===void 0&&(f=o[bs]=new Set);var v=s+"__bubble";f.has(v)||(Uy(o,s,2,!1),f.add(v))}function Pp(s,o,f){var v=0;o&&(v|=4),Uy(f,s,v,o)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function zp(s){if(!s[Qu]){s[Qu]=!0,Ur.forEach(function(f){f!=="selectionchange"&&(i4.has(f)||Pp(f,!1,s),Pp(f,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[Qu]||(o[Qu]=!0,Pp("selectionchange",!1,o))}}function Uy(s,o,f,v){switch(yb(o)){case 2:var A=M4;break;case 8:A=O4;break;default:A=Jp}f=A.bind(null,o,f,s),A=void 0,!Yo||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(A=!0),v?A!==void 0?s.addEventListener(o,f,{capture:!0,passive:A}):s.addEventListener(o,f,!0):A!==void 0?s.addEventListener(o,f,{passive:A}):s.addEventListener(o,f,!1)}function Bp(s,o,f,v,A){var T=v;if((o&1)===0&&(o&2)===0&&v!==null)e:for(;;){if(v===null)return;var U=v.tag;if(U===3||U===4){var Z=v.stateNode.containerInfo;if(Z===A)break;if(U===4)for(U=v.return;U!==null;){var ne=U.tag;if((ne===3||ne===4)&&U.stateNode.containerInfo===A)return;U=U.return}for(;Z!==null;){if(U=Bn(Z),U===null)return;if(ne=U.tag,ne===5||ne===6||ne===26||ne===27){v=T=U;continue e}Z=Z.parentNode}}v=v.return}to(function(){var fe=T,_e=hl(f),Ce=[];e:{var pe=S1.get(s);if(pe!==void 0){var ye=so,Ke=s;switch(s){case"keypress":if(Xo(f)===0)break e;case"keydown":case"keyup":ye=_t;break;case"focusin":Ke="focus",ye=Jo;break;case"focusout":Ke="blur",ye=Jo;break;case"beforeblur":case"afterblur":ye=Jo;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=ru;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=oh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=ao;break;case y1:case b1:case x1:ye=su;break;case _1:ye=lo;break;case"scroll":case"scrollend":ye=sh;break;case"wheel":ye=i3;break;case"copy":case"cut":case"paste":ye=li;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=St;break;case"toggle":case"beforetoggle":ye=a3}var st=(o&4)!==0,Bt=!st&&(s==="scroll"||s==="scrollend"),le=st?pe!==null?pe+"Capture":null:pe;st=[];for(var ie=fe,ue;ie!==null;){var we=ie;if(ue=we.stateNode,we=we.tag,we!==5&&we!==26&&we!==27||ue===null||le===null||(we=ai(ie,le),we!=null&&st.push(Kl(ie,we,ue))),Bt)break;ie=ie.return}0<st.length&&(pe=new ye(pe,Ke,null,f,_e),Ce.push({event:pe,listeners:st}))}}if((o&7)===0){e:{if(pe=s==="mouseover"||s==="pointerover",ye=s==="mouseout"||s==="pointerout",pe&&f!==fl&&(Ke=f.relatedTarget||f.fromElement)&&(Bn(Ke)||Ke[jn]))break e;if((ye||pe)&&(pe=_e.window===_e?_e:(pe=_e.ownerDocument)?pe.defaultView||pe.parentWindow:window,ye?(Ke=f.relatedTarget||f.toElement,ye=fe,Ke=Ke?Bn(Ke):null,Ke!==null&&(Bt=l(Ke),st=Ke.tag,Ke!==Bt||st!==5&&st!==27&&st!==6)&&(Ke=null)):(ye=null,Ke=fe),ye!==Ke)){if(st=ru,we="onMouseLeave",le="onMouseEnter",ie="mouse",(s==="pointerout"||s==="pointerover")&&(st=St,we="onPointerLeave",le="onPointerEnter",ie="pointer"),Bt=ye==null?pe:Gn(ye),ue=Ke==null?pe:Gn(Ke),pe=new st(we,ie+"leave",ye,f,_e),pe.target=Bt,pe.relatedTarget=ue,we=null,Bn(_e)===fe&&(st=new st(le,ie+"enter",Ke,f,_e),st.target=ue,st.relatedTarget=Bt,we=st),Bt=we,ye&&Ke)t:{for(st=o4,le=ye,ie=Ke,ue=0,we=le;we;we=st(we))ue++;we=0;for(var tt=ie;tt;tt=st(tt))we++;for(;0<ue-we;)le=st(le),ue--;for(;0<we-ue;)ie=st(ie),we--;for(;ue--;){if(le===ie||ie!==null&&le===ie.alternate){st=le;break t}le=st(le),ie=st(ie)}st=null}else st=null;ye!==null&&Vy(Ce,pe,ye,st,!1),Ke!==null&&Bt!==null&&Vy(Ce,Bt,Ke,st,!0)}}e:{if(pe=fe?Gn(fe):window,ye=pe.nodeName&&pe.nodeName.toLowerCase(),ye==="select"||ye==="input"&&pe.type==="file")var Et=a1;else if(i1(pe))if(l1)Et=v3;else{Et=m3;var Je=p3}else ye=pe.nodeName,!ye||ye.toLowerCase()!=="input"||pe.type!=="checkbox"&&pe.type!=="radio"?fe&&ni(fe.elementType)&&(Et=a1):Et=g3;if(Et&&(Et=Et(s,fe))){o1(Ce,Et,f,_e);break e}Je&&Je(s,pe,fe),s==="focusout"&&fe&&pe.type==="number"&&fe.memoizedProps.value!=null&&Yt(pe,"number",pe.value)}switch(Je=fe?Gn(fe):window,s){case"focusin":(i1(Je)||Je.contentEditable==="true")&&(ta=Je,ph=fe,wl=null);break;case"focusout":wl=ph=ta=null;break;case"mousedown":mh=!0;break;case"contextmenu":case"mouseup":case"dragend":mh=!1,g1(Ce,f,_e);break;case"selectionchange":if(b3)break;case"keydown":case"keyup":g1(Ce,f,_e)}var ut;if(uh)e:{switch(s){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else ea?r1(s,f)&&(bt="onCompositionEnd"):s==="keydown"&&f.keyCode===229&&(bt="onCompositionStart");bt&&(e1&&f.locale!=="ko"&&(ea||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&ea&&(ut=tu()):(ss=_e,pl="value"in ss?ss.value:ss.textContent,ea=!0)),Je=Zu(fe,bt),0<Je.length&&(bt=new vl(bt,s,null,f,_e),Ce.push({event:bt,listeners:Je}),ut?bt.data=ut:(ut=s1(f),ut!==null&&(bt.data=ut)))),(ut=c3?u3(s,f):d3(s,f))&&(bt=Zu(fe,"onBeforeInput"),0<bt.length&&(Je=new vl("onBeforeInput","beforeinput",null,f,_e),Ce.push({event:Je,listeners:bt}),Je.data=ut)),n4(Ce,s,fe,f,_e)}$y(Ce,o)})}function Kl(s,o,f){return{instance:s,listener:o,currentTarget:f}}function Zu(s,o){for(var f=o+"Capture",v=[];s!==null;){var A=s,T=A.stateNode;if(A=A.tag,A!==5&&A!==26&&A!==27||T===null||(A=ai(s,f),A!=null&&v.unshift(Kl(s,A,T)),A=ai(s,o),A!=null&&v.push(Kl(s,A,T))),s.tag===3)return v;s=s.return}return[]}function o4(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function Vy(s,o,f,v,A){for(var T=o._reactName,U=[];f!==null&&f!==v;){var Z=f,ne=Z.alternate,fe=Z.stateNode;if(Z=Z.tag,ne!==null&&ne===v)break;Z!==5&&Z!==26&&Z!==27||fe===null||(ne=fe,A?(fe=ai(f,T),fe!=null&&U.unshift(Kl(f,fe,ne))):A||(fe=ai(f,T),fe!=null&&U.push(Kl(f,fe,ne)))),f=f.return}U.length!==0&&s.push({event:o,listeners:U})}var a4=/\r\n?/g,l4=/\u0000|\uFFFD/g;function qy(s){return(typeof s=="string"?s:""+s).replace(a4,`
|
|
49
|
-
`).replace(l4,"")}function Wy(s,o){return o=qy(o),qy(s)===o}function zt(s,o,f,v,A,T){switch(f){case"children":typeof v=="string"?o==="body"||o==="textarea"&&v===""||ei(s,v):(typeof v=="number"||typeof v=="bigint")&&o!=="body"&&ei(s,""+v);break;case"className":Ar(s,"class",v);break;case"tabIndex":Ar(s,"tabindex",v);break;case"dir":case"role":case"viewBox":case"width":case"height":Ar(s,f,v);break;case"style":eu(s,v,T);break;case"data":if(o!=="object"){Ar(s,"data",v);break}case"src":case"href":if(v===""&&(o!=="a"||f!=="href")){s.removeAttribute(f);break}if(v==null||typeof v=="function"||typeof v=="symbol"||typeof v=="boolean"){s.removeAttribute(f);break}v=eo(""+v),s.setAttribute(f,v);break;case"action":case"formAction":if(typeof v=="function"){s.setAttribute(f,"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 T=="function"&&(f==="formAction"?(o!=="input"&&zt(s,o,"name",A.name,A,null),zt(s,o,"formEncType",A.formEncType,A,null),zt(s,o,"formMethod",A.formMethod,A,null),zt(s,o,"formTarget",A.formTarget,A,null)):(zt(s,o,"encType",A.encType,A,null),zt(s,o,"method",A.method,A,null),zt(s,o,"target",A.target,A,null)));if(v==null||typeof v=="symbol"||typeof v=="boolean"){s.removeAttribute(f);break}v=eo(""+v),s.setAttribute(f,v);break;case"onClick":v!=null&&(s.onclick=qr);break;case"onScroll":v!=null&>("scroll",s);break;case"onScrollEnd":v!=null&>("scrollend",s);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(f=v.__html,f!=null){if(A.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"multiple":s.multiple=v&&typeof v!="function"&&typeof v!="symbol";break;case"muted":s.muted=v&&typeof v!="function"&&typeof v!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(v==null||typeof v=="function"||typeof v=="boolean"||typeof v=="symbol"){s.removeAttribute("xlink:href");break}f=eo(""+v),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":v!=null&&typeof v!="function"&&typeof v!="symbol"?s.setAttribute(f,""+v):s.removeAttribute(f);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":v&&typeof v!="function"&&typeof v!="symbol"?s.setAttribute(f,""):s.removeAttribute(f);break;case"capture":case"download":v===!0?s.setAttribute(f,""):v!==!1&&v!=null&&typeof v!="function"&&typeof v!="symbol"?s.setAttribute(f,v):s.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":v!=null&&typeof v!="function"&&typeof v!="symbol"&&!isNaN(v)&&1<=v?s.setAttribute(f,v):s.removeAttribute(f);break;case"rowSpan":case"start":v==null||typeof v=="function"||typeof v=="symbol"||isNaN(v)?s.removeAttribute(f):s.setAttribute(f,v);break;case"popover":gt("beforetoggle",s),gt("toggle",s),dr(s,"popover",v);break;case"xlinkActuate":yn(s,"http://www.w3.org/1999/xlink","xlink:actuate",v);break;case"xlinkArcrole":yn(s,"http://www.w3.org/1999/xlink","xlink:arcrole",v);break;case"xlinkRole":yn(s,"http://www.w3.org/1999/xlink","xlink:role",v);break;case"xlinkShow":yn(s,"http://www.w3.org/1999/xlink","xlink:show",v);break;case"xlinkTitle":yn(s,"http://www.w3.org/1999/xlink","xlink:title",v);break;case"xlinkType":yn(s,"http://www.w3.org/1999/xlink","xlink:type",v);break;case"xmlBase":yn(s,"http://www.w3.org/XML/1998/namespace","xml:base",v);break;case"xmlLang":yn(s,"http://www.w3.org/XML/1998/namespace","xml:lang",v);break;case"xmlSpace":yn(s,"http://www.w3.org/XML/1998/namespace","xml:space",v);break;case"is":dr(s,"is",v);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=ri.get(f)||f,dr(s,f,v))}}function Fp(s,o,f,v,A,T){switch(f){case"style":eu(s,v,T);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(f=v.__html,f!=null){if(A.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"children":typeof v=="string"?ei(s,v):(typeof v=="number"||typeof v=="bigint")&&ei(s,""+v);break;case"onScroll":v!=null&>("scroll",s);break;case"onScrollEnd":v!=null&>("scrollend",s);break;case"onClick":v!=null&&(s.onclick=qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_s.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(A=f.endsWith("Capture"),o=f.slice(2,A?f.length-7:void 0),T=s[Dt]||null,T=T!=null?T[f]:null,typeof T=="function"&&s.removeEventListener(o,T,A),typeof v=="function")){typeof T!="function"&&T!==null&&(f in s?s[f]=null:s.hasAttribute(f)&&s.removeAttribute(f)),s.addEventListener(o,v,A);break e}f in s?s[f]=v:v===!0?s.setAttribute(f,""):dr(s,f,v)}}}function Ln(s,o,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gt("error",s),gt("load",s);var v=!1,A=!1,T;for(T in f)if(f.hasOwnProperty(T)){var U=f[T];if(U!=null)switch(T){case"src":v=!0;break;case"srcSet":A=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:zt(s,o,T,U,f,null)}}A&&zt(s,o,"srcSet",f.srcSet,f,null),v&&zt(s,o,"src",f.src,f,null);return;case"input":gt("invalid",s);var Z=T=U=A=null,ne=null,fe=null;for(v in f)if(f.hasOwnProperty(v)){var _e=f[v];if(_e!=null)switch(v){case"name":A=_e;break;case"type":U=_e;break;case"checked":ne=_e;break;case"defaultChecked":fe=_e;break;case"value":T=_e;break;case"defaultValue":Z=_e;break;case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(r(137,o));break;default:zt(s,o,v,_e,f,null)}}Jc(s,T,Z,ne,fe,U,A,!1);return;case"select":gt("invalid",s),v=U=T=null;for(A in f)if(f.hasOwnProperty(A)&&(Z=f[A],Z!=null))switch(A){case"value":T=Z;break;case"defaultValue":U=Z;break;case"multiple":v=Z;default:zt(s,o,A,Z,f,null)}o=T,f=U,s.multiple=!!v,o!=null?It(s,!!v,o,!1):f!=null&&It(s,!!v,f,!0);return;case"textarea":gt("invalid",s),T=A=v=null;for(U in f)if(f.hasOwnProperty(U)&&(Z=f[U],Z!=null))switch(U){case"value":v=Z;break;case"defaultValue":A=Z;break;case"children":T=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(91));break;default:zt(s,o,U,Z,f,null)}Go(s,v,A,T);return;case"option":for(ne in f)if(f.hasOwnProperty(ne)&&(v=f[ne],v!=null))switch(ne){case"selected":s.selected=v&&typeof v!="function"&&typeof v!="symbol";break;default:zt(s,o,ne,v,f,null)}return;case"dialog":gt("beforetoggle",s),gt("toggle",s),gt("cancel",s),gt("close",s);break;case"iframe":case"object":gt("load",s);break;case"video":case"audio":for(v=0;v<Gl.length;v++)gt(Gl[v],s);break;case"image":gt("error",s),gt("load",s);break;case"details":gt("toggle",s);break;case"embed":case"source":case"link":gt("error",s),gt("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(fe in f)if(f.hasOwnProperty(fe)&&(v=f[fe],v!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:zt(s,o,fe,v,f,null)}return;default:if(ni(o)){for(_e in f)f.hasOwnProperty(_e)&&(v=f[_e],v!==void 0&&Fp(s,o,_e,v,f,void 0));return}}for(Z in f)f.hasOwnProperty(Z)&&(v=f[Z],v!=null&&zt(s,o,Z,v,f,null))}function c4(s,o,f,v){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var A=null,T=null,U=null,Z=null,ne=null,fe=null,_e=null;for(ye in f){var Ce=f[ye];if(f.hasOwnProperty(ye)&&Ce!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":ne=Ce;default:v.hasOwnProperty(ye)||zt(s,o,ye,null,v,Ce)}}for(var pe in v){var ye=v[pe];if(Ce=f[pe],v.hasOwnProperty(pe)&&(ye!=null||Ce!=null))switch(pe){case"type":T=ye;break;case"name":A=ye;break;case"checked":fe=ye;break;case"defaultChecked":_e=ye;break;case"value":U=ye;break;case"defaultValue":Z=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,o));break;default:ye!==Ce&&zt(s,o,pe,ye,v,Ce)}}Wo(s,U,Z,ne,fe,_e,T,A);return;case"select":ye=U=Z=pe=null;for(T in f)if(ne=f[T],f.hasOwnProperty(T)&&ne!=null)switch(T){case"value":break;case"multiple":ye=ne;default:v.hasOwnProperty(T)||zt(s,o,T,null,v,ne)}for(A in v)if(T=v[A],ne=f[A],v.hasOwnProperty(A)&&(T!=null||ne!=null))switch(A){case"value":pe=T;break;case"defaultValue":Z=T;break;case"multiple":U=T;default:T!==ne&&zt(s,o,A,T,v,ne)}o=Z,f=U,v=ye,pe!=null?It(s,!!f,pe,!1):!!v!=!!f&&(o!=null?It(s,!!f,o,!0):It(s,!!f,f?[]:"",!1));return;case"textarea":ye=pe=null;for(Z in f)if(A=f[Z],f.hasOwnProperty(Z)&&A!=null&&!v.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:zt(s,o,Z,null,v,A)}for(U in v)if(A=v[U],T=f[U],v.hasOwnProperty(U)&&(A!=null||T!=null))switch(U){case"value":pe=A;break;case"defaultValue":ye=A;break;case"children":break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:A!==T&&zt(s,o,U,A,v,T)}Ji(s,pe,ye);return;case"option":for(var Ke in f)if(pe=f[Ke],f.hasOwnProperty(Ke)&&pe!=null&&!v.hasOwnProperty(Ke))switch(Ke){case"selected":s.selected=!1;break;default:zt(s,o,Ke,null,v,pe)}for(ne in v)if(pe=v[ne],ye=f[ne],v.hasOwnProperty(ne)&&pe!==ye&&(pe!=null||ye!=null))switch(ne){case"selected":s.selected=pe&&typeof pe!="function"&&typeof pe!="symbol";break;default:zt(s,o,ne,pe,v,ye)}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 st in f)pe=f[st],f.hasOwnProperty(st)&&pe!=null&&!v.hasOwnProperty(st)&&zt(s,o,st,null,v,pe);for(fe in v)if(pe=v[fe],ye=f[fe],v.hasOwnProperty(fe)&&pe!==ye&&(pe!=null||ye!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,o));break;default:zt(s,o,fe,pe,v,ye)}return;default:if(ni(o)){for(var Bt in f)pe=f[Bt],f.hasOwnProperty(Bt)&&pe!==void 0&&!v.hasOwnProperty(Bt)&&Fp(s,o,Bt,void 0,v,pe);for(_e in v)pe=v[_e],ye=f[_e],!v.hasOwnProperty(_e)||pe===ye||pe===void 0&&ye===void 0||Fp(s,o,_e,pe,v,ye);return}}for(var le in f)pe=f[le],f.hasOwnProperty(le)&&pe!=null&&!v.hasOwnProperty(le)&&zt(s,o,le,null,v,pe);for(Ce in v)pe=v[Ce],ye=f[Ce],!v.hasOwnProperty(Ce)||pe===ye||pe==null&&ye==null||zt(s,o,Ce,pe,v,ye)}function Gy(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function u4(){if(typeof performance.getEntriesByType=="function"){for(var s=0,o=0,f=performance.getEntriesByType("resource"),v=0;v<f.length;v++){var A=f[v],T=A.transferSize,U=A.initiatorType,Z=A.duration;if(T&&Z&&Gy(U)){for(U=0,Z=A.responseEnd,v+=1;v<f.length;v++){var ne=f[v],fe=ne.startTime;if(fe>Z)break;var _e=ne.transferSize,Ce=ne.initiatorType;_e&&Gy(Ce)&&(ne=ne.responseEnd,U+=_e*(ne<Z?1:(Z-fe)/(ne-fe)))}if(--v,o+=8*(T+U)/(A.duration/1e3),s++,10<s)break}}if(0<s)return o/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Hp=null,$p=null;function Ju(s){return s.nodeType===9?s:s.ownerDocument}function Ky(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 Yy(s,o){if(s===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&o==="foreignObject"?0:s}function Up(s,o){return s==="textarea"||s==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Vp=null;function d4(){var s=window.event;return s&&s.type==="popstate"?s===Vp?!1:(Vp=s,!0):(Vp=null,!1)}var Xy=typeof setTimeout=="function"?setTimeout:void 0,f4=typeof clearTimeout=="function"?clearTimeout:void 0,Qy=typeof Promise=="function"?Promise:void 0,h4=typeof queueMicrotask=="function"?queueMicrotask:typeof Qy<"u"?function(s){return Qy.resolve(null).then(s).catch(p4)}:Xy;function p4(s){setTimeout(function(){throw s})}function ki(s){return s==="head"}function Zy(s,o){var f=o,v=0;do{var A=f.nextSibling;if(s.removeChild(f),A&&A.nodeType===8)if(f=A.data,f==="/$"||f==="/&"){if(v===0){s.removeChild(A),Na(o);return}v--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")v++;else if(f==="html")Yl(s.ownerDocument.documentElement);else if(f==="head"){f=s.ownerDocument.head,Yl(f);for(var T=f.firstChild;T;){var U=T.nextSibling,Z=T.nodeName;T[kr]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&T.rel.toLowerCase()==="stylesheet"||f.removeChild(T),T=U}}else f==="body"&&Yl(s.ownerDocument.body);f=A}while(f);Na(o)}function Jy(s,o){var f=s;s=0;do{var v=f.nextSibling;if(f.nodeType===1?o?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(o?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),v&&v.nodeType===8)if(f=v.data,f==="/$"){if(s===0)break;s--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||s++;f=v}while(f)}function qp(s){var o=s.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var f=o;switch(o=o.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":qp(f),Er(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}s.removeChild(f)}}function m4(s,o,f,v){for(;s.nodeType===1;){var A=f;if(s.nodeName.toLowerCase()!==o.toLowerCase()){if(!v&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(v){if(!s[kr])switch(o){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(T=s.getAttribute("rel"),T==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(T!==A.rel||s.getAttribute("href")!==(A.href==null||A.href===""?null:A.href)||s.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin)||s.getAttribute("title")!==(A.title==null?null:A.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(T=s.getAttribute("src"),(T!==(A.src==null?null:A.src)||s.getAttribute("type")!==(A.type==null?null:A.type)||s.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin))&&T&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(o==="input"&&s.type==="hidden"){var T=A.name==null?null:""+A.name;if(A.type==="hidden"&&s.getAttribute("name")===T)return s}else return s;if(s=Lr(s.nextSibling),s===null)break}return null}function g4(s,o,f){if(o==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!f||(s=Lr(s.nextSibling),s===null))return null;return s}function eb(s,o){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=Lr(s.nextSibling),s===null))return null;return s}function Wp(s){return s.data==="$?"||s.data==="$~"}function Gp(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function v4(s,o){var f=s.ownerDocument;if(s.data==="$~")s._reactRetry=o;else if(s.data!=="$?"||f.readyState!=="loading")o();else{var v=function(){o(),f.removeEventListener("DOMContentLoaded",v)};f.addEventListener("DOMContentLoaded",v),s._reactRetry=v}}function Lr(s){for(;s!=null;s=s.nextSibling){var o=s.nodeType;if(o===1||o===3)break;if(o===8){if(o=s.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return s}var Kp=null;function tb(s){s=s.nextSibling;for(var o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="/$"||f==="/&"){if(o===0)return Lr(s.nextSibling);o--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||o++}s=s.nextSibling}return null}function nb(s){s=s.previousSibling;for(var o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(o===0)return s;o--}else f!=="/$"&&f!=="/&"||o++}s=s.previousSibling}return null}function rb(s,o,f){switch(o=Ju(f),s){case"html":if(s=o.documentElement,!s)throw Error(r(452));return s;case"head":if(s=o.head,!s)throw Error(r(453));return s;case"body":if(s=o.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Yl(s){for(var o=s.attributes;o.length;)s.removeAttributeNode(o[0]);Er(s)}var Ir=new Map,sb=new Set;function ed(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var zs=X.d;X.d={f:y4,r:b4,D:x4,C:_4,L:S4,m:w4,X:k4,S:C4,M:E4};function y4(){var s=zs.f(),o=qu();return s||o}function b4(s){var o=Wn(s);o!==null&&o.tag===5&&o.type==="form"?_0(o):zs.r(s)}var ka=typeof document>"u"?null:document;function ib(s,o,f){var v=ka;if(v&&typeof o=="string"&&o){var A=Fn(o);A='link[rel="'+s+'"][href="'+A+'"]',typeof f=="string"&&(A+='[crossorigin="'+f+'"]'),sb.has(A)||(sb.add(A),s={rel:s,crossOrigin:f,href:o},v.querySelector(A)===null&&(o=v.createElement("link"),Ln(o,"link",s),en(o),v.head.appendChild(o)))}}function x4(s){zs.D(s),ib("dns-prefetch",s,null)}function _4(s,o){zs.C(s,o),ib("preconnect",s,o)}function S4(s,o,f){zs.L(s,o,f);var v=ka;if(v&&s&&o){var A='link[rel="preload"][as="'+Fn(o)+'"]';o==="image"&&f&&f.imageSrcSet?(A+='[imagesrcset="'+Fn(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(A+='[imagesizes="'+Fn(f.imageSizes)+'"]')):A+='[href="'+Fn(s)+'"]';var T=A;switch(o){case"style":T=Ea(s);break;case"script":T=Aa(s)}Ir.has(T)||(s=p({rel:"preload",href:o==="image"&&f&&f.imageSrcSet?void 0:s,as:o},f),Ir.set(T,s),v.querySelector(A)!==null||o==="style"&&v.querySelector(Xl(T))||o==="script"&&v.querySelector(Ql(T))||(o=v.createElement("link"),Ln(o,"link",s),en(o),v.head.appendChild(o)))}}function w4(s,o){zs.m(s,o);var f=ka;if(f&&s){var v=o&&typeof o.as=="string"?o.as:"script",A='link[rel="modulepreload"][as="'+Fn(v)+'"][href="'+Fn(s)+'"]',T=A;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=Aa(s)}if(!Ir.has(T)&&(s=p({rel:"modulepreload",href:s},o),Ir.set(T,s),f.querySelector(A)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Ql(T)))return}v=f.createElement("link"),Ln(v,"link",s),en(v),f.head.appendChild(v)}}}function C4(s,o,f){zs.S(s,o,f);var v=ka;if(v&&s){var A=wn(v).hoistableStyles,T=Ea(s);o=o||"default";var U=A.get(T);if(!U){var Z={loading:0,preload:null};if(U=v.querySelector(Xl(T)))Z.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":o},f),(f=Ir.get(T))&&Yp(s,f);var ne=U=v.createElement("link");en(ne),Ln(ne,"link",s),ne._p=new Promise(function(fe,_e){ne.onload=fe,ne.onerror=_e}),ne.addEventListener("load",function(){Z.loading|=1}),ne.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,td(U,o,v)}U={type:"stylesheet",instance:U,count:1,state:Z},A.set(T,U)}}}function k4(s,o){zs.X(s,o);var f=ka;if(f&&s){var v=wn(f).hoistableScripts,A=Aa(s),T=v.get(A);T||(T=f.querySelector(Ql(A)),T||(s=p({src:s,async:!0},o),(o=Ir.get(A))&&Xp(s,o),T=f.createElement("script"),en(T),Ln(T,"link",s),f.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},v.set(A,T))}}function E4(s,o){zs.M(s,o);var f=ka;if(f&&s){var v=wn(f).hoistableScripts,A=Aa(s),T=v.get(A);T||(T=f.querySelector(Ql(A)),T||(s=p({src:s,async:!0,type:"module"},o),(o=Ir.get(A))&&Xp(s,o),T=f.createElement("script"),en(T),Ln(T,"link",s),f.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},v.set(A,T))}}function ob(s,o,f,v){var A=(A=ee.current)?ed(A):null;if(!A)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(o=Ea(f.href),f=wn(A).hoistableStyles,v=f.get(o),v||(v={type:"style",instance:null,count:0,state:null},f.set(o,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){s=Ea(f.href);var T=wn(A).hoistableStyles,U=T.get(s);if(U||(A=A.ownerDocument||A,U={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(s,U),(T=A.querySelector(Xl(s)))&&!T._p&&(U.instance=T,U.state.loading=5),Ir.has(s)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Ir.set(s,f),T||A4(A,s,f,U.state))),o&&v===null)throw Error(r(528,""));return U}if(o&&v!==null)throw Error(r(529,""));return null;case"script":return o=f.async,f=f.src,typeof f=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Aa(f),f=wn(A).hoistableScripts,v=f.get(o),v||(v={type:"script",instance:null,count:0,state:null},f.set(o,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Ea(s){return'href="'+Fn(s)+'"'}function Xl(s){return'link[rel="stylesheet"]['+s+"]"}function ab(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function A4(s,o,f,v){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?v.loading=1:(o=s.createElement("link"),v.preload=o,o.addEventListener("load",function(){return v.loading|=1}),o.addEventListener("error",function(){return v.loading|=2}),Ln(o,"link",f),en(o),s.head.appendChild(o))}function Aa(s){return'[src="'+Fn(s)+'"]'}function Ql(s){return"script[async]"+s}function lb(s,o,f){if(o.count++,o.instance===null)switch(o.type){case"style":var v=s.querySelector('style[data-href~="'+Fn(f.href)+'"]');if(v)return o.instance=v,en(v),v;var A=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return v=(s.ownerDocument||s).createElement("style"),en(v),Ln(v,"style",A),td(v,f.precedence,s),o.instance=v;case"stylesheet":A=Ea(f.href);var T=s.querySelector(Xl(A));if(T)return o.state.loading|=4,o.instance=T,en(T),T;v=ab(f),(A=Ir.get(A))&&Yp(v,A),T=(s.ownerDocument||s).createElement("link"),en(T);var U=T;return U._p=new Promise(function(Z,ne){U.onload=Z,U.onerror=ne}),Ln(T,"link",v),o.state.loading|=4,td(T,f.precedence,s),o.instance=T;case"script":return T=Aa(f.src),(A=s.querySelector(Ql(T)))?(o.instance=A,en(A),A):(v=f,(A=Ir.get(T))&&(v=p({},f),Xp(v,A)),s=s.ownerDocument||s,A=s.createElement("script"),en(A),Ln(A,"link",v),s.head.appendChild(A),o.instance=A);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(v=o.instance,o.state.loading|=4,td(v,f.precedence,s));return o.instance}function td(s,o,f){for(var v=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=v.length?v[v.length-1]:null,T=A,U=0;U<v.length;U++){var Z=v[U];if(Z.dataset.precedence===o)T=Z;else if(T!==A)break}T?T.parentNode.insertBefore(s,T.nextSibling):(o=f.nodeType===9?f.head:f,o.insertBefore(s,o.firstChild))}function Yp(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.title==null&&(s.title=o.title)}function Xp(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.integrity==null&&(s.integrity=o.integrity)}var nd=null;function cb(s,o,f){if(nd===null){var v=new Map,A=nd=new Map;A.set(f,v)}else A=nd,v=A.get(f),v||(v=new Map,A.set(f,v));if(v.has(s))return v;for(v.set(s,null),f=f.getElementsByTagName(s),A=0;A<f.length;A++){var T=f[A];if(!(T[kr]||T[Nt]||s==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var U=T.getAttribute(o)||"";U=s+U;var Z=v.get(U);Z?Z.push(T):v.set(U,[T])}}return v}function ub(s,o,f){s=s.ownerDocument||s,s.head.insertBefore(f,o==="title"?s.querySelector("head > title"):null)}function N4(s,o,f){if(f===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return s=o.disabled,typeof o.precedence=="string"&&s==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function db(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function R4(s,o,f,v){if(f.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var A=Ea(v.href),T=o.querySelector(Xl(A));if(T){o=T._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=rd.bind(s),o.then(s,s)),f.state.loading|=4,f.instance=T,en(T);return}T=o.ownerDocument||o,v=ab(v),(A=Ir.get(A))&&Yp(v,A),T=T.createElement("link"),en(T);var U=T;U._p=new Promise(function(Z,ne){U.onload=Z,U.onerror=ne}),Ln(T,"link",v),f.instance=T}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(f,o),(o=f.state.preload)&&(f.state.loading&3)===0&&(s.count++,f=rd.bind(s),o.addEventListener("load",f),o.addEventListener("error",f))}}var Qp=0;function j4(s,o){return s.stylesheets&&s.count===0&&id(s,s.stylesheets),0<s.count||0<s.imgCount?function(f){var v=setTimeout(function(){if(s.stylesheets&&id(s,s.stylesheets),s.unsuspend){var T=s.unsuspend;s.unsuspend=null,T()}},6e4+o);0<s.imgBytes&&Qp===0&&(Qp=62500*u4());var A=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&id(s,s.stylesheets),s.unsuspend)){var T=s.unsuspend;s.unsuspend=null,T()}},(s.imgBytes>Qp?50:800)+o);return s.unsuspend=f,function(){s.unsuspend=null,clearTimeout(v),clearTimeout(A)}}:null}function rd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)id(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var sd=null;function id(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,sd=new Map,o.forEach(T4,s),sd=null,rd.call(s))}function T4(s,o){if(!(o.state.loading&4)){var f=sd.get(s);if(f)var v=f.get(null);else{f=new Map,sd.set(s,f);for(var A=s.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<A.length;T++){var U=A[T];(U.nodeName==="LINK"||U.getAttribute("media")!=="not all")&&(f.set(U.dataset.precedence,U),v=U)}v&&f.set(null,v)}A=o.instance,U=A.getAttribute("data-precedence"),T=f.get(U)||v,T===v&&f.set(null,A),f.set(U,A),this.count++,v=rd.bind(this),A.addEventListener("load",v),A.addEventListener("error",v),T?T.parentNode.insertBefore(A,T.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(A,s.firstChild)),o.state.loading|=4}}var Zl={$$typeof:_,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function D4(s,o,f,v,A,T,U,Z,ne){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=Oe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oe(0),this.hiddenUpdates=Oe(null),this.identifierPrefix=v,this.onUncaughtError=A,this.onCaughtError=T,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function fb(s,o,f,v,A,T,U,Z,ne,fe,_e,Ce){return s=new D4(s,o,f,U,ne,fe,_e,Ce,Z),o=1,T===!0&&(o|=24),T=hr(3,null,null,o),s.current=T,T.stateNode=s,o=jh(),o.refCount++,s.pooledCache=o,o.refCount++,T.memoizedState={element:v,isDehydrated:f,cache:o},Oh(T),s}function hb(s){return s?(s=sa,s):sa}function pb(s,o,f,v,A,T){A=hb(A),v.context===null?v.context=A:v.pendingContext=A,v=pi(o),v.payload={element:f},T=T===void 0?null:T,T!==null&&(v.callback=T),f=mi(s,v,o),f!==null&&(sr(f,s,o),jl(f,s,o))}function mb(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<o?f:o}}function Zp(s,o){mb(s,o),(s=s.alternate)&&mb(s,o)}function gb(s){if(s.tag===13||s.tag===31){var o=fo(s,67108864);o!==null&&sr(o,s,67108864),Zp(s,67108864)}}function vb(s){if(s.tag===13||s.tag===31){var o=yr();o=An(o);var f=fo(s,o);f!==null&&sr(f,s,o),Zp(s,o)}}var od=!0;function M4(s,o,f,v){var A=W.T;W.T=null;var T=X.p;try{X.p=2,Jp(s,o,f,v)}finally{X.p=T,W.T=A}}function O4(s,o,f,v){var A=W.T;W.T=null;var T=X.p;try{X.p=8,Jp(s,o,f,v)}finally{X.p=T,W.T=A}}function Jp(s,o,f,v){if(od){var A=em(v);if(A===null)Bp(s,o,v,ad,f),bb(s,v);else if(I4(A,s,o,f,v))v.stopPropagation();else if(bb(s,v),o&4&&-1<L4.indexOf(s)){for(;A!==null;){var T=Wn(A);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var U=Jt(T.pendingLanes);if(U!==0){var Z=T;for(Z.pendingLanes|=2,Z.entangledLanes|=2;U;){var ne=1<<31-Pe(U);Z.entanglements[1]|=ne,U&=~ne}ls(T),(jt&6)===0&&(Uu=Re()+500,Wl(0))}}break;case 31:case 13:Z=fo(T,2),Z!==null&&sr(Z,T,2),qu(),Zp(T,2)}if(T=em(v),T===null&&Bp(s,o,v,ad,f),T===A)break;A=T}A!==null&&v.stopPropagation()}else Bp(s,o,v,null,f)}}function em(s){return s=hl(s),tm(s)}var ad=null;function tm(s){if(ad=null,s=Bn(s),s!==null){var o=l(s);if(o===null)s=null;else{var f=o.tag;if(f===13){if(s=c(o),s!==null)return s;s=null}else if(f===31){if(s=a(o),s!==null)return s;s=null}else if(f===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;s=null}else o!==s&&(s=null)}}return ad=s,null}function yb(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(be()){case oe:return 2;case me:return 8;case Ee:case Ie:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var nm=!1,Ei=null,Ai=null,Ni=null,Jl=new Map,ec=new Map,Ri=[],L4="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 bb(s,o){switch(s){case"focusin":case"focusout":Ei=null;break;case"dragenter":case"dragleave":Ai=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":Jl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ec.delete(o.pointerId)}}function tc(s,o,f,v,A,T){return s===null||s.nativeEvent!==T?(s={blockedOn:o,domEventName:f,eventSystemFlags:v,nativeEvent:T,targetContainers:[A]},o!==null&&(o=Wn(o),o!==null&&gb(o)),s):(s.eventSystemFlags|=v,o=s.targetContainers,A!==null&&o.indexOf(A)===-1&&o.push(A),s)}function I4(s,o,f,v,A){switch(o){case"focusin":return Ei=tc(Ei,s,o,f,v,A),!0;case"dragenter":return Ai=tc(Ai,s,o,f,v,A),!0;case"mouseover":return Ni=tc(Ni,s,o,f,v,A),!0;case"pointerover":var T=A.pointerId;return Jl.set(T,tc(Jl.get(T)||null,s,o,f,v,A)),!0;case"gotpointercapture":return T=A.pointerId,ec.set(T,tc(ec.get(T)||null,s,o,f,v,A)),!0}return!1}function xb(s){var o=Bn(s.target);if(o!==null){var f=l(o);if(f!==null){if(o=f.tag,o===13){if(o=c(f),o!==null){s.blockedOn=o,Rn(s.priority,function(){vb(f)});return}}else if(o===31){if(o=a(f),o!==null){s.blockedOn=o,Rn(s.priority,function(){vb(f)});return}}else if(o===3&&f.stateNode.current.memoizedState.isDehydrated){s.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}s.blockedOn=null}function ld(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var f=em(s.nativeEvent);if(f===null){f=s.nativeEvent;var v=new f.constructor(f.type,f);fl=v,f.target.dispatchEvent(v),fl=null}else return o=Wn(f),o!==null&&gb(o),s.blockedOn=f,!1;o.shift()}return!0}function _b(s,o,f){ld(s)&&f.delete(o)}function P4(){nm=!1,Ei!==null&&ld(Ei)&&(Ei=null),Ai!==null&&ld(Ai)&&(Ai=null),Ni!==null&&ld(Ni)&&(Ni=null),Jl.forEach(_b),ec.forEach(_b)}function cd(s,o){s.blockedOn===o&&(s.blockedOn=null,nm||(nm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,P4)))}var ud=null;function Sb(s){ud!==s&&(ud=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ud===s&&(ud=null);for(var o=0;o<s.length;o+=3){var f=s[o],v=s[o+1],A=s[o+2];if(typeof v!="function"){if(tm(v||f)===null)continue;break}var T=Wn(f);T!==null&&(s.splice(o,3),o-=3,ep(T,{pending:!0,data:A,method:f.method,action:v},v,A))}}))}function Na(s){function o(ne){return cd(ne,s)}Ei!==null&&cd(Ei,s),Ai!==null&&cd(Ai,s),Ni!==null&&cd(Ni,s),Jl.forEach(o),ec.forEach(o);for(var f=0;f<Ri.length;f++){var v=Ri[f];v.blockedOn===s&&(v.blockedOn=null)}for(;0<Ri.length&&(f=Ri[0],f.blockedOn===null);)xb(f),f.blockedOn===null&&Ri.shift();if(f=(s.ownerDocument||s).$$reactFormReplay,f!=null)for(v=0;v<f.length;v+=3){var A=f[v],T=f[v+1],U=A[Dt]||null;if(typeof T=="function")U||Sb(f);else if(U){var Z=null;if(T&&T.hasAttribute("formAction")){if(A=T,U=T[Dt]||null)Z=U.formAction;else if(tm(A)!==null)continue}else Z=U.action;typeof Z=="function"?f[v+1]=Z:(f.splice(v,3),v-=3),Sb(f)}}}function wb(){function s(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(U){return A=U})},focusReset:"manual",scroll:"manual"})}function o(){A!==null&&(A(),A=null),v||setTimeout(f,20)}function f(){if(!v&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var v=!1,A=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(f,100),function(){v=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),A!==null&&(A(),A=null)}}}function rm(s){this._internalRoot=s}dd.prototype.render=rm.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(r(409));var f=o.current,v=yr();pb(f,v,s,o,null,null)},dd.prototype.unmount=rm.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;pb(s.current,2,null,s,null,null),qu(),o[jn]=null}};function dd(s){this._internalRoot=s}dd.prototype.unstable_scheduleHydration=function(s){if(s){var o=Nn();s={blockedOn:null,target:s,priority:o};for(var f=0;f<Ri.length&&o!==0&&o<Ri[f].priority;f++);Ri.splice(f,0,s),f===0&&xb(s)}};var Cb=e.version;if(Cb!=="19.2.4")throw Error(r(527,Cb,"19.2.4"));X.findDOMNode=function(s){var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=d(o),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var z4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fd.isDisabled&&fd.supportsFiber)try{lt=fd.inject(z4),ze=fd}catch{}}return rc.createRoot=function(s,o){if(!i(s))throw Error(r(299));var f=!1,v="",A=T0,T=D0,U=M0;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(v=o.identifierPrefix),o.onUncaughtError!==void 0&&(A=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(U=o.onRecoverableError)),o=fb(s,1,!1,null,null,f,v,null,A,T,U,wb),s[jn]=o.current,zp(s),new rm(o)},rc.hydrateRoot=function(s,o,f){if(!i(s))throw Error(r(299));var v=!1,A="",T=T0,U=D0,Z=M0,ne=null;return f!=null&&(f.unstable_strictMode===!0&&(v=!0),f.identifierPrefix!==void 0&&(A=f.identifierPrefix),f.onUncaughtError!==void 0&&(T=f.onUncaughtError),f.onCaughtError!==void 0&&(U=f.onCaughtError),f.onRecoverableError!==void 0&&(Z=f.onRecoverableError),f.formState!==void 0&&(ne=f.formState)),o=fb(s,1,!0,o,f!=null?f:null,v,A,ne,T,U,Z,wb),o.context=hb(null),f=o.current,v=yr(),v=An(v),A=pi(v),A.callback=null,mi(f,A,v),f=v,o.current.lanes=f,ot(o,f),ls(o),s[jn]=o.current,zp(s),new dd(o)},rc.version="19.2.4",rc}var Ob;function K4(){if(Ob)return om.exports;Ob=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),om.exports=G4(),om.exports}var Y4=K4();const Lb="jean2-theme",Pg="neutral",hS="system",X4={mode:hS,scheme:Pg,setMode:()=>null,setScheme:()=>null,resolvedMode:"dark"},pS=R.createContext(X4);function Q4(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ib(t){return t==="system"?Q4():t}function Z4(t){const e=localStorage.getItem(Lb);if(!e||!["light","dark","system"].includes(e))return null;const r={mode:e,scheme:Pg};return localStorage.setItem(t,JSON.stringify(r)),localStorage.removeItem(Lb),r}function J4({children:t,defaultMode:e=hS,defaultScheme:n=Pg,storageKey:r="jean2-theme-settings",...i}){const[l,c]=R.useState(()=>{const x=Z4(r);if(x)return x;const w=localStorage.getItem(r);if(w)try{const C=JSON.parse(w);if(typeof C=="object"&&C!==null&&"mode"in C&&"scheme"in C)return C}catch{}return{mode:e,scheme:n}}),[a,u]=R.useState(()=>Ib(l.mode)),d=R.useCallback((x,w)=>{const C=window.document.documentElement,y=Ib(x);C.classList.remove("light","dark"),C.classList.remove("neutral","ocean","forest","sunset","amethyst"),C.classList.add(y),C.classList.add(w),u(y)},[]);R.useEffect(()=>{d(l.mode,l.scheme)},[l,d]),R.useEffect(()=>{if(l.mode!=="system")return;const x=window.matchMedia("(prefers-color-scheme: dark)"),w=()=>{d(l.mode,l.scheme)};return x.addEventListener("change",w),()=>x.removeEventListener("change",w)},[l.mode,l.scheme,d]);const m=R.useCallback(x=>{const w={...l,mode:x};c(w),localStorage.setItem(r,JSON.stringify(w))},[l,r]),p=R.useCallback(x=>{const w={...l,scheme:x};c(w),localStorage.setItem(r,JSON.stringify(w))},[l,r]),g={mode:l.mode,scheme:l.scheme,setMode:m,setScheme:p,resolvedMode:a};return h.jsx(pS.Provider,{...i,value:g,children:t})}const e5=()=>{const t=R.useContext(pS);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var um={exports:{}},dm={};/**
|
|
50
|
-
* @license React
|
|
51
|
-
* react-compiler-runtime.production.js
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/var Pb;function t5(){if(Pb)return dm;Pb=1;var t=of().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return dm.c=function(e){return t.H.useMemoCache(e)},dm}var zb;function n5(){return zb||(zb=1,um.exports=t5()),um.exports}var he=n5();const Bb=t=>Symbol.iterator in t,Fb=t=>"entries"in t,Hb=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),r=e instanceof Map?e:new Map(e.entries());if(n.size!==r.size)return!1;for(const[i,l]of n)if(!r.has(i)||!Object.is(l,r.get(i)))return!1;return!0},r5=(t,e)=>{const n=t[Symbol.iterator](),r=e[Symbol.iterator]();let i=n.next(),l=r.next();for(;!i.done&&!l.done;){if(!Object.is(i.value,l.value))return!1;i=n.next(),l=r.next()}return!!i.done&&!!l.done};function s5(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Bb(t)&&Bb(e)?Fb(t)&&Fb(e)?Hb(t,e):r5(t,e):Hb({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function ko(t){const e=In.useRef(void 0);return n=>{const r=t(n);return s5(e.current,r)?e.current:e.current=r}}const $b=t=>{let e;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(e):d;if(!Object.is(p,e)){const g=e;e=(m!=null?m:typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(x=>x(e,g))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=e=t(r,i,a);return a},i5=(t=>t?$b(t):$b),o5=t=>t;function a5(t,e=o5){const n=In.useSyncExternalStore(t.subscribe,In.useCallback(()=>e(t.getState()),[t,e]),In.useCallback(()=>e(t.getInitialState()),[t,e]));return In.useDebugValue(n),n}const Ub=t=>{const e=i5(t),n=r=>a5(e,r);return Object.assign(n,e),n},Xa=(t=>t?Ub(t):Ub);function zg(t){return t.role==="assistant"}const l5=220,mS=256,c5=512;function Md(t){return Math.max(l5,Math.min(c5,t))}const af={SESSIONS:"jean2_sessions_panel_width",FILES:"jean2_files_panel_width"},gS="jean2_draft_",vS=720*60*60*1e3;function u5(){try{for(let t=0;t<localStorage.length;t++){const e=localStorage.key(t);if(!(!e||!e.startsWith(gS)))try{const n=localStorage.getItem(e);if(!n)continue;const r=JSON.parse(n);Date.now()-r.updatedAt>vS&&localStorage.removeItem(e)}catch{localStorage.removeItem(e)}}}catch{}}function lf(t){return Md(t)}function d5(t){if(typeof window>"u")return t;try{const e=localStorage.getItem(af.SESSIONS);if(e===null)return t;const n=JSON.parse(e);return typeof n.width!="number"||isNaN(n.width)?t:lf(n.width)}catch{return t}}function f5(t){if(!(typeof window>"u"))try{const e=lf(t);localStorage.setItem(af.SESSIONS,JSON.stringify({width:e}))}catch(e){console.warn("Error saving sessions panel width:",e)}}function h5(t){if(typeof window>"u")return t;try{const e=localStorage.getItem(af.FILES);if(e===null)return t;const n=JSON.parse(e);return typeof n.width!="number"||isNaN(n.width)?t:lf(n.width)}catch{return t}}function p5(t){if(!(typeof window>"u"))try{const e=lf(t);localStorage.setItem(af.FILES,JSON.stringify({width:e}))}catch(e){console.warn("Error saving files panel width:",e)}}const m5=5e3,yS="jean2_sidebar_view",g5=()=>{if(typeof window>"u")return"default";const t=localStorage.getItem(yS);return t==="default"||t==="overview"?t:"default"},v5=()=>d5(mS),y5=()=>h5(mS),qt=Xa(t=>({showSettings:!1,showConfiguration:!1,showMCPDialog:!1,showFilesPanel:!1,showTerminalPanel:!1,showAddServer:!1,editServerData:null,sidebarViewMode:g5(),completionState:new Map,sessionsPanelWidth:v5(),filesPanelWidth:y5(),filePreviewTarget:null,setShowSettings:e=>t({showSettings:e}),setShowConfiguration:e=>t({showConfiguration:e}),setShowMCPDialog:e=>t({showMCPDialog:e}),setShowFilesPanel:e=>t({showFilesPanel:e}),setShowTerminalPanel:e=>t({showTerminalPanel:e}),setShowAddServer:e=>t({showAddServer:e}),setEditServerData:e=>t({editServerData:e}),setSidebarViewMode:e=>{typeof window<"u"&&localStorage.setItem(yS,e),t({sidebarViewMode:e})},setCompletion:(e,n)=>t(r=>{const i=new Map(r.completionState);return i.set(e,n),{completionState:i}}),clearCompletion:e=>t(n=>{const r=new Map(n.completionState);return r.delete(e),{completionState:r}}),clearAllCompletions:()=>t({completionState:new Map}),setSessionsPanelWidth:e=>{const n=Md(e);f5(n),t({sessionsPanelWidth:n})},setFilesPanelWidth:e=>{const n=Md(e);p5(n),t({filesPanelWidth:n})},openFilePreview:e=>t({filePreviewTarget:e}),closeFilePreview:()=>t({filePreviewTarget:null})})),b5=t=>e=>e.completionState.get(t),Vb=m5,x5=Xa(t=>({pendingPermissions:[],queuedMessages:{},clearPendingPermissions:()=>t({pendingPermissions:[]}),setPendingPermissions:e=>t({pendingPermissions:e}),mergePendingPermissions:e=>t(n=>{const r=new Set(n.pendingPermissions.map(l=>l.toolCallId)),i=e.filter(l=>!r.has(l.toolCallId));return{pendingPermissions:[...n.pendingPermissions,...i]}}),addPendingPermission:e=>t(n=>({pendingPermissions:[...n.pendingPermissions,e]})),removePendingPermissionByToolCallId:e=>t(n=>({pendingPermissions:n.pendingPermissions.filter(r=>r.toolCallId!==e)})),removePendingPermissionsBySessionId:e=>t(n=>({pendingPermissions:n.pendingPermissions.filter(r=>r.sessionId!==e)})),clearQueuedMessages:()=>t({queuedMessages:{}}),setQueuedMessagesForSession:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:n}})),addQueuedMessage:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:[...r.queuedMessages[e]||[],n]}})),removeQueuedMessageById:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:(r.queuedMessages[e]||[]).filter(i=>i.id!==n)}})),removeQueuedMessagesByIds:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:(r.queuedMessages[e]||[]).filter(i=>!n.includes(i.id))}}))})),ng=Xa(t=>({streamingSessionIds:new Set,interruptedSessions:new Set,clearStreamingSessions:()=>t({streamingSessionIds:new Set}),addStreamingSession:e=>t(n=>{if(n.streamingSessionIds.has(e))return n;const r=new Set(n.streamingSessionIds);return r.add(e),{streamingSessionIds:r}}),removeStreamingSession:e=>t(n=>{if(!n.streamingSessionIds.has(e))return n;const r=new Set(n.streamingSessionIds);return r.delete(e),{streamingSessionIds:r}}),replaceStreamingSessions:e=>t({streamingSessionIds:e instanceof Set?e:new Set(e)}),addInterruptedSession:e=>t(n=>{if(n.interruptedSessions.has(e))return n;const r=new Set(n.interruptedSessions);return r.add(e),{interruptedSessions:r}}),removeInterruptedSession:e=>t(n=>{if(!n.interruptedSessions.has(e))return n;const r=new Set(n.interruptedSessions);return r.delete(e),{interruptedSessions:r}}),clearInterruptedSessions:()=>t({interruptedSessions:new Set})})),_5=Xa(t=>({sessions:[],currentSession:null,setSessions:e=>t(n=>({sessions:typeof e=="function"?e(n.sessions):e})),addSessionToFront:e=>t(n=>({sessions:[e,...n.sessions]})),updateSession:e=>t(n=>({sessions:n.sessions.map(r=>r.id===e.id?e:r)})),removeSessionById:e=>t(n=>({sessions:n.sessions.filter(r=>r.id!==e)})),setCurrentSession:e=>t({currentSession:e}),clearSessionState:()=>t({sessions:[],currentSession:null})})),sc=Xa((t,e)=>({messagesBySession:{},partsBySession:{},setMessagesBySession:n=>t(r=>({messagesBySession:typeof n=="function"?n(r.messagesBySession):n})),setPartsBySession:n=>t(r=>({partsBySession:typeof n=="function"?n(r.partsBySession):n})),getMessagesBySessionKeysCount:()=>Object.keys(e().messagesBySession).length})),Bg=Xa(t=>({activeWorkspace:null,setActiveWorkspace:e=>t({activeWorkspace:e})})),Sr={SERVERS:"jean2_servers",ACTIVE_SERVER_ID:"jean2_active_server_id",QUICK_CONNECTIONS:"jean2_quick_connections"};function Fs(){try{const t=localStorage.getItem(Sr.SERVERS);return t?JSON.parse(t):[]}catch(t){return console.error("Error reading saved servers from localStorage:",t),[]}}function S5(t){return Fs().find(n=>n.id===t)||null}function w5(t){try{const e=Fs();e.push(t),localStorage.setItem(Sr.SERVERS,JSON.stringify(e))}catch(e){console.error("Error saving server to localStorage:",e)}}function C5(t,e){try{const n=Fs(),r=n.findIndex(i=>i.id===t);if(r===-1){console.error("Server not found:",t);return}n[r]={...n[r],...e},localStorage.setItem(Sr.SERVERS,JSON.stringify(n))}catch(n){console.error("Error updating server in localStorage:",n)}}function k5(t){try{const n=Fs().filter(c=>c.id!==t);localStorage.setItem(Sr.SERVERS,JSON.stringify(n));const i=Xr().filter(c=>c.serverId!==t);localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(i)),bS()===t&&localStorage.removeItem(Sr.ACTIVE_SERVER_ID)}catch(e){console.error("Error deleting server from localStorage:",e)}}function bS(){try{return localStorage.getItem(Sr.ACTIVE_SERVER_ID)}catch(t){return console.error("Error reading active server ID from localStorage:",t),null}}function fm(t){try{localStorage.setItem(Sr.ACTIVE_SERVER_ID,t)}catch(e){console.error("Error setting active server ID in localStorage:",e)}}function qb(){const t=bS();return t?S5(t):null}function Xr(){try{const t=localStorage.getItem(Sr.QUICK_CONNECTIONS);return t?JSON.parse(t):[]}catch(t){return console.error("Error reading quick connections from localStorage:",t),[]}}function E5(t){const e=Xr(),n=e.reduce((i,l)=>Math.max(i,l.order),-1),r={...t,id:crypto.randomUUID(),order:n+1};e.push(r);try{localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(e))}catch(i){console.error("Error saving quick connection to localStorage:",i)}return r}function A5(t){try{const n=Xr().filter(r=>r.id!==t);localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(e){console.error("Error removing quick connection from localStorage:",e)}}function N5(t){try{const n=Xr().filter(r=>r.workspaceId!==t);localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(e){console.error("Error removing quick connections for workspace from localStorage:",e)}}function R5(t){try{const e=Xr(),n=new Map(e.map(r=>[r.id,r]));t.forEach((r,i)=>{const l=n.get(r);l&&(l.order=i)}),localStorage.setItem(Sr.QUICK_CONNECTIONS,JSON.stringify(e))}catch(e){console.error("Error reordering quick connections in localStorage:",e)}}function xS(t){return/^[a-f0-9]{64}$/.test(t)}function j5(t){return t.length<12?t:`${t.slice(0,4)}...${t.slice(-4)}`}function Od(t){const e=t.trim(),n=/^https:\/\//i.test(e);let r=e.replace(/^(https?:\/\/|wss?:\/\/)/i,"");return r=r.replace(/\/+$/,""),n&&(r=`https://${r}`),r}const _S=R.createContext(null),T5=t=>{const e=he.c(30),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=[],e[0]=r):r=e[0];const[i,l]=R.useState(r),[c,a]=R.useState(null);let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=[],e[1]=u):u=e[1];const[d,m]=R.useState(u),[p,g]=R.useState(!1),x=R.useRef(null),w=R.useRef(!1);let C,y;e[2]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{const Q=Fs(),J=qb(),ee=Xr();l(Q),a(J),m(ee)},y=[],e[2]=C,e[3]=y):(C=e[2],y=e[3]),R.useEffect(C,y);let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{w.current=!0},e[4]=S):S=e[4];const b=S;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=(Q,J,ee)=>{const K=Od(J),V={id:crypto.randomUUID(),name:Q,url:K,token:ee,createdAt:new Date().toISOString()};return w5(V),l(Fs()),fm(V.id),a(V),V},e[5]=_):_=e[5];const k=_;let j;e[6]!==(c==null?void 0:c.id)?(j=(Q,J)=>{const ee={...J,...J.url&&{url:Od(J.url)}};C5(Q,ee),l(Fs()),(c==null?void 0:c.id)===Q&&a(qb())},e[6]=c==null?void 0:c.id,e[7]=j):j=e[7];const N=j;let D;e[8]!==(c==null?void 0:c.id)?(D=Q=>{const J=(c==null?void 0:c.id)===Q;if(k5(Q),l(Fs()),J){const ee=Fs(),K=ee.length>0?ee[0]:null;K?(fm(K.id),a(K)):a(null)}m(Xr())},e[8]=c==null?void 0:c.id,e[9]=D):D=e[9];const E=D;let O;e[10]!==(c==null?void 0:c.id)||e[11]!==p||e[12]!==i?(O=Q=>(x.current&&(clearTimeout(x.current),x.current=null),p&&(c==null?void 0:c.id)===Q?!1:(p&&g(!1),g(!0),x.current=setTimeout(()=>{fm(Q);const J=i.find(ee=>ee.id===Q)||null;a(J),g(!1)},100),!0)),e[10]=c==null?void 0:c.id,e[11]=p,e[12]=i,e[13]=O):O=e[13];const L=O;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{g(!1)},e[14]=z):z=e[14];const H=z;let $;e[15]===Symbol.for("react.memo_cache_sentinel")?($=(Q,J,ee,K)=>{E5({serverId:Q,serverName:J,workspaceId:ee,workspaceName:K}),m(Xr())},e[15]=$):$=e[15];const q=$;let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=Q=>{A5(Q),m(Xr())},e[16]=G):G=e[16];const W=G;let X;e[17]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>{N5(Q),m(Xr())},e[17]=X):X=e[17];const Y=X;let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=Q=>{R5(Q),m(Xr())},e[18]=I):I=e[18];const M=I;let P;e[19]!==c||e[20]!==N||e[21]!==p||e[22]!==d||e[23]!==E||e[24]!==i||e[25]!==L?(P={servers:i,activeServer:c,quickConnections:d,isSwitching:p,isAddingServerRef:w,prepareForServerAdd:b,addServer:k,editServer:N,removeServer:E,switchServer:L,clearSwitchingState:H,addToQuickConnections:q,removeFromQuickConnections:W,removeFromQuickConnectionsByWorkspace:Y,reorderQuick:M},e[19]=c,e[20]=N,e[21]=p,e[22]=d,e[23]=E,e[24]=i,e[25]=L,e[26]=P):P=e[26];const B=P;let F;return e[27]!==n||e[28]!==B?(F=h.jsx(_S.Provider,{value:B,children:n}),e[27]=n,e[28]=B,e[29]=F):F=e[29],F},Qa=()=>{const t=R.useContext(_S);if(t===null)throw new Error("useServerContext must be used within a ServerProvider");return t};/**
|
|
58
|
-
* @license lucide-react v0.577.0 - ISC
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the ISC license.
|
|
61
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const SS=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
63
|
-
* @license lucide-react v0.577.0 - ISC
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the ISC license.
|
|
66
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const D5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
68
|
-
* @license lucide-react v0.577.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const M5=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
73
|
-
* @license lucide-react v0.577.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const Wb=t=>{const e=M5(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
78
|
-
* @license lucide-react v0.577.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the ISC license.
|
|
81
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/var O5={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"};/**
|
|
83
|
-
* @license lucide-react v0.577.0 - ISC
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the ISC license.
|
|
86
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const L5=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
|
|
88
|
-
* @license lucide-react v0.577.0 - ISC
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const I5=R.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:l,iconNode:c,...a},u)=>R.createElement("svg",{ref:u,...O5,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:SS("lucide",i),...!l&&!L5(a)&&{"aria-hidden":"true"},...a},[...c.map(([d,m])=>R.createElement(d,m)),...Array.isArray(l)?l:[l]]));/**
|
|
93
|
-
* @license lucide-react v0.577.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const Be=(t,e)=>{const n=R.forwardRef(({className:r,...i},l)=>R.createElement(I5,{ref:l,iconNode:e,className:SS(`lucide-${D5(Wb(t))}`,`lucide-${t}`,r),...i}));return n.displayName=Wb(t),n};/**
|
|
98
|
-
* @license lucide-react v0.577.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* This source code is licensed under the ISC license.
|
|
101
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const P5=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],z5=Be("archive",P5);/**
|
|
103
|
-
* @license lucide-react v0.577.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const B5=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],F5=Be("arrow-down",B5);/**
|
|
108
|
-
* @license lucide-react v0.577.0 - ISC
|
|
109
|
-
*
|
|
110
|
-
* This source code is licensed under the ISC license.
|
|
111
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const H5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Fg=Be("arrow-left",H5);/**
|
|
113
|
-
* @license lucide-react v0.577.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const $5=[["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"}]],U5=Be("bot",$5);/**
|
|
118
|
-
* @license lucide-react v0.577.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const V5=[["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"}]],rg=Be("box",V5);/**
|
|
123
|
-
* @license lucide-react v0.577.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const q5=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],wS=Be("boxes",q5);/**
|
|
128
|
-
* @license lucide-react v0.577.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const W5=[["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"}]],Gb=Be("brain",W5);/**
|
|
133
|
-
* @license lucide-react v0.577.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const G5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Vn=Be("check",G5);/**
|
|
138
|
-
* @license lucide-react v0.577.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const K5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Za=Be("chevron-down",K5);/**
|
|
143
|
-
* @license lucide-react v0.577.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const Y5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],X5=Be("chevron-left",Y5);/**
|
|
148
|
-
* @license lucide-react v0.577.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const Q5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hr=Be("chevron-right",Q5);/**
|
|
153
|
-
* @license lucide-react v0.577.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const Z5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],J5=Be("chevron-up",Z5);/**
|
|
158
|
-
* @license lucide-react v0.577.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const eA=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],CS=Be("chevrons-up-down",eA);/**
|
|
163
|
-
* @license lucide-react v0.577.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const tA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],To=Be("circle-alert",tA);/**
|
|
168
|
-
* @license lucide-react v0.577.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const nA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Mc=Be("circle-check-big",nA);/**
|
|
173
|
-
* @license lucide-react v0.577.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const rA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],sA=Be("circle-check",rA);/**
|
|
178
|
-
* @license lucide-react v0.577.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const iA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],cf=Be("circle-x",iA);/**
|
|
183
|
-
* @license lucide-react v0.577.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const oA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aA=Be("circle",oA);/**
|
|
188
|
-
* @license lucide-react v0.577.0 - ISC
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the ISC license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const lA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],kS=Be("clock",lA);/**
|
|
193
|
-
* @license lucide-react v0.577.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the ISC license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const cA=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],uA=Be("cog",cA);/**
|
|
198
|
-
* @license lucide-react v0.577.0 - ISC
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the ISC license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const dA=[["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"}]],bc=Be("copy",dA);/**
|
|
203
|
-
* @license lucide-react v0.577.0 - ISC
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the ISC license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const fA=[["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"}]],Kb=Be("cpu",fA);/**
|
|
208
|
-
* @license lucide-react v0.577.0 - ISC
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the ISC license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const hA=[["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"}]],pA=Be("download",hA);/**
|
|
213
|
-
* @license lucide-react v0.577.0 - ISC
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the ISC license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const mA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],ES=Be("ellipsis",mA);/**
|
|
218
|
-
* @license lucide-react v0.577.0 - ISC
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the ISC license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const gA=[["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"}]],xc=Be("external-link",gA);/**
|
|
223
|
-
* @license lucide-react v0.577.0 - ISC
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the ISC license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const vA=[["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"}]],AS=Be("eye-off",vA);/**
|
|
228
|
-
* @license lucide-react v0.577.0 - ISC
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the ISC license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const yA=[["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"}]],Hg=Be("eye",yA);/**
|
|
233
|
-
* @license lucide-react v0.577.0 - ISC
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the ISC license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const bA=[["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"}]],xA=Be("file-exclamation-point",bA);/**
|
|
238
|
-
* @license lucide-react v0.577.0 - ISC
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the ISC license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const _A=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],SA=Be("file-pen",_A);/**
|
|
243
|
-
* @license lucide-react v0.577.0 - ISC
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the ISC license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const wA=[["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 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],CA=Be("file-question-mark",wA);/**
|
|
248
|
-
* @license lucide-react v0.577.0 - ISC
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the ISC license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const kA=[["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"}]],Oc=Be("file-text",kA);/**
|
|
253
|
-
* @license lucide-react v0.577.0 - ISC
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the ISC license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const EA=[["path",{d:"M11 22H6a2 2 0 0 1-2-2V4a2 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 8v5",key:"1jo35a"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m15 17 5 5",key:"36xl1x"}],["path",{d:"m20 17-5 5",key:"vdz27y"}]],AA=Be("file-x-corner",EA);/**
|
|
258
|
-
* @license lucide-react v0.577.0 - ISC
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the ISC license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const NA=[["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"}]],Pr=Be("file",NA);/**
|
|
263
|
-
* @license lucide-react v0.577.0 - ISC
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the ISC license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/const RA=[["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"}]],sg=Be("folder-open",RA);/**
|
|
268
|
-
* @license lucide-react v0.577.0 - ISC
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the ISC license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/const jA=[["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"}]],Vs=Be("folder",jA);/**
|
|
273
|
-
* @license lucide-react v0.577.0 - ISC
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the ISC license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/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"}]],DA=Be("git-branch",TA);/**
|
|
278
|
-
* @license lucide-react v0.577.0 - ISC
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the ISC license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/const MA=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],OA=Be("hard-drive",MA);/**
|
|
283
|
-
* @license lucide-react v0.577.0 - ISC
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the ISC license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/const LA=[["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"}]],IA=Be("image",LA);/**
|
|
288
|
-
* @license lucide-react v0.577.0 - ISC
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the ISC license.
|
|
291
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/const PA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],zA=Be("info",PA);/**
|
|
293
|
-
* @license lucide-react v0.577.0 - ISC
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the ISC license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/const BA=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],NS=Be("key",BA);/**
|
|
298
|
-
* @license lucide-react v0.577.0 - ISC
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the ISC license.
|
|
301
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/const FA=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],HA=Be("keyboard",FA);/**
|
|
303
|
-
* @license lucide-react v0.577.0 - ISC
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the ISC license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/const $A=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],RS=Be("layers",$A);/**
|
|
308
|
-
* @license lucide-react v0.577.0 - ISC
|
|
309
|
-
*
|
|
310
|
-
* This source code is licensed under the ISC license.
|
|
311
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/const UA=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],VA=Be("layout-grid",UA);/**
|
|
313
|
-
* @license lucide-react v0.577.0 - ISC
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the ISC license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/const qA=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]],WA=Be("layout-list",qA);/**
|
|
318
|
-
* @license lucide-react v0.577.0 - ISC
|
|
319
|
-
*
|
|
320
|
-
* This source code is licensed under the ISC license.
|
|
321
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
-
*/const GA=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],KA=Be("link-2",GA);/**
|
|
323
|
-
* @license lucide-react v0.577.0 - ISC
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the ISC license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/const YA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wt=Be("loader-circle",YA);/**
|
|
328
|
-
* @license lucide-react v0.577.0 - ISC
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the ISC license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/const XA=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],QA=Be("lock",XA);/**
|
|
333
|
-
* @license lucide-react v0.577.0 - ISC
|
|
334
|
-
*
|
|
335
|
-
* This source code is licensed under the ISC license.
|
|
336
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
-
*/const ZA=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],JA=Be("message-square",ZA);/**
|
|
338
|
-
* @license lucide-react v0.577.0 - ISC
|
|
339
|
-
*
|
|
340
|
-
* This source code is licensed under the ISC license.
|
|
341
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
-
*/const eN=[["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"}]],jS=Be("minimize-2",eN);/**
|
|
343
|
-
* @license lucide-react v0.577.0 - ISC
|
|
344
|
-
*
|
|
345
|
-
* This source code is licensed under the ISC license.
|
|
346
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/const tN=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],nN=Be("monitor",tN);/**
|
|
348
|
-
* @license lucide-react v0.577.0 - ISC
|
|
349
|
-
*
|
|
350
|
-
* This source code is licensed under the ISC license.
|
|
351
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
-
*/const rN=[["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"}]],sN=Be("moon",rN);/**
|
|
353
|
-
* @license lucide-react v0.577.0 - ISC
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the ISC license.
|
|
356
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/const iN=[["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"}]],oN=Be("palette",iN);/**
|
|
358
|
-
* @license lucide-react v0.577.0 - ISC
|
|
359
|
-
*
|
|
360
|
-
* This source code is licensed under the ISC license.
|
|
361
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
-
*/const aN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],lN=Be("panel-left",aN);/**
|
|
363
|
-
* @license lucide-react v0.577.0 - ISC
|
|
364
|
-
*
|
|
365
|
-
* This source code is licensed under the ISC license.
|
|
366
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/const cN=[["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"}]],uN=Be("paperclip",cN);/**
|
|
368
|
-
* @license lucide-react v0.577.0 - ISC
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the ISC license.
|
|
371
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/const dN=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],TS=Be("pause",dN);/**
|
|
373
|
-
* @license lucide-react v0.577.0 - ISC
|
|
374
|
-
*
|
|
375
|
-
* This source code is licensed under the ISC license.
|
|
376
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
-
*/const fN=[["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"}]],za=Be("pencil",fN);/**
|
|
378
|
-
* @license lucide-react v0.577.0 - ISC
|
|
379
|
-
*
|
|
380
|
-
* This source code is licensed under the ISC license.
|
|
381
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
-
*/const hN=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],pN=Be("plug-zap",hN);/**
|
|
383
|
-
* @license lucide-react v0.577.0 - ISC
|
|
384
|
-
*
|
|
385
|
-
* This source code is licensed under the ISC license.
|
|
386
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
-
*/const mN=[["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"}]],gN=Be("plug",mN);/**
|
|
388
|
-
* @license lucide-react v0.577.0 - ISC
|
|
389
|
-
*
|
|
390
|
-
* This source code is licensed under the ISC license.
|
|
391
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
-
*/const vN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qr=Be("plus",vN);/**
|
|
393
|
-
* @license lucide-react v0.577.0 - ISC
|
|
394
|
-
*
|
|
395
|
-
* This source code is licensed under the ISC license.
|
|
396
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
-
*/const yN=[["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"}]],Pi=Be("refresh-cw",yN);/**
|
|
398
|
-
* @license lucide-react v0.577.0 - ISC
|
|
399
|
-
*
|
|
400
|
-
* This source code is licensed under the ISC license.
|
|
401
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
-
*/const bN=[["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"}]],DS=Be("rotate-ccw",bN);/**
|
|
403
|
-
* @license lucide-react v0.577.0 - ISC
|
|
404
|
-
*
|
|
405
|
-
* This source code is licensed under the ISC license.
|
|
406
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
-
*/const xN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$g=Be("search",xN);/**
|
|
408
|
-
* @license lucide-react v0.577.0 - ISC
|
|
409
|
-
*
|
|
410
|
-
* This source code is licensed under the ISC license.
|
|
411
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
-
*/const _N=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],SN=Be("send",_N);/**
|
|
413
|
-
* @license lucide-react v0.577.0 - ISC
|
|
414
|
-
*
|
|
415
|
-
* This source code is licensed under the ISC license.
|
|
416
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
-
*/const wN=[["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"}]],Do=Be("server",wN);/**
|
|
418
|
-
* @license lucide-react v0.577.0 - ISC
|
|
419
|
-
*
|
|
420
|
-
* This source code is licensed under the ISC license.
|
|
421
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
-
*/const CN=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],MS=Be("settings",CN);/**
|
|
423
|
-
* @license lucide-react v0.577.0 - ISC
|
|
424
|
-
*
|
|
425
|
-
* This source code is licensed under the ISC license.
|
|
426
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
-
*/const kN=[["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"}]],OS=Be("shield",kN);/**
|
|
428
|
-
* @license lucide-react v0.577.0 - ISC
|
|
429
|
-
*
|
|
430
|
-
* This source code is licensed under the ISC license.
|
|
431
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
-
*/const EN=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],AN=Be("sliders-horizontal",EN);/**
|
|
433
|
-
* @license lucide-react v0.577.0 - ISC
|
|
434
|
-
*
|
|
435
|
-
* This source code is licensed under the ISC license.
|
|
436
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
-
*/const NN=[["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"}]],Yb=Be("square-terminal",NN);/**
|
|
438
|
-
* @license lucide-react v0.577.0 - ISC
|
|
439
|
-
*
|
|
440
|
-
* This source code is licensed under the ISC license.
|
|
441
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
-
*/const RN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],LS=Be("square",RN);/**
|
|
443
|
-
* @license lucide-react v0.577.0 - ISC
|
|
444
|
-
*
|
|
445
|
-
* This source code is licensed under the ISC license.
|
|
446
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
-
*/const jN=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],_c=Be("star",jN);/**
|
|
448
|
-
* @license lucide-react v0.577.0 - ISC
|
|
449
|
-
*
|
|
450
|
-
* This source code is licensed under the ISC license.
|
|
451
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
-
*/const TN=[["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"}]],DN=Be("sun",TN);/**
|
|
453
|
-
* @license lucide-react v0.577.0 - ISC
|
|
454
|
-
*
|
|
455
|
-
* This source code is licensed under the ISC license.
|
|
456
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
457
|
-
*/const MN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Xb=Be("terminal",MN);/**
|
|
458
|
-
* @license lucide-react v0.577.0 - ISC
|
|
459
|
-
*
|
|
460
|
-
* This source code is licensed under the ISC license.
|
|
461
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
462
|
-
*/const ON=[["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"}]],Br=Be("trash-2",ON);/**
|
|
463
|
-
* @license lucide-react v0.577.0 - ISC
|
|
464
|
-
*
|
|
465
|
-
* This source code is licensed under the ISC license.
|
|
466
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
467
|
-
*/const LN=[["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"}]],Ua=Be("triangle-alert",LN);/**
|
|
468
|
-
* @license lucide-react v0.577.0 - ISC
|
|
469
|
-
*
|
|
470
|
-
* This source code is licensed under the ISC license.
|
|
471
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
472
|
-
*/const IN=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],PN=Be("undo-2",IN);/**
|
|
473
|
-
* @license lucide-react v0.577.0 - ISC
|
|
474
|
-
*
|
|
475
|
-
* This source code is licensed under the ISC license.
|
|
476
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
477
|
-
*/const zN=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],BN=Be("unplug",zN);/**
|
|
478
|
-
* @license lucide-react v0.577.0 - ISC
|
|
479
|
-
*
|
|
480
|
-
* This source code is licensed under the ISC license.
|
|
481
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
482
|
-
*/const FN=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],IS=Be("user",FN);/**
|
|
483
|
-
* @license lucide-react v0.577.0 - ISC
|
|
484
|
-
*
|
|
485
|
-
* This source code is licensed under the ISC license.
|
|
486
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
487
|
-
*/const HN=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],$N=Be("volume-2",HN);/**
|
|
488
|
-
* @license lucide-react v0.577.0 - ISC
|
|
489
|
-
*
|
|
490
|
-
* This source code is licensed under the ISC license.
|
|
491
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
492
|
-
*/const UN=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],VN=Be("volume-x",UN);/**
|
|
493
|
-
* @license lucide-react v0.577.0 - ISC
|
|
494
|
-
*
|
|
495
|
-
* This source code is licensed under the ISC license.
|
|
496
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
497
|
-
*/const qN=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],PS=Be("wifi-off",qN);/**
|
|
498
|
-
* @license lucide-react v0.577.0 - ISC
|
|
499
|
-
*
|
|
500
|
-
* This source code is licensed under the ISC license.
|
|
501
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
502
|
-
*/const WN=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],GN=Be("wifi",WN);/**
|
|
503
|
-
* @license lucide-react v0.577.0 - ISC
|
|
504
|
-
*
|
|
505
|
-
* This source code is licensed under the ISC license.
|
|
506
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
507
|
-
*/const KN=[["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"}]],YN=Be("wrench",KN);/**
|
|
508
|
-
* @license lucide-react v0.577.0 - ISC
|
|
509
|
-
*
|
|
510
|
-
* This source code is licensed under the ISC license.
|
|
511
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
512
|
-
*/const XN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zn=Be("x",XN);/**
|
|
513
|
-
* @license lucide-react v0.577.0 - ISC
|
|
514
|
-
*
|
|
515
|
-
* This source code is licensed under the ISC license.
|
|
516
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
517
|
-
*/const QN=[["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"}]],hm=Be("zap",QN);function zS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=zS(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function uf(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=zS(t))&&(r&&(r+=" "),r+=e);return r}const Qb=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Zb=uf,Ja=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Zb(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:l}=e,c=Object.keys(i).map(d=>{const m=n==null?void 0:n[d],p=l==null?void 0:l[d];if(m===null)return null;const g=Qb(m)||Qb(p);return i[d][g]}),a=n&&Object.entries(n).reduce((d,m)=>{let[p,g]=m;return g===void 0||(d[p]=g),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:p,className:g,...x}=m;return Object.entries(x).every(w=>{let[C,y]=w;return Array.isArray(y)?y.includes({...l,...a}[C]):{...l,...a}[C]===y})?[...d,p,g]:d},[]);return Zb(t,c,u,n==null?void 0:n.class,n==null?void 0:n.className)};var el=fS();const ZN=sf(el);function Jb(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function qs(...t){return e=>{let n=!1;const r=t.map(i=>{const l=Jb(i,e);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let i=0;i<r.length;i++){const l=r[i];typeof l=="function"?l():Jb(t[i],null)}}}}function ht(...t){return R.useCallback(qs(...t),t)}function zi(t){const e=JN(t),n=R.forwardRef((r,i)=>{const{children:l,...c}=r,a=R.Children.toArray(l),u=a.find(tR);if(u){const d=u.props.children,m=a.map(p=>p===u?R.Children.count(d)>1?R.Children.only(null):R.isValidElement(d)?d.props.children:null:p);return h.jsx(e,{...c,ref:i,children:R.isValidElement(d)?R.cloneElement(d,void 0,m):null})}return h.jsx(e,{...c,ref:i,children:l})});return n.displayName=`${t}.Slot`,n}var Lc=zi("Slot");function JN(t){const e=R.forwardRef((n,r)=>{const{children:i,...l}=n;if(R.isValidElement(i)){const c=rR(i),a=nR(l,i.props);return i.type!==R.Fragment&&(a.ref=r?qs(r,c):c),R.cloneElement(i,a)}return R.Children.count(i)>1?R.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var BS=Symbol("radix.slottable");function eR(t){const e=({children:n})=>h.jsx(h.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=BS,e}function tR(t){return R.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===BS}function nR(t,e){const n={...e};for(const r in e){const i=t[r],l=e[r];/^on[A-Z]/.test(r)?i&&l?n[r]=(...a)=>{const u=l(...a);return i(...a),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...l}:r==="className"&&(n[r]=[i,l].filter(Boolean).join(" "))}return{...t,...n}}function rR(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var sR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qe=sR.reduce((t,e)=>{const n=zi(`Primitive.${e}`),r=R.forwardRef((i,l)=>{const{asChild:c,...a}=i,u=c?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(u,{...a,ref:l})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function FS(t,e){t&&el.flushSync(()=>t.dispatchEvent(e))}var HS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),iR="VisuallyHidden",$S=R.forwardRef((t,e)=>h.jsx(Qe.span,{...t,ref:e,style:{...HS,...t.style}}));$S.displayName=iR;var oR=$S;function aR(t,e){const n=R.createContext(e),r=l=>{const{children:c,...a}=l,u=R.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:u,children:c})};r.displayName=t+"Provider";function i(l){const c=R.useContext(n);if(c)return c;if(e!==void 0)return e;throw new Error(`\`${l}\` must be used within \`${t}\``)}return[r,i]}function or(t,e=[]){let n=[];function r(l,c){const a=R.createContext(c),u=n.length;n=[...n,c];const d=p=>{var S;const{scope:g,children:x,...w}=p,C=((S=g==null?void 0:g[t])==null?void 0:S[u])||a,y=R.useMemo(()=>w,Object.values(w));return h.jsx(C.Provider,{value:y,children:x})};d.displayName=l+"Provider";function m(p,g){var C;const x=((C=g==null?void 0:g[t])==null?void 0:C[u])||a,w=R.useContext(x);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[d,m]}const i=()=>{const l=n.map(c=>R.createContext(c));return function(a){const u=(a==null?void 0:a[t])||l;return R.useMemo(()=>({[`__scope${t}`]:{...a,[t]:u}}),[a,u])}};return i.scopeName=t,[r,lR(i,...e)]}function lR(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const c=r.reduce((a,{useScope:u,scopeName:d})=>{const p=u(l)[`__scope${d}`];return{...a,...p}},{});return R.useMemo(()=>({[`__scope${e.scopeName}`]:c}),[c])}};return n.scopeName=e.scopeName,n}function Ug(t){const e=t+"CollectionProvider",[n,r]=or(e),[i,l]=n(e,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:y,children:S}=C,b=In.useRef(null),_=In.useRef(new Map).current;return h.jsx(i,{scope:y,itemMap:_,collectionRef:b,children:S})};c.displayName=e;const a=t+"CollectionSlot",u=zi(a),d=In.forwardRef((C,y)=>{const{scope:S,children:b}=C,_=l(a,S),k=ht(y,_.collectionRef);return h.jsx(u,{ref:k,children:b})});d.displayName=a;const m=t+"CollectionItemSlot",p="data-radix-collection-item",g=zi(m),x=In.forwardRef((C,y)=>{const{scope:S,children:b,..._}=C,k=In.useRef(null),j=ht(y,k),N=l(m,S);return In.useEffect(()=>(N.itemMap.set(k,{ref:k,..._}),()=>void N.itemMap.delete(k))),h.jsx(g,{[p]:"",ref:j,children:b})});x.displayName=m;function w(C){const y=l(t+"CollectionConsumer",C);return In.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const _=Array.from(b.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((N,D)=>_.indexOf(N.ref.current)-_.indexOf(D.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:c,Slot:d,ItemSlot:x},w,r]}function $e(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}var kn=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},cR=dS[" useInsertionEffect ".trim().toString()]||kn;function ms({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,l,c]=uR({defaultProp:e,onChange:n}),a=t!==void 0,u=a?t:i;{const m=R.useRef(t!==void 0);R.useEffect(()=>{const p=m.current;p!==a&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=a},[a,r])}const d=R.useCallback(m=>{var p;if(a){const g=dR(m)?m(t):m;g!==t&&((p=c.current)==null||p.call(c,g))}else l(m)},[a,t,l,c]);return[u,d]}function uR({defaultProp:t,onChange:e}){const[n,r]=R.useState(t),i=R.useRef(n),l=R.useRef(e);return cR(()=>{l.current=e},[e]),R.useEffect(()=>{var c;i.current!==n&&((c=l.current)==null||c.call(l,n),i.current=n)},[n,i]),[n,r,l]}function dR(t){return typeof t=="function"}function fR(t,e){return R.useReducer((n,r)=>{const i=e[n][r];return i!=null?i:n},t)}var En=t=>{const{present:e,children:n}=t,r=hR(e),i=typeof n=="function"?n({present:r.isPresent}):R.Children.only(n),l=ht(r.ref,pR(i));return typeof n=="function"||r.isPresent?R.cloneElement(i,{ref:l}):null};En.displayName="Presence";function hR(t){const[e,n]=R.useState(),r=R.useRef(null),i=R.useRef(t),l=R.useRef("none"),c=t?"mounted":"unmounted",[a,u]=fR(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const d=hd(r.current);l.current=a==="mounted"?d:"none"},[a]),kn(()=>{const d=r.current,m=i.current;if(m!==t){const g=l.current,x=hd(d);t?u("MOUNT"):x==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),kn(()=>{var d;if(e){let m;const p=(d=e.ownerDocument.defaultView)!=null?d:window,g=w=>{const y=hd(r.current).includes(CSS.escape(w.animationName));if(w.target===e&&y&&(u("ANIMATION_END"),!i.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",m=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},x=w=>{w.target===e&&(l.current=hd(r.current))};return e.addEventListener("animationstart",x),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(m),e.removeEventListener("animationstart",x),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:R.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function hd(t){return(t==null?void 0:t.animationName)||"none"}function pR(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var mR=dS[" useId ".trim().toString()]||(()=>{}),gR=0;function Sn(t){const[e,n]=R.useState(mR());return kn(()=>{n(r=>r!=null?r:String(gR++))},[t]),e?`radix-${e}`:""}var df="Collapsible",[vR]=or(df),[yR,Vg]=vR(df),US=R.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:l,onOpenChange:c,...a}=t,[u,d]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:c,caller:df});return h.jsx(yR,{scope:n,disabled:l,contentId:Sn(),open:u,onOpenToggle:R.useCallback(()=>d(m=>!m),[d]),children:h.jsx(Qe.div,{"data-state":Wg(u),"data-disabled":l?"":void 0,...a,ref:e})})});US.displayName=df;var VS="CollapsibleTrigger",qS=R.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=Vg(VS,n);return h.jsx(Qe.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Wg(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:$e(t.onClick,i.onOpenToggle)})});qS.displayName=VS;var qg="CollapsibleContent",WS=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Vg(qg,t.__scopeCollapsible);return h.jsx(En,{present:n||i.open,children:({present:l})=>h.jsx(bR,{...r,ref:e,present:l})})});WS.displayName=qg;var bR=R.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...l}=t,c=Vg(qg,n),[a,u]=R.useState(r),d=R.useRef(null),m=ht(e,d),p=R.useRef(0),g=p.current,x=R.useRef(0),w=x.current,C=c.open||a,y=R.useRef(C),S=R.useRef(void 0);return R.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),kn(()=>{const b=d.current;if(b){S.current=S.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const _=b.getBoundingClientRect();p.current=_.height,x.current=_.width,y.current||(b.style.transitionDuration=S.current.transitionDuration,b.style.animationName=S.current.animationName),u(r)}},[c.open,r]),h.jsx(Qe.div,{"data-state":Wg(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!C,...l,ref:m,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...t.style},children:C&&i})});function Wg(t){return t?"open":"closed"}var xR=US,_R=R.createContext(void 0);function Ic(t){const e=R.useContext(_R);return t||e||"ltr"}function Pn(t){const e=R.useRef(t);return R.useEffect(()=>{e.current=t}),R.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function SR(t,e=globalThis==null?void 0:globalThis.document){const n=Pn(t);R.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var wR="DismissableLayer",ig="dismissableLayer.update",CR="dismissableLayer.pointerDownOutside",kR="dismissableLayer.focusOutside",ex,GS=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tl=R.forwardRef((t,e)=>{var D;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:c,onDismiss:a,...u}=t,d=R.useContext(GS),[m,p]=R.useState(null),g=(D=m==null?void 0:m.ownerDocument)!=null?D:globalThis==null?void 0:globalThis.document,[,x]=R.useState({}),w=ht(e,E=>p(E)),C=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=C.indexOf(y),b=m?C.indexOf(m):-1,_=d.layersWithOutsidePointerEventsDisabled.size>0,k=b>=S,j=NR(E=>{const O=E.target,L=[...d.branches].some(z=>z.contains(O));!k||L||(i==null||i(E),c==null||c(E),E.defaultPrevented||a==null||a())},g),N=RR(E=>{const O=E.target;[...d.branches].some(z=>z.contains(O))||(l==null||l(E),c==null||c(E),E.defaultPrevented||a==null||a())},g);return SR(E=>{b===d.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},g),R.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ex=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),tx(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=ex)}},[m,g,n,d]),R.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),tx())},[m,d]),R.useEffect(()=>{const E=()=>x({});return document.addEventListener(ig,E),()=>document.removeEventListener(ig,E)},[]),h.jsx(Qe.div,{...u,ref:w,style:{pointerEvents:_?k?"auto":"none":void 0,...t.style},onFocusCapture:$e(t.onFocusCapture,N.onFocusCapture),onBlurCapture:$e(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:$e(t.onPointerDownCapture,j.onPointerDownCapture)})});tl.displayName=wR;var ER="DismissableLayerBranch",AR=R.forwardRef((t,e)=>{const n=R.useContext(GS),r=R.useRef(null),i=ht(e,r);return R.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),h.jsx(Qe.div,{...t,ref:i})});AR.displayName=ER;function NR(t,e=globalThis==null?void 0:globalThis.document){const n=Pn(t),r=R.useRef(!1),i=R.useRef(()=>{});return R.useEffect(()=>{const l=a=>{if(a.target&&!r.current){let u=function(){KS(CR,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=u,e.addEventListener("click",i.current,{once:!0})):u()}else e.removeEventListener("click",i.current);r.current=!1},c=window.setTimeout(()=>{e.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),e.removeEventListener("pointerdown",l),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function RR(t,e=globalThis==null?void 0:globalThis.document){const n=Pn(t),r=R.useRef(!1);return R.useEffect(()=>{const i=l=>{l.target&&!r.current&&KS(kR,n,{originalEvent:l},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tx(){const t=new CustomEvent(ig);document.dispatchEvent(t)}function KS(t,e,n,{discrete:r}){const i=n.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?FS(i,l):i.dispatchEvent(l)}var pm="focusScope.autoFocusOnMount",mm="focusScope.autoFocusOnUnmount",nx={bubbles:!1,cancelable:!0},jR="FocusScope",Pc=R.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...c}=t,[a,u]=R.useState(null),d=Pn(i),m=Pn(l),p=R.useRef(null),g=ht(e,C=>u(C)),x=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(r){let C=function(_){if(x.paused||!a)return;const k=_.target;a.contains(k)?p.current=k:Li(p.current,{select:!0})},y=function(_){if(x.paused||!a)return;const k=_.relatedTarget;k!==null&&(a.contains(k)||Li(p.current,{select:!0}))},S=function(_){if(document.activeElement===document.body)for(const j of _)j.removedNodes.length>0&&Li(a)};document.addEventListener("focusin",C),document.addEventListener("focusout",y);const b=new MutationObserver(S);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,x.paused]),R.useEffect(()=>{if(a){sx.add(x);const C=document.activeElement;if(!a.contains(C)){const S=new CustomEvent(pm,nx);a.addEventListener(pm,d),a.dispatchEvent(S),S.defaultPrevented||(TR(IR(YS(a)),{select:!0}),document.activeElement===C&&Li(a))}return()=>{a.removeEventListener(pm,d),setTimeout(()=>{const S=new CustomEvent(mm,nx);a.addEventListener(mm,m),a.dispatchEvent(S),S.defaultPrevented||Li(C!=null?C:document.body,{select:!0}),a.removeEventListener(mm,m),sx.remove(x)},0)}}},[a,d,m,x]);const w=R.useCallback(C=>{if(!n&&!r||x.paused)return;const y=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,S=document.activeElement;if(y&&S){const b=C.currentTarget,[_,k]=DR(b);_&&k?!C.shiftKey&&S===k?(C.preventDefault(),n&&Li(_,{select:!0})):C.shiftKey&&S===_&&(C.preventDefault(),n&&Li(k,{select:!0})):S===b&&C.preventDefault()}},[n,r,x.paused]);return h.jsx(Qe.div,{tabIndex:-1,...c,ref:g,onKeyDown:w})});Pc.displayName=jR;function TR(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Li(r,{select:e}),document.activeElement!==n)return}function DR(t){const e=YS(t),n=rx(e,t),r=rx(e.reverse(),t);return[n,r]}function YS(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function rx(t,e){for(const n of t)if(!MR(n,{upTo:e}))return n}function MR(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function OR(t){return t instanceof HTMLInputElement&&"select"in t}function Li(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&OR(t)&&e&&t.select()}}var sx=LR();function LR(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=ix(t,e),t.unshift(e)},remove(e){var n;t=ix(t,e),(n=t[0])==null||n.resume()}}}function ix(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function IR(t){return t.filter(e=>e.tagName!=="A")}var PR="Portal",nl=R.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,l]=R.useState(!1);kn(()=>l(!0),[]);const c=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return c?ZN.createPortal(h.jsx(Qe.div,{...r,ref:e}),c):null});nl.displayName=PR;var gm=0;function ff(){R.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!=null?e:ox()),document.body.insertAdjacentElement("beforeend",(n=t[1])!=null?n:ox()),gm++,()=>{gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),gm--}},[])}function ox(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var us=function(){return us=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},us.apply(this,arguments)};function XS(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function zR(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,l;r<i;r++)(l||!(r in e))&&(l||(l=Array.prototype.slice.call(e,0,r)),l[r]=e[r]);return t.concat(l||Array.prototype.slice.call(e))}var Ed="right-scroll-bar-position",Ad="width-before-scroll-bar",BR="with-scroll-bars-hidden",FR="--removed-body-scroll-bar-size";function vm(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function HR(t,e){var n=R.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var $R=typeof window<"u"?R.useLayoutEffect:R.useEffect,ax=new WeakMap;function UR(t,e){var n=HR(null,function(r){return t.forEach(function(i){return vm(i,r)})});return $R(function(){var r=ax.get(n);if(r){var i=new Set(r),l=new Set(t),c=n.current;i.forEach(function(a){l.has(a)||vm(a,null)}),l.forEach(function(a){i.has(a)||vm(a,c)})}ax.set(n,t)},[t]),n}function VR(t){return t}function qR(t,e){e===void 0&&(e=VR);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(l){var c=e(l,r);return n.push(c),function(){n=n.filter(function(a){return a!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(a){return l(a)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var a=n;n=[],a.forEach(l),c=n}var u=function(){var m=c;c=[],m.forEach(l)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(m){c.push(m),d()},filter:function(m){return c=c.filter(m),n}}}};return i}function WR(t){t===void 0&&(t={});var e=qR(null);return e.options=us({async:!0,ssr:!1},t),e}var QS=function(t){var e=t.sideCar,n=XS(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return R.createElement(r,us({},n))};QS.isSideCarExport=!0;function GR(t,e){return t.useMedium(e),QS}var ZS=WR(),ym=function(){},hf=R.forwardRef(function(t,e){var n=R.useRef(null),r=R.useState({onScrollCapture:ym,onWheelCapture:ym,onTouchMoveCapture:ym}),i=r[0],l=r[1],c=t.forwardProps,a=t.children,u=t.className,d=t.removeScrollBar,m=t.enabled,p=t.shards,g=t.sideCar,x=t.noRelative,w=t.noIsolation,C=t.inert,y=t.allowPinchZoom,S=t.as,b=S===void 0?"div":S,_=t.gapMode,k=XS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=g,N=UR([n,e]),D=us(us({},k),i);return R.createElement(R.Fragment,null,m&&R.createElement(j,{sideCar:ZS,removeScrollBar:d,shards:p,noRelative:x,noIsolation:w,inert:C,setCallbacks:l,allowPinchZoom:!!y,lockRef:n,gapMode:_}),c?R.cloneElement(R.Children.only(a),us(us({},D),{ref:N})):R.createElement(b,us({},D,{className:u,ref:N}),a))});hf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hf.classNames={fullWidth:Ad,zeroRight:Ed};var KR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function YR(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=KR();return e&&t.setAttribute("nonce",e),t}function XR(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function QR(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var ZR=function(){var t=0,e=null;return{add:function(n){t==0&&(e=YR())&&(XR(e,n),QR(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},JR=function(){var t=ZR();return function(e,n){R.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},JS=function(){var t=JR(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},ej={left:0,top:0,right:0,gap:0},bm=function(t){return parseInt(t||"",10)||0},tj=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[bm(n),bm(r),bm(i)]},nj=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return ej;var e=tj(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},rj=JS(),Ba="data-scroll-locked",sj=function(t,e,n,r){var i=t.left,l=t.top,c=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
518
|
-
.`.concat(BR,` {
|
|
519
|
-
overflow: hidden `).concat(r,`;
|
|
520
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
521
|
-
}
|
|
522
|
-
body[`).concat(Ba,`] {
|
|
523
|
-
overflow: hidden `).concat(r,`;
|
|
524
|
-
overscroll-behavior: contain;
|
|
525
|
-
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
526
|
-
padding-left: `.concat(i,`px;
|
|
527
|
-
padding-top: `).concat(l,`px;
|
|
528
|
-
padding-right: `).concat(c,`px;
|
|
529
|
-
margin-left:0;
|
|
530
|
-
margin-top:0;
|
|
531
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
532
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
.`).concat(Ed,` {
|
|
536
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
.`).concat(Ad,` {
|
|
540
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
.`).concat(Ed," .").concat(Ed,` {
|
|
544
|
-
right: 0 `).concat(r,`;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
.`).concat(Ad," .").concat(Ad,` {
|
|
548
|
-
margin-right: 0 `).concat(r,`;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
body[`).concat(Ba,`] {
|
|
552
|
-
`).concat(FR,": ").concat(a,`px;
|
|
553
|
-
}
|
|
554
|
-
`)},lx=function(){var t=parseInt(document.body.getAttribute(Ba)||"0",10);return isFinite(t)?t:0},ij=function(){R.useEffect(function(){return document.body.setAttribute(Ba,(lx()+1).toString()),function(){var t=lx()-1;t<=0?document.body.removeAttribute(Ba):document.body.setAttribute(Ba,t.toString())}},[])},oj=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;ij();var l=R.useMemo(function(){return nj(i)},[i]);return R.createElement(rj,{styles:sj(l,!e,i,n?"":"!important")})},og=!1;if(typeof window<"u")try{var pd=Object.defineProperty({},"passive",{get:function(){return og=!0,!0}});window.addEventListener("test",pd,pd),window.removeEventListener("test",pd,pd)}catch{og=!1}var Ra=og?{passive:!1}:!1,aj=function(t){return t.tagName==="TEXTAREA"},e2=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!aj(t)&&n[e]==="visible")},lj=function(t){return e2(t,"overflowY")},cj=function(t){return e2(t,"overflowX")},cx=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=t2(t,r);if(i){var l=n2(t,r),c=l[1],a=l[2];if(c>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uj=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},dj=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},t2=function(t,e){return t==="v"?lj(e):cj(e)},n2=function(t,e){return t==="v"?uj(e):dj(e)},fj=function(t,e){return t==="h"&&e==="rtl"?-1:1},hj=function(t,e,n,r,i){var l=fj(t,window.getComputedStyle(e).direction),c=l*r,a=n.target,u=e.contains(a),d=!1,m=c>0,p=0,g=0;do{if(!a)break;var x=n2(t,a),w=x[0],C=x[1],y=x[2],S=C-y-l*w;(w||S)&&t2(t,a)&&(p+=S,g+=w);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!u&&a!==document.body||u&&(e.contains(a)||e===a));return(m&&Math.abs(p)<1||!m&&Math.abs(g)<1)&&(d=!0),d},md=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},ux=function(t){return[t.deltaX,t.deltaY]},dx=function(t){return t&&"current"in t?t.current:t},pj=function(t,e){return t[0]===e[0]&&t[1]===e[1]},mj=function(t){return`
|
|
555
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
556
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
557
|
-
`)},gj=0,ja=[];function vj(t){var e=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(gj++)[0],l=R.useState(JS)[0],c=R.useRef(t);R.useEffect(function(){c.current=t},[t]),R.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var C=zR([t.lockRef.current],(t.shards||[]).map(dx),!0).filter(Boolean);return C.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),C.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=R.useCallback(function(C,y){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!c.current.allowPinchZoom;var S=md(C),b=n.current,_="deltaX"in C?C.deltaX:b[0]-S[0],k="deltaY"in C?C.deltaY:b[1]-S[1],j,N=C.target,D=Math.abs(_)>Math.abs(k)?"h":"v";if("touches"in C&&D==="h"&&N.type==="range")return!1;var E=window.getSelection(),O=E&&E.anchorNode,L=O?O===N||O.contains(N):!1;if(L)return!1;var z=cx(D,N);if(!z)return!0;if(z?j=D:(j=D==="v"?"h":"v",z=cx(D,N)),!z)return!1;if(!r.current&&"changedTouches"in C&&(_||k)&&(r.current=j),!j)return!0;var H=r.current||j;return hj(H,y,C,H==="h"?_:k)},[]),u=R.useCallback(function(C){var y=C;if(!(!ja.length||ja[ja.length-1]!==l)){var S="deltaY"in y?ux(y):md(y),b=e.current.filter(function(j){return j.name===y.type&&(j.target===y.target||y.target===j.shadowParent)&&pj(j.delta,S)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var _=(c.current.shards||[]).map(dx).filter(Boolean).filter(function(j){return j.contains(y.target)}),k=_.length>0?a(y,_[0]):!c.current.noIsolation;k&&y.cancelable&&y.preventDefault()}}},[]),d=R.useCallback(function(C,y,S,b){var _={name:C,delta:y,target:S,should:b,shadowParent:yj(S)};e.current.push(_),setTimeout(function(){e.current=e.current.filter(function(k){return k!==_})},1)},[]),m=R.useCallback(function(C){n.current=md(C),r.current=void 0},[]),p=R.useCallback(function(C){d(C.type,ux(C),C.target,a(C,t.lockRef.current))},[]),g=R.useCallback(function(C){d(C.type,md(C),C.target,a(C,t.lockRef.current))},[]);R.useEffect(function(){return ja.push(l),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Ra),document.addEventListener("touchmove",u,Ra),document.addEventListener("touchstart",m,Ra),function(){ja=ja.filter(function(C){return C!==l}),document.removeEventListener("wheel",u,Ra),document.removeEventListener("touchmove",u,Ra),document.removeEventListener("touchstart",m,Ra)}},[]);var x=t.removeScrollBar,w=t.inert;return R.createElement(R.Fragment,null,w?R.createElement(l,{styles:mj(i)}):null,x?R.createElement(oj,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function yj(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const bj=GR(ZS,vj);var zc=R.forwardRef(function(t,e){return R.createElement(hf,us({},t,{ref:e,sideCar:bj}))});zc.classNames=hf.classNames;var xj=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ta=new WeakMap,gd=new WeakMap,vd={},xm=0,r2=function(t){return t&&(t.host||r2(t.parentNode))},_j=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=r2(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Sj=function(t,e,n,r){var i=_j(e,Array.isArray(t)?t:[t]);vd[n]||(vd[n]=new WeakMap);var l=vd[n],c=[],a=new Set,u=new Set(i),d=function(p){!p||a.has(p)||(a.add(p),d(p.parentNode))};i.forEach(d);var m=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(a.has(g))m(g);else try{var x=g.getAttribute(r),w=x!==null&&x!=="false",C=(Ta.get(g)||0)+1,y=(l.get(g)||0)+1;Ta.set(g,C),l.set(g,y),c.push(g),C===1&&w&&gd.set(g,!0),y===1&&g.setAttribute(n,"true"),w||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return m(e),a.clear(),xm++,function(){c.forEach(function(p){var g=Ta.get(p)-1,x=l.get(p)-1;Ta.set(p,g),l.set(p,x),g||(gd.has(p)||p.removeAttribute(r),gd.delete(p)),x||p.removeAttribute(n)}),xm--,xm||(Ta=new WeakMap,Ta=new WeakMap,gd=new WeakMap,vd={})}},pf=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=xj(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Sj(r,i,n,"aria-hidden")):function(){return null}},mf="Dialog",[s2]=or(mf),[wj,ts]=s2(mf),i2=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:l,modal:c=!0}=t,a=R.useRef(null),u=R.useRef(null),[d,m]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:l,caller:mf});return h.jsx(wj,{scope:e,triggerRef:a,contentRef:u,contentId:Sn(),titleId:Sn(),descriptionId:Sn(),open:d,onOpenChange:m,onOpenToggle:R.useCallback(()=>m(p=>!p),[m]),modal:c,children:n})};i2.displayName=mf;var o2="DialogTrigger",a2=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(o2,n),l=ht(e,i.triggerRef);return h.jsx(Qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Yg(i.open),...r,ref:l,onClick:$e(t.onClick,i.onOpenToggle)})});a2.displayName=o2;var Gg="DialogPortal",[Cj,l2]=s2(Gg,{forceMount:void 0}),c2=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,l=ts(Gg,e);return h.jsx(Cj,{scope:e,forceMount:n,children:R.Children.map(r,c=>h.jsx(En,{present:n||l.open,children:h.jsx(nl,{asChild:!0,container:i,children:c})}))})};c2.displayName=Gg;var Ld="DialogOverlay",u2=R.forwardRef((t,e)=>{const n=l2(Ld,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,l=ts(Ld,t.__scopeDialog);return l.modal?h.jsx(En,{present:r||l.open,children:h.jsx(Ej,{...i,ref:e})}):null});u2.displayName=Ld;var kj=zi("DialogOverlay.RemoveScroll"),Ej=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(Ld,n);return h.jsx(zc,{as:kj,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(Qe.div,{"data-state":Yg(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Mo="DialogContent",d2=R.forwardRef((t,e)=>{const n=l2(Mo,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,l=ts(Mo,t.__scopeDialog);return h.jsx(En,{present:r||l.open,children:l.modal?h.jsx(Aj,{...i,ref:e}):h.jsx(Nj,{...i,ref:e})})});d2.displayName=Mo;var Aj=R.forwardRef((t,e)=>{const n=ts(Mo,t.__scopeDialog),r=R.useRef(null),i=ht(e,n.contentRef,r);return R.useEffect(()=>{const l=r.current;if(l)return pf(l)},[]),h.jsx(f2,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$e(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:$e(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,a=c.button===0&&c.ctrlKey===!0;(c.button===2||a)&&l.preventDefault()}),onFocusOutside:$e(t.onFocusOutside,l=>l.preventDefault())})}),Nj=R.forwardRef((t,e)=>{const n=ts(Mo,t.__scopeDialog),r=R.useRef(!1),i=R.useRef(!1);return h.jsx(f2,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,a;(c=t.onCloseAutoFocus)==null||c.call(t,l),l.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),l.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:l=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),f2=R.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:l,...c}=t,a=ts(Mo,n),u=R.useRef(null),d=ht(e,u);return ff(),h.jsxs(h.Fragment,{children:[h.jsx(Pc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:l,children:h.jsx(tl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Yg(a.open),...c,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Rj,{titleId:a.titleId}),h.jsx(Tj,{contentRef:u,descriptionId:a.descriptionId})]})]})}),Kg="DialogTitle",h2=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(Kg,n);return h.jsx(Qe.h2,{id:i.titleId,...r,ref:e})});h2.displayName=Kg;var p2="DialogDescription",m2=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(p2,n);return h.jsx(Qe.p,{id:i.descriptionId,...r,ref:e})});m2.displayName=p2;var g2="DialogClose",v2=R.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(g2,n);return h.jsx(Qe.button,{type:"button",...r,ref:e,onClick:$e(t.onClick,()=>i.onOpenChange(!1))})});v2.displayName=g2;function Yg(t){return t?"open":"closed"}var y2="DialogTitleWarning",[kq,b2]=aR(y2,{contentName:Mo,titleName:Kg,docsSlug:"dialog"}),Rj=({titleId:t})=>{const e=b2(y2),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
558
|
-
|
|
559
|
-
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
560
|
-
|
|
561
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return R.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},jj="DialogDescriptionWarning",Tj=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${b2(jj).contentName}}.`;return R.useEffect(()=>{var l;const i=(l=t.current)==null?void 0:l.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Xg=i2,Dj=a2,Qg=c2,Zg=u2,Jg=d2,x2=h2,_2=m2,gf=v2;function S2(t){const e=R.useRef({value:t,previous:t});return R.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function w2(t){const[e,n]=R.useState(void 0);return kn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let c,a;if("borderBoxSize"in l){const u=l.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,a=d.blockSize}else c=t.offsetWidth,a=t.offsetHeight;n({width:c,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const Mj=["top","right","bottom","left"],Bi=Math.min,_r=Math.max,Id=Math.round,yd=Math.floor,hs=t=>({x:t,y:t}),Oj={left:"right",right:"left",bottom:"top",top:"bottom"};function ag(t,e,n){return _r(t,Bi(e,n))}function Ws(t,e){return typeof t=="function"?t(e):t}function Gs(t){return t.split("-")[0]}function rl(t){return t.split("-")[1]}function ev(t){return t==="x"?"y":"x"}function tv(t){return t==="y"?"height":"width"}function fs(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function nv(t){return ev(fs(t))}function Lj(t,e,n){n===void 0&&(n=!1);const r=rl(t),i=nv(t),l=tv(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(c=Pd(c)),[c,Pd(c)]}function Ij(t){const e=Pd(t);return[lg(t),e,lg(e)]}function lg(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const fx=["left","right"],hx=["right","left"],Pj=["top","bottom"],zj=["bottom","top"];function Bj(t,e,n){switch(t){case"top":case"bottom":return n?e?hx:fx:e?fx:hx;case"left":case"right":return e?Pj:zj;default:return[]}}function Fj(t,e,n,r){const i=rl(t);let l=Bj(Gs(t),n==="start",r);return i&&(l=l.map(c=>c+"-"+i),e&&(l=l.concat(l.map(lg)))),l}function Pd(t){const e=Gs(t);return Oj[e]+t.slice(e.length)}function Hj(t){return{top:0,right:0,bottom:0,left:0,...t}}function C2(t){return typeof t!="number"?Hj(t):{top:t,right:t,bottom:t,left:t}}function zd(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function px(t,e,n){let{reference:r,floating:i}=t;const l=fs(e),c=nv(e),a=tv(c),u=Gs(e),d=l==="y",m=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let x;switch(u){case"top":x={x:m,y:r.y-i.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-i.width,y:p};break;default:x={x:r.x,y:r.y}}switch(rl(e)){case"start":x[c]-=g*(n&&d?-1:1);break;case"end":x[c]+=g*(n&&d?-1:1);break}return x}async function $j(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:l,rects:c,elements:a,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:g=!1,padding:x=0}=Ws(e,t),w=C2(x),y=a[g?p==="floating"?"reference":"floating":p],S=zd(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(y)))==null||n?y:y.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(a.floating)),boundary:d,rootBoundary:m,strategy:u})),b=p==="floating"?{x:r,y:i,width:c.floating.width,height:c.floating.height}:c.reference,_=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a.floating)),k=await(l.isElement==null?void 0:l.isElement(_))?await(l.getScale==null?void 0:l.getScale(_))||{x:1,y:1}:{x:1,y:1},j=zd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:_,strategy:u}):b);return{top:(S.top-j.top+w.top)/k.y,bottom:(j.bottom-S.bottom+w.bottom)/k.y,left:(S.left-j.left+w.left)/k.x,right:(j.right-S.right+w.right)/k.x}}const Uj=50,Vj=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:l=[],platform:c}=n,a=c.detectOverflow?c:{...c,detectOverflow:$j},u=await(c.isRTL==null?void 0:c.isRTL(e));let d=await c.getElementRects({reference:t,floating:e,strategy:i}),{x:m,y:p}=px(d,r,u),g=r,x=0;const w={};for(let C=0;C<l.length;C++){const y=l[C];if(!y)continue;const{name:S,fn:b}=y,{x:_,y:k,data:j,reset:N}=await b({x:m,y:p,initialPlacement:r,placement:g,strategy:i,middlewareData:w,rects:d,platform:a,elements:{reference:t,floating:e}});m=_!=null?_:m,p=k!=null?k:p,w[S]={...w[S],...j},N&&x<Uj&&(x++,typeof N=="object"&&(N.placement&&(g=N.placement),N.rects&&(d=N.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:i}):N.rects),{x:m,y:p}=px(d,g,u)),C=-1)}return{x:m,y:p,placement:g,strategy:i,middlewareData:w}},qj=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:l,platform:c,elements:a,middlewareData:u}=e,{element:d,padding:m=0}=Ws(t,e)||{};if(d==null)return{};const p=C2(m),g={x:n,y:r},x=nv(i),w=tv(x),C=await c.getDimensions(d),y=x==="y",S=y?"top":"left",b=y?"bottom":"right",_=y?"clientHeight":"clientWidth",k=l.reference[w]+l.reference[x]-g[x]-l.floating[w],j=g[x]-l.reference[x],N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let D=N?N[_]:0;(!D||!await(c.isElement==null?void 0:c.isElement(N)))&&(D=a.floating[_]||l.floating[w]);const E=k/2-j/2,O=D/2-C[w]/2-1,L=Bi(p[S],O),z=Bi(p[b],O),H=L,$=D-C[w]-z,q=D/2-C[w]/2+E,G=ag(H,q,$),W=!u.arrow&&rl(i)!=null&&q!==G&&l.reference[w]/2-(q<H?L:z)-C[w]/2<0,X=W?q<H?q-H:q-$:0;return{[x]:g[x]+X,data:{[x]:G,centerOffset:q-G-X,...W&&{alignmentOffset:X}},reset:W}}}),Wj=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:l,rects:c,initialPlacement:a,platform:u,elements:d}=e,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...y}=Ws(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const S=Gs(i),b=fs(a),_=Gs(a)===a,k=await(u.isRTL==null?void 0:u.isRTL(d.floating)),j=g||(_||!C?[Pd(a)]:Ij(a)),N=w!=="none";!g&&N&&j.push(...Fj(a,C,w,k));const D=[a,...j],E=await u.detectOverflow(e,y),O=[];let L=((r=l.flip)==null?void 0:r.overflows)||[];if(m&&O.push(E[S]),p){const q=Lj(i,c,k);O.push(E[q[0]],E[q[1]])}if(L=[...L,{placement:i,overflows:O}],!O.every(q=>q<=0)){var z,H;const q=(((z=l.flip)==null?void 0:z.index)||0)+1,G=D[q];if(G&&(!(p==="alignment"?b!==fs(G):!1)||L.every(Y=>fs(Y.placement)===b?Y.overflows[0]>0:!0)))return{data:{index:q,overflows:L},reset:{placement:G}};let W=(H=L.filter(X=>X.overflows[0]<=0).sort((X,Y)=>X.overflows[1]-Y.overflows[1])[0])==null?void 0:H.placement;if(!W)switch(x){case"bestFit":{var $;const X=($=L.filter(Y=>{if(N){const I=fs(Y.placement);return I===b||I==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(I=>I>0).reduce((I,M)=>I+M,0)]).sort((Y,I)=>Y[1]-I[1])[0])==null?void 0:$[0];X&&(W=X);break}case"initialPlacement":W=a;break}if(i!==W)return{reset:{placement:W}}}return{}}}};function mx(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function gx(t){return Mj.some(e=>t[e]>=0)}const Gj=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...l}=Ws(t,e);switch(i){case"referenceHidden":{const c=await r.detectOverflow(e,{...l,elementContext:"reference"}),a=mx(c,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:gx(a)}}}case"escaped":{const c=await r.detectOverflow(e,{...l,altBoundary:!0}),a=mx(c,n.floating);return{data:{escapedOffsets:a,escaped:gx(a)}}}default:return{}}}}},k2=new Set(["left","top"]);async function Kj(t,e){const{placement:n,platform:r,elements:i}=t,l=await(r.isRTL==null?void 0:r.isRTL(i.floating)),c=Gs(n),a=rl(n),u=fs(n)==="y",d=k2.has(c)?-1:1,m=l&&u?-1:1,p=Ws(e,t);let{mainAxis:g,crossAxis:x,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof w=="number"&&(x=a==="end"?w*-1:w),u?{x:x*m,y:g*d}:{x:g*d,y:x*m}}const Yj=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:l,placement:c,middlewareData:a}=e,u=await Kj(e,t);return c===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:l+u.y,data:{...u,placement:c}}}}},Xj=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:l}=e,{mainAxis:c=!0,crossAxis:a=!1,limiter:u={fn:S=>{let{x:b,y:_}=S;return{x:b,y:_}}},...d}=Ws(t,e),m={x:n,y:r},p=await l.detectOverflow(e,d),g=fs(Gs(i)),x=ev(g);let w=m[x],C=m[g];if(c){const S=x==="y"?"top":"left",b=x==="y"?"bottom":"right",_=w+p[S],k=w-p[b];w=ag(_,w,k)}if(a){const S=g==="y"?"top":"left",b=g==="y"?"bottom":"right",_=C+p[S],k=C-p[b];C=ag(_,C,k)}const y=u.fn({...e,[x]:w,[g]:C});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[x]:c,[g]:a}}}}}},Qj=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:l,middlewareData:c}=e,{offset:a=0,mainAxis:u=!0,crossAxis:d=!0}=Ws(t,e),m={x:n,y:r},p=fs(i),g=ev(p);let x=m[g],w=m[p];const C=Ws(a,e),y=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(u){const _=g==="y"?"height":"width",k=l.reference[g]-l.floating[_]+y.mainAxis,j=l.reference[g]+l.reference[_]-y.mainAxis;x<k?x=k:x>j&&(x=j)}if(d){var S,b;const _=g==="y"?"width":"height",k=k2.has(Gs(i)),j=l.reference[p]-l.floating[_]+(k&&((S=c.offset)==null?void 0:S[p])||0)+(k?0:y.crossAxis),N=l.reference[p]+l.reference[_]+(k?0:((b=c.offset)==null?void 0:b[p])||0)-(k?y.crossAxis:0);w<j?w=j:w>N&&(w=N)}return{[g]:x,[p]:w}}}},Zj=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:l,platform:c,elements:a}=e,{apply:u=()=>{},...d}=Ws(t,e),m=await c.detectOverflow(e,d),p=Gs(i),g=rl(i),x=fs(i)==="y",{width:w,height:C}=l.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=g===(await(c.isRTL==null?void 0:c.isRTL(a.floating))?"start":"end")?"left":"right"):(S=p,y=g==="end"?"top":"bottom");const b=C-m.top-m.bottom,_=w-m.left-m.right,k=Bi(C-m[y],b),j=Bi(w-m[S],_),N=!e.middlewareData.shift;let D=k,E=j;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(E=_),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(D=b),N&&!g){const L=_r(m.left,0),z=_r(m.right,0),H=_r(m.top,0),$=_r(m.bottom,0);x?E=w-2*(L!==0||z!==0?L+z:_r(m.left,m.right)):D=C-2*(H!==0||$!==0?H+$:_r(m.top,m.bottom))}await u({...e,availableWidth:E,availableHeight:D});const O=await c.getDimensions(a.floating);return w!==O.width||C!==O.height?{reset:{rects:!0}}:{}}}};function vf(){return typeof window<"u"}function sl(t){return E2(t)?(t.nodeName||"").toLowerCase():"#document"}function wr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function gs(t){var e;return(e=(E2(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function E2(t){return vf()?t instanceof Node||t instanceof wr(t).Node:!1}function Jr(t){return vf()?t instanceof Element||t instanceof wr(t).Element:!1}function Xs(t){return vf()?t instanceof HTMLElement||t instanceof wr(t).HTMLElement:!1}function vx(t){return!vf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof wr(t).ShadowRoot}function Bc(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=es(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function Jj(t){return/^(table|td|th)$/.test(sl(t))}function yf(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const eT=/transform|translate|scale|rotate|perspective|filter/,tT=/paint|layout|strict|content/,Eo=t=>!!t&&t!=="none";let _m;function rv(t){const e=Jr(t)?es(t):t;return Eo(e.transform)||Eo(e.translate)||Eo(e.scale)||Eo(e.rotate)||Eo(e.perspective)||!sv()&&(Eo(e.backdropFilter)||Eo(e.filter))||eT.test(e.willChange||"")||tT.test(e.contain||"")}function nT(t){let e=Fi(t);for(;Xs(e)&&!Va(e);){if(rv(e))return e;if(yf(e))return null;e=Fi(e)}return null}function sv(){return _m==null&&(_m=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_m}function Va(t){return/^(html|body|#document)$/.test(sl(t))}function es(t){return wr(t).getComputedStyle(t)}function bf(t){return Jr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fi(t){if(sl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vx(t)&&t.host||gs(t);return vx(e)?e.host:e}function A2(t){const e=Fi(t);return Va(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xs(e)&&Bc(e)?e:A2(e)}function Sc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=A2(t),l=i===((r=t.ownerDocument)==null?void 0:r.body),c=wr(i);if(l){const a=cg(c);return e.concat(c,c.visualViewport||[],Bc(i)?i:[],a&&n?Sc(a):[])}else return e.concat(i,Sc(i,[],n))}function cg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function N2(t){const e=es(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Xs(t),l=i?t.offsetWidth:n,c=i?t.offsetHeight:r,a=Id(n)!==l||Id(r)!==c;return a&&(n=l,r=c),{width:n,height:r,$:a}}function iv(t){return Jr(t)?t:t.contextElement}function Fa(t){const e=iv(t);if(!Xs(e))return hs(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:l}=N2(e);let c=(l?Id(n.width):n.width)/r,a=(l?Id(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!a||!Number.isFinite(a))&&(a=1),{x:c,y:a}}const rT=hs(0);function R2(t){const e=wr(t);return!sv()||!e.visualViewport?rT:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function sT(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==wr(t)?!1:e}function Oo(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),l=iv(t);let c=hs(1);e&&(r?Jr(r)&&(c=Fa(r)):c=Fa(t));const a=sT(l,n,r)?R2(l):hs(0);let u=(i.left+a.x)/c.x,d=(i.top+a.y)/c.y,m=i.width/c.x,p=i.height/c.y;if(l){const g=wr(l),x=r&&Jr(r)?wr(r):r;let w=g,C=cg(w);for(;C&&r&&x!==w;){const y=Fa(C),S=C.getBoundingClientRect(),b=es(C),_=S.left+(C.clientLeft+parseFloat(b.paddingLeft))*y.x,k=S.top+(C.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,d*=y.y,m*=y.x,p*=y.y,u+=_,d+=k,w=wr(C),C=cg(w)}}return zd({width:m,height:p,x:u,y:d})}function xf(t,e){const n=bf(t).scrollLeft;return e?e.left+n:Oo(gs(t)).left+n}function j2(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-xf(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function iT(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const l=i==="fixed",c=gs(r),a=e?yf(e.floating):!1;if(r===c||a&&l)return n;let u={scrollLeft:0,scrollTop:0},d=hs(1);const m=hs(0),p=Xs(r);if((p||!p&&!l)&&((sl(r)!=="body"||Bc(c))&&(u=bf(r)),p)){const x=Oo(r);d=Fa(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const g=c&&!p&&!l?j2(c,u):hs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+m.x+g.x,y:n.y*d.y-u.scrollTop*d.y+m.y+g.y}}function oT(t){return Array.from(t.getClientRects())}function aT(t){const e=gs(t),n=bf(t),r=t.ownerDocument.body,i=_r(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=_r(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+xf(t);const a=-n.scrollTop;return es(r).direction==="rtl"&&(c+=_r(e.clientWidth,r.clientWidth)-i),{width:i,height:l,x:c,y:a}}const yx=25;function lT(t,e){const n=wr(t),r=gs(t),i=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,a=0,u=0;if(i){l=i.width,c=i.height;const m=sv();(!m||m&&e==="fixed")&&(a=i.offsetLeft,u=i.offsetTop)}const d=xf(r);if(d<=0){const m=r.ownerDocument,p=m.body,g=getComputedStyle(p),x=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,w=Math.abs(r.clientWidth-p.clientWidth-x);w<=yx&&(l-=w)}else d<=yx&&(l+=d);return{width:l,height:c,x:a,y:u}}function cT(t,e){const n=Oo(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,l=Xs(t)?Fa(t):hs(1),c=t.clientWidth*l.x,a=t.clientHeight*l.y,u=i*l.x,d=r*l.y;return{width:c,height:a,x:u,y:d}}function bx(t,e,n){let r;if(e==="viewport")r=lT(t,n);else if(e==="document")r=aT(gs(t));else if(Jr(e))r=cT(e,n);else{const i=R2(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return zd(r)}function T2(t,e){const n=Fi(t);return n===e||!Jr(n)||Va(n)?!1:es(n).position==="fixed"||T2(n,e)}function uT(t,e){const n=e.get(t);if(n)return n;let r=Sc(t,[],!1).filter(a=>Jr(a)&&sl(a)!=="body"),i=null;const l=es(t).position==="fixed";let c=l?Fi(t):t;for(;Jr(c)&&!Va(c);){const a=es(c),u=rv(c);!u&&a.position==="fixed"&&(i=null),(l?!u&&!i:!u&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Bc(c)&&!u&&T2(t,c))?r=r.filter(m=>m!==c):i=a,c=Fi(c)}return e.set(t,r),r}function dT(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const c=[...n==="clippingAncestors"?yf(e)?[]:uT(e,this._c):[].concat(n),r],a=bx(e,c[0],i);let u=a.top,d=a.right,m=a.bottom,p=a.left;for(let g=1;g<c.length;g++){const x=bx(e,c[g],i);u=_r(x.top,u),d=Bi(x.right,d),m=Bi(x.bottom,m),p=_r(x.left,p)}return{width:d-p,height:m-u,x:p,y:u}}function fT(t){const{width:e,height:n}=N2(t);return{width:e,height:n}}function hT(t,e,n){const r=Xs(e),i=gs(e),l=n==="fixed",c=Oo(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const u=hs(0);function d(){u.x=xf(i)}if(r||!r&&!l)if((sl(e)!=="body"||Bc(i))&&(a=bf(e)),r){const x=Oo(e,!0,l,e);u.x=x.x+e.clientLeft,u.y=x.y+e.clientTop}else i&&d();l&&!r&&i&&d();const m=i&&!r&&!l?j2(i,a):hs(0),p=c.left+a.scrollLeft-u.x-m.x,g=c.top+a.scrollTop-u.y-m.y;return{x:p,y:g,width:c.width,height:c.height}}function Sm(t){return es(t).position==="static"}function xx(t,e){if(!Xs(t)||es(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return gs(t)===n&&(n=n.ownerDocument.body),n}function D2(t,e){const n=wr(t);if(yf(t))return n;if(!Xs(t)){let i=Fi(t);for(;i&&!Va(i);){if(Jr(i)&&!Sm(i))return i;i=Fi(i)}return n}let r=xx(t,e);for(;r&&Jj(r)&&Sm(r);)r=xx(r,e);return r&&Va(r)&&Sm(r)&&!rv(r)?n:r||nT(t)||n}const pT=async function(t){const e=this.getOffsetParent||D2,n=this.getDimensions,r=await n(t.floating);return{reference:hT(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mT(t){return es(t).direction==="rtl"}const gT={convertOffsetParentRelativeRectToViewportRelativeRect:iT,getDocumentElement:gs,getClippingRect:dT,getOffsetParent:D2,getElementRects:pT,getClientRects:oT,getDimensions:fT,getScale:Fa,isElement:Jr,isRTL:mT};function M2(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function vT(t,e){let n=null,r;const i=gs(t);function l(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function c(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),l();const d=t.getBoundingClientRect(),{left:m,top:p,width:g,height:x}=d;if(a||e(),!g||!x)return;const w=yd(p),C=yd(i.clientWidth-(m+g)),y=yd(i.clientHeight-(p+x)),S=yd(m),_={rootMargin:-w+"px "+-C+"px "+-y+"px "+-S+"px",threshold:_r(0,Bi(1,u))||1};let k=!0;function j(N){const D=N[0].intersectionRatio;if(D!==u){if(!k)return c();D?c(!1,D):r=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!M2(d,t.getBoundingClientRect())&&c(),k=!1}try{n=new IntersectionObserver(j,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,_)}n.observe(t)}return c(!0),l}function yT(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=iv(t),m=i||l?[...d?Sc(d):[],...e?Sc(e):[]]:[];m.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),l&&S.addEventListener("resize",n)});const p=d&&a?vT(d,n):null;let g=-1,x=null;c&&(x=new ResizeObserver(S=>{let[b]=S;b&&b.target===d&&x&&e&&(x.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var _;(_=x)==null||_.observe(e)})),n()}),d&&!u&&x.observe(d),e&&x.observe(e));let w,C=u?Oo(t):null;u&&y();function y(){const S=Oo(t);C&&!M2(C,S)&&n(),C=S,w=requestAnimationFrame(y)}return n(),()=>{var S;m.forEach(b=>{i&&b.removeEventListener("scroll",n),l&&b.removeEventListener("resize",n)}),p==null||p(),(S=x)==null||S.disconnect(),x=null,u&&cancelAnimationFrame(w)}}const bT=Yj,xT=Xj,_T=Wj,ST=Zj,wT=Gj,_x=qj,CT=Qj,kT=(t,e,n)=>{const r=new Map,i={platform:gT,...n},l={...i.platform,_c:r};return Vj(t,e,{...i,platform:l})};var ET=typeof document<"u",AT=function(){},Nd=ET?R.useLayoutEffect:AT;function Bd(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Bd(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const l=i[r];if(!(l==="_owner"&&t.$$typeof)&&!Bd(t[l],e[l]))return!1}return!0}return t!==t&&e!==e}function O2(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Sx(t,e){const n=O2(t);return Math.round(e*n)/n}function wm(t){const e=R.useRef(t);return Nd(()=>{e.current=t}),e}function NT(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:l,floating:c}={},transform:a=!0,whileElementsMounted:u,open:d}=t,[m,p]=R.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,x]=R.useState(r);Bd(g,r)||x(r);const[w,C]=R.useState(null),[y,S]=R.useState(null),b=R.useCallback(Y=>{Y!==N.current&&(N.current=Y,C(Y))},[]),_=R.useCallback(Y=>{Y!==D.current&&(D.current=Y,S(Y))},[]),k=l||w,j=c||y,N=R.useRef(null),D=R.useRef(null),E=R.useRef(m),O=u!=null,L=wm(u),z=wm(i),H=wm(d),$=R.useCallback(()=>{if(!N.current||!D.current)return;const Y={placement:e,strategy:n,middleware:g};z.current&&(Y.platform=z.current),kT(N.current,D.current,Y).then(I=>{const M={...I,isPositioned:H.current!==!1};q.current&&!Bd(E.current,M)&&(E.current=M,el.flushSync(()=>{p(M)}))})},[g,e,n,z,H]);Nd(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[d]);const q=R.useRef(!1);Nd(()=>(q.current=!0,()=>{q.current=!1}),[]),Nd(()=>{if(k&&(N.current=k),j&&(D.current=j),k&&j){if(L.current)return L.current(k,j,$);$()}},[k,j,$,L,O]);const G=R.useMemo(()=>({reference:N,floating:D,setReference:b,setFloating:_}),[b,_]),W=R.useMemo(()=>({reference:k,floating:j}),[k,j]),X=R.useMemo(()=>{const Y={position:n,left:0,top:0};if(!W.floating)return Y;const I=Sx(W.floating,m.x),M=Sx(W.floating,m.y);return a?{...Y,transform:"translate("+I+"px, "+M+"px)",...O2(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:M}},[n,a,W.floating,m.x,m.y]);return R.useMemo(()=>({...m,update:$,refs:G,elements:W,floatingStyles:X}),[m,$,G,W,X])}const RT=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?_x({element:r.current,padding:i}).fn(n):{}:r?_x({element:r,padding:i}).fn(n):{}}}},jT=(t,e)=>{const n=bT(t);return{name:n.name,fn:n.fn,options:[t,e]}},TT=(t,e)=>{const n=xT(t);return{name:n.name,fn:n.fn,options:[t,e]}},DT=(t,e)=>({fn:CT(t).fn,options:[t,e]}),MT=(t,e)=>{const n=_T(t);return{name:n.name,fn:n.fn,options:[t,e]}},OT=(t,e)=>{const n=ST(t);return{name:n.name,fn:n.fn,options:[t,e]}},LT=(t,e)=>{const n=wT(t);return{name:n.name,fn:n.fn,options:[t,e]}},IT=(t,e)=>{const n=RT(t);return{name:n.name,fn:n.fn,options:[t,e]}};var PT="Arrow",L2=R.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...l}=t;return h.jsx(Qe.svg,{...l,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});L2.displayName=PT;var zT=L2,ov="Popper",[I2,Ui]=or(ov),[BT,P2]=I2(ov),z2=t=>{const{__scopePopper:e,children:n}=t,[r,i]=R.useState(null);return h.jsx(BT,{scope:e,anchor:r,onAnchorChange:i,children:n})};z2.displayName=ov;var B2="PopperAnchor",F2=R.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,l=P2(B2,n),c=R.useRef(null),a=ht(e,c),u=R.useRef(null);return R.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||c.current,d!==u.current&&l.onAnchorChange(u.current)}),r?null:h.jsx(Qe.div,{...i,ref:a})});F2.displayName=B2;var av="PopperContent",[FT,HT]=I2(av),H2=R.forwardRef((t,e)=>{var K,V,te,re,ae,se,Se,Ae;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:l="center",alignOffset:c=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:w,...C}=t,y=P2(av,n),[S,b]=R.useState(null),_=ht(e,De=>b(De)),[k,j]=R.useState(null),N=w2(k),D=(K=N==null?void 0:N.width)!=null?K:0,E=(V=N==null?void 0:N.height)!=null?V:0,O=r+(l!=="center"?"-"+l:""),L=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},z=Array.isArray(d)?d:[d],H=z.length>0,$={padding:L,boundary:z.filter(UT),altBoundary:H},{refs:q,floatingStyles:G,placement:W,isPositioned:X,middlewareData:Y}=NT({strategy:"fixed",placement:O,whileElementsMounted:(...De)=>yT(...De,{animationFrame:x==="always"}),elements:{reference:y.anchor},middleware:[jT({mainAxis:i+E,alignmentAxis:c}),u&&TT({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?DT():void 0,...$}),u&&MT({...$}),OT({...$,apply:({elements:De,rects:Ue,availableWidth:ce,availableHeight:je})=>{const{width:xe,height:Ve}=Ue.reference,We=De.floating.style;We.setProperty("--radix-popper-available-width",`${ce}px`),We.setProperty("--radix-popper-available-height",`${je}px`),We.setProperty("--radix-popper-anchor-width",`${xe}px`),We.setProperty("--radix-popper-anchor-height",`${Ve}px`)}}),k&&IT({element:k,padding:a}),VT({arrowWidth:D,arrowHeight:E}),g&<({strategy:"referenceHidden",...$})]}),[I,M]=V2(W),P=Pn(w);kn(()=>{X&&(P==null||P())},[X,P]);const B=(te=Y.arrow)==null?void 0:te.x,F=(re=Y.arrow)==null?void 0:re.y,Q=((ae=Y.arrow)==null?void 0:ae.centerOffset)!==0,[J,ee]=R.useState();return kn(()=>{S&&ee(window.getComputedStyle(S).zIndex)},[S]),h.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:X?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(se=Y.transformOrigin)==null?void 0:se.x,(Se=Y.transformOrigin)==null?void 0:Se.y].join(" "),...((Ae=Y.hide)==null?void 0:Ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(FT,{scope:n,placedSide:I,onArrowChange:j,arrowX:B,arrowY:F,shouldHideArrow:Q,children:h.jsx(Qe.div,{"data-side":I,"data-align":M,...C,ref:_,style:{...C.style,animation:X?void 0:"none"}})})})});H2.displayName=av;var $2="PopperArrow",$T={top:"bottom",right:"left",bottom:"top",left:"right"},U2=R.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,l=HT($2,r),c=$T[l.placedSide];return h.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:h.jsx(zT,{...i,ref:n,style:{...i.style,display:"block"}})})});U2.displayName=$2;function UT(t){return t!==null}var VT=t=>({name:"transformOrigin",options:t,fn(e){var y,S,b,_,k;const{placement:n,rects:r,middlewareData:i}=e,c=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=c?0:t.arrowWidth,u=c?0:t.arrowHeight,[d,m]=V2(n),p={start:"0%",center:"50%",end:"100%"}[m],g=((b=(S=i.arrow)==null?void 0:S.x)!=null?b:0)+a/2,x=((k=(_=i.arrow)==null?void 0:_.y)!=null?k:0)+u/2;let w="",C="";return d==="bottom"?(w=c?p:`${g}px`,C=`${-u}px`):d==="top"?(w=c?p:`${g}px`,C=`${r.floating.height+u}px`):d==="right"?(w=`${-u}px`,C=c?p:`${x}px`):d==="left"&&(w=`${r.floating.width+u}px`,C=c?p:`${x}px`),{data:{x:w,y:C}}}});function V2(t){const[e,n="center"]=t.split("-");return[e,n]}var _f=z2,Fc=F2,Sf=H2,wf=U2,Cm="rovingFocusGroup.onEntryFocus",qT={bubbles:!1,cancelable:!0},Hc="RovingFocusGroup",[ug,q2,WT]=Ug(Hc),[GT,Cf]=or(Hc,[WT]),[KT,YT]=GT(Hc),W2=R.forwardRef((t,e)=>h.jsx(ug.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(ug.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(XT,{...t,ref:e})})}));W2.displayName=Hc;var XT=R.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...p}=t,g=R.useRef(null),x=ht(e,g),w=Ic(l),[C,y]=ms({prop:c,defaultProp:a!=null?a:null,onChange:u,caller:Hc}),[S,b]=R.useState(!1),_=Pn(d),k=q2(n),j=R.useRef(!1),[N,D]=R.useState(0);return R.useEffect(()=>{const E=g.current;if(E)return E.addEventListener(Cm,_),()=>E.removeEventListener(Cm,_)},[_]),h.jsx(KT,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:C,onItemFocus:R.useCallback(E=>y(E),[y]),onItemShiftTab:R.useCallback(()=>b(!0),[]),onFocusableItemAdd:R.useCallback(()=>D(E=>E+1),[]),onFocusableItemRemove:R.useCallback(()=>D(E=>E-1),[]),children:h.jsx(Qe.div,{tabIndex:S||N===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...t.style},onMouseDown:$e(t.onMouseDown,()=>{j.current=!0}),onFocus:$e(t.onFocus,E=>{const O=!j.current;if(E.target===E.currentTarget&&O&&!S){const L=new CustomEvent(Cm,qT);if(E.currentTarget.dispatchEvent(L),!L.defaultPrevented){const z=k().filter(W=>W.focusable),H=z.find(W=>W.active),$=z.find(W=>W.id===C),G=[H,$,...z].filter(Boolean).map(W=>W.ref.current);Y2(G,m)}}j.current=!1}),onBlur:$e(t.onBlur,()=>b(!1))})})}),G2="RovingFocusGroupItem",K2=R.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:l,children:c,...a}=t,u=Sn(),d=l||u,m=YT(G2,n),p=m.currentTabStopId===d,g=q2(n),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:C}=m;return R.useEffect(()=>{if(r)return x(),()=>w()},[r,x,w]),h.jsx(ug.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:h.jsx(Qe.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...a,ref:e,onMouseDown:$e(t.onMouseDown,y=>{r?m.onItemFocus(d):y.preventDefault()}),onFocus:$e(t.onFocus,()=>m.onItemFocus(d)),onKeyDown:$e(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){m.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=JT(y,m.orientation,m.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let _=g().filter(k=>k.focusable).map(k=>k.ref.current);if(S==="last")_.reverse();else if(S==="prev"||S==="next"){S==="prev"&&_.reverse();const k=_.indexOf(y.currentTarget);_=m.loop?e6(_,k+1):_.slice(k+1)}setTimeout(()=>Y2(_))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:C!=null}):c})})});K2.displayName=G2;var QT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ZT(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function JT(t,e,n){const r=ZT(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return QT[r]}function Y2(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function e6(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var X2=W2,Q2=K2,dg=["Enter"," "],t6=["ArrowDown","PageUp","Home"],Z2=["ArrowUp","PageDown","End"],n6=[...t6,...Z2],r6={ltr:[...dg,"ArrowRight"],rtl:[...dg,"ArrowLeft"]},s6={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$c="Menu",[wc,i6,o6]=Ug($c),[Bo,J2]=or($c,[o6,Ui,Cf]),kf=Ui(),ew=Cf(),[a6,Fo]=Bo($c),[l6,Uc]=Bo($c),tw=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:l,modal:c=!0}=t,a=kf(e),[u,d]=R.useState(null),m=R.useRef(!1),p=Pn(l),g=Ic(i);return R.useEffect(()=>{const x=()=>{m.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>m.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),h.jsx(_f,{...a,children:h.jsx(a6,{scope:e,open:n,onOpenChange:p,content:u,onContentChange:d,children:h.jsx(l6,{scope:e,onClose:R.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:c,children:r})})})};tw.displayName=$c;var c6="MenuAnchor",lv=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=kf(n);return h.jsx(Fc,{...i,...r,ref:e})});lv.displayName=c6;var cv="MenuPortal",[u6,nw]=Bo(cv,{forceMount:void 0}),rw=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,l=Fo(cv,e);return h.jsx(u6,{scope:e,forceMount:n,children:h.jsx(En,{present:n||l.open,children:h.jsx(nl,{asChild:!0,container:i,children:r})})})};rw.displayName=cv;var Fr="MenuContent",[d6,uv]=Bo(Fr),sw=R.forwardRef((t,e)=>{const n=nw(Fr,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,l=Fo(Fr,t.__scopeMenu),c=Uc(Fr,t.__scopeMenu);return h.jsx(wc.Provider,{scope:t.__scopeMenu,children:h.jsx(En,{present:r||l.open,children:h.jsx(wc.Slot,{scope:t.__scopeMenu,children:c.modal?h.jsx(f6,{...i,ref:e}):h.jsx(h6,{...i,ref:e})})})})}),f6=R.forwardRef((t,e)=>{const n=Fo(Fr,t.__scopeMenu),r=R.useRef(null),i=ht(e,r);return R.useEffect(()=>{const l=r.current;if(l)return pf(l)},[]),h.jsx(dv,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:$e(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),h6=R.forwardRef((t,e)=>{const n=Fo(Fr,t.__scopeMenu);return h.jsx(dv,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),p6=zi("MenuContent.ScrollLock"),dv=R.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,disableOutsideScroll:w,...C}=t,y=Fo(Fr,n),S=Uc(Fr,n),b=kf(n),_=ew(n),k=i6(n),[j,N]=R.useState(null),D=R.useRef(null),E=ht(e,D,y.onContentChange),O=R.useRef(0),L=R.useRef(""),z=R.useRef(0),H=R.useRef(null),$=R.useRef("right"),q=R.useRef(0),G=w?zc:R.Fragment,W=w?{as:p6,allowPinchZoom:!0}:void 0,X=I=>{var K,V;const M=L.current+I,P=k().filter(te=>!te.disabled),B=document.activeElement,F=(K=P.find(te=>te.ref.current===B))==null?void 0:K.textValue,Q=P.map(te=>te.textValue),J=E6(Q,M,F),ee=(V=P.find(te=>te.textValue===J))==null?void 0:V.ref.current;(function te(re){L.current=re,window.clearTimeout(O.current),re!==""&&(O.current=window.setTimeout(()=>te(""),1e3))})(M),ee&&setTimeout(()=>ee.focus())};R.useEffect(()=>()=>window.clearTimeout(O.current),[]),ff();const Y=R.useCallback(I=>{var P,B;return $.current===((P=H.current)==null?void 0:P.side)&&N6(I,(B=H.current)==null?void 0:B.area)},[]);return h.jsx(d6,{scope:n,searchRef:L,onItemEnter:R.useCallback(I=>{Y(I)&&I.preventDefault()},[Y]),onItemLeave:R.useCallback(I=>{var M;Y(I)||((M=D.current)==null||M.focus(),N(null))},[Y]),onTriggerLeave:R.useCallback(I=>{Y(I)&&I.preventDefault()},[Y]),pointerGraceTimerRef:z,onPointerGraceIntentChange:R.useCallback(I=>{H.current=I},[]),children:h.jsx(G,{...W,children:h.jsx(Pc,{asChild:!0,trapped:i,onMountAutoFocus:$e(l,I=>{var M;I.preventDefault(),(M=D.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,children:h.jsx(X2,{asChild:!0,..._,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:$e(u,I=>{S.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Sf,{role:"menu","aria-orientation":"vertical","data-state":xw(y.open),"data-radix-menu-content":"",dir:S.dir,...b,...C,ref:E,style:{outline:"none",...C.style},onKeyDown:$e(C.onKeyDown,I=>{const P=I.target.closest("[data-radix-menu-content]")===I.currentTarget,B=I.ctrlKey||I.altKey||I.metaKey,F=I.key.length===1;P&&(I.key==="Tab"&&I.preventDefault(),!B&&F&&X(I.key));const Q=D.current;if(I.target!==Q||!n6.includes(I.key))return;I.preventDefault();const ee=k().filter(K=>!K.disabled).map(K=>K.ref.current);Z2.includes(I.key)&&ee.reverse(),C6(ee)}),onBlur:$e(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(O.current),L.current="")}),onPointerMove:$e(t.onPointerMove,Cc(I=>{const M=I.target,P=q.current!==I.clientX;if(I.currentTarget.contains(M)&&P){const B=I.clientX>q.current?"right":"left";$.current=B,q.current=I.clientX}}))})})})})})})});sw.displayName=Fr;var m6="MenuGroup",fv=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(Qe.div,{role:"group",...r,ref:e})});fv.displayName=m6;var g6="MenuLabel",iw=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(Qe.div,{...r,ref:e})});iw.displayName=g6;var Fd="MenuItem",wx="menu.itemSelect",Ef=R.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,l=R.useRef(null),c=Uc(Fd,t.__scopeMenu),a=uv(Fd,t.__scopeMenu),u=ht(e,l),d=R.useRef(!1),m=()=>{const p=l.current;if(!n&&p){const g=new CustomEvent(wx,{bubbles:!0,cancelable:!0});p.addEventListener(wx,x=>r==null?void 0:r(x),{once:!0}),FS(p,g),g.defaultPrevented?d.current=!1:c.onClose()}};return h.jsx(ow,{...i,ref:u,disabled:n,onClick:$e(t.onClick,m),onPointerDown:p=>{var g;(g=t.onPointerDown)==null||g.call(t,p),d.current=!0},onPointerUp:$e(t.onPointerUp,p=>{var g;d.current||(g=p.currentTarget)==null||g.click()}),onKeyDown:$e(t.onKeyDown,p=>{const g=a.searchRef.current!=="";n||g&&p.key===" "||dg.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Ef.displayName=Fd;var ow=R.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...l}=t,c=uv(Fd,n),a=ew(n),u=R.useRef(null),d=ht(e,u),[m,p]=R.useState(!1),[g,x]=R.useState("");return R.useEffect(()=>{var C;const w=u.current;w&&x(((C=w.textContent)!=null?C:"").trim())},[l.children]),h.jsx(wc.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:g,children:h.jsx(Q2,{asChild:!0,...a,focusable:!r,children:h.jsx(Qe.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:d,onPointerMove:$e(t.onPointerMove,Cc(w=>{r?c.onItemLeave(w):(c.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$e(t.onPointerLeave,Cc(w=>c.onItemLeave(w))),onFocus:$e(t.onFocus,()=>p(!0)),onBlur:$e(t.onBlur,()=>p(!1))})})})}),v6="MenuCheckboxItem",aw=R.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return h.jsx(fw,{scope:t.__scopeMenu,checked:n,children:h.jsx(Ef,{role:"menuitemcheckbox","aria-checked":Hd(n)?"mixed":n,...i,ref:e,"data-state":pv(n),onSelect:$e(i.onSelect,()=>r==null?void 0:r(Hd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});aw.displayName=v6;var lw="MenuRadioGroup",[y6,b6]=Bo(lw,{value:void 0,onValueChange:()=>{}}),cw=R.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,l=Pn(r);return h.jsx(y6,{scope:t.__scopeMenu,value:n,onValueChange:l,children:h.jsx(fv,{...i,ref:e})})});cw.displayName=lw;var uw="MenuRadioItem",dw=R.forwardRef((t,e)=>{const{value:n,...r}=t,i=b6(uw,t.__scopeMenu),l=n===i.value;return h.jsx(fw,{scope:t.__scopeMenu,checked:l,children:h.jsx(Ef,{role:"menuitemradio","aria-checked":l,...r,ref:e,"data-state":pv(l),onSelect:$e(r.onSelect,()=>{var c;return(c=i.onValueChange)==null?void 0:c.call(i,n)},{checkForDefaultPrevented:!1})})})});dw.displayName=uw;var hv="MenuItemIndicator",[fw,x6]=Bo(hv,{checked:!1}),hw=R.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,l=x6(hv,n);return h.jsx(En,{present:r||Hd(l.checked)||l.checked===!0,children:h.jsx(Qe.span,{...i,ref:e,"data-state":pv(l.checked)})})});hw.displayName=hv;var _6="MenuSeparator",pw=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(Qe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});pw.displayName=_6;var S6="MenuArrow",mw=R.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=kf(n);return h.jsx(wf,{...i,...r,ref:e})});mw.displayName=S6;var w6="MenuSub",[Eq,gw]=Bo(w6),fc="MenuSubTrigger",vw=R.forwardRef((t,e)=>{const n=Fo(fc,t.__scopeMenu),r=Uc(fc,t.__scopeMenu),i=gw(fc,t.__scopeMenu),l=uv(fc,t.__scopeMenu),c=R.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=l,d={__scopeMenu:t.__scopeMenu},m=R.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return R.useEffect(()=>m,[m]),R.useEffect(()=>{const p=a.current;return()=>{window.clearTimeout(p),u(null)}},[a,u]),h.jsx(lv,{asChild:!0,...d,children:h.jsx(ow,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":xw(n.open),...t,ref:qs(e,i.onTriggerChange),onClick:p=>{var g;(g=t.onClick)==null||g.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:$e(t.onPointerMove,Cc(p=>{l.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:$e(t.onPointerLeave,Cc(p=>{var x,w;m();const g=(x=n.content)==null?void 0:x.getBoundingClientRect();if(g){const C=(w=n.content)==null?void 0:w.dataset.side,y=C==="right",S=y?-5:5,b=g[y?"left":"right"],_=g[y?"right":"left"];l.onPointerGraceIntentChange({area:[{x:p.clientX+S,y:p.clientY},{x:b,y:g.top},{x:_,y:g.top},{x:_,y:g.bottom},{x:b,y:g.bottom}],side:C}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(p),p.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:$e(t.onKeyDown,p=>{var x;const g=l.searchRef.current!=="";t.disabled||g&&p.key===" "||r6[r.dir].includes(p.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),p.preventDefault())})})})});vw.displayName=fc;var yw="MenuSubContent",bw=R.forwardRef((t,e)=>{const n=nw(Fr,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,l=Fo(Fr,t.__scopeMenu),c=Uc(Fr,t.__scopeMenu),a=gw(yw,t.__scopeMenu),u=R.useRef(null),d=ht(e,u);return h.jsx(wc.Provider,{scope:t.__scopeMenu,children:h.jsx(En,{present:r||l.open,children:h.jsx(wc.Slot,{scope:t.__scopeMenu,children:h.jsx(dv,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:d,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;c.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:$e(t.onFocusOutside,m=>{m.target!==a.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:$e(t.onEscapeKeyDown,m=>{c.onClose(),m.preventDefault()}),onKeyDown:$e(t.onKeyDown,m=>{var x;const p=m.currentTarget.contains(m.target),g=s6[c.dir].includes(m.key);p&&g&&(l.onOpenChange(!1),(x=a.trigger)==null||x.focus(),m.preventDefault())})})})})})});bw.displayName=yw;function xw(t){return t?"open":"closed"}function Hd(t){return t==="indeterminate"}function pv(t){return Hd(t)?"indeterminate":t?"checked":"unchecked"}function C6(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function k6(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function E6(t,e,n){const i=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let c=k6(t,Math.max(l,0));i.length===1&&(c=c.filter(d=>d!==n));const u=c.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function A6(t,e){const{x:n,y:r}=t;let i=!1;for(let l=0,c=e.length-1;l<e.length;c=l++){const a=e[l],u=e[c],d=a.x,m=a.y,p=u.x,g=u.y;m>r!=g>r&&n<(p-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function N6(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return A6(n,e)}function Cc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var R6=tw,j6=lv,T6=rw,D6=sw,M6=fv,O6=iw,L6=Ef,I6=aw,P6=cw,z6=dw,B6=hw,F6=pw,H6=mw,$6=vw,U6=bw,Af="DropdownMenu",[V6]=or(Af,[J2]),Qn=J2(),[q6,_w]=V6(Af),Sw=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:l,onOpenChange:c,modal:a=!0}=t,u=Qn(e),d=R.useRef(null),[m,p]=ms({prop:i,defaultProp:l!=null?l:!1,onChange:c,caller:Af});return h.jsx(q6,{scope:e,triggerId:Sn(),triggerRef:d,contentId:Sn(),open:m,onOpenChange:p,onOpenToggle:R.useCallback(()=>p(g=>!g),[p]),modal:a,children:h.jsx(R6,{...u,open:m,onOpenChange:p,dir:r,modal:a,children:n})})};Sw.displayName=Af;var ww="DropdownMenuTrigger",Cw=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,l=_w(ww,n),c=Qn(n);return h.jsx(j6,{asChild:!0,...c,children:h.jsx(Qe.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:qs(e,l.triggerRef),onPointerDown:$e(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(l.onOpenToggle(),l.open||a.preventDefault())}),onKeyDown:$e(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&l.onOpenToggle(),a.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Cw.displayName=ww;var W6="DropdownMenuPortal",kw=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Qn(e);return h.jsx(T6,{...r,...n})};kw.displayName=W6;var Ew="DropdownMenuContent",Aw=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=_w(Ew,n),l=Qn(n),c=R.useRef(!1);return h.jsx(D6,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...r,ref:e,onCloseAutoFocus:$e(t.onCloseAutoFocus,a=>{var u;c.current||(u=i.triggerRef.current)==null||u.focus(),c.current=!1,a.preventDefault()}),onInteractOutside:$e(t.onInteractOutside,a=>{const u=a.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,m=u.button===2||d;(!i.modal||m)&&(c.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Aw.displayName=Ew;var G6="DropdownMenuGroup",K6=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(M6,{...i,...r,ref:e})});K6.displayName=G6;var Y6="DropdownMenuLabel",X6=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(O6,{...i,...r,ref:e})});X6.displayName=Y6;var Q6="DropdownMenuItem",Nw=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(L6,{...i,...r,ref:e})});Nw.displayName=Q6;var Z6="DropdownMenuCheckboxItem",J6=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(I6,{...i,...r,ref:e})});J6.displayName=Z6;var eD="DropdownMenuRadioGroup",tD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(P6,{...i,...r,ref:e})});tD.displayName=eD;var nD="DropdownMenuRadioItem",rD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(z6,{...i,...r,ref:e})});rD.displayName=nD;var sD="DropdownMenuItemIndicator",iD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(B6,{...i,...r,ref:e})});iD.displayName=sD;var oD="DropdownMenuSeparator",aD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(F6,{...i,...r,ref:e})});aD.displayName=oD;var lD="DropdownMenuArrow",cD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(H6,{...i,...r,ref:e})});cD.displayName=lD;var uD="DropdownMenuSubTrigger",dD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx($6,{...i,...r,ref:e})});dD.displayName=uD;var fD="DropdownMenuSubContent",hD=R.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Qn(n);return h.jsx(U6,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hD.displayName=fD;var pD=Sw,mD=Cw,gD=kw,vD=Aw,yD=Nw,bD="Label",Rw=R.forwardRef((t,e)=>h.jsx(Qe.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Rw.displayName=bD;var xD=Rw;function fg(t,[e,n]){return Math.min(n,Math.max(e,t))}var Nf="Popover",[jw]=or(Nf,[Ui]),Vc=Ui(),[_D,Vi]=jw(Nf),Tw=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:l,modal:c=!1}=t,a=Vc(e),u=R.useRef(null),[d,m]=R.useState(!1),[p,g]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:l,caller:Nf});return h.jsx(_f,{...a,children:h.jsx(_D,{scope:e,contentId:Sn(),triggerRef:u,open:p,onOpenChange:g,onOpenToggle:R.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:d,onCustomAnchorAdd:R.useCallback(()=>m(!0),[]),onCustomAnchorRemove:R.useCallback(()=>m(!1),[]),modal:c,children:n})})};Tw.displayName=Nf;var Dw="PopoverAnchor",Mw=R.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Vi(Dw,n),l=Vc(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:a}=i;return R.useEffect(()=>(c(),()=>a()),[c,a]),h.jsx(Fc,{...l,...r,ref:e})});Mw.displayName=Dw;var Ow="PopoverTrigger",Lw=R.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Vi(Ow,n),l=Vc(n),c=ht(e,i.triggerRef),a=h.jsx(Qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Fw(i.open),...r,ref:c,onClick:$e(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:h.jsx(Fc,{asChild:!0,...l,children:a})});Lw.displayName=Ow;var mv="PopoverPortal",[SD,wD]=jw(mv,{forceMount:void 0}),Iw=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,l=Vi(mv,e);return h.jsx(SD,{scope:e,forceMount:n,children:h.jsx(En,{present:n||l.open,children:h.jsx(nl,{asChild:!0,container:i,children:r})})})};Iw.displayName=mv;var qa="PopoverContent",Pw=R.forwardRef((t,e)=>{const n=wD(qa,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,l=Vi(qa,t.__scopePopover);return h.jsx(En,{present:r||l.open,children:l.modal?h.jsx(kD,{...i,ref:e}):h.jsx(ED,{...i,ref:e})})});Pw.displayName=qa;var CD=zi("PopoverContent.RemoveScroll"),kD=R.forwardRef((t,e)=>{const n=Vi(qa,t.__scopePopover),r=R.useRef(null),i=ht(e,r),l=R.useRef(!1);return R.useEffect(()=>{const c=r.current;if(c)return pf(c)},[]),h.jsx(zc,{as:CD,allowPinchZoom:!0,children:h.jsx(zw,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$e(t.onCloseAutoFocus,c=>{var a;c.preventDefault(),l.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:$e(t.onPointerDownOutside,c=>{const a=c.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,d=a.button===2||u;l.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:$e(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),ED=R.forwardRef((t,e)=>{const n=Vi(qa,t.__scopePopover),r=R.useRef(!1),i=R.useRef(!1);return h.jsx(zw,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,a;(c=t.onCloseAutoFocus)==null||c.call(t,l),l.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),l.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:l=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),zw=R.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,...p}=t,g=Vi(qa,n),x=Vc(n);return ff(),h.jsx(Pc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:l,children:h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:h.jsx(Sf,{"data-state":Fw(g.open),role:"dialog",id:g.contentId,...x,...p,ref:e,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Bw="PopoverClose",AD=R.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Vi(Bw,n);return h.jsx(Qe.button,{type:"button",...r,ref:e,onClick:$e(t.onClick,()=>i.onOpenChange(!1))})});AD.displayName=Bw;var ND="PopoverArrow",RD=R.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Vc(n);return h.jsx(wf,{...i,...r,ref:e})});RD.displayName=ND;function Fw(t){return t?"open":"closed"}var jD=Tw,TD=Mw,DD=Lw,MD=Iw,OD=Pw,gv="Progress",vv=100,[LD]=or(gv),[ID,PD]=LD(gv),Hw=R.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:l=zD,...c}=t;(i||i===0)&&!Cx(i)&&console.error(BD(`${i}`,"Progress"));const a=Cx(i)?i:vv;r!==null&&!kx(r,a)&&console.error(FD(`${r}`,"Progress"));const u=kx(r,a)?r:null,d=$d(u)?l(u,a):void 0;return h.jsx(ID,{scope:n,value:u,max:a,children:h.jsx(Qe.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":$d(u)?u:void 0,"aria-valuetext":d,role:"progressbar","data-state":Vw(u,a),"data-value":u!=null?u:void 0,"data-max":a,...c,ref:e})})});Hw.displayName=gv;var $w="ProgressIndicator",Uw=R.forwardRef((t,e)=>{var l;const{__scopeProgress:n,...r}=t,i=PD($w,n);return h.jsx(Qe.div,{"data-state":Vw(i.value,i.max),"data-value":(l=i.value)!=null?l:void 0,"data-max":i.max,...r,ref:e})});Uw.displayName=$w;function zD(t,e){return`${Math.round(t/e*100)}%`}function Vw(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function $d(t){return typeof t=="number"}function Cx(t){return $d(t)&&!isNaN(t)&&t>0}function kx(t,e){return $d(t)&&!isNaN(t)&&t<=e&&t>=0}function BD(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${vv}\`.`}function FD(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
|
|
562
|
-
- a positive number
|
|
563
|
-
- less than the value passed to \`max\` (or ${vv} if no \`max\` prop is set)
|
|
564
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
565
|
-
|
|
566
|
-
Defaulting to \`null\`.`}var HD=Hw,$D=Uw;function UD(t,e){return R.useReducer((n,r)=>{const i=e[n][r];return i!=null?i:n},t)}var yv="ScrollArea",[qw]=or(yv),[VD,$r]=qw(yv),Ww=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:l=600,...c}=t,[a,u]=R.useState(null),[d,m]=R.useState(null),[p,g]=R.useState(null),[x,w]=R.useState(null),[C,y]=R.useState(null),[S,b]=R.useState(0),[_,k]=R.useState(0),[j,N]=R.useState(!1),[D,E]=R.useState(!1),O=ht(e,z=>u(z)),L=Ic(i);return h.jsx(VD,{scope:n,type:r,dir:L,scrollHideDelay:l,scrollArea:a,viewport:d,onViewportChange:m,content:p,onContentChange:g,scrollbarX:x,onScrollbarXChange:w,scrollbarXEnabled:j,onScrollbarXEnabledChange:N,scrollbarY:C,onScrollbarYChange:y,scrollbarYEnabled:D,onScrollbarYEnabledChange:E,onCornerWidthChange:b,onCornerHeightChange:k,children:h.jsx(Qe.div,{dir:L,...c,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":_+"px",...t.style}})})});Ww.displayName=yv;var Gw="ScrollAreaViewport",Kw=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:i,...l}=t,c=$r(Gw,n),a=R.useRef(null),u=ht(e,a,c.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),h.jsx(Qe.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:h.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Kw.displayName=Gw;var vs="ScrollAreaScrollbar",Yw=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=$r(vs,t.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=i,a=t.orientation==="horizontal";return R.useEffect(()=>(a?l(!0):c(!0),()=>{a?l(!1):c(!1)}),[a,l,c]),i.type==="hover"?h.jsx(qD,{...r,ref:e,forceMount:n}):i.type==="scroll"?h.jsx(WD,{...r,ref:e,forceMount:n}):i.type==="auto"?h.jsx(Xw,{...r,ref:e,forceMount:n}):i.type==="always"?h.jsx(bv,{...r,ref:e}):null});Yw.displayName=vs;var qD=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=$r(vs,t.__scopeScrollArea),[l,c]=R.useState(!1);return R.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const d=()=>{window.clearTimeout(u),c(!0)},m=()=>{u=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),h.jsx(En,{present:n||l,children:h.jsx(Xw,{"data-state":l?"visible":"hidden",...r,ref:e})})}),WD=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=$r(vs,t.__scopeScrollArea),l=t.orientation==="horizontal",c=jf(()=>u("SCROLL_END"),100),[a,u]=UD("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return R.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,i.scrollHideDelay,u]),R.useEffect(()=>{const d=i.viewport,m=l?"scrollLeft":"scrollTop";if(d){let p=d[m];const g=()=>{const x=d[m];p!==x&&(u("SCROLL"),c()),p=x};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[i.viewport,l,u,c]),h.jsx(En,{present:n||a!=="hidden",children:h.jsx(bv,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:$e(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:$e(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Xw=R.forwardRef((t,e)=>{const n=$r(vs,t.__scopeScrollArea),{forceMount:r,...i}=t,[l,c]=R.useState(!1),a=t.orientation==="horizontal",u=jf(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(a?d:m)}},10);return Wa(n.viewport,u),Wa(n.content,u),h.jsx(En,{present:r||l,children:h.jsx(bv,{"data-state":l?"visible":"hidden",...i,ref:e})})}),bv=R.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,i=$r(vs,t.__scopeScrollArea),l=R.useRef(null),c=R.useRef(0),[a,u]=R.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=tC(a.viewport,a.content),m={...r,sizes:a,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:g=>l.current=g,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:g=>c.current=g};function p(g,x){return ZD(g,c.current,a,x)}return n==="horizontal"?h.jsx(GD,{...m,ref:e,onThumbPositionChange:()=>{if(i.viewport&&l.current){const g=i.viewport.scrollLeft,x=Ex(g,a,i.dir);l.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollLeft=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollLeft=p(g,i.dir))}}):n==="vertical"?h.jsx(KD,{...m,ref:e,onThumbPositionChange:()=>{if(i.viewport&&l.current){const g=i.viewport.scrollTop,x=Ex(g,a);l.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=p(g))}}):null}),GD=R.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,l=$r(vs,t.__scopeScrollArea),[c,a]=R.useState(),u=R.useRef(null),d=ht(e,u,l.onScrollbarXChange);return R.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),h.jsx(Zw,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Rf(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.x),onDragScroll:m=>t.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(l.viewport){const g=l.viewport.scrollLeft+m.deltaX;t.onWheelScroll(g),rC(g,p)&&m.preventDefault()}},onResize:()=>{u.current&&l.viewport&&c&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Vd(c.paddingLeft),paddingEnd:Vd(c.paddingRight)}})}})}),KD=R.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,l=$r(vs,t.__scopeScrollArea),[c,a]=R.useState(),u=R.useRef(null),d=ht(e,u,l.onScrollbarYChange);return R.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),h.jsx(Zw,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Rf(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.y),onDragScroll:m=>t.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(l.viewport){const g=l.viewport.scrollTop+m.deltaY;t.onWheelScroll(g),rC(g,p)&&m.preventDefault()}},onResize:()=>{u.current&&l.viewport&&c&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Vd(c.paddingTop),paddingEnd:Vd(c.paddingBottom)}})}})}),[YD,Qw]=qw(vs),Zw=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:m,onResize:p,...g}=t,x=$r(vs,n),[w,C]=R.useState(null),y=ht(e,O=>C(O)),S=R.useRef(null),b=R.useRef(""),_=x.viewport,k=r.content-r.viewport,j=Pn(m),N=Pn(u),D=jf(p,10);function E(O){if(S.current){const L=O.clientX-S.current.left,z=O.clientY-S.current.top;d({x:L,y:z})}}return R.useEffect(()=>{const O=L=>{const z=L.target;(w==null?void 0:w.contains(z))&&j(L,k)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[_,w,k,j]),R.useEffect(N,[r,N]),Wa(w,D),Wa(x.content,D),h.jsx(YD,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:Pn(l),onThumbPointerUp:Pn(c),onThumbPositionChange:N,onThumbPointerDown:Pn(a),children:h.jsx(Qe.div,{...g,ref:y,style:{position:"absolute",...g.style},onPointerDown:$e(t.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),S.current=w.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),E(O))}),onPointerMove:$e(t.onPointerMove,E),onPointerUp:$e(t.onPointerUp,O=>{const L=O.target;L.hasPointerCapture(O.pointerId)&&L.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=b.current,x.viewport&&(x.viewport.style.scrollBehavior=""),S.current=null})})})}),Ud="ScrollAreaThumb",Jw=R.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Qw(Ud,t.__scopeScrollArea);return h.jsx(En,{present:n||i.hasThumb,children:h.jsx(XD,{ref:e,...r})})}),XD=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...i}=t,l=$r(Ud,n),c=Qw(Ud,n),{onThumbPositionChange:a}=c,u=ht(e,p=>c.onThumbChange(p)),d=R.useRef(void 0),m=jf(()=>{d.current&&(d.current(),d.current=void 0)},100);return R.useEffect(()=>{const p=l.viewport;if(p){const g=()=>{if(m(),!d.current){const x=JD(p,a);d.current=x,a()}};return a(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[l.viewport,m,a]),h.jsx(Qe.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:$e(t.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),w=p.clientX-x.left,C=p.clientY-x.top;c.onThumbPointerDown({x:w,y:C})}),onPointerUp:$e(t.onPointerUp,c.onThumbPointerUp)})});Jw.displayName=Ud;var xv="ScrollAreaCorner",eC=R.forwardRef((t,e)=>{const n=$r(xv,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.jsx(QD,{...t,ref:e}):null});eC.displayName=xv;var QD=R.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,i=$r(xv,n),[l,c]=R.useState(0),[a,u]=R.useState(0),d=!!(l&&a);return Wa(i.scrollbarX,()=>{var p;const m=((p=i.scrollbarX)==null?void 0:p.offsetHeight)||0;i.onCornerHeightChange(m),u(m)}),Wa(i.scrollbarY,()=>{var p;const m=((p=i.scrollbarY)==null?void 0:p.offsetWidth)||0;i.onCornerWidthChange(m),c(m)}),d?h.jsx(Qe.div,{...r,ref:e,style:{width:l,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Vd(t){return t?parseInt(t,10):0}function tC(t,e){const n=t/e;return isNaN(n)?0:n}function Rf(t){const e=tC(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function ZD(t,e,n,r="ltr"){const i=Rf(n),l=i/2,c=e||l,a=i-c,u=n.scrollbar.paddingStart+c,d=n.scrollbar.size-n.scrollbar.paddingEnd-a,m=n.content-n.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return nC([u,d],p)(t)}function Ex(t,e,n="ltr"){const r=Rf(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=e.scrollbar.size-i,c=e.content-e.viewport,a=l-r,u=n==="ltr"?[0,c]:[c*-1,0],d=fg(t,u);return nC([0,c],[0,a])(d)}function nC(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function rC(t,e){return t>0&&t<e}var JD=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function i(){const l={left:t.scrollLeft,top:t.scrollTop},c=n.left!==l.left,a=n.top!==l.top;(c||a)&&e(),n=l,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function jf(t,e){const n=Pn(t),r=R.useRef(0);return R.useEffect(()=>()=>window.clearTimeout(r.current),[]),R.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Wa(t,e){const n=Pn(e);kn(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}var eM=Ww,tM=Kw,nM=eC,rM=[" ","Enter","ArrowUp","ArrowDown"],sM=[" ","Enter"],Lo="Select",[Tf,Df,iM]=Ug(Lo),[il]=or(Lo,[iM,Ui]),Mf=Ui(),[oM,qi]=il(Lo),[aM,lM]=il(Lo),sC=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:l,value:c,defaultValue:a,onValueChange:u,dir:d,name:m,autoComplete:p,disabled:g,required:x,form:w}=t,C=Mf(e),[y,S]=R.useState(null),[b,_]=R.useState(null),[k,j]=R.useState(!1),N=Ic(d),[D,E]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:l,caller:Lo}),[O,L]=ms({prop:c,defaultProp:a,onChange:u,caller:Lo}),z=R.useRef(null),H=y?w||!!y.closest("form"):!0,[$,q]=R.useState(new Set),G=Array.from($).map(W=>W.props.value).join(";");return h.jsx(_f,{...C,children:h.jsxs(oM,{required:x,scope:e,trigger:y,onTriggerChange:S,valueNode:b,onValueNodeChange:_,valueNodeHasChildren:k,onValueNodeHasChildrenChange:j,contentId:Sn(),value:O,onValueChange:L,open:D,onOpenChange:E,dir:N,triggerPointerDownPosRef:z,disabled:g,children:[h.jsx(Tf.Provider,{scope:e,children:h.jsx(aM,{scope:t.__scopeSelect,onNativeOptionAdd:R.useCallback(W=>{q(X=>new Set(X).add(W))},[]),onNativeOptionRemove:R.useCallback(W=>{q(X=>{const Y=new Set(X);return Y.delete(W),Y})},[]),children:n})}),H?h.jsxs(NC,{"aria-hidden":!0,required:x,tabIndex:-1,name:m,autoComplete:p,value:O,onChange:W=>L(W.target.value),disabled:g,form:w,children:[O===void 0?h.jsx("option",{value:""}):null,Array.from($)]},G):null]})})};sC.displayName=Lo;var iC="SelectTrigger",oC=R.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,l=Mf(n),c=qi(iC,n),a=c.disabled||r,u=ht(e,c.onTriggerChange),d=Df(n),m=R.useRef("touch"),[p,g,x]=jC(C=>{const y=d().filter(_=>!_.disabled),S=y.find(_=>_.value===c.value),b=TC(y,C,S);b!==void 0&&c.onValueChange(b.value)}),w=C=>{a||(c.onOpenChange(!0),x()),C&&(c.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return h.jsx(Fc,{asChild:!0,...l,children:h.jsx(Qe.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":RC(c.value)?"":void 0,...i,ref:u,onClick:$e(i.onClick,C=>{C.currentTarget.focus(),m.current!=="mouse"&&w(C)}),onPointerDown:$e(i.onPointerDown,C=>{m.current=C.pointerType;const y=C.target;y.hasPointerCapture(C.pointerId)&&y.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(w(C),C.preventDefault())}),onKeyDown:$e(i.onKeyDown,C=>{const y=p.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&g(C.key),!(y&&C.key===" ")&&rM.includes(C.key)&&(w(),C.preventDefault())})})})});oC.displayName=iC;var aC="SelectValue",lC=R.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:l,placeholder:c="",...a}=t,u=qi(aC,n),{onValueNodeHasChildrenChange:d}=u,m=l!==void 0,p=ht(e,u.onValueNodeChange);return kn(()=>{d(m)},[d,m]),h.jsx(Qe.span,{...a,ref:p,style:{pointerEvents:"none"},children:RC(u.value)?h.jsx(h.Fragment,{children:c}):l})});lC.displayName=aC;var cM="SelectIcon",cC=R.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return h.jsx(Qe.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});cC.displayName=cM;var uM="SelectPortal",uC=t=>h.jsx(nl,{asChild:!0,...t});uC.displayName=uM;var Io="SelectContent",dC=R.forwardRef((t,e)=>{const n=qi(Io,t.__scopeSelect),[r,i]=R.useState();if(kn(()=>{i(new DocumentFragment)},[]),!n.open){const l=r;return l?el.createPortal(h.jsx(fC,{scope:t.__scopeSelect,children:h.jsx(Tf.Slot,{scope:t.__scopeSelect,children:h.jsx("div",{children:t.children})})}),l):null}return h.jsx(hC,{...t,ref:e})});dC.displayName=Io;var Yr=10,[fC,Wi]=il(Io),dM="SelectContentImpl",fM=zi("SelectContent.RemoveScroll"),hC=R.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:c,side:a,sideOffset:u,align:d,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:w,hideWhenDetached:C,avoidCollisions:y,...S}=t,b=qi(Io,n),[_,k]=R.useState(null),[j,N]=R.useState(null),D=ht(e,K=>k(K)),[E,O]=R.useState(null),[L,z]=R.useState(null),H=Df(n),[$,q]=R.useState(!1),G=R.useRef(!1);R.useEffect(()=>{if(_)return pf(_)},[_]),ff();const W=R.useCallback(K=>{const[V,...te]=H().map(se=>se.ref.current),[re]=te.slice(-1),ae=document.activeElement;for(const se of K)if(se===ae||(se==null||se.scrollIntoView({block:"nearest"}),se===V&&j&&(j.scrollTop=0),se===re&&j&&(j.scrollTop=j.scrollHeight),se==null||se.focus(),document.activeElement!==ae))return},[H,j]),X=R.useCallback(()=>W([E,_]),[W,E,_]);R.useEffect(()=>{$&&X()},[$,X]);const{onOpenChange:Y,triggerPointerDownPosRef:I}=b;R.useEffect(()=>{if(_){let K={x:0,y:0};const V=re=>{var ae,se,Se,Ae;K={x:Math.abs(Math.round(re.pageX)-((se=(ae=I.current)==null?void 0:ae.x)!=null?se:0)),y:Math.abs(Math.round(re.pageY)-((Ae=(Se=I.current)==null?void 0:Se.y)!=null?Ae:0))}},te=re=>{K.x<=10&&K.y<=10?re.preventDefault():_.contains(re.target)||Y(!1),document.removeEventListener("pointermove",V),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",te,{capture:!0})}}},[_,Y,I]),R.useEffect(()=>{const K=()=>Y(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[Y]);const[M,P]=jC(K=>{const V=H().filter(ae=>!ae.disabled),te=V.find(ae=>ae.ref.current===document.activeElement),re=TC(V,K,te);re&&setTimeout(()=>re.ref.current.focus())}),B=R.useCallback((K,V,te)=>{const re=!G.current&&!te;(b.value!==void 0&&b.value===V||re)&&(O(K),re&&(G.current=!0))},[b.value]),F=R.useCallback(()=>_==null?void 0:_.focus(),[_]),Q=R.useCallback((K,V,te)=>{const re=!G.current&&!te;(b.value!==void 0&&b.value===V||re)&&z(K)},[b.value]),J=r==="popper"?hg:pC,ee=J===hg?{side:a,sideOffset:u,align:d,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:w,hideWhenDetached:C,avoidCollisions:y}:{};return h.jsx(fC,{scope:n,content:_,viewport:j,onViewportChange:N,itemRefCallback:B,selectedItem:E,onItemLeave:F,itemTextRefCallback:Q,focusSelectedItem:X,selectedItemText:L,position:r,isPositioned:$,searchRef:M,children:h.jsx(zc,{as:fM,allowPinchZoom:!0,children:h.jsx(Pc,{asChild:!0,trapped:b.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:$e(i,K=>{var V;(V=b.trigger)==null||V.focus({preventScroll:!0}),K.preventDefault()}),children:h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:h.jsx(J,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:K=>K.preventDefault(),...S,...ee,onPlaced:()=>q(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:$e(S.onKeyDown,K=>{const V=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!V&&K.key.length===1&&P(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let re=H().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(K.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ae=K.target,se=re.indexOf(ae);re=re.slice(se+1)}setTimeout(()=>W(re)),K.preventDefault()}})})})})})})});hC.displayName=dM;var hM="SelectItemAlignedPosition",pC=R.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,l=qi(Io,n),c=Wi(Io,n),[a,u]=R.useState(null),[d,m]=R.useState(null),p=ht(e,D=>m(D)),g=Df(n),x=R.useRef(!1),w=R.useRef(!0),{viewport:C,selectedItem:y,selectedItemText:S,focusSelectedItem:b}=c,_=R.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&d&&C&&y&&S){const D=l.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),O=l.valueNode.getBoundingClientRect(),L=S.getBoundingClientRect();if(l.dir!=="rtl"){const ae=L.left-E.left,se=O.left-ae,Se=D.left-se,Ae=D.width+Se,De=Math.max(Ae,E.width),Ue=window.innerWidth-Yr,ce=fg(se,[Yr,Math.max(Yr,Ue-De)]);a.style.minWidth=Ae+"px",a.style.left=ce+"px"}else{const ae=E.right-L.right,se=window.innerWidth-O.right-ae,Se=window.innerWidth-D.right-se,Ae=D.width+Se,De=Math.max(Ae,E.width),Ue=window.innerWidth-Yr,ce=fg(se,[Yr,Math.max(Yr,Ue-De)]);a.style.minWidth=Ae+"px",a.style.right=ce+"px"}const z=g(),H=window.innerHeight-Yr*2,$=C.scrollHeight,q=window.getComputedStyle(d),G=parseInt(q.borderTopWidth,10),W=parseInt(q.paddingTop,10),X=parseInt(q.borderBottomWidth,10),Y=parseInt(q.paddingBottom,10),I=G+W+$+Y+X,M=Math.min(y.offsetHeight*5,I),P=window.getComputedStyle(C),B=parseInt(P.paddingTop,10),F=parseInt(P.paddingBottom,10),Q=D.top+D.height/2-Yr,J=H-Q,ee=y.offsetHeight/2,K=y.offsetTop+ee,V=G+W+K,te=I-V;if(V<=Q){const ae=z.length>0&&y===z[z.length-1].ref.current;a.style.bottom="0px";const se=d.clientHeight-C.offsetTop-C.offsetHeight,Se=Math.max(J,ee+(ae?F:0)+se+X),Ae=V+Se;a.style.height=Ae+"px"}else{const ae=z.length>0&&y===z[0].ref.current;a.style.top="0px";const Se=Math.max(Q,G+C.offsetTop+(ae?B:0)+ee)+te;a.style.height=Se+"px",C.scrollTop=V-Q+C.offsetTop}a.style.margin=`${Yr}px 0`,a.style.minHeight=M+"px",a.style.maxHeight=H+"px",r==null||r(),requestAnimationFrame(()=>x.current=!0)}},[g,l.trigger,l.valueNode,a,d,C,y,S,l.dir,r]);kn(()=>_(),[_]);const[k,j]=R.useState();kn(()=>{d&&j(window.getComputedStyle(d).zIndex)},[d]);const N=R.useCallback(D=>{D&&w.current===!0&&(_(),b==null||b(),w.current=!1)},[_,b]);return h.jsx(mM,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:x,onScrollButtonChange:N,children:h.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:h.jsx(Qe.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});pC.displayName=hM;var pM="SelectPopperPosition",hg=R.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Yr,...l}=t,c=Mf(n);return h.jsx(Sf,{...c,...l,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});hg.displayName=pM;var[mM,_v]=il(Io,{}),pg="SelectViewport",mC=R.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,l=Wi(pg,n),c=_v(pg,n),a=ht(e,l.onViewportChange),u=R.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(Tf.Slot,{scope:n,children:h.jsx(Qe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:$e(i.onScroll,d=>{const m=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=c;if(g!=null&&g.current&&p){const x=Math.abs(u.current-m.scrollTop);if(x>0){const w=window.innerHeight-Yr*2,C=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(C,y);if(S<w){const b=S+x,_=Math.min(w,b),k=b-_;p.style.height=_+"px",p.style.bottom==="0px"&&(m.scrollTop=k>0?k:0,p.style.justifyContent="flex-end")}}}u.current=m.scrollTop})})})]})});mC.displayName=pg;var gC="SelectGroup",[gM,vM]=il(gC),vC=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Sn();return h.jsx(gM,{scope:n,id:i,children:h.jsx(Qe.div,{role:"group","aria-labelledby":i,...r,ref:e})})});vC.displayName=gC;var yC="SelectLabel",bC=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=vM(yC,n);return h.jsx(Qe.div,{id:i.id,...r,ref:e})});bC.displayName=yC;var qd="SelectItem",[yM,xC]=il(qd),_C=R.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:l,...c}=t,a=qi(qd,n),u=Wi(qd,n),d=a.value===r,[m,p]=R.useState(l!=null?l:""),[g,x]=R.useState(!1),w=ht(e,b=>{var _;return(_=u.itemRefCallback)==null?void 0:_.call(u,b,r,i)}),C=Sn(),y=R.useRef("touch"),S=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(yM,{scope:n,value:r,disabled:i,textId:C,isSelected:d,onItemTextChange:R.useCallback(b=>{p(_=>{var k;return _||((k=b==null?void 0:b.textContent)!=null?k:"").trim()})},[]),children:h.jsx(Tf.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:h.jsx(Qe.div,{role:"option","aria-labelledby":C,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:w,onFocus:$e(c.onFocus,()=>x(!0)),onBlur:$e(c.onBlur,()=>x(!1)),onClick:$e(c.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:$e(c.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:$e(c.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:$e(c.onPointerMove,b=>{var _;y.current=b.pointerType,i?(_=u.onItemLeave)==null||_.call(u):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$e(c.onPointerLeave,b=>{var _;b.currentTarget===document.activeElement&&((_=u.onItemLeave)==null||_.call(u))}),onKeyDown:$e(c.onKeyDown,b=>{var k;((k=u.searchRef)==null?void 0:k.current)!==""&&b.key===" "||(sM.includes(b.key)&&S(),b.key===" "&&b.preventDefault())})})})})});_C.displayName=qd;var hc="SelectItemText",SC=R.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...l}=t,c=qi(hc,n),a=Wi(hc,n),u=xC(hc,n),d=lM(hc,n),[m,p]=R.useState(null),g=ht(e,S=>p(S),u.onItemTextChange,S=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,S,u.value,u.disabled)}),x=m==null?void 0:m.textContent,w=R.useMemo(()=>h.jsx("option",{value:u.value,disabled:u.disabled,children:x},u.value),[u.disabled,u.value,x]),{onNativeOptionAdd:C,onNativeOptionRemove:y}=d;return kn(()=>(C(w),()=>y(w)),[C,y,w]),h.jsxs(h.Fragment,{children:[h.jsx(Qe.span,{id:u.textId,...l,ref:g}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren?el.createPortal(l.children,c.valueNode):null]})});SC.displayName=hc;var wC="SelectItemIndicator",CC=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return xC(wC,n).isSelected?h.jsx(Qe.span,{"aria-hidden":!0,...r,ref:e}):null});CC.displayName=wC;var mg="SelectScrollUpButton",kC=R.forwardRef((t,e)=>{const n=Wi(mg,t.__scopeSelect),r=_v(mg,t.__scopeSelect),[i,l]=R.useState(!1),c=ht(e,r.onScrollButtonChange);return kn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=u.scrollTop>0;l(d)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?h.jsx(AC,{...t,ref:c,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});kC.displayName=mg;var gg="SelectScrollDownButton",EC=R.forwardRef((t,e)=>{const n=Wi(gg,t.__scopeSelect),r=_v(gg,t.__scopeSelect),[i,l]=R.useState(!1),c=ht(e,r.onScrollButtonChange);return kn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=u.scrollHeight-u.clientHeight,m=Math.ceil(u.scrollTop)<d;l(m)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?h.jsx(AC,{...t,ref:c,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});EC.displayName=gg;var AC=R.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,l=Wi("SelectScrollButton",n),c=R.useRef(null),a=Df(n),u=R.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return R.useEffect(()=>()=>u(),[u]),kn(()=>{var m;const d=a().find(p=>p.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[a]),h.jsx(Qe.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:$e(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:$e(i.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:$e(i.onPointerLeave,()=>{u()})})}),bM="SelectSeparator",xM=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return h.jsx(Qe.div,{"aria-hidden":!0,...r,ref:e})});xM.displayName=bM;var vg="SelectArrow",_M=R.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Mf(n),l=qi(vg,n),c=Wi(vg,n);return l.open&&c.position==="popper"?h.jsx(wf,{...i,...r,ref:e}):null});_M.displayName=vg;var SM="SelectBubbleInput",NC=R.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=R.useRef(null),l=ht(r,i),c=S2(e);return R.useEffect(()=>{const a=i.current;if(!a)return;const u=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(u,"value").set;if(c!==e&&m){const p=new Event("change",{bubbles:!0});m.call(a,e),a.dispatchEvent(p)}},[c,e]),h.jsx(Qe.select,{...n,style:{...HS,...n.style},ref:l,defaultValue:e})});NC.displayName=SM;function RC(t){return t===""||t===void 0}function jC(t){const e=Pn(t),n=R.useRef(""),r=R.useRef(0),i=R.useCallback(c=>{const a=n.current+c;e(a),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(a)},[e]),l=R.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,l]}function TC(t,e,n){const i=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let c=wM(t,Math.max(l,0));i.length===1&&(c=c.filter(d=>d!==n));const u=c.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function wM(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var CM=sC,kM=oC,EM=lC,AM=cC,NM=uC,RM=dC,jM=mC,TM=vC,DM=bC,MM=_C,OM=SC,LM=CC,IM=kC,PM=EC,zM="Separator",Ax="horizontal",BM=["horizontal","vertical"],DC=R.forwardRef((t,e)=>{const{decorative:n,orientation:r=Ax,...i}=t,l=FM(r)?r:Ax,a=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return h.jsx(Qe.div,{"data-orientation":l,...a,...i,ref:e})});DC.displayName=zM;function FM(t){return BM.includes(t)}var HM=DC,Of="Switch",[$M]=or(Of),[UM,VM]=$M(Of),MC=R.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:l,required:c,disabled:a,value:u="on",onCheckedChange:d,form:m,...p}=t,[g,x]=R.useState(null),w=ht(e,_=>x(_)),C=R.useRef(!1),y=g?m||!!g.closest("form"):!0,[S,b]=ms({prop:i,defaultProp:l!=null?l:!1,onChange:d,caller:Of});return h.jsxs(UM,{scope:n,checked:S,disabled:a,children:[h.jsx(Qe.button,{type:"button",role:"switch","aria-checked":S,"aria-required":c,"data-state":PC(S),"data-disabled":a?"":void 0,disabled:a,value:u,...p,ref:w,onClick:$e(t.onClick,_=>{b(k=>!k),y&&(C.current=_.isPropagationStopped(),C.current||_.stopPropagation())})}),y&&h.jsx(IC,{control:g,bubbles:!C.current,name:r,value:u,checked:S,required:c,disabled:a,form:m,style:{transform:"translateX(-100%)"}})]})});MC.displayName=Of;var OC="SwitchThumb",LC=R.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=VM(OC,n);return h.jsx(Qe.span,{"data-state":PC(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});LC.displayName=OC;var qM="SwitchBubbleInput",IC=R.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...i},l)=>{const c=R.useRef(null),a=ht(c,l),u=S2(n),d=w2(e);return R.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(u!==n&&x){const w=new Event("click",{bubbles:r});x.call(m,n),m.dispatchEvent(w)}},[u,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:a,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});IC.displayName=qM;function PC(t){return t?"checked":"unchecked"}var WM=MC,GM=LC,Lf="Tabs",[KM]=or(Lf,[Cf]),zC=Cf(),[YM,Sv]=KM(Lf),BC=R.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:l,orientation:c="horizontal",dir:a,activationMode:u="automatic",...d}=t,m=Ic(a),[p,g]=ms({prop:r,onChange:i,defaultProp:l!=null?l:"",caller:Lf});return h.jsx(YM,{scope:n,baseId:Sn(),value:p,onValueChange:g,orientation:c,dir:m,activationMode:u,children:h.jsx(Qe.div,{dir:m,"data-orientation":c,...d,ref:e})})});BC.displayName=Lf;var FC="TabsList",HC=R.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,l=Sv(FC,n),c=zC(n);return h.jsx(X2,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:r,children:h.jsx(Qe.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:e})})});HC.displayName=FC;var $C="TabsTrigger",UC=R.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...l}=t,c=Sv($C,n),a=zC(n),u=WC(c.baseId,r),d=GC(c.baseId,r),m=r===c.value;return h.jsx(Q2,{asChild:!0,...a,focusable:!i,active:m,children:h.jsx(Qe.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...l,ref:e,onMouseDown:$e(t.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?c.onValueChange(r):p.preventDefault()}),onKeyDown:$e(t.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&c.onValueChange(r)}),onFocus:$e(t.onFocus,()=>{const p=c.activationMode!=="manual";!m&&!i&&p&&c.onValueChange(r)})})})});UC.displayName=$C;var VC="TabsContent",qC=R.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:l,...c}=t,a=Sv(VC,n),u=WC(a.baseId,r),d=GC(a.baseId,r),m=r===a.value,p=R.useRef(m);return R.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),h.jsx(En,{present:i||m,children:({present:g})=>h.jsx(Qe.div,{"data-state":m?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:d,tabIndex:0,...c,ref:e,style:{...t.style,animationDuration:p.current?"0s":void 0},children:g&&l})})});qC.displayName=VC;function WC(t,e){return`${t}-trigger-${e}`}function GC(t,e){return`${t}-content-${e}`}var XM=BC,QM=HC,ZM=UC,JM=qC,[If]=or("Tooltip",[Ui]),Pf=Ui(),KC="TooltipProvider",eO=700,yg="tooltip.open",[tO,wv]=If(KC),YC=t=>{const{__scopeTooltip:e,delayDuration:n=eO,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:l}=t,c=R.useRef(!0),a=R.useRef(!1),u=R.useRef(0);return R.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),h.jsx(tO,{scope:e,isOpenDelayedRef:c,delayDuration:n,onOpen:R.useCallback(()=>{window.clearTimeout(u.current),c.current=!1},[]),onClose:R.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:R.useCallback(d=>{a.current=d},[]),disableHoverableContent:i,children:l})};YC.displayName=KC;var kc="Tooltip",[nO,qc]=If(kc),XC=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:l,disableHoverableContent:c,delayDuration:a}=t,u=wv(kc,t.__scopeTooltip),d=Pf(e),[m,p]=R.useState(null),g=Sn(),x=R.useRef(0),w=c!=null?c:u.disableHoverableContent,C=a!=null?a:u.delayDuration,y=R.useRef(!1),[S,b]=ms({prop:r,defaultProp:i!=null?i:!1,onChange:D=>{D?(u.onOpen(),document.dispatchEvent(new CustomEvent(yg))):u.onClose(),l==null||l(D)},caller:kc}),_=R.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),k=R.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y.current=!1,b(!0)},[b]),j=R.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b(!1)},[b]),N=R.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{y.current=!0,b(!0),x.current=0},C)},[C,b]);return R.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),h.jsx(_f,{...d,children:h.jsx(nO,{scope:e,contentId:g,open:S,stateAttribute:_,trigger:m,onTriggerChange:p,onTriggerEnter:R.useCallback(()=>{u.isOpenDelayedRef.current?N():k()},[u.isOpenDelayedRef,N,k]),onTriggerLeave:R.useCallback(()=>{w?j():(window.clearTimeout(x.current),x.current=0)},[j,w]),onOpen:k,onClose:j,disableHoverableContent:w,children:n})})};XC.displayName=kc;var bg="TooltipTrigger",QC=R.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=qc(bg,n),l=wv(bg,n),c=Pf(n),a=R.useRef(null),u=ht(e,a,i.onTriggerChange),d=R.useRef(!1),m=R.useRef(!1),p=R.useCallback(()=>d.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),h.jsx(Fc,{asChild:!0,...c,children:h.jsx(Qe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:u,onPointerMove:$e(t.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:$e(t.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:$e(t.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:$e(t.onFocus,()=>{d.current||i.onOpen()}),onBlur:$e(t.onBlur,i.onClose),onClick:$e(t.onClick,i.onClose)})})});QC.displayName=bg;var Cv="TooltipPortal",[rO,sO]=If(Cv,{forceMount:void 0}),ZC=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,l=qc(Cv,e);return h.jsx(rO,{scope:e,forceMount:n,children:h.jsx(En,{present:n||l.open,children:h.jsx(nl,{asChild:!0,container:i,children:r})})})};ZC.displayName=Cv;var Ga="TooltipContent",JC=R.forwardRef((t,e)=>{const n=sO(Ga,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...l}=t,c=qc(Ga,t.__scopeTooltip);return h.jsx(En,{present:r||c.open,children:c.disableHoverableContent?h.jsx(ek,{side:i,...l,ref:e}):h.jsx(iO,{side:i,...l,ref:e})})}),iO=R.forwardRef((t,e)=>{const n=qc(Ga,t.__scopeTooltip),r=wv(Ga,t.__scopeTooltip),i=R.useRef(null),l=ht(e,i),[c,a]=R.useState(null),{trigger:u,onClose:d}=n,m=i.current,{onPointerInTransitChange:p}=r,g=R.useCallback(()=>{a(null),p(!1)},[p]),x=R.useCallback((w,C)=>{const y=w.currentTarget,S={x:w.clientX,y:w.clientY},b=cO(S,y.getBoundingClientRect()),_=uO(S,b),k=dO(C.getBoundingClientRect()),j=hO([..._,...k]);a(j),p(!0)},[p]);return R.useEffect(()=>()=>g(),[g]),R.useEffect(()=>{if(u&&m){const w=y=>x(y,m),C=y=>x(y,u);return u.addEventListener("pointerleave",w),m.addEventListener("pointerleave",C),()=>{u.removeEventListener("pointerleave",w),m.removeEventListener("pointerleave",C)}}},[u,m,x,g]),R.useEffect(()=>{if(c){const w=C=>{const y=C.target,S={x:C.clientX,y:C.clientY},b=(u==null?void 0:u.contains(y))||(m==null?void 0:m.contains(y)),_=!fO(S,c);b?g():_&&(g(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[u,m,c,d,g]),h.jsx(ek,{...t,ref:l})}),[oO,aO]=If(kc,{isInside:!1}),lO=eR("TooltipContent"),ek=R.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:l,onPointerDownOutside:c,...a}=t,u=qc(Ga,n),d=Pf(n),{onClose:m}=u;return R.useEffect(()=>(document.addEventListener(yg,m),()=>document.removeEventListener(yg,m)),[m]),R.useEffect(()=>{if(u.trigger){const p=g=>{const x=g.target;x!=null&&x.contains(u.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,m]),h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:h.jsxs(Sf,{"data-state":u.stateAttribute,...d,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(lO,{children:r}),h.jsx(oO,{scope:n,isInside:!0,children:h.jsx(oR,{id:u.contentId,role:"tooltip",children:i||r})})]})})});JC.displayName=Ga;var tk="TooltipArrow",nk=R.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Pf(n);return aO(tk,n).isInside?null:h.jsx(wf,{...i,...r,ref:e})});nk.displayName=tk;function cO(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),l=Math.abs(e.left-t.x);switch(Math.min(n,r,i,l)){case l:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function uO(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function dO(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function fO(t,e){const{x:n,y:r}=t;let i=!1;for(let l=0,c=e.length-1;l<e.length;c=l++){const a=e[l],u=e[c],d=a.x,m=a.y,p=u.x,g=u.y;m>r!=g>r&&n<(p-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function hO(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),pO(e)}function pO(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const l=e[e.length-1],c=e[e.length-2];if((l.x-c.x)*(i.y-c.y)>=(l.y-c.y)*(i.x-c.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(i.y-c.y)>=(l.y-c.y)*(i.x-c.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var mO=YC,gO=XC,vO=QC,yO=ZC,bO=JC,xO=nk;const _O=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},SO=(t,e)=>({classGroupId:t,validator:e}),rk=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Wd="-",Nx=[],wO="arbitrary..",CO=t=>{const e=EO(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return kO(c);const a=c.split(Wd),u=a[0]===""&&a.length>1?1:0;return sk(a,u,e)},getConflictingClassGroupIds:(c,a)=>{if(a){const u=r[c],d=n[c];return u?d?_O(d,u):u:d||Nx}return n[c]||Nx}}},sk=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],l=n.nextPart.get(i);if(l){const d=sk(t,e+1,l);if(d)return d}const c=n.validators;if(c===null)return;const a=e===0?t.join(Wd):t.slice(e).join(Wd),u=c.length;for(let d=0;d<u;d++){const m=c[d];if(m.validator(a))return m.classGroupId}},kO=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?wO+r:void 0})(),EO=t=>{const{theme:e,classGroups:n}=t;return AO(n,e)},AO=(t,e)=>{const n=rk();for(const r in t){const i=t[r];kv(i,n,r,e)}return n},kv=(t,e,n,r)=>{const i=t.length;for(let l=0;l<i;l++){const c=t[l];NO(c,e,n,r)}},NO=(t,e,n,r)=>{if(typeof t=="string"){RO(t,e,n);return}if(typeof t=="function"){jO(t,e,n,r);return}TO(t,e,n,r)},RO=(t,e,n)=>{const r=t===""?e:ik(e,t);r.classGroupId=n},jO=(t,e,n,r)=>{if(DO(t)){kv(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(SO(n,t))},TO=(t,e,n,r)=>{const i=Object.entries(t),l=i.length;for(let c=0;c<l;c++){const[a,u]=i[c];kv(u,ik(e,a),n,r)}},ik=(t,e)=>{let n=t;const r=e.split(Wd),i=r.length;for(let l=0;l<i;l++){const c=r[l];let a=n.nextPart.get(c);a||(a=rk(),n.nextPart.set(c,a)),n=a}return n},DO=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,MO=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(l,c)=>{n[l]=c,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(l){let c=n[l];if(c!==void 0)return c;if((c=r[l])!==void 0)return i(l,c),c},set(l,c){l in n?n[l]=c:i(l,c)}}},xg="!",Rx=":",OO=[],jx=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),LO=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const l=[];let c=0,a=0,u=0,d;const m=i.length;for(let C=0;C<m;C++){const y=i[C];if(c===0&&a===0){if(y===Rx){l.push(i.slice(u,C)),u=C+1;continue}if(y==="/"){d=C;continue}}y==="["?c++:y==="]"?c--:y==="("?a++:y===")"&&a--}const p=l.length===0?i:i.slice(u);let g=p,x=!1;p.endsWith(xg)?(g=p.slice(0,-1),x=!0):p.startsWith(xg)&&(g=p.slice(1),x=!0);const w=d&&d>u?d-u:void 0;return jx(l,x,g,w)};if(e){const i=e+Rx,l=r;r=c=>c.startsWith(i)?l(c.slice(i.length)):jx(OO,!1,c,void 0,!0)}if(n){const i=r;r=l=>n({className:l,parseClassName:i})}return r},IO=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let l=0;l<n.length;l++){const c=n[l],a=c[0]==="[",u=e.has(c);a||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(c)):i.push(c)}return i.length>0&&(i.sort(),r.push(...i)),r}},PO=t=>({cache:MO(t.cacheSize),parseClassName:LO(t),sortModifiers:IO(t),...CO(t)}),zO=/\s+/,BO=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:l}=e,c=[],a=t.trim().split(zO);let u="";for(let d=a.length-1;d>=0;d-=1){const m=a[d],{isExternal:p,modifiers:g,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:C}=n(m);if(p){u=m+(u.length>0?" "+u:u);continue}let y=!!C,S=r(y?w.substring(0,C):w);if(!S){if(!y){u=m+(u.length>0?" "+u:u);continue}if(S=r(w),!S){u=m+(u.length>0?" "+u:u);continue}y=!1}const b=g.length===0?"":g.length===1?g[0]:l(g).join(":"),_=x?b+xg:b,k=_+S;if(c.indexOf(k)>-1)continue;c.push(k);const j=i(S,y);for(let N=0;N<j.length;++N){const D=j[N];c.push(_+D)}u=m+(u.length>0?" "+u:u)}return u},FO=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=ok(n))&&(i&&(i+=" "),i+=r);return i},ok=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=ok(t[r]))&&(n&&(n+=" "),n+=e);return n},HO=(t,...e)=>{let n,r,i,l;const c=u=>{const d=e.reduce((m,p)=>p(m),t());return n=PO(d),r=n.cache.get,i=n.cache.set,l=a,a(u)},a=u=>{const d=r(u);if(d)return d;const m=BO(u,n);return i(u,m),m};return l=c,(...u)=>l(FO(...u))},$O=[],xn=t=>{const e=n=>n[t]||$O;return e.isThemeGetter=!0,e},ak=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,UO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,VO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qO=/\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$/,WO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,GO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ti=t=>UO.test(t),pt=t=>!!t&&!Number.isNaN(Number(t)),Di=t=>!!t&&Number.isInteger(Number(t)),km=t=>t.endsWith("%")&&pt(t.slice(0,-1)),Bs=t=>VO.test(t),ck=()=>!0,YO=t=>qO.test(t)&&!WO.test(t),Ev=()=>!1,XO=t=>GO.test(t),QO=t=>KO.test(t),ZO=t=>!Ye(t)&&!Xe(t),JO=t=>Gi(t,fk,Ev),Ye=t=>ak.test(t),Ao=t=>Gi(t,hk,YO),Tx=t=>Gi(t,a8,pt),e8=t=>Gi(t,mk,ck),t8=t=>Gi(t,pk,Ev),Dx=t=>Gi(t,uk,Ev),n8=t=>Gi(t,dk,QO),bd=t=>Gi(t,gk,XO),Xe=t=>lk.test(t),ic=t=>Ho(t,hk),r8=t=>Ho(t,pk),Mx=t=>Ho(t,uk),s8=t=>Ho(t,fk),i8=t=>Ho(t,dk),xd=t=>Ho(t,gk,!0),o8=t=>Ho(t,mk,!0),Gi=(t,e,n)=>{const r=ak.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Ho=(t,e,n=!1)=>{const r=lk.exec(t);return r?r[1]?e(r[1]):n:!1},uk=t=>t==="position"||t==="percentage",dk=t=>t==="image"||t==="url",fk=t=>t==="length"||t==="size"||t==="bg-size",hk=t=>t==="length",a8=t=>t==="number",pk=t=>t==="family-name",mk=t=>t==="number"||t==="weight",gk=t=>t==="shadow",l8=()=>{const t=xn("color"),e=xn("font"),n=xn("text"),r=xn("font-weight"),i=xn("tracking"),l=xn("leading"),c=xn("breakpoint"),a=xn("container"),u=xn("spacing"),d=xn("radius"),m=xn("shadow"),p=xn("inset-shadow"),g=xn("text-shadow"),x=xn("drop-shadow"),w=xn("blur"),C=xn("perspective"),y=xn("aspect"),S=xn("ease"),b=xn("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...k(),Xe,Ye],N=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],E=()=>[Xe,Ye,u],O=()=>[Ti,"full","auto",...E()],L=()=>[Di,"none","subgrid",Xe,Ye],z=()=>["auto",{span:["full",Di,Xe,Ye]},Di,Xe,Ye],H=()=>[Di,"auto",Xe,Ye],$=()=>["auto","min","max","fr",Xe,Ye],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...E()],X=()=>[Ti,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],Y=()=>[Ti,"screen","full","dvw","lvw","svw","min","max","fit",...E()],I=()=>[Ti,"screen","full","lh","dvh","lvh","svh","min","max","fit",...E()],M=()=>[t,Xe,Ye],P=()=>[...k(),Mx,Dx,{position:[Xe,Ye]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",s8,JO,{size:[Xe,Ye]}],Q=()=>[km,ic,Ao],J=()=>["","none","full",d,Xe,Ye],ee=()=>["",pt,ic,Ao],K=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[pt,km,Mx,Dx],re=()=>["","none",w,Xe,Ye],ae=()=>["none",pt,Xe,Ye],se=()=>["none",pt,Xe,Ye],Se=()=>[pt,Xe,Ye],Ae=()=>[Ti,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bs],breakpoint:[Bs],color:[ck],container:[Bs],"drop-shadow":[Bs],ease:["in","out","in-out"],font:[ZO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bs],shadow:[Bs],spacing:["px",pt],text:[Bs],"text-shadow":[Bs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ti,Ye,Xe,y]}],container:["container"],columns:[{columns:[pt,Ye,Xe,a]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:j()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Di,"auto",Xe,Ye]}],basis:[{basis:[Ti,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pt,Ti,"auto","initial","none",Ye]}],grow:[{grow:["",pt,Xe,Ye]}],shrink:[{shrink:["",pt,Xe,Ye]}],order:[{order:[Di,"first","last","none",Xe,Ye]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pbs:[{pbs:E()}],pbe:[{pbe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mbs:[{mbs:W()}],mbe:[{mbe:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[a,"screen",...X()]}],"min-w":[{"min-w":[a,"screen","none",...X()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[c]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,ic,Ao]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,o8,e8]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",km,Ye]}],"font-family":[{font:[r8,t8,e]}],"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:[i,Xe,Ye]}],"line-clamp":[{"line-clamp":[pt,"none",Xe,Tx]}],leading:[{leading:[l,...E()]}],"list-image":[{"list-image":["none",Xe,Ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Xe,Ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[pt,"from-font","auto",Xe,Ao]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[pt,"auto",Xe,Ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Xe,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",Xe,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:P()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Di,Xe,Ye],radial:["",Xe,Ye],conic:[Di,Xe,Ye]},i8,n8]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pt,Xe,Ye]}],"outline-w":[{outline:["",pt,ic,Ao]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",m,xd,bd]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",p,xd,bd]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[pt,Ao]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",g,xd,bd]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[pt,Xe,Ye]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"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":[pt]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Xe,Ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[pt]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Xe,Ye]}],filter:[{filter:["","none",Xe,Ye]}],blur:[{blur:re()}],brightness:[{brightness:[pt,Xe,Ye]}],contrast:[{contrast:[pt,Xe,Ye]}],"drop-shadow":[{"drop-shadow":["","none",x,xd,bd]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",pt,Xe,Ye]}],"hue-rotate":[{"hue-rotate":[pt,Xe,Ye]}],invert:[{invert:["",pt,Xe,Ye]}],saturate:[{saturate:[pt,Xe,Ye]}],sepia:[{sepia:["",pt,Xe,Ye]}],"backdrop-filter":[{"backdrop-filter":["","none",Xe,Ye]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[pt,Xe,Ye]}],"backdrop-contrast":[{"backdrop-contrast":[pt,Xe,Ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pt,Xe,Ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pt,Xe,Ye]}],"backdrop-invert":[{"backdrop-invert":["",pt,Xe,Ye]}],"backdrop-opacity":[{"backdrop-opacity":[pt,Xe,Ye]}],"backdrop-saturate":[{"backdrop-saturate":[pt,Xe,Ye]}],"backdrop-sepia":[{"backdrop-sepia":["",pt,Xe,Ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Xe,Ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pt,"initial",Xe,Ye]}],ease:[{ease:["linear","initial",S,Xe,Ye]}],delay:[{delay:[pt,Xe,Ye]}],animate:[{animate:["none",b,Xe,Ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Xe,Ye]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[Xe,Ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ae()}],"translate-x":[{"translate-x":Ae()}],"translate-y":[{"translate-y":Ae()}],"translate-z":[{"translate-z":Ae()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"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",Xe,Ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mbs":[{"scroll-mbs":E()}],"scroll-mbe":[{"scroll-mbe":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pbs":[{"scroll-pbs":E()}],"scroll-pbe":[{"scroll-pbe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",Xe,Ye]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[pt,ic,Ao,Tx]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},c8=HO(l8);function Ne(...t){return c8(uf(t))}const u8=Ja("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Te(t){const e=he.c(16);let n,r,i,l,c;e[0]!==t?({className:n,variant:i,size:l,asChild:c,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5]);const a=i===void 0?"default":i,u=l===void 0?"default":l,m=(c===void 0?!1:c)?Lc:"button";let p;e[6]!==n||e[7]!==u||e[8]!==a?(p=Ne(u8({variant:a,size:u,className:n})),e[6]=n,e[7]=u,e[8]=a,e[9]=p):p=e[9];let g;return e[10]!==m||e[11]!==r||e[12]!==u||e[13]!==p||e[14]!==a?(g=h.jsx(m,{"data-slot":"button","data-variant":a,"data-size":u,className:p,...r}),e[10]=m,e[11]=r,e[12]=u,e[13]=p,e[14]=a,e[15]=g):g=e[15],g}function vk(t){return t.startsWith("https://")?"https":"http"}function d8(t){return vk(t)==="https"?"wss":"ws"}function Xn(t,e){const n=vk(t),r=t.replace(/^https?:\/\//,"");return`${n}://${r}${e}`}function Gd(t,e){const n=d8(t),r=t.replace(/^https?:\/\//,"");return`${n}://${r}${e}`}function ns(){const t=he.c(1),e=f8;let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n={fetchWithAuth:e},t[0]=n):n=t[0],n}async function f8(t,e,n){const r=e===void 0?{}:e,{serverUrl:i,token:l}=n||{};let c=t;t.startsWith("/")&&i&&(c=Xn(i,t));const a=new Headers(r.headers||{});return l&&a.set("Authorization",`Bearer ${l}`),fetch(c,{...r,headers:a})}function h8(...t){return t.map((e,n)=>n===0?e.replace(/\/+$/,""):e.replace(/^\/+|\/+$/g,"")).filter(Boolean).join("/")}function Ki(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Xg,{"data-slot":"dialog",...n}),e[2]=n,e[3]=r):r=e[3],r}function p8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Qg,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function m8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(gf,{"data-slot":"dialog-close",...n}),e[2]=n,e[3]=r):r=e[3],r}function g8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Zg,{"data-slot":"dialog-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Yi(t){const e=he.c(15);let n,r,i,l;e[0]!==t?({className:r,children:n,showCloseButton:l,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?!0:l;let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(g8,{}),e[5]=a):a=e[5];let u;e[6]!==r?(u=Ne("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",r),e[6]=r,e[7]=u):u=e[7];let d;e[8]!==c?(d=c&&h.jsx(gf,{"data-slot":"dialog-close",asChild:!0,children:h.jsxs(Te,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[h.jsx(zn,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})}),e[8]=c,e[9]=d):d=e[9];let m;return e[10]!==n||e[11]!==i||e[12]!==u||e[13]!==d?(m=h.jsxs(p8,{children:[a,h.jsxs(Jg,{"data-slot":"dialog-content",className:u,...i,children:[n,d]})]}),e[10]=n,e[11]=i,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function Xi(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("flex flex-col gap-2",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"dialog-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function zf(t){const e=he.c(14);let n,r,i,l;e[0]!==t?({className:r,showCloseButton:l,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?!1:l;let a;e[5]!==r?(a=Ne("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]!==c?(u=c&&h.jsx(gf,{asChild:!0,children:h.jsx(Te,{variant:"outline",children:"Close"})}),e[7]=c,e[8]=u):u=e[8];let d;return e[9]!==n||e[10]!==i||e[11]!==a||e[12]!==u?(d=h.jsxs("div",{"data-slot":"dialog-footer",className:a,...i,children:[n,u]}),e[9]=n,e[10]=i,e[11]=a,e[12]=u,e[13]=d):d=e[13],d}function Qi(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("text-base leading-none font-medium",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(x2,{"data-slot":"dialog-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function $o(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(_2,{"data-slot":"dialog-description",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function an(t){const e=he.c(10);let n,r,i;e[0]!==t?({className:n,type:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let l;e[4]!==n?(l=Ne("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),e[4]=n,e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==i?(c=h.jsx("input",{type:i,"data-slot":"input",className:l,...r}),e[6]=r,e[7]=l,e[8]=i,e[9]=c):c=e[9],c}const ds=R.forwardRef((t,e)=>{const n=he.c(16);let r,i,l;n[0]!==t?({className:i,children:r,...l}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=l):(r=n[1],i=n[2],l=n[3]);let c;n[4]!==i?(c=Ne("relative overflow-hidden",i),n[4]=i,n[5]=c):c=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a={WebkitOverflowScrolling:"touch"},n[6]=a):a=n[6];let u;n[7]!==r||n[8]!==e?(u=h.jsx(tM,{ref:e,"data-slot":"scroll-area-viewport",className:"size-full min-w-0 rounded-[inherit] outline-none",style:a,children:r}),n[7]=r,n[8]=e,n[9]=u):u=n[9];let d,m;n[10]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(v8,{}),m=h.jsx(nM,{}),n[10]=d,n[11]=m):(d=n[10],m=n[11]);let p;return n[12]!==l||n[13]!==c||n[14]!==u?(p=h.jsxs(eM,{"data-slot":"scroll-area",className:c,...l,children:[u,d,m]}),n[12]=l,n[13]=c,n[14]=u,n[15]=p):p=n[15],p});ds.displayName="ScrollArea";function v8(t){const e=he.c(11);let n,r,i;e[0]!==t?({className:n,orientation:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"vertical":i;let c;e[4]!==n?(c=Ne("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",n),e[4]=n,e[5]=c):c=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(Jw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[6]=a):a=e[6];let u;return e[7]!==l||e[8]!==r||e[9]!==c?(u=h.jsx(Yw,{"data-slot":"scroll-area-scrollbar","data-orientation":l,orientation:l,className:c,...r,children:a}),e[7]=l,e[8]=r,e[9]=c,e[10]=u):u=e[10],u}function y8({open:t,onOpenChange:e,onSelect:n,initialPath:r,title:i="Select Folder"}){var F;const[l,c]=R.useState(r||""),[a,u]=R.useState([]),[d,m]=R.useState(!1),[p,g]=R.useState(0),[x,w]=R.useState(null),[C,y]=R.useState(""),[S,b]=R.useState(!1),[_,k]=R.useState([]),[j,N]=R.useState(!1),D=R.useRef(null),E=R.useRef(null),{fetchWithAuth:O}=ns(),{activeServer:L}=Qa(),z=R.useCallback(async Q=>{var J;m(!0),w(null),g(0),y(""),N(!1);try{const ee=await O(`/api/fs/browse?path=${encodeURIComponent(Q)}`,{},{serverUrl:L==null?void 0:L.url,token:L==null?void 0:L.token}),K=await ee.json();if(!ee.ok)throw new Error(K.message||"Failed to browse directory");const V=K.files.filter(te=>te.type==="directory");u(V),c(K.currentPath),b((J=K.isRoot)!=null?J:!1)}catch(ee){w(ee instanceof Error?ee.message:"Failed to load directory"),u([])}finally{m(!1)}},[O,L]),H=R.useCallback(async()=>{try{const J=await(await O("/api/fs/drives",{},{serverUrl:L==null?void 0:L.url,token:L==null?void 0:L.token})).json();k(J.drives||[])}catch{}},[O,L]);R.useEffect(()=>{t&&(z(r||""),H())},[t,r,z,H]),R.useEffect(()=>{g(0)},[C]);const $=a.filter(Q=>Q.name.toLowerCase().includes(C.toLowerCase())),q=(F=$[p])!=null?F:null,G=R.useCallback(Q=>h8(l,Q.name),[l]),W=q?G(q):l,X=!q,Y=async()=>{var Q;m(!0),w(null);try{const J=await O(`/api/fs/parent?path=${encodeURIComponent(l)}`,{},{serverUrl:L==null?void 0:L.url,token:L==null?void 0:L.token}),ee=await J.json();if(!J.ok)throw new Error(ee.message||"Failed to navigate up");const K=ee.files.filter(V=>V.type==="directory");u(K),c(ee.currentPath),b((Q=ee.isRoot)!=null?Q:!1),g(0),y("")}catch(J){w(J instanceof Error?J.message:"Failed to navigate up")}finally{m(!1)}},I=()=>{W&&(n(W),e(!1))},M=Q=>{const J=G(Q);z(J)},P=Q=>{if($.length!==0)switch(Q.key){case"ArrowDown":Q.preventDefault(),g(J=>Math.min(J+1,$.length-1));break;case"ArrowRight":$[p]&&(Q.preventDefault(),M($[p]));break;case"ArrowUp":Q.preventDefault(),g(J=>Math.max(J-1,0));break;case"Enter":Q.preventDefault(),I();break;case"Escape":C&&(Q.preventDefault(),y(""));break}};R.useEffect(()=>{if(E.current&&$.length>0){const Q=E.current.children[p];Q&&Q.scrollIntoView({block:"nearest"})}},[p,$.length]),R.useEffect(()=>{t&&setTimeout(()=>{var Q;return(Q=D.current)==null?void 0:Q.focus()},100)},[t]),R.useEffect(()=>{N(!1)},[l]);const B=(Q,J=50)=>{if(Q.length<=J)return Q;const ee=Q.split(/[/\\]/);return ee.length<=2?Q:".../"+ee.slice(-2).join("/")};return h.jsx(Ki,{open:t,onOpenChange:e,children:h.jsxs(Yi,{className:"sm:max-w-lg",onKeyDown:P,children:[h.jsx(Xi,{children:h.jsx(Qi,{children:i})}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted rounded-md",children:[h.jsx(Te,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:Y,disabled:d||!l||S,children:h.jsx(X5,{className:"w-4 h-4"})}),_.length>1&&h.jsxs("div",{className:"relative",children:[h.jsx(Te,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:()=>N(Q=>!Q),disabled:d,children:h.jsx(OA,{className:"w-4 h-4"})}),j&&h.jsx("div",{className:"absolute top-full left-0 mt-1 bg-popover border rounded-md shadow-md z-50 min-w-[120px]",children:_.map(Q=>h.jsxs("button",{onClick:()=>{z(Q),N(!1)},className:Ne("flex items-center gap-2 w-full px-3 py-1.5 text-sm text-left hover:bg-muted",l===Q&&"bg-primary/20 text-primary font-medium"),children:[h.jsx(Vs,{className:"w-3.5 h-3.5 text-amber-500"}),Q]},Q))})]}),h.jsx("span",{className:"flex-1 text-sm font-mono truncate",title:W,children:q?h.jsx("span",{className:"text-primary",children:B(G(q),45)}):B(l)||"Home"})]}),h.jsxs("div",{className:"relative",children:[h.jsx($g,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),h.jsx(an,{ref:D,placeholder:"Filter folders...",value:C,onChange:Q=>y(Q.target.value),className:"pl-8"})]}),h.jsx(ds,{className:"h-64 border rounded-md",children:d?h.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[h.jsx(Wt,{className:"w-4 h-4 animate-spin mr-2"}),"Loading..."]}):x?h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[h.jsx("span",{className:"text-destructive",children:x}),h.jsx(Te,{variant:"ghost",size:"sm",onClick:()=>z(l),className:"mt-2",children:"Retry"})]}):$.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-sm",children:[h.jsx(Vs,{className:"w-8 h-8 mb-2 opacity-50"}),C?"No matching folders":"No folders in this directory"]}):h.jsx("div",{className:"p-1",ref:E,children:$.map((Q,J)=>h.jsxs("button",{onClick:()=>g(J),onDoubleClick:()=>M(Q),className:Ne("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",J===p&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[h.jsx(Vs,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),h.jsx("span",{className:"truncate flex-1",children:Q.name}),J===p&&h.jsx(Vn,{className:"w-4 h-4 text-primary"})]},Q.path))})}),x&&h.jsx("p",{className:"text-xs text-destructive",children:x})]}),h.jsxs(zf,{children:[h.jsx(Te,{variant:"outline",onClick:()=>e(!1),children:"Cancel"}),h.jsx(Te,{onClick:I,disabled:!W||d,children:X?"Use This Folder":"Add Selected Folder"})]})]})})}function _g(t){const e=he.c(26),{open:n,onOpenChange:r,title:i,description:l,confirmLabel:c,cancelLabel:a,onConfirm:u,variant:d}=t,m=c===void 0?"Confirm":c,p=a===void 0?"Cancel":a,g=d===void 0?"default":d;let x;e[0]!==u||e[1]!==r?(x=()=>{u(),r(!1)},e[0]=u,e[1]=r,e[2]=x):x=e[2];const w=x;let C;e[3]!==i?(C=h.jsx(Qi,{children:i}),e[3]=i,e[4]=C):C=e[4];let y;e[5]!==l?(y=h.jsx($o,{children:l}),e[5]=l,e[6]=y):y=e[6];let S;e[7]!==C||e[8]!==y?(S=h.jsxs(Xi,{children:[C,y]}),e[7]=C,e[8]=y,e[9]=S):S=e[9];let b;e[10]!==p?(b=h.jsx(m8,{asChild:!0,children:h.jsx(Te,{variant:"outline",children:p})}),e[10]=p,e[11]=b):b=e[11];const _=g==="destructive"?"destructive":"default";let k;e[12]!==m||e[13]!==w||e[14]!==_?(k=h.jsx(Te,{onClick:w,variant:_,children:m}),e[12]=m,e[13]=w,e[14]=_,e[15]=k):k=e[15];let j;e[16]!==k||e[17]!==b?(j=h.jsxs(zf,{children:[b,k]}),e[16]=k,e[17]=b,e[18]=j):j=e[18];let N;e[19]!==j||e[20]!==S?(N=h.jsxs(Yi,{showCloseButton:!1,children:[S,j]}),e[19]=j,e[20]=S,e[21]=N):N=e[21];let D;return e[22]!==r||e[23]!==n||e[24]!==N?(D=h.jsx(Ki,{open:n,onOpenChange:r,children:N}),e[22]=r,e[23]=n,e[24]=N,e[25]=D):D=e[25],D}function yk(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(pD,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function bk(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(mD,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function xk(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,align:i,sideOffset:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?"start":i,a=l===void 0?4:l;let u;e[5]!==n?(u=Ne("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==r||e[9]!==a||e[10]!==u?(d=h.jsx(gD,{children:h.jsx(vD,{"data-slot":"dropdown-menu-content",sideOffset:a,align:c,className:u,...r})}),e[7]=c,e[8]=r,e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function pc(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,inset:r,variant:l,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?"default":l;let a;e[5]!==n?(a=Ne("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",n),e[5]=n,e[6]=a):a=e[6];let u;return e[7]!==r||e[8]!==i||e[9]!==a||e[10]!==c?(u=h.jsx(yD,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":c,className:a,...i}),e[7]=r,e[8]=i,e[9]=a,e[10]=c,e[11]=u):u=e[11],u}var Ox=1,b8=.9,x8=.8,_8=.17,Em=.1,Am=.999,S8=.9999,w8=.99,C8=/[\\\/_+.#"@\[\(\{&]/,k8=/[\\\/_+.#"@\[\(\{&]/g,E8=/[\s-]/,_k=/[\s-]/g;function Sg(t,e,n,r,i,l,c){if(l===e.length)return i===t.length?Ox:w8;var a=`${i},${l}`;if(c[a]!==void 0)return c[a];for(var u=r.charAt(l),d=n.indexOf(u,i),m=0,p,g,x,w;d>=0;)p=Sg(t,e,n,r,d+1,l+1,c),p>m&&(d===i?p*=Ox:C8.test(t.charAt(d-1))?(p*=x8,x=t.slice(i,d-1).match(k8),x&&i>0&&(p*=Math.pow(Am,x.length))):E8.test(t.charAt(d-1))?(p*=b8,w=t.slice(i,d-1).match(_k),w&&i>0&&(p*=Math.pow(Am,w.length))):(p*=_8,i>0&&(p*=Math.pow(Am,d-i))),t.charAt(d)!==e.charAt(l)&&(p*=S8)),(p<Em&&n.charAt(d-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(d-1)!==r.charAt(l))&&(g=Sg(t,e,n,r,d+1,l+2,c),g*Em>p&&(p=g*Em)),p>m&&(m=p),d=n.indexOf(u,d+1);return c[a]=m,m}function Lx(t){return t.toLowerCase().replace(_k," ")}function A8(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Sg(t,e,Lx(t),Lx(e),0,0,{})}var oc='[cmdk-group=""]',Nm='[cmdk-group-items=""]',N8='[cmdk-group-heading=""]',Sk='[cmdk-item=""]',Ix=`${Sk}:not([aria-disabled="true"])`,wg="cmdk-item-select",La="data-value",R8=(t,e,n)=>A8(t,e,n),wk=R.createContext(void 0),Wc=()=>R.useContext(wk),Ck=R.createContext(void 0),Av=()=>R.useContext(Ck),kk=R.createContext(void 0),Ek=R.forwardRef((t,e)=>{let n=Ia(()=>{var B,F;return{search:"",value:(F=(B=t.value)!=null?B:t.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ia(()=>new Set),i=Ia(()=>new Map),l=Ia(()=>new Map),c=Ia(()=>new Set),a=Ak(t),{label:u,children:d,value:m,onValueChange:p,filter:g,shouldFilter:x,loop:w,disablePointerSelection:C=!1,vimBindings:y=!0,...S}=t,b=Sn(),_=Sn(),k=Sn(),j=R.useRef(null),N=F8();Po(()=>{if(m!==void 0){let B=m.trim();n.current.value=B,D.emit()}},[m]),Po(()=>{N(6,$)},[]);let D=R.useMemo(()=>({subscribe:B=>(c.current.add(B),()=>c.current.delete(B)),snapshot:()=>n.current,setState:(B,F,Q)=>{var J,ee,K,V;if(!Object.is(n.current[B],F)){if(n.current[B]=F,B==="search")H(),L(),N(1,z);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let te=document.getElementById(k);te?te.focus():(J=document.getElementById(b))==null||J.focus()}if(N(7,()=>{var te;n.current.selectedItemId=(te=q())==null?void 0:te.id,D.emit()}),Q||N(5,$),((ee=a.current)==null?void 0:ee.value)!==void 0){let te=F!=null?F:"";(V=(K=a.current).onValueChange)==null||V.call(K,te);return}}D.emit()}},emit:()=>{c.current.forEach(B=>B())}}),[]),E=R.useMemo(()=>({value:(B,F,Q)=>{var J;F!==((J=l.current.get(B))==null?void 0:J.value)&&(l.current.set(B,{value:F,keywords:Q}),n.current.filtered.items.set(B,O(F,Q)),N(2,()=>{L(),D.emit()}))},item:(B,F)=>(r.current.add(B),F&&(i.current.has(F)?i.current.get(F).add(B):i.current.set(F,new Set([B]))),N(3,()=>{H(),L(),n.current.value||z(),D.emit()}),()=>{l.current.delete(B),r.current.delete(B),n.current.filtered.items.delete(B);let Q=q();N(4,()=>{H(),(Q==null?void 0:Q.getAttribute("id"))===B&&z(),D.emit()})}),group:B=>(i.current.has(B)||i.current.set(B,new Set),()=>{l.current.delete(B),i.current.delete(B)}),filter:()=>a.current.shouldFilter,label:u||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:k,labelId:_,listInnerRef:j}),[]);function O(B,F){var Q,J;let ee=(J=(Q=a.current)==null?void 0:Q.filter)!=null?J:R8;return B?ee(B,n.current.search,F):0}function L(){if(!n.current.search||a.current.shouldFilter===!1)return;let B=n.current.filtered.items,F=[];n.current.filtered.groups.forEach(J=>{let ee=i.current.get(J),K=0;ee.forEach(V=>{let te=B.get(V);K=Math.max(te,K)}),F.push([J,K])});let Q=j.current;G().sort((J,ee)=>{var K,V;let te=J.getAttribute("id"),re=ee.getAttribute("id");return((K=B.get(re))!=null?K:0)-((V=B.get(te))!=null?V:0)}).forEach(J=>{let ee=J.closest(Nm);ee?ee.appendChild(J.parentElement===ee?J:J.closest(`${Nm} > *`)):Q.appendChild(J.parentElement===Q?J:J.closest(`${Nm} > *`))}),F.sort((J,ee)=>ee[1]-J[1]).forEach(J=>{var ee;let K=(ee=j.current)==null?void 0:ee.querySelector(`${oc}[${La}="${encodeURIComponent(J[0])}"]`);K==null||K.parentElement.appendChild(K)})}function z(){let B=G().find(Q=>Q.getAttribute("aria-disabled")!=="true"),F=B==null?void 0:B.getAttribute(La);D.setState("value",F||void 0)}function H(){var B,F,Q,J;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ee=0;for(let K of r.current){let V=(F=(B=l.current.get(K))==null?void 0:B.value)!=null?F:"",te=(J=(Q=l.current.get(K))==null?void 0:Q.keywords)!=null?J:[],re=O(V,te);n.current.filtered.items.set(K,re),re>0&&ee++}for(let[K,V]of i.current)for(let te of V)if(n.current.filtered.items.get(te)>0){n.current.filtered.groups.add(K);break}n.current.filtered.count=ee}function $(){var B,F,Q;let J=q();J&&(((B=J.parentElement)==null?void 0:B.firstChild)===J&&((Q=(F=J.closest(oc))==null?void 0:F.querySelector(N8))==null||Q.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function q(){var B;return(B=j.current)==null?void 0:B.querySelector(`${Sk}[aria-selected="true"]`)}function G(){var B;return Array.from(((B=j.current)==null?void 0:B.querySelectorAll(Ix))||[])}function W(B){let F=G()[B];F&&D.setState("value",F.getAttribute(La))}function X(B){var F;let Q=q(),J=G(),ee=J.findIndex(V=>V===Q),K=J[ee+B];(F=a.current)!=null&&F.loop&&(K=ee+B<0?J[J.length-1]:ee+B===J.length?J[0]:J[ee+B]),K&&D.setState("value",K.getAttribute(La))}function Y(B){let F=q(),Q=F==null?void 0:F.closest(oc),J;for(;Q&&!J;)Q=B>0?z8(Q,oc):B8(Q,oc),J=Q==null?void 0:Q.querySelector(Ix);J?D.setState("value",J.getAttribute(La)):X(B)}let I=()=>W(G().length-1),M=B=>{B.preventDefault(),B.metaKey?I():B.altKey?Y(1):X(1)},P=B=>{B.preventDefault(),B.metaKey?W(0):B.altKey?Y(-1):X(-1)};return R.createElement(Qe.div,{ref:e,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:B=>{var F;(F=S.onKeyDown)==null||F.call(S,B);let Q=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||Q))switch(B.key){case"n":case"j":{y&&B.ctrlKey&&M(B);break}case"ArrowDown":{M(B);break}case"p":case"k":{y&&B.ctrlKey&&P(B);break}case"ArrowUp":{P(B);break}case"Home":{B.preventDefault(),W(0);break}case"End":{B.preventDefault(),I();break}case"Enter":{B.preventDefault();let J=q();if(J){let ee=new Event(wg);J.dispatchEvent(ee)}}}}},R.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:$8},u),Bf(t,B=>R.createElement(Ck.Provider,{value:D},R.createElement(wk.Provider,{value:E},B))))}),j8=R.forwardRef((t,e)=>{var n,r;let i=Sn(),l=R.useRef(null),c=R.useContext(kk),a=Wc(),u=Ak(t),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;Po(()=>{if(!d)return a.item(i,c==null?void 0:c.id)},[d]);let m=Nk(i,l,[t.value,t.children,l],t.keywords),p=Av(),g=Hi(N=>N.value&&N.value===m.current),x=Hi(N=>d||a.filter()===!1?!0:N.search?N.filtered.items.get(i)>0:!0);R.useEffect(()=>{let N=l.current;if(!(!N||t.disabled))return N.addEventListener(wg,w),()=>N.removeEventListener(wg,w)},[x,t.onSelect,t.disabled]);function w(){var N,D;C(),(D=(N=u.current).onSelect)==null||D.call(N,m.current)}function C(){p.setState("value",m.current,!0)}if(!x)return null;let{disabled:y,value:S,onSelect:b,forceMount:_,keywords:k,...j}=t;return R.createElement(Qe.div,{ref:qs(l,e),...j,id:i,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!g,"data-disabled":!!y,"data-selected":!!g,onPointerMove:y||a.getDisablePointerSelection()?void 0:C,onClick:y?void 0:w},t.children)}),T8=R.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...l}=t,c=Sn(),a=R.useRef(null),u=R.useRef(null),d=Sn(),m=Wc(),p=Hi(x=>i||m.filter()===!1?!0:x.search?x.filtered.groups.has(c):!0);Po(()=>m.group(c),[]),Nk(c,a,[t.value,t.heading,u]);let g=R.useMemo(()=>({id:c,forceMount:i}),[i]);return R.createElement(Qe.div,{ref:qs(a,e),...l,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&R.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Bf(t,x=>R.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},R.createElement(kk.Provider,{value:g},x))))}),D8=R.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=R.useRef(null),l=Hi(c=>!c.search);return!n&&!l?null:R.createElement(Qe.div,{ref:qs(i,e),...r,"cmdk-separator":"",role:"separator"})}),M8=R.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,l=Av(),c=Hi(d=>d.search),a=Hi(d=>d.selectedItemId),u=Wc();return R.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),R.createElement(Qe.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":a,id:u.inputId,type:"text",value:i?t.value:c,onChange:d=>{i||l.setState("search",d.target.value),n==null||n(d.target.value)}})}),O8=R.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,l=R.useRef(null),c=R.useRef(null),a=Hi(d=>d.selectedItemId),u=Wc();return R.useEffect(()=>{if(c.current&&l.current){let d=c.current,m=l.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=d.offsetHeight;m.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(p),g.unobserve(d)}}},[]),R.createElement(Qe.div,{ref:qs(l,e),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:u.listId},Bf(t,d=>R.createElement("div",{ref:qs(c,u.listInnerRef),"cmdk-list-sizer":""},d)))}),L8=R.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:l,container:c,...a}=t;return R.createElement(Xg,{open:n,onOpenChange:r},R.createElement(Qg,{container:c},R.createElement(Zg,{"cmdk-overlay":"",className:i}),R.createElement(Jg,{"aria-label":t.label,"cmdk-dialog":"",className:l},R.createElement(Ek,{ref:e,...a}))))}),I8=R.forwardRef((t,e)=>Hi(n=>n.filtered.count===0)?R.createElement(Qe.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),P8=R.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...l}=t;return R.createElement(Qe.div,{ref:e,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Bf(t,c=>R.createElement("div",{"aria-hidden":!0},c)))}),Uo=Object.assign(Ek,{List:O8,Item:j8,Input:M8,Group:T8,Separator:D8,Dialog:L8,Empty:I8,Loading:P8});function z8(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function B8(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function Ak(t){let e=R.useRef(t);return Po(()=>{e.current=t}),e}var Po=typeof window>"u"?R.useEffect:R.useLayoutEffect;function Ia(t){let e=R.useRef();return e.current===void 0&&(e.current=t()),e}function Hi(t){let e=Av(),n=()=>t(e.snapshot());return R.useSyncExternalStore(e.subscribe,n,n)}function Nk(t,e,n,r=[]){let i=R.useRef(),l=Wc();return Po(()=>{var c;let a=(()=>{var d;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(d=m.current.textContent)==null?void 0:d.trim():i.current}})(),u=r.map(d=>d.trim());l.value(t,a,u),(c=e.current)==null||c.setAttribute(La,a),i.current=a}),i}var F8=()=>{let[t,e]=R.useState(),n=Ia(()=>new Map);return Po(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function H8(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Bf({asChild:t,children:e},n){return t&&R.isValidElement(e)?R.cloneElement(H8(e),{ref:e.ref},n(e.props.children)):n(e)}var $8={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Rk(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("textarea",{"data-slot":"textarea",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function U8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"input-group",role:"group",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}const V8=Ja("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function q8(t){const e=he.c(11);let n,r,i;e[0]!==t?({className:n,align:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"inline-start":i;let c;e[4]!==l||e[5]!==n?(c=Ne(V8({align:l}),n),e[4]=l,e[5]=n,e[6]=c):c=e[6];let a;return e[7]!==l||e[8]!==r||e[9]!==c?(a=h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":l,className:c,onClick:W8,...r}),e[7]=l,e[8]=r,e[9]=c,e[10]=a):a=e[10],a}function W8(t){var e,n;t.target.closest("button")||(n=(e=t.currentTarget.parentElement)==null?void 0:e.querySelector("input"))==null||n.focus()}function Nv(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo,{"data-slot":"command",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function jk(t){const e=he.c(11);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=i):i=e[4];let l;e[5]!==r||e[6]!==i?(l=h.jsx(Uo.Input,{"data-slot":"command-input",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(q8,{children:h.jsx($g,{className:"size-4 shrink-0 opacity-50"})}),e[8]=c):c=e[8];let a;return e[9]!==l?(a=h.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:h.jsxs(U8,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[l,c]})}),e[9]=l,e[10]=a):a=e[10],a}function Rv(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo.List,{"data-slot":"command-list",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function jv(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("py-6 text-center text-sm",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo.Empty,{"data-slot":"command-empty",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Ec(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo.Group,{"data-slot":"command-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Tk(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("-mx-1 h-px bg-border",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Uo.Separator,{"data-slot":"command-separator",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Ha(t){const e=he.c(14);let n,r,i,l;e[0]!==t?({className:r,children:n,showCheck:l,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?!0:l;let a;e[5]!==r?(a=Ne("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]!==c?(u=c&&h.jsx(Vn,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"}),e[7]=c,e[8]=u):u=e[8];let d;return e[9]!==n||e[10]!==i||e[11]!==a||e[12]!==u?(d=h.jsxs(Uo.Item,{"data-slot":"command-item",className:a,...i,children:[n,u]}),e[9]=n,e[10]=i,e[11]=a,e[12]=u,e[13]=d):d=e[13],d}function Ff(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(jD,{"data-slot":"popover",...n}),e[2]=n,e[3]=r):r=e[3],r}function Tv(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(DD,{"data-slot":"popover-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Hf(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,align:i,sideOffset:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?"center":i,a=l===void 0?4:l;let u;e[5]!==n?(u=Ne("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==r||e[9]!==a||e[10]!==u?(d=h.jsx(MD,{children:h.jsx(OD,{"data-slot":"popover-content",align:c,sideOffset:a,className:u,...r})}),e[7]=c,e[8]=r,e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function G8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(TD,{"data-slot":"popover-anchor",...n}),e[2]=n,e[3]=r):r=e[3],r}function K8(t){const e=he.c(59),{workspaces:n,activeWorkspace:r,onSelectWorkspace:i,onCreateVirtualWorkspace:l,onCreatePhysicalWorkspace:c,isWorkspaceFavorited:a,onToggleFavorite:u,onDeleteWorkspace:d}=t,[m,p]=R.useState(!1),[g,x]=R.useState(!1),[w,C]=R.useState(null);let y;e[0]!==(r==null?void 0:r.isVirtual)?(y=r!=null&&r.isVirtual?h.jsx(rg,{className:"size-4 flex-shrink-0 text-muted-foreground"}):h.jsx(Vs,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=r==null?void 0:r.isVirtual,e[1]=y):y=e[1];const S=(r==null?void 0:r.name)||"Select workspace";let b;e[2]!==S?(b=h.jsx("span",{className:"truncate",children:S}),e[2]=S,e[3]=b):b=e[3];let _;e[4]!==y||e[5]!==b?(_=h.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[y,b]}),e[4]=y,e[5]=b,e[6]=_):_=e[6];let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(CS,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[7]=k):k=e[7];let j;e[8]!==m||e[9]!==_?(j=h.jsx(Tv,{asChild:!0,children:h.jsxs(Te,{variant:"outline",role:"combobox","aria-expanded":m,"aria-label":"Select workspace",className:"w-full justify-between h-9",children:[_,k]})}),e[8]=m,e[9]=_,e[10]=j):j=e[10];let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(jk,{placeholder:"Search workspace..."}),e[11]=N):N=e[11];let D;e[12]===Symbol.for("react.memo_cache_sentinel")?(D=h.jsx(jv,{children:"No workspace found."}),e[12]=D):D=e[12];let E;if(e[13]!==(r==null?void 0:r.id)||e[14]!==a||e[15]!==i||e[16]!==u||e[17]!==n){let ee;e[19]!==(r==null?void 0:r.id)||e[20]!==a||e[21]!==i||e[22]!==u?(ee=K=>h.jsxs(Ha,{showCheck:!1,onSelect:()=>{i(K),p(!1)},children:[h.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[K.isVirtual?h.jsx(rg,{className:"size-4 flex-shrink-0 text-muted-foreground"}):h.jsx(Vs,{className:"size-4 flex-shrink-0 text-muted-foreground"}),h.jsx("span",{className:"truncate",children:K.name})]}),h.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[h.jsx("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:V=>{V.stopPropagation(),u(K.id,K.name)},title:a(K.id)?"Remove from favorites":"Add to favorites",children:a(K.id)?h.jsx(_c,{className:"size-4 fill-primary text-primary"}):h.jsx(_c,{className:"size-4 text-muted-foreground"})}),h.jsx(Vn,{className:Ne("size-4",(r==null?void 0:r.id)===K.id?"opacity-100":"opacity-0")}),h.jsxs(yk,{children:[h.jsx(bk,{asChild:!0,children:h.jsxs("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:Y8,children:[h.jsx(ES,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Workspace actions"})]})}),h.jsx(xk,{align:"end",children:h.jsxs(pc,{onClick:V=>{V.stopPropagation(),C(K)},className:"text-destructive focus:text-destructive",children:[h.jsx(Br,{className:"size-4"}),"Delete workspace"]})})]})]})]},K.id),e[19]=r==null?void 0:r.id,e[20]=a,e[21]=i,e[22]=u,e[23]=ee):ee=e[23],E=n.map(ee),e[13]=r==null?void 0:r.id,e[14]=a,e[15]=i,e[16]=u,e[17]=n,e[18]=E}else E=e[18];let O;e[24]!==E?(O=h.jsx(Ec,{heading:"Workspaces",children:E}),e[24]=E,e[25]=O):O=e[25];let L;e[26]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(Tk,{}),e[26]=L):L=e[26];let z;e[27]!==l?(z=()=>{l(),p(!1)},e[27]=l,e[28]=z):z=e[28];let H;e[29]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(Qr,{className:"size-4","data-icon":"inline-start"}),e[29]=H):H=e[29];let $;e[30]!==z?($=h.jsxs(Ha,{onSelect:z,children:[H,"Create virtual workspace"]}),e[30]=z,e[31]=$):$=e[31];let q;e[32]===Symbol.for("react.memo_cache_sentinel")?(q=h.jsxs(Ha,{onSelect:()=>{p(!1),x(!0)},children:[h.jsx(Vs,{className:"size-4","data-icon":"inline-start"}),"Add existing folder"]}),e[32]=q):q=e[32];let G;e[33]!==$?(G=h.jsxs(Ec,{children:[$,q]}),e[33]=$,e[34]=G):G=e[34];let W;e[35]!==O||e[36]!==G?(W=h.jsx(Hf,{className:"w-[240px] p-0 max-h-[80vh]",children:h.jsxs(Nv,{children:[N,h.jsxs(Rv,{className:"max-h-[50vh] overflow-y-auto",children:[D,O,L,G]})]})}),e[35]=O,e[36]=G,e[37]=W):W=e[37];let X;e[38]!==m||e[39]!==W||e[40]!==j?(X=h.jsxs(Ff,{open:m,onOpenChange:p,children:[j,W]}),e[38]=m,e[39]=W,e[40]=j,e[41]=X):X=e[41];let Y;e[42]!==c?(Y=ee=>{c(ee),x(!1)},e[42]=c,e[43]=Y):Y=e[43];let I;e[44]!==g||e[45]!==Y?(I=h.jsx(y8,{open:g,onOpenChange:x,onSelect:Y,title:"Select Workspace Folder"}),e[44]=g,e[45]=Y,e[46]=I):I=e[46];const M=w!==null;let P;e[47]===Symbol.for("react.memo_cache_sentinel")?(P=ee=>!ee&&C(null),e[47]=P):P=e[47];const B=w?`Are you sure you want to delete "${w.name}"? This will permanently remove the workspace and all associated Jean data, including sessions, messages, and temporary files. The actual files in "${w.name}" on disk will not be deleted.`:"";let F;e[48]!==d||e[49]!==w?(F=()=>{w&&(d(w.id),C(null))},e[48]=d,e[49]=w,e[50]=F):F=e[50];let Q;e[51]!==M||e[52]!==B||e[53]!==F?(Q=h.jsx(_g,{open:M,onOpenChange:P,title:"Delete Workspace",description:B,confirmLabel:"Delete",variant:"destructive",onConfirm:F}),e[51]=M,e[52]=B,e[53]=F,e[54]=Q):Q=e[54];let J;return e[55]!==X||e[56]!==I||e[57]!==Q?(J=h.jsxs(h.Fragment,{children:[X,I,Q]}),e[55]=X,e[56]=I,e[57]=Q,e[58]=J):J=e[58],J}function Y8(t){return t.stopPropagation()}function X8(t){const e=he.c(33),{onOpenAddServer:n,onServerSwitch:r}=t,[i,l]=R.useState(!1),{servers:c,activeServer:a,switchServer:u}=Qa();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(Do,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=d):d=e[0];const m=(a==null?void 0:a.name)||"Select server";let p;e[1]!==m?(p=h.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[d,h.jsx("span",{className:"truncate",children:m})]}),e[1]=m,e[2]=p):p=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(CS,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[3]=g):g=e[3];let x;e[4]!==i||e[5]!==p?(x=h.jsx(Tv,{asChild:!0,children:h.jsxs(Te,{variant:"outline",role:"combobox","aria-expanded":i,"aria-label":"Select server",className:"w-full justify-between h-9",children:[p,g]})}),e[4]=i,e[5]=p,e[6]=x):x=e[6];let w;e[7]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx(jk,{placeholder:"Search server..."}),e[7]=w):w=e[7];let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=h.jsx(jv,{children:"No server found."}),e[8]=C):C=e[8];let y;if(e[9]!==(a==null?void 0:a.id)||e[10]!==r||e[11]!==c||e[12]!==u){let E;e[14]!==(a==null?void 0:a.id)||e[15]!==r||e[16]!==u?(E=O=>h.jsxs(Ha,{onSelect:()=>{u(O.id),r==null||r(),l(!1)},className:"justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Do,{className:"size-4 text-muted-foreground"}),h.jsx("span",{children:O.name})]}),h.jsx(Vn,{className:Ne("size-4",(a==null?void 0:a.id)===O.id?"opacity-100":"opacity-0")})]},O.id),e[14]=a==null?void 0:a.id,e[15]=r,e[16]=u,e[17]=E):E=e[17],y=c.map(E),e[9]=a==null?void 0:a.id,e[10]=r,e[11]=c,e[12]=u,e[13]=y}else y=e[13];let S;e[18]!==y?(S=h.jsx(Ec,{heading:"Servers",children:y}),e[18]=y,e[19]=S):S=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx(Tk,{}),e[20]=b):b=e[20];let _;e[21]!==n?(_=()=>{n(),l(!1)},e[21]=n,e[22]=_):_=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(Qr,{className:"size-4","data-icon":"inline-start"}),e[23]=k):k=e[23];let j;e[24]!==_?(j=h.jsx(Ec,{children:h.jsxs(Ha,{onSelect:_,children:[k,"Add Server..."]})}),e[24]=_,e[25]=j):j=e[25];let N;e[26]!==j||e[27]!==S?(N=h.jsx(Hf,{className:"w-[240px] p-0 max-h-[80vh]",children:h.jsxs(Nv,{children:[w,h.jsxs(Rv,{className:"max-h-[50vh] overflow-y-auto",children:[C,S,b,j]})]})}),e[26]=j,e[27]=S,e[28]=N):N=e[28];let D;return e[29]!==i||e[30]!==N||e[31]!==x?(D=h.jsxs(Ff,{open:i,onOpenChange:l,children:[x,N]}),e[29]=i,e[30]=N,e[31]=x,e[32]=D):D=e[32],D}const Rm=640,jm=1700;function ol(){const t=he.c(2),[e,n]=R.useState(void 0);let r,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=window.matchMedia(`(max-width: ${Rm-1}px)`),c=()=>{n(window.innerWidth<Rm)};return l.addEventListener("change",c),n(window.innerWidth<Rm),()=>l.removeEventListener("change",c)},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),R.useEffect(r,i),!!e}function Q8(){const t=he.c(2),[e,n]=R.useState(void 0);let r,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=window.matchMedia(`(max-width: ${jm-1}px)`),c=()=>{n(window.innerWidth<jm)};return l.addEventListener("change",c),n(window.innerWidth<jm),()=>l.removeEventListener("change",c)},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),R.useEffect(r,i),!!e}function _n(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,orientation:i,decorative:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?"horizontal":i,a=l===void 0?!0:l;let u;e[5]!==n?(u=Ne("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==a||e[8]!==c||e[9]!==r||e[10]!==u?(d=h.jsx(HM,{"data-slot":"separator",decorative:a,orientation:c,className:u,...r}),e[7]=a,e[8]=c,e[9]=r,e[10]=u,e[11]=d):d=e[11],d}function $f(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Xg,{"data-slot":"sheet",...n}),e[2]=n,e[3]=r):r=e[3],r}function Z8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Dj,{"data-slot":"sheet-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function J8(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(Qg,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function eL(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(Zg,{"data-slot":"sheet-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Uf(t){const e=he.c(24);let n,r,i,l,c,a;e[0]!==t?({className:r,children:n,side:c,showCloseButton:a,style:l,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c,e[6]=a):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5],a=e[6]);const u=c===void 0?"right":c,d=a===void 0?!0:a;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(eL,{}),e[7]=m):m=e[7];let p;e[8]!==r?(p=Ne("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",r),e[8]=r,e[9]=p):p=e[9];let g;e[10]!==u?(g=u==="left"||u==="right"?{top:"env(safe-area-inset-top, 0px)",bottom:"env(safe-area-inset-bottom, 0px)",height:"calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))"}:u==="top"?{top:"env(safe-area-inset-top, 0px)"}:u==="bottom"?{bottom:"env(safe-area-inset-bottom, 0px)"}:void 0,e[10]=u,e[11]=g):g=e[11];const x=g;let w;e[12]!==x||e[13]!==l?(w=x?{...x,...l}:l,e[12]=x,e[13]=l,e[14]=w):w=e[14];const C=w;let y;e[15]!==d?(y=d&&h.jsx(gf,{"data-slot":"sheet-close",asChild:!0,children:h.jsxs(Te,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[h.jsx(zn,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})}),e[15]=d,e[16]=y):y=e[16];let S;return e[17]!==n||e[18]!==i||e[19]!==u||e[20]!==p||e[21]!==C||e[22]!==y?(S=h.jsxs(J8,{children:[m,h.jsxs(Jg,{"data-slot":"sheet-content","data-side":u,className:p,style:C,...i,children:[n,y]})]}),e[17]=n,e[18]=i,e[19]=u,e[20]=p,e[21]=C,e[22]=y,e[23]=S):S=e[23],S}function Vf(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("flex flex-col gap-0.5 p-4",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sheet-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function qf(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("text-base font-medium text-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(x2,{"data-slot":"sheet-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function tL(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("text-sm text-muted-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(_2,{"data-slot":"sheet-description",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Tm(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("animate-pulse rounded-md bg-muted",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"skeleton",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Kd(t){const e=he.c(6);let n,r;e[0]!==t?({delayDuration:r,...n}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const i=r===void 0?0:r;let l;return e[3]!==i||e[4]!==n?(l=h.jsx(mO,{"data-slot":"tooltip-provider",delayDuration:i,...n}),e[3]=i,e[4]=n,e[5]=l):l=e[5],l}function Ac(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(gO,{"data-slot":"tooltip",...n}),e[2]=n,e[3]=r):r=e[3],r}function Nc(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(vO,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Rc(t){const e=he.c(13);let n,r,i,l;e[0]!==t?({className:r,sideOffset:l,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?0:l;let a;e[5]!==r?(a=Ne("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(xO,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"}),e[7]=u):u=e[7];let d;return e[8]!==n||e[9]!==i||e[10]!==c||e[11]!==a?(d=h.jsx(yO,{children:h.jsxs(bO,{"data-slot":"tooltip-content",sideOffset:c,className:a,...i,children:[n,u]})}),e[8]=n,e[9]=i,e[10]=c,e[11]=a,e[12]=d):d=e[12],d}const nL="sidebar_state",rL=3600*24*7,sL="16rem",iL="18rem",oL="3rem",Dk=R.createContext(null);function Gc(){const t=R.useContext(Dk);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Mk(t){const e=he.c(35);let n,r,i,l,c,a,u,d;e[0]!==t?({defaultOpen:d,open:i,onOpenChange:a,className:r,style:u,children:n,panelId:l,...c}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c,e[6]=a,e[7]=u,e[8]=d):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5],a=e[6],u=e[7],d=e[8]);const m=d===void 0?!0:d,p=ol(),[g,x]=R.useState(!1),[w,C]=R.useState(m),y=i!=null?i:w;let S;e[9]!==y||e[10]!==a?(S=$=>{const q=typeof $=="function"?$(y):$;a?a(q):C(q),document.cookie=`${nL}=${q}; path=/; max-age=${rL}`},e[9]=y,e[10]=a,e[11]=S):S=e[11];const b=S;let _;e[12]!==p||e[13]!==b?(_=()=>p?x(lL):b(aL),e[12]=p,e[13]=b,e[14]=_):_=e[14];const k=_,j=y?"expanded":"collapsed";let N;e[15]!==p||e[16]!==y||e[17]!==g||e[18]!==b||e[19]!==j||e[20]!==k?(N={state:j,open:y,setOpen:b,isMobile:p,openMobile:g,setOpenMobile:x,toggleSidebar:k},e[15]=p,e[16]=y,e[17]=g,e[18]=b,e[19]=j,e[20]=k,e[21]=N):N=e[21];const D=N;let E;e[22]!==u?(E={"--sidebar-width":sL,"--sidebar-width-icon":oL,...u},e[22]=u,e[23]=E):E=e[23];const O=E;let L;e[24]!==r?(L=Ne("overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar",r),e[24]=r,e[25]=L):L=e[25];let z;e[26]!==n||e[27]!==l||e[28]!==c||e[29]!==O||e[30]!==L?(z=h.jsx("div",{"data-slot":"sidebar-wrapper","data-panel-id":l,style:O,className:L,...c,children:n}),e[26]=n,e[27]=l,e[28]=c,e[29]=O,e[30]=L,e[31]=z):z=e[31];let H;return e[32]!==D||e[33]!==z?(H=h.jsx(Dk.Provider,{value:D,children:z}),e[32]=D,e[33]=z,e[34]=H):H=e[34],H}function aL(t){return!t}function lL(t){return!t}function Ok(t){const e=he.c(53);let n,r,i,l,c,a,u,d;if(e[0]!==t){const{side:X,variant:Y,collapsible:I,className:M,children:P,dir:B,isOpen:F,onOpenChange:Q,...J}=t;a=X,u=Y,d=I,r=M,n=P,i=B,l=F,c=J,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c,e[6]=a,e[7]=u,e[8]=d}else n=e[1],r=e[2],i=e[3],l=e[4],c=e[5],a=e[6],u=e[7],d=e[8];const m=a===void 0?"left":a,p=u===void 0?"sidebar":u,g=d===void 0?"offcanvas":d,{isMobile:x,state:w,openMobile:C,setOpenMobile:y}=Gc(),b=l!==void 0?l:void 0,_=b!==void 0?b?"expanded":"collapsed":w;if(g==="none"){let X;e[9]!==r?(X=Ne("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),e[9]=r,e[10]=X):X=e[10];let Y;return e[11]!==n||e[12]!==c||e[13]!==X?(Y=h.jsx("div",{"data-slot":"sidebar",className:X,...c,children:n}),e[11]=n,e[12]=c,e[13]=X,e[14]=Y):Y=e[14],Y}if(x){let X;e[15]===Symbol.for("react.memo_cache_sentinel")?(X={"--sidebar-width":iL},e[15]=X):X=e[15];let Y;e[16]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsxs(Vf,{className:"sr-only",children:[h.jsx(qf,{children:"Sidebar"}),h.jsx(tL,{children:"Displays the mobile sidebar."})]}),e[16]=Y):Y=e[16];let I;e[17]!==n?(I=h.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[17]=n,e[18]=I):I=e[18];let M;e[19]!==i||e[20]!==m||e[21]!==I?(M=h.jsxs(Uf,{dir:i,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:X,side:m,children:[Y,I]}),e[19]=i,e[20]=m,e[21]=I,e[22]=M):M=e[22];let P;return e[23]!==C||e[24]!==c||e[25]!==y||e[26]!==M?(P=h.jsx($f,{open:C,onOpenChange:y,...c,children:M}),e[23]=C,e[24]=c,e[25]=y,e[26]=M,e[27]=P):P=e[27],P}const k=_==="collapsed"?g:"",j=b!==void 0&&!b&&"w-0",N=p==="floating"||p==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let D;e[28]!==j||e[29]!==N?(D=Ne("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0",j,"group-data-[side=right]:rotate-180",N),e[28]=j,e[29]=N,e[30]=D):D=e[30];let E;e[31]!==D?(E=h.jsx("div",{"data-slot":"sidebar-gap",className:D}),e[31]=D,e[32]=E):E=e[32];const O=m==="left"&&b!==void 0&&!b&&"left-[calc(var(--sidebar-width)*-1)]",L=m==="right"&&b!==void 0&&!b&&"right-[calc(var(--sidebar-width)*-1)]",z=p==="floating"||p==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";let H;e[33]!==r||e[34]!==L||e[35]!==z||e[36]!==O?(H=Ne("fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",O,L,z,r),e[33]=r,e[34]=L,e[35]=z,e[36]=O,e[37]=H):H=e[37];let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($={top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},e[38]=$):$=e[38];let q;e[39]!==n?(q=h.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:n}),e[39]=n,e[40]=q):q=e[40];let G;e[41]!==c||e[42]!==m||e[43]!==H||e[44]!==q?(G=h.jsx("div",{"data-slot":"sidebar-container","data-side":m,className:H,style:$,...c,children:q}),e[41]=c,e[42]=m,e[43]=H,e[44]=q,e[45]=G):G=e[45];let W;return e[46]!==_||e[47]!==m||e[48]!==G||e[49]!==k||e[50]!==E||e[51]!==p?(W=h.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":_,"data-collapsible":k,"data-variant":p,"data-side":m,"data-slot":"sidebar",children:[E,G]}),e[46]=_,e[47]=m,e[48]=G,e[49]=k,e[50]=E,e[51]=p,e[52]=W):W=e[52],W}function Px(t){const e=he.c(15);let n,r,i;e[0]!==t?({className:n,onClick:r,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const{toggleSidebar:l}=Gc();let c;e[4]!==n?(c=Ne(n),e[4]=n,e[5]=c):c=e[5];let a;e[6]!==r||e[7]!==l?(a=p=>{r==null||r(p),l()},e[6]=r,e[7]=l,e[8]=a):a=e[8];let u,d;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(lN,{}),d=h.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=u,e[10]=d):(u=e[9],d=e[10]);let m;return e[11]!==i||e[12]!==c||e[13]!==a?(m=h.jsxs(Te,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:c,onClick:a,...i,children:[u,d]}),e[11]=i,e[12]=c,e[13]=a,e[14]=m):m=e[14],m}function Lk(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function cL(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function uL(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("mx-2 w-auto bg-sidebar-border",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(_n,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}const Ik=R.forwardRef((t,e)=>{const n=he.c(9);let r,i;n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]);let l;n[3]!==r?(l=Ne("no-scrollbar flex min-h-0 min-w-0 w-full flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r),n[3]=r,n[4]=l):l=n[4];let c;return n[5]!==i||n[6]!==e||n[7]!==l?(c=h.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l,ref:e,...i}),n[5]=i,n[6]=e,n[7]=l,n[8]=c):c=n[8],c});function Yd(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("relative flex w-full min-w-0 flex-col p-2",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Xd(t){const e=he.c(10);let n,r,i;e[0]!==t?({className:n,asChild:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const c=(i===void 0?!1:i)?Lc:"div";let a;e[4]!==n?(a=Ne("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",n),e[4]=n,e[5]=a):a=e[5];let u;return e[6]!==c||e[7]!==r||e[8]!==a?(u=h.jsx(c,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:a,...r}),e[6]=c,e[7]=r,e[8]=a,e[9]=u):u=e[9],u}function Qd(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("w-full text-sm",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function jo(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("flex w-full min-w-0 flex-col gap-0",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Hs(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("group/menu-item relative",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}const dL=Ja("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-1 focus:ring-inset active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ii(t){const e=he.c(28);let n,r,i,l,c,a,u;e[0]!==t?({asChild:i,isActive:l,variant:c,size:a,tooltip:u,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c,e[6]=a,e[7]=u):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5],a=e[6],u=e[7]);const d=i===void 0?!1:i,m=l===void 0?!1:l,p=c===void 0?"default":c,g=a===void 0?"default":a,x=d?Lc:"button",{isMobile:w,state:C}=Gc();let y;e[8]!==n||e[9]!==g||e[10]!==p?(y=Ne(dL({variant:p,size:g}),n),e[8]=n,e[9]=g,e[10]=p,e[11]=y):y=e[11];let S;e[12]!==x||e[13]!==m||e[14]!==r||e[15]!==g||e[16]!==y?(S=h.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":g,"data-active":m,className:y,...r}),e[12]=x,e[13]=m,e[14]=r,e[15]=g,e[16]=y,e[17]=S):S=e[17];const b=S;if(!u)return b;if(typeof u=="string"){let D;e[18]!==u?(D={children:u},e[18]=u,e[19]=D):D=e[19],u=D}let _;e[20]!==b?(_=h.jsx(Nc,{asChild:!0,children:b}),e[20]=b,e[21]=_):_=e[21];const k=C!=="collapsed"||w;let j;e[22]!==k||e[23]!==u?(j=h.jsx(Rc,{side:"right",align:"center",hidden:k,...u}),e[22]=k,e[23]=u,e[24]=j):j=e[24];let N;return e[25]!==_||e[26]!==j?(N=h.jsxs(Ac,{children:[_,j]}),e[25]=_,e[26]=j,e[27]=N):N=e[27],N}function fL(t){const e=he.c(12);let n,r,i,l;e[0]!==t?({className:n,asChild:i,showOnHover:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?!1:i,a=l===void 0?!1:l,u=c?Lc:"button",d=a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0";let m;e[5]!==n||e[6]!==d?(m=Ne("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-1 focus:ring-inset md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",d,n),e[5]=n,e[6]=d,e[7]=m):m=e[7];let p;return e[8]!==u||e[9]!==r||e[10]!==m?(p=h.jsx(u,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:m,...r}),e[8]=u,e[9]=r,e[10]=m,e[11]=p):p=e[11],p}function hL(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("ml-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border pl-2.5 py-0.5 group-data-[collapsible=icon]:hidden",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Pk(t){const e=he.c(29);let n,r,i,l;e[0]!==t?({side:l,panelId:r,className:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=ol(),a=qt(vL),u=qt(gL),d=qt(mL),m=qt(pL),p=r==="sessions"?a:d,g=r==="sessions"?u:m,[x,w]=R.useState(!1),C=R.useRef(!1),y=R.useRef(0),S=R.useRef(0),b=R.useRef(0),_=R.useRef(null),k=R.useRef(null);let j;e[5]!==c||e[6]!==r?(j=X=>{if(c)return;X.preventDefault(),X.stopPropagation(),C.current=!0,w(!0),y.current=X.clientX,S.current=b.current,document.body.style.cursor="ew-resize",document.body.style.userSelect="none";const Y=document.querySelector(`[data-panel-id="${r}"]`);_.current=Y,Y&&(k.current=Y.style.getPropertyValue("--sidebar-width")||null,Y.classList.add("no-transition"))},e[5]=c,e[6]=r,e[7]=j):j=e[7];const N=j;let D,E;e[8]!==p?(D=()=>{b.current=p},E=[p],e[8]=p,e[9]=D,e[10]=E):(D=e[9],E=e[10]),R.useEffect(D,E);let O,L;if(e[11]!==r||e[12]!==g||e[13]!==l?(O=()=>{const X=I=>{if(!C.current)return;const M=l==="left"?I.clientX-y.current:y.current-I.clientX,P=Md(S.current+M);b.current=P;const B=_.current||document.querySelector(`[data-panel-id="${r}"]`);B&&(B.style.setProperty("--sidebar-width",`${Math.round(P)}px`),_.current=B);const F=document.querySelector(`[data-panel-gap="${r}"]`);F&&(F.style.width=`${Math.round(P)}px`)},Y=()=>{if(!C.current)return;C.current=!1,w(!1),document.body.style.cursor="",document.body.style.userSelect="";const I=_.current||document.querySelector(`[data-panel-id="${r}"]`);I&&(I.classList.remove("no-transition"),k.current!==null?I.style.setProperty("--sidebar-width",k.current):I.style.removeProperty("--sidebar-width"));const M=document.querySelector(`[data-panel-gap="${r}"]`);M&&(M.classList.add("no-transition"),M.style.width=`${Math.round(b.current)}px`,requestAnimationFrame(()=>{M==null||M.classList.remove("no-transition")})),g(Math.round(b.current))};return document.addEventListener("mousemove",X),document.addEventListener("mouseup",Y),()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",Y)}},L=[g,l,r],e[11]=r,e[12]=g,e[13]=l,e[14]=O,e[15]=L):(O=e[14],L=e[15]),R.useEffect(O,L),c)return null;const z=l==="left"?"absolute top-0 right-0":"absolute top-0 left-0";let H;e[16]!==n||e[17]!==z?(H=Ne("z-30 flex h-full w-2 cursor-ew-resize items-center justify-center group/sidebar-resize",z,n),e[16]=n,e[17]=z,e[18]=H):H=e[18];const $=x?"bg-primary":"group-active/sidebar-resize:bg-primary";let q;e[19]!==$?(q=Ne("h-8 w-0.5 rounded-full transition-colors duration-100","bg-transparent group-hover/sidebar-resize:bg-border",$),e[19]=$,e[20]=q):q=e[20];let G;e[21]!==q?(G=h.jsx("div",{className:q}),e[21]=q,e[22]=G):G=e[22];let W;return e[23]!==N||e[24]!==r||e[25]!==i||e[26]!==H||e[27]!==G?(W=h.jsx("div",{"data-slot":"panel-resize-handle","data-panel-id":r,className:H,onMouseDown:N,...i,children:G}),e[23]=N,e[24]=r,e[25]=i,e[26]=H,e[27]=G,e[28]=W):W=e[28],W}function pL(t){return t.setFilesPanelWidth}function mL(t){return t.filesPanelWidth}function gL(t){return t.setSessionsPanelWidth}function vL(t){return t.sessionsPanelWidth}function yL(t){const e=he.c(6);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;return e[3]!==n||e[4]!==r?(i=h.jsx(Pk,{side:"left",panelId:"sessions",className:n,...r}),e[3]=n,e[4]=r,e[5]=i):i=e[5],i}function Ks(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(xR,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function $i(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(qS,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ys(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(WS,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}const zx=In.memo(function(e){const n=he.c(13),{isClosed:r,isEditing:i,onRename:l,onReopen:c,onClose:a,onDelete:u}=e;if(i){let w;return n[0]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx("div",{className:"shrink-0 size-7"}),n[0]=w):w=n[0],w}let d;n[1]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsx(bk,{asChild:!0,children:h.jsxs(fL,{showOnHover:!0,children:[h.jsx(ES,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Session actions"})]})}),n[1]=d):d=n[1];let m;n[2]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsx(za,{className:"size-4"}),n[2]=m):m=n[2];let p;n[3]!==l?(p=h.jsxs(pc,{onClick:l,children:[m,"Rename"]}),n[3]=l,n[4]=p):p=n[4];let g;n[5]!==r||n[6]!==a||n[7]!==u||n[8]!==c?(g=r?h.jsxs(h.Fragment,{children:[h.jsxs(pc,{onClick:c,children:[h.jsx(DS,{className:"size-4"}),"Restore"]}),h.jsxs(pc,{onClick:u,className:"text-destructive focus:text-destructive",children:[h.jsx(Br,{className:"size-4"}),"Delete permanently"]})]}):h.jsxs(pc,{onClick:a,children:[h.jsx(zn,{className:"size-4"}),"Archive"]}),n[5]=r,n[6]=a,n[7]=u,n[8]=c,n[9]=g):g=n[9];let x;return n[10]!==p||n[11]!==g?(x=h.jsxs(yk,{children:[d,h.jsxs(xk,{align:"end",children:[p,g]})]}),n[10]=p,n[11]=g,n[12]=x):x=n[12],x}),Bx=In.memo(function(e){const n=he.c(4),{status:r,isStreaming:i,runningAt:l}=e;if(i||r==="running"||!!l){let u;return n[0]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(Wt,{className:"size-3.5 animate-spin shrink-0"}),n[0]=u):u=n[0],u}if(r==="error"){let u;return n[1]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(cf,{className:"size-3.5 shrink-0"}),n[1]=u):u=n[1],u}if(r==="interrupted"){let u;return n[2]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(TS,{className:"size-3.5 shrink-0"}),n[2]=u):u=n[2],u}let a;return n[3]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(Mc,{className:"size-3.5 shrink-0"}),n[3]=a):a=n[3],a}),Cg=In.memo(function t({session:e,childrenMap:n,sessionDerivedValues:r,isActive:i,currentSessionId:l,onResumeSession:c,onCloseSession:a,onReopenSession:u,onDeleteSession:d,onRename:m}){var X,Y;const[p,g]=R.useState(!1),[x,w]=R.useState(e.title||""),C=R.useRef(null),y=(X=r.get(e.id))!=null?X:{isStreaming:!1,hasPendingPermission:!1},S=(Y=n.get(e.id))!=null?Y:[],b=S.length>0,_=e.status==="closed",k=S.some(I=>I.id===l),j=qt(b5(e.id)),N=qt(I=>I.clearCompletion),[D,E]=R.useState(()=>Date.now());R.useEffect(()=>{const I=setInterval(()=>E(Date.now()),500);return()=>clearInterval(I)},[]);const O=!!j&&D-j.flashStartedAt<Vb,L=(j==null?void 0:j.type)==="flash-then-sticky";R.useEffect(()=>{if(!j||j.type!=="flash-only")return;const I=Vb-(D-j.flashStartedAt);if(I<=0){N(e.id);return}const M=setTimeout(()=>{N(e.id)},I);return()=>clearTimeout(M)},[j,e.id,N,D]);const z=O?"animate-completion-flash rounded-md":L?"bg-[oklch(0.85_0.15_145_/_0.15)] rounded-md":"",H=R.useRef(!1);R.useEffect(()=>{p&&C.current?H.current||(C.current.focus(),C.current.select(),H.current=!0):H.current=!1},[p]),R.useEffect(()=>{p||w(e.title||"")},[p,e.title]);const $=()=>{w(e.title||""),g(!0)},q=()=>{const I=x.trim();I&&I!==e.title&&m(e.id,I),g(!1)},G=()=>{g(!1),w(e.title||"")},W=I=>{I.key==="Enter"?(I.preventDefault(),q()):I.key==="Escape"&&(I.preventDefault(),G())};return b?h.jsx(Kd,{delayDuration:300,children:h.jsx(Ks,{defaultOpen:i||k,className:"group/collapsible",children:h.jsxs(Hs,{children:[h.jsxs("div",{className:"flex items-center w-full",children:[h.jsx($i,{asChild:!0,children:h.jsx("button",{className:"flex items-center justify-center rounded-md hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shrink-0 size-7 p-1","aria-label":"Toggle child sessions",children:h.jsx(Hr,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-90"})})}),p?h.jsx("input",{ref:C,type:"text",value:x,onChange:I=>w(I.target.value),onKeyDown:W,onBlur:q,"aria-label":`Rename session: ${e.title||"Untitled"}`,className:"flex-1 min-w-0 h-8 px-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"}):h.jsx(Ii,{"data-session-id":e.id,isActive:i,onClick:()=>c(e.id),className:Ne("flex-1 min-w-0",z),children:h.jsxs(Ac,{children:[h.jsx(Nc,{asChild:!0,children:h.jsxs("span",{className:"truncate flex items-center gap-2",children:[h.jsx(Bx,{status:e.subagentStatus,isStreaming:i?y.isStreaming:!1,runningAt:e.runningAt}),y.hasPendingPermission&&h.jsx(Ua,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),h.jsx(Rc,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),h.jsx(zx,{isClosed:_,isEditing:p,onRename:$,onReopen:()=>u(e.id),onClose:()=>a(e.id),onDelete:()=>d(e.id)})]}),h.jsx(Ys,{children:h.jsx(hL,{children:S.map(I=>h.jsx(t,{session:I,childrenMap:n,sessionDerivedValues:r,isActive:l===I.id,currentSessionId:l,onResumeSession:c,onCloseSession:a,onReopenSession:u,onDeleteSession:d,onRename:m},I.id))})})]})})}):h.jsx(Kd,{delayDuration:300,children:h.jsx(Hs,{children:h.jsxs("div",{className:"flex items-center w-full",children:[h.jsx("div",{className:"shrink-0 size-7 p-1"}),p?h.jsx("input",{ref:C,type:"text",value:x,onChange:I=>w(I.target.value),onKeyDown:W,onBlur:q,"aria-label":`Rename session: ${e.title||"Untitled"}`,className:"flex-1 min-w-0 h-8 px-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"}):h.jsx(Ii,{"data-session-id":e.id,isActive:i,onClick:()=>c(e.id),className:Ne("flex-1 min-w-0",z),children:h.jsxs(Ac,{children:[h.jsx(Nc,{asChild:!0,children:h.jsxs("span",{className:"truncate flex items-center gap-2",children:[h.jsx(Bx,{status:e.subagentStatus,isStreaming:i?y.isStreaming:!1,runningAt:e.runningAt}),y.hasPendingPermission&&h.jsx(Ua,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),h.jsx(Rc,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),h.jsx(zx,{isClosed:_,isEditing:p,onRename:$,onReopen:()=>u(e.id),onClose:()=>a(e.id),onDelete:()=>d(e.id)})]})})})}),bL=Ja("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Ft(t){const e=he.c(13);let n,r,i,l;e[0]!==t?({className:n,variant:i,asChild:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=i===void 0?"default":i,u=(l===void 0?!1:l)?Lc:"span";let d;e[5]!==n||e[6]!==c?(d=Ne(bL({variant:c}),n),e[5]=n,e[6]=c,e[7]=d):d=e[7];let m;return e[8]!==u||e[9]!==r||e[10]!==d||e[11]!==c?(m=h.jsx(u,{"data-slot":"badge","data-variant":c,className:d,...r}),e[8]=u,e[9]=r,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}const xL=In.memo(function(e){const n=he.c(43),{allSessions:r,childrenMap:i,sessionDerivedValues:l,currentSession:c,currentSessionId:a,favoritedWorkspaceIds:u,workspaces:d,activeWorkspace:m,onSelectWorkspace:p,onResumeSession:g,onCloseSession:x,onReopenSession:w,onDeleteSession:C,onRenameSession:y,onCreateSessionInWorkspace:S,connected:b}=e;let _;if(n[0]!==u||n[1]!==d){const O=new Map(d.map(_L));_=u.map(L=>O.get(L)).filter(SL),n[0]=u,n[1]=d,n[2]=_}else _=n[2];const k=_;let j;if(n[3]!==r||n[4]!==k){j=new Map;for(const O of k){const L=r.filter(z=>z.workspaceId===O.id&&z.status==="active"&&z.parentId===null).sort(wL);j.set(O.id,L)}n[3]=r,n[4]=k,n[5]=j}else j=n[5];const N=j;if(k.length===0){let O;n[6]===Symbol.for("react.memo_cache_sentinel")?(O=h.jsx(Xd,{children:"Overview"}),n[6]=O):O=n[6];let L;return n[7]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsxs(Yd,{children:[O,h.jsx(Qd,{children:h.jsx("div",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"Star a workspace to see it here"})})]}),n[7]=L):L=n[7],L}let D;if(n[8]!==(m==null?void 0:m.id)||n[9]!==i||n[10]!==b||n[11]!==(c==null?void 0:c.id)||n[12]!==(c==null?void 0:c.workspaceId)||n[13]!==a||n[14]!==k||n[15]!==x||n[16]!==S||n[17]!==C||n[18]!==y||n[19]!==w||n[20]!==g||n[21]!==p||n[22]!==l||n[23]!==N){let O;n[25]!==(m==null?void 0:m.id)||n[26]!==i||n[27]!==b||n[28]!==(c==null?void 0:c.id)||n[29]!==(c==null?void 0:c.workspaceId)||n[30]!==a||n[31]!==x||n[32]!==S||n[33]!==C||n[34]!==y||n[35]!==w||n[36]!==g||n[37]!==p||n[38]!==l||n[39]!==N?(O=L=>{const z=L.id===(m==null?void 0:m.id),H=(c==null?void 0:c.workspaceId)===L.id,$=N.get(L.id)||[];return h.jsx(Ks,{defaultOpen:z,className:"group/collapsible",children:h.jsxs(Yd,{children:[h.jsx(Xd,{asChild:!0,children:h.jsxs($i,{className:"flex items-center justify-between w-full",onClick:()=>p(L),children:[h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(Hr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),L.isVirtual?h.jsx(rg,{className:"size-3.5"}):h.jsx(Vs,{className:"size-3.5"}),h.jsx("span",{className:H?"truncate text-sidebar-foreground font-medium":"truncate",children:L.name})]}),h.jsx(Ft,{variant:"secondary",children:$.length})]})}),h.jsx(Ys,{children:h.jsxs(Qd,{children:[h.jsx(jo,{children:h.jsx(Hs,{children:h.jsxs(Ii,{onClick:()=>S(L.id),disabled:!b,className:"w-full",children:[h.jsx(Qr,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{children:"New Chat"})]})})}),h.jsx(uL,{}),h.jsx(jo,{children:$.length===0?h.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"(no active sessions)"}):$.map(q=>h.jsx(Cg,{session:q,childrenMap:i,sessionDerivedValues:l,isActive:(c==null?void 0:c.id)===q.id,currentSessionId:a,onResumeSession:g,onCloseSession:x,onReopenSession:w,onDeleteSession:C,onRename:y},q.id))})]})})]})},L.id)},n[25]=m==null?void 0:m.id,n[26]=i,n[27]=b,n[28]=c==null?void 0:c.id,n[29]=c==null?void 0:c.workspaceId,n[30]=a,n[31]=x,n[32]=S,n[33]=C,n[34]=y,n[35]=w,n[36]=g,n[37]=p,n[38]=l,n[39]=N,n[40]=O):O=n[40],D=k.map(O),n[8]=m==null?void 0:m.id,n[9]=i,n[10]=b,n[11]=c==null?void 0:c.id,n[12]=c==null?void 0:c.workspaceId,n[13]=a,n[14]=k,n[15]=x,n[16]=S,n[17]=C,n[18]=y,n[19]=w,n[20]=g,n[21]=p,n[22]=l,n[23]=N,n[24]=D}else D=n[24];let E;return n[41]!==D?(E=h.jsx(h.Fragment,{children:D}),n[41]=D,n[42]=E):E=n[42],E});function _L(t){return[t.id,t]}function SL(t){return t!==void 0}function wL(t,e){return new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()}const CL=R.forwardRef((t,e)=>{var Me;const n=he.c(106),{sessions:r,currentSession:i,currentSessionId:l,streamingSessionIds:c,pendingPermissions:a,connected:u,workspaces:d,activeWorkspace:m,allSessions:p,favoritedWorkspaceIds:g,onCreateSession:x,onResumeSession:w,onCloseSession:C,onReopenSession:y,onDeleteSession:S,onRenameSession:b,onSelectWorkspace:_,onCreateVirtualWorkspace:k,onCreatePhysicalWorkspace:j,onDeleteWorkspace:N,onCreateSessionInWorkspace:D,onOpenSettings:E,onOpenMCP:O,onOpenAddServer:L,onOpenConfiguration:z,onServerSwitch:H,onEscape:$}=t,q=qt(kL),{quickConnections:G,addToQuickConnections:W,removeFromQuickConnections:X,activeServer:Y}=Qa();Gc();const I=R.useRef(null),M=R.useRef(null);let P,B;n[0]!==l?(P=()=>{M.current=l},B=[l],n[0]=l,n[1]=P,n[2]=B):(P=n[1],B=n[2]),R.useEffect(P,B);let F;n[3]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{var Gt;const Oe=I.current;if(!Oe)return;const ot=Array.from(Oe.querySelectorAll('[data-sidebar="menu-button"]'));if(ot.length===0){Oe.focus();return}const Tt=ot.find(Kt=>Kt.getAttribute("data-session-id")===M.current);Tt?Tt.focus():(Gt=ot[0])==null||Gt.focus()},n[3]=F):F=n[3];const Q=F;let J,ee;n[4]===Symbol.for("react.memo_cache_sentinel")?(J=()=>({focusSessionPanel:Q}),ee=[Q],n[4]=J,n[5]=ee):(J=n[4],ee=n[5]),R.useImperativeHandle(e,J,ee);let K;n[6]!==$?(K=Oe=>{var lr,An,vn,Nn,Rn;const ot=I.current;if(!ot)return;const Tt=document.activeElement;if(Tt instanceof HTMLInputElement||Tt instanceof HTMLTextAreaElement||Tt instanceof HTMLElement&&Tt.contentEditable==="true")return;const Gt=Array.from(ot.querySelectorAll('[data-sidebar="menu-button"]')),Kt=Gt.indexOf(document.activeElement);e:switch(Oe.key){case"ArrowDown":{Oe.preventDefault();const Mt=Kt<Gt.length-1?Kt+1:0;(lr=Gt[Mt])==null||lr.focus();break e}case"ArrowUp":{Oe.preventDefault();const Mt=Kt>0?Kt-1:Gt.length-1;(An=Gt[Mt])==null||An.focus();break e}case"ArrowRight":{const Mt=(vn=document.activeElement)==null?void 0:vn.parentElement;if(!Mt)break e;const Nt=Mt.querySelector('button[aria-label="Toggle child sessions"]');if(!Nt)break e;const Dt=Mt.closest("[data-state]");(Dt==null?void 0:Dt.dataset.state)==="closed"&&(Oe.preventDefault(),Nt.click());break e}case"ArrowLeft":{const Mt=(Nn=document.activeElement)==null?void 0:Nn.parentElement;if(!Mt)break e;const Nt=Mt.querySelector('button[aria-label="Toggle child sessions"]');if(!Nt)break e;const Dt=Mt.closest("[data-state]");(Dt==null?void 0:Dt.dataset.state)==="open"&&(Oe.preventDefault(),Nt.click());break e}case"Enter":{document.activeElement instanceof HTMLButtonElement&&document.activeElement.click();break e}case"Escape":Oe.preventDefault(),(Rn=document.activeElement)==null||Rn.blur(),$==null||$()}},n[6]=$,n[7]=K):K=n[7];const V=K;let te;if(n[8]!==p){te=new Map;for(const Oe of p)if(Oe.parentId){const ot=(Me=te.get(Oe.parentId))!=null?Me:[];ot.push(Oe),te.set(Oe.parentId,ot)}n[8]=p,n[9]=te}else te=n[9];const re=te;let ae;n[10]!==a?(ae=new Set(a.map(EL)),n[10]=a,n[11]=ae):ae=n[11];const se=ae;let Se;if(n[12]!==p||n[13]!==l||n[14]!==se||n[15]!==c){Se=new Map;for(const Oe of p){const ot=c.has(Oe.id),Tt=se.has(Oe.id),Kt=Oe.id===l&&ot||Oe.subagentStatus==="running"||!!Oe.runningAt;Se.set(Oe.id,{isStreaming:ot,hasPendingPermission:Tt,isRunning:Kt})}n[12]=p,n[13]=l,n[14]=se,n[15]=c,n[16]=Se}else Se=n[16];const Ae=Se;let De,Ue;if(n[17]!==r){const Oe=r.filter(AL);De=Oe.filter(NL),Ue=Oe.filter(RL),n[17]=r,n[18]=De,n[19]=Ue}else De=n[18],Ue=n[19];let ce;n[20]!==De||n[21]!==Ue?(ce={activeSessions:De,archivedSessions:Ue},n[20]=De,n[21]=Ue,n[22]=ce):ce=n[22];const{activeSessions:je,archivedSessions:xe}=ce;let Ve;n[23]!==(Y==null?void 0:Y.id)||n[24]!==G?(Ve=Oe=>G.some(ot=>ot.workspaceId===Oe&&ot.serverId===(Y==null?void 0:Y.id)),n[23]=Y==null?void 0:Y.id,n[24]=G,n[25]=Ve):Ve=n[25];const We=Ve;let it;n[26]!==Y||n[27]!==W||n[28]!==G||n[29]!==X?(it=(Oe,ot)=>{if(!Y)return;const Tt=G.find(Gt=>Gt.workspaceId===Oe&&Gt.serverId===Y.id);Tt?X(Tt.id):W(Y.id,Y.name,Oe,ot)},n[26]=Y,n[27]=W,n[28]=G,n[29]=X,n[30]=it):it=n[30];const ge=it;let Re;n[31]===Symbol.for("react.memo_cache_sentinel")?(Re=h.jsx(yL,{}),n[31]=Re):Re=n[31];let be;n[32]!==L||n[33]!==H?(be=h.jsx(X8,{onOpenAddServer:L,onServerSwitch:H}),n[32]=L,n[33]=H,n[34]=be):be=n[34];let oe;n[35]!==m||n[36]!==ge||n[37]!==We||n[38]!==j||n[39]!==k||n[40]!==N||n[41]!==_||n[42]!==q||n[43]!==d?(oe=q!=="overview"&&h.jsx(K8,{workspaces:d,activeWorkspace:m,onSelectWorkspace:_,onCreateVirtualWorkspace:k,onCreatePhysicalWorkspace:j,isWorkspaceFavorited:We,onToggleFavorite:ge,onDeleteWorkspace:N}),n[35]=m,n[36]=ge,n[37]=We,n[38]=j,n[39]=k,n[40]=N,n[41]=_,n[42]=q,n[43]=d,n[44]=oe):oe=n[44];let me;n[45]!==be||n[46]!==oe?(me=h.jsxs("div",{className:"p-2 space-y-2",children:[be,oe]}),n[45]=be,n[46]=oe,n[47]=me):me=n[47];let Ee;n[48]!==u||n[49]!==x||n[50]!==q?(Ee=q!=="overview"&&h.jsx(jo,{children:h.jsx(Hs,{children:h.jsxs(Ii,{onClick:x,disabled:!u,className:"w-full",children:[h.jsx(Qr,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{children:"New Chat"})]})})}),n[48]=u,n[49]=x,n[50]=q,n[51]=Ee):Ee=n[51];let Ie;n[52]!==me||n[53]!==Ee?(Ie=h.jsxs(Lk,{children:[me,Ee]}),n[52]=me,n[53]=Ee,n[54]=Ie):Ie=n[54];let Fe;n[55]!==je||n[56]!==m||n[57]!==p||n[58]!==xe||n[59]!==re||n[60]!==u||n[61]!==i||n[62]!==l||n[63]!==g||n[64]!==C||n[65]!==D||n[66]!==S||n[67]!==b||n[68]!==y||n[69]!==w||n[70]!==_||n[71]!==Ae||n[72]!==q||n[73]!==d?(Fe=q==="overview"?h.jsx(xL,{allSessions:p,childrenMap:re,sessionDerivedValues:Ae,currentSession:i,currentSessionId:l,favoritedWorkspaceIds:g,workspaces:d,activeWorkspace:m,onSelectWorkspace:_,onResumeSession:w,onCloseSession:C,onReopenSession:y,onDeleteSession:S,onRenameSession:b,onCreateSessionInWorkspace:D,connected:u}):h.jsxs(h.Fragment,{children:[je.length>0&&h.jsx(Ks,{defaultOpen:!0,className:"group/collapsible",children:h.jsxs(Yd,{children:[h.jsx(Xd,{asChild:!0,children:h.jsxs($i,{className:"flex items-center justify-between w-full",children:[h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(Hr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Active"]}),h.jsx(Ft,{variant:"secondary",children:je.length})]})}),h.jsx(Ys,{children:h.jsx(Qd,{children:h.jsx(jo,{children:je.map(Oe=>h.jsx(Cg,{session:Oe,childrenMap:re,sessionDerivedValues:Ae,isActive:(i==null?void 0:i.id)===Oe.id,currentSessionId:l,onResumeSession:w,onCloseSession:C,onReopenSession:y,onDeleteSession:S,onRename:b},Oe.id))})})})]})}),xe.length>0&&h.jsx(Ks,{defaultOpen:!0,className:"group/collapsible",children:h.jsxs(Yd,{children:[h.jsx(Xd,{asChild:!0,children:h.jsxs($i,{className:"flex items-center justify-between w-full",children:[h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(Hr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Archived"]}),h.jsx(Ft,{variant:"secondary",children:xe.length})]})}),h.jsx(Ys,{children:h.jsx(Qd,{children:h.jsx(jo,{children:xe.map(Oe=>h.jsx(Cg,{session:Oe,childrenMap:re,sessionDerivedValues:Ae,isActive:(i==null?void 0:i.id)===Oe.id,currentSessionId:l,onResumeSession:w,onCloseSession:C,onReopenSession:y,onDeleteSession:S,onRename:b},Oe.id))})})})]})}),je.length===0&&xe.length===0&&h.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["No sessions yet.",h.jsx("br",{}),"Start a new chat to begin."]})]}),n[55]=je,n[56]=m,n[57]=p,n[58]=xe,n[59]=re,n[60]=u,n[61]=i,n[62]=l,n[63]=g,n[64]=C,n[65]=D,n[66]=S,n[67]=b,n[68]=y,n[69]=w,n[70]=_,n[71]=Ae,n[72]=q,n[73]=d,n[74]=Fe):Fe=n[74];let Ge;n[75]!==V||n[76]!==Fe?(Ge=h.jsx(Ik,{ref:I,tabIndex:-1,onKeyDown:V,className:"outline-none",children:Fe}),n[75]=V,n[76]=Fe,n[77]=Ge):Ge=n[77];let Ze;n[78]!==u?(Ze=u?h.jsx(GN,{className:"size-3.5 text-success"}):h.jsx(PS,{className:"size-3.5 text-destructive"}),n[78]=u,n[79]=Ze):Ze=n[79];const lt=u?"Connected":"Disconnected";let ze;n[80]!==lt?(ze=h.jsx("span",{className:"text-xs text-muted-foreground",children:lt}),n[80]=lt,n[81]=ze):ze=n[81];let qe;n[82]!==Ze||n[83]!==ze?(qe=h.jsx(Hs,{children:h.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[Ze,ze]})}),n[82]=Ze,n[83]=ze,n[84]=qe):qe=n[84];let Pe,nt;n[85]===Symbol.for("react.memo_cache_sentinel")?(Pe=h.jsx(Do,{className:"size-4","data-icon":"inline-start"}),nt=h.jsx("span",{children:"MCP Servers"}),n[85]=Pe,n[86]=nt):(Pe=n[85],nt=n[86]);let kt;n[87]!==O?(kt=h.jsx(Hs,{children:h.jsxs(Ii,{onClick:O,children:[Pe,nt]})}),n[87]=O,n[88]=kt):kt=n[88];let mn,gn;n[89]===Symbol.for("react.memo_cache_sentinel")?(mn=h.jsx(AN,{className:"size-4","data-icon":"inline-start"}),gn=h.jsx("span",{children:"Configuration"}),n[89]=mn,n[90]=gn):(mn=n[89],gn=n[90]);let Zt;n[91]!==z?(Zt=h.jsx(Hs,{children:h.jsxs(Ii,{onClick:z,children:[mn,gn]})}),n[91]=z,n[92]=Zt):Zt=n[92];let rn,Jt;n[93]===Symbol.for("react.memo_cache_sentinel")?(rn=h.jsx(MS,{className:"size-4","data-icon":"inline-start"}),Jt=h.jsx("span",{children:"Settings"}),n[93]=rn,n[94]=Jt):(rn=n[93],Jt=n[94]);let ve;n[95]!==E?(ve=h.jsx(Hs,{children:h.jsx("div",{className:"flex items-center gap-1",children:h.jsxs(Ii,{onClick:E,children:[rn,Jt]})})}),n[95]=E,n[96]=ve):ve=n[96];let He;n[97]!==qe||n[98]!==kt||n[99]!==Zt||n[100]!==ve?(He=h.jsx(cL,{className:"pb-4",children:h.jsxs(jo,{children:[qe,kt,Zt,ve]})}),n[97]=qe,n[98]=kt,n[99]=Zt,n[100]=ve,n[101]=He):He=n[101];let et;return n[102]!==Ie||n[103]!==Ge||n[104]!==He?(et=h.jsxs(Ok,{collapsible:"offcanvas",children:[Re,Ie,Ge,He]}),n[102]=Ie,n[103]=Ge,n[104]=He,n[105]=et):et=n[105],et});function kL(t){return t.sidebarViewMode}function EL(t){return t.sessionId}function AL(t){return!t.parentId}function NL(t){return t.status==="active"}function RL(t){return t.status==="closed"}function zk(t){const e=he.c(10);let n,r,i;e[0]!==t?({className:n,orientation:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"horizontal":i;let c;e[4]!==n?(c=Ne("group/tabs flex gap-2 data-horizontal:flex-col",n),e[4]=n,e[5]=c):c=e[5];let a;return e[6]!==l||e[7]!==r||e[8]!==c?(a=h.jsx(XM,{"data-slot":"tabs","data-orientation":l,className:c,...r}),e[6]=l,e[7]=r,e[8]=c,e[9]=a):a=e[9],a}const jL=Ja("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Bk(t){const e=he.c(11);let n,r,i;e[0]!==t?({className:n,variant:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"default":i;let c;e[4]!==n||e[5]!==l?(c=Ne(jL({variant:l}),n),e[4]=n,e[5]=l,e[6]=c):c=e[6];let a;return e[7]!==r||e[8]!==c||e[9]!==l?(a=h.jsx(QM,{"data-slot":"tabs-list","data-variant":l,className:c,...r}),e[7]=r,e[8]=c,e[9]=l,e[10]=a):a=e[10],a}function $s(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(ZM,{"data-slot":"tabs-trigger",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Us(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("flex-1 text-sm outline-none",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(JM,{"data-slot":"tabs-content",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function xt(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(xD,{"data-slot":"label",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Fx(t){return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Hx(t){const e=he.c(29),{permission:n,onRevoke:r}=t,i=!!n.revokedAt,l=i?"outline":"secondary";let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx(OS,{className:"size-3","data-icon":"inline-start"}),e[0]=c):c=e[0];let a;e[1]!==n.permissionType||e[2]!==l?(a=h.jsxs(Ft,{variant:l,children:[c,n.permissionType]}),e[1]=n.permissionType,e[2]=l,e[3]=a):a=e[3];let u;e[4]!==i?(u=i&&h.jsx(Ft,{variant:"outline",className:"text-muted-foreground",children:"Revoked"}),e[4]=i,e[5]=u):u=e[5];let d;e[6]!==a||e[7]!==u?(d=h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a,u]}),e[6]=a,e[7]=u,e[8]=d):d=e[8];let m;e[9]!==n.permissionKey?(m=h.jsx("p",{className:"text-sm font-mono truncate text-muted-foreground",children:n.permissionKey}),e[9]=n.permissionKey,e[10]=m):m=e[10];let p;e[11]!==n.grantedAt?(p=Fx(n.grantedAt),e[11]=n.grantedAt,e[12]=p):p=e[12];let g;e[13]!==n.revokedAt?(g=n.revokedAt&&` • Revoked ${Fx(n.revokedAt)}`,e[13]=n.revokedAt,e[14]=g):g=e[14];let x;e[15]!==p||e[16]!==g?(x=h.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Granted ",p,g]}),e[15]=p,e[16]=g,e[17]=x):x=e[17];let w;e[18]!==d||e[19]!==m||e[20]!==x?(w=h.jsxs("div",{className:"flex-1 min-w-0",children:[d,m,x]}),e[18]=d,e[19]=m,e[20]=x,e[21]=w):w=e[21];let C;e[22]!==i||e[23]!==r||e[24]!==n.id?(C=!i&&h.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>r(n.id),className:"size-8 text-destructive hover:text-destructive",children:h.jsx(Br,{className:"size-4"})}),e[22]=i,e[23]=r,e[24]=n.id,e[25]=C):C=e[25];let y;return e[26]!==w||e[27]!==C?(y=h.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border last:border-0",children:[w,C]}),e[26]=w,e[27]=C,e[28]=y):y=e[28],y}function jc(t){const e=he.c(30),{open:n,onOpenChange:r,title:i,description:l,confirmLabel:c,cancelLabel:a,variant:u,onConfirm:d,onCancel:m}=t,p=c===void 0?"Confirm":c,g=a===void 0?"Cancel":a,x=u===void 0?"default":u;let w;e[0]!==m||e[1]!==r?(w=()=>{m==null||m(),r(!1)},e[0]=m,e[1]=r,e[2]=w):w=e[2];const C=w;let y;e[3]!==d||e[4]!==r?(y=()=>{d(),r(!1)},e[3]=d,e[4]=r,e[5]=y):y=e[5];const S=y;let b;e[6]!==i?(b=h.jsx(Qi,{children:i}),e[6]=i,e[7]=b):b=e[7];let _;e[8]!==l?(_=h.jsx($o,{children:l}),e[8]=l,e[9]=_):_=e[9];let k;e[10]!==b||e[11]!==_?(k=h.jsxs(Xi,{children:[b,_]}),e[10]=b,e[11]=_,e[12]=k):k=e[12];let j;e[13]!==g||e[14]!==C?(j=h.jsx(Te,{variant:"outline",onClick:C,children:g}),e[13]=g,e[14]=C,e[15]=j):j=e[15];const N=x==="destructive"?"destructive":"default";let D;e[16]!==p||e[17]!==S||e[18]!==N?(D=h.jsx(Te,{variant:N,onClick:S,children:p}),e[16]=p,e[17]=S,e[18]=N,e[19]=D):D=e[19];let E;e[20]!==D||e[21]!==j?(E=h.jsxs(zf,{children:[j,D]}),e[20]=D,e[21]=j,e[22]=E):E=e[22];let O;e[23]!==E||e[24]!==k?(O=h.jsxs(Yi,{className:"sm:max-w-[425px]",children:[k,E]}),e[23]=E,e[24]=k,e[25]=O):O=e[25];let L;return e[26]!==r||e[27]!==n||e[28]!==O?(L=h.jsx(Ki,{open:n,onOpenChange:r,children:O}),e[26]=r,e[27]=n,e[28]=O,e[29]=L):L=e[29],L}function TL(t){const e=he.c(10),{token:n,onLogout:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("span",{className:"text-muted-foreground",children:"Token:"}),e[0]=i):i=e[0];let l;e[1]!==n?(l=j5(n),e[1]=n,e[2]=l):l=e[2];let c;e[3]!==l?(c=h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i,h.jsx("code",{className:"font-mono text-foreground bg-background px-1.5 py-0.5 rounded text-[10px]",children:l})]}),e[3]=l,e[4]=c):c=e[4];let a;e[5]!==r?(a=h.jsx(Te,{variant:"destructive",size:"sm",onClick:r,title:"Disconnect and clear token",children:"Logout"}),e[5]=r,e[6]=a):a=e[6];let u;return e[7]!==c||e[8]!==a?(u=h.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md bg-muted",children:[c,a]}),e[7]=c,e[8]=a,e[9]=u):u=e[9],u}const $x="0.7.2";function Ux(t){const e=t.trim().match(/^v?(\d+)\.(\d+)\.(\d+)$/);return e?[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]:null}function DL(t,e){const n=Ux(t),r=Ux(e);if(!n&&!r)return 0;if(!n)return-1;if(!r)return 1;for(let i=0;i<3;i++)if(n[i]!==r[i])return n[i]-r[i];return 0}function Vx(t,e){return e?DL(t,e)>=0?"up-to-date":"update-available":"unknown"}const Fk="rabbyte-tech/jean2",ML=300*1e3,Hk=1e4,Zd=new Map;function $k(t){const e=Zd.get(t);return e?Date.now()-e.timestamp>ML?(Zd.delete(t),null):e.value:null}function Uk(t,e){Zd.set(t,{value:e,timestamp:Date.now()})}function OL(){Zd.clear()}async function Vk(t,e){const n=new AbortController,r=setTimeout(()=>n.abort(),e);try{return await fetch(t,{signal:n.signal})}finally{clearTimeout(r)}}async function LL(){const t=$k("latest-server");if(t)return t;try{const e=`https://raw.githubusercontent.com/${Fk}/refs/heads/main/packages/server/VERSION`,n=await Vk(e,Hk);if(!n.ok)return null;const r=(await n.text()).trim();return/^\d+\.\d+\.\d+$/.test(r)?(Uk("latest-server",r),r):null}catch{return null}}async function IL(){const t=$k("latest-client");if(t)return t;try{const e=`https://api.github.com/repos/${Fk}/releases?per_page=20`,n=await Vk(e,Hk);if(!n.ok)return null;const i=(await n.json()).find(c=>c.tag_name.startsWith("client/")&&!c.prerelease);if(!i)return null;const l=i.tag_name.replace(/^client\/v?/,"");return/^\d+\.\d+\.\d+$/.test(l)?(Uk("latest-client",l),l):null}catch{return null}}function PL(t){if(!t)return"";const e=Math.floor((Date.now()-t)/1e3);if(e<10)return"just now";if(e<60)return`${e}s ago`;const n=Math.floor(e/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function qx(t){const e=he.c(3),{status:n}=t;if(n==="up-to-date"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsxs("span",{className:"text-xs text-green-500 flex items-center gap-1",children:[h.jsx("span",{className:"inline-block size-1.5 rounded-full bg-green-500"}),"Up to date"]}),e[0]=i):i=e[0],i}if(n==="update-available"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400",children:"Update available"}),e[1]=i):i=e[1],i}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx("span",{className:"text-xs text-muted-foreground",children:"Unknown"}),e[2]=r):r=e[2],r}function zL({serverUrl:t,enabled:e}){const n=R.useRef(0),[r,i]=R.useState({serverVersion:null,latestServer:null,latestClient:null,loading:!0,lastChecked:null,fetchError:null}),l=R.useCallback(async(u=!1)=>{u&&OL();const d=++n.current;i(m=>({...m,loading:!0,fetchError:null}));try{const m=await Promise.allSettled([t?fetch(Xn(t,"/api/info")).then(w=>w.ok?w.json():null).then(w=>{var C;return(C=w==null?void 0:w.version)!=null?C:null}):Promise.resolve(null),LL(),IL()]);if(n.current!==d)return;const p=m[0].status==="fulfilled"?m[0].value:null,g=m[1].status==="fulfilled"?m[1].value:null,x=m[2].status==="fulfilled"?m[2].value:null;i({serverVersion:p,latestServer:g,latestClient:x,loading:!1,lastChecked:Date.now(),fetchError:null})}catch{if(n.current!==d)return;i(m=>({...m,loading:!1,fetchError:"Unable to check for updates"}))}},[t]);R.useEffect(()=>{e&&l()},[l,e]);const c=Vx($x,r.latestClient),a=t&&r.serverVersion?Vx(r.serverVersion,r.latestServer):"unknown";return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm font-medium",children:"Versions"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Check for updates to client and server"})]}),h.jsx(_n,{}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-sm font-medium",children:"Client"}),r.loading?h.jsx(Tm,{className:"h-5 w-32"}):h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",$x]}),h.jsx(qx,{status:c})]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-sm font-medium",children:"Server"}),r.loading?h.jsx(Tm,{className:"h-5 w-32"}):r.serverVersion?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",r.serverVersion]}),h.jsx(qx,{status:a})]}):h.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-sm font-medium",children:"Latest"}),r.loading?h.jsx(Tm,{className:"h-5 w-48"}):h.jsxs("span",{className:"text-sm text-muted-foreground",children:[r.latestServer?`v${r.latestServer} (server)`:"",r.latestServer&&r.latestClient&&" · ",r.latestClient?`v${r.latestClient} (client)`:"",!r.latestServer&&!r.latestClient&&"Unknown"]})]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[r.lastChecked&&!r.loading&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last checked: ",PL(r.lastChecked)]}),h.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>l(!0),disabled:r.loading,className:"ml-auto",children:[h.jsx(Pi,{className:`size-3.5 ${r.loading?"animate-spin":""}`}),"Check for Updates"]})]})]})}const BL={neutral:{label:"Neutral",colors:["bg-zinc-400","bg-zinc-600","bg-zinc-800"]},ocean:{label:"Ocean",colors:["bg-sky-300","bg-sky-500","bg-slate-700"]},forest:{label:"Forest",colors:["bg-emerald-300","bg-emerald-500","bg-green-800"]},sunset:{label:"Sunset",colors:["bg-orange-300","bg-amber-500","bg-orange-800"]},amethyst:{label:"Amethyst",colors:["bg-violet-300","bg-violet-500","bg-purple-800"]}};function ac(t){const e=he.c(15),{scheme:n,currentScheme:r,onClick:i}=t,l=n===r,c=BL[n];let a;e[0]!==i||e[1]!==n?(a=()=>i(n),e[0]=i,e[1]=n,e[2]=a):a=e[2];const u=`
|
|
567
|
-
flex flex-col items-center gap-1.5 p-2 rounded-lg border transition-all
|
|
568
|
-
${l?"border-primary bg-primary/5":"border-border bg-transparent hover:bg-muted/50"}
|
|
569
|
-
`,d=c.label;let m;e[3]!==c.colors?(m=c.colors.map(FL),e[3]=c.colors,e[4]=m):m=e[4];let p;e[5]!==m?(p=h.jsx("div",{className:"flex gap-0.5",children:m}),e[5]=m,e[6]=p):p=e[6];let g;e[7]!==n?(g=h.jsx("span",{className:"text-[10px] text-muted-foreground capitalize",children:n}),e[7]=n,e[8]=g):g=e[8];let x;return e[9]!==c.label||e[10]!==a||e[11]!==u||e[12]!==p||e[13]!==g?(x=h.jsxs("button",{type:"button",onClick:a,className:u,title:d,children:[p,g]}),e[9]=c.label,e[10]=a,e[11]=u,e[12]=p,e[13]=g,e[14]=x):x=e[14],x}function FL(t,e){return h.jsx("div",{className:`w-4 h-4 rounded-full ${t}`},e)}function HL(t){var se;const e=he.c(172),{open:n,onOpenChange:r,permissions:i,onRefreshPermissions:l,onRevokePermission:c,onRevokeAllPermissions:a,apiToken:u,onLogout:d,chatFinishSoundEnabled:m,onChatFinishSoundEnabledChange:p,permissionSoundEnabled:g,onPermissionSoundEnabledChange:x,serverUrl:w}=t,{mode:C,scheme:y,setMode:S,setScheme:b}=e5(),[_,k]=R.useState(!1),N=((se=navigator.userAgentData)==null?void 0:se.platform)==="macOS"||/mac|iphone|ipad|ipod/i.test(navigator.userAgent)?"⌘":"Ctrl";let D,E,O,L,z,H,$,q,G,W,X,Y,I,M,P,B,F,Q;if(e[0]!==u||e[1]!==m||e[2]!==C||e[3]!==p||e[4]!==d||e[5]!==r||e[6]!==x||e[7]!==l||e[8]!==c||e[9]!==n||e[10]!==g||e[11]!==i||e[12]!==y||e[13]!==w||e[14]!==S||e[15]!==b){const Se=[{keys:[N,"1"],description:"Open session list"},{keys:[N,"2"],description:"Open files panel"},{keys:[N,"T"],description:"Open terminal"},{keys:[N,"O"],description:"Toggle overview mode"},{keys:[N,"N"],description:"New session"},{keys:[N,"Shift","N"],description:"New window"},{keys:[N,"Shift","F"],description:"Toggle follow/free mode"},{keys:["Shift","Esc"],description:"Close focused panel"},{keys:["Shift","Enter"],description:"New line in input"},{keys:["Enter"],description:"Send message"},{keys:["↑","↓","←","→"],description:"Navigate sessions"},{keys:["Esc"],description:"Focus chat input"},{keys:["Esc","Esc"],description:"Stop streaming (chat input focused)"}],Ae=i.filter(VL),De=i.filter(UL);L=Ki,G=n,W=r,O=Yi,$="sm:max-w-[700px] max-h-[80vh]",e[34]===Symbol.for("react.memo_cache_sentinel")?(q=h.jsxs(Xi,{children:[h.jsx(Qi,{children:"Settings"}),h.jsx($o,{children:"Manage your preferences and permissions"})]}),e[34]=q):q=e[34],E=zk,M="account",P="mt-4";let Ue,ce;e[35]===Symbol.for("react.memo_cache_sentinel")?(Ue=h.jsxs($s,{value:"account",children:[h.jsx(IS,{className:"size-4 sm:size-3","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Account"})]}),ce=h.jsxs($s,{value:"appearance",children:[h.jsx(oN,{className:"size-4 sm:size-3","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Appearance"})]}),e[35]=Ue,e[36]=ce):(Ue=e[35],ce=e[36]);let je,xe;e[37]===Symbol.for("react.memo_cache_sentinel")?(je=h.jsx(OS,{className:"size-4 sm:size-3","data-icon":"inline-start"}),xe=h.jsx("span",{className:"hidden sm:inline",children:"Permissions"}),e[37]=je,e[38]=xe):(je=e[37],xe=e[38]);const Ve=Ae.length>0&&h.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex size-3.5 items-center justify-center rounded-full bg-primary text-[8px] font-bold leading-none text-primary-foreground sm:static sm:flex sm:size-auto sm:ml-1.5 sm:px-1.5 sm:py-0.5 sm:text-xs sm:font-medium sm:leading-normal",children:Ae.length});let We;e[39]!==Ve?(We=h.jsxs($s,{value:"permissions",children:[je,xe,Ve]}),e[39]=Ve,e[40]=We):We=e[40];let it;e[41]===Symbol.for("react.memo_cache_sentinel")?(it=h.jsxs($s,{value:"keybinds",children:[h.jsx(HA,{className:"size-4 sm:size-3","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Keybinds"})]}),e[41]=it):it=e[41],e[42]!==We?(B=h.jsxs(Bk,{className:"grid w-full grid-cols-4",children:[Ue,ce,We,it]}),e[42]=We,e[43]=B):B=e[43];let ge,Re;e[44]===Symbol.for("react.memo_cache_sentinel")?(ge=h.jsx(xt,{className:"text-sm font-medium",children:"Session"}),Re=h.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Manage your current session"}),e[44]=ge,e[45]=Re):(ge=e[44],Re=e[45]);let be;e[46]!==u||e[47]!==d?(be=h.jsxs("div",{children:[ge,Re,u?h.jsx(TL,{token:u,onLogout:d}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No active session"})]}),e[46]=u,e[47]=d,e[48]=be):be=e[48];let oe;e[49]===Symbol.for("react.memo_cache_sentinel")?(oe=h.jsx(_n,{}),e[49]=oe):oe=e[49];let me;e[50]!==n||e[51]!==w?(me=h.jsx(zL,{serverUrl:w,enabled:n}),e[50]=n,e[51]=w,e[52]=me):me=e[52],e[53]!==be||e[54]!==me?(F=h.jsx(Us,{value:"account",className:"mt-4",children:h.jsxs("div",{className:"flex flex-col gap-4",children:[be,oe,me]})}),e[53]=be,e[54]=me,e[55]=F):F=e[55];let Ee,Ie;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ee=h.jsx(xt,{className:"text-sm font-medium",children:"Mode"}),Ie=h.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose light, dark, or system theme"}),e[56]=Ee,e[57]=Ie):(Ee=e[56],Ie=e[57]);const Fe=C==="light"?"default":"outline";let Ge;e[58]!==S?(Ge=()=>S("light"),e[58]=S,e[59]=Ge):Ge=e[59];let Ze;e[60]===Symbol.for("react.memo_cache_sentinel")?(Ze=h.jsx(DN,{className:"size-4","data-icon":"inline-start"}),e[60]=Ze):Ze=e[60];let lt;e[61]!==Fe||e[62]!==Ge?(lt=h.jsxs(Te,{variant:Fe,className:"justify-start",onClick:Ge,children:[Ze,"Light"]}),e[61]=Fe,e[62]=Ge,e[63]=lt):lt=e[63];const ze=C==="dark"?"default":"outline";let qe;e[64]!==S?(qe=()=>S("dark"),e[64]=S,e[65]=qe):qe=e[65];let Pe;e[66]===Symbol.for("react.memo_cache_sentinel")?(Pe=h.jsx(sN,{className:"size-4","data-icon":"inline-start"}),e[66]=Pe):Pe=e[66];let nt;e[67]!==ze||e[68]!==qe?(nt=h.jsxs(Te,{variant:ze,className:"justify-start",onClick:qe,children:[Pe,"Dark"]}),e[67]=ze,e[68]=qe,e[69]=nt):nt=e[69];const kt=C==="system"?"default":"outline";let mn;e[70]!==S?(mn=()=>S("system"),e[70]=S,e[71]=mn):mn=e[71];let gn;e[72]===Symbol.for("react.memo_cache_sentinel")?(gn=h.jsx(nN,{className:"size-4","data-icon":"inline-start"}),e[72]=gn):gn=e[72];let Zt;e[73]!==kt||e[74]!==mn?(Zt=h.jsxs(Te,{variant:kt,className:"justify-start",onClick:mn,children:[gn,"System"]}),e[73]=kt,e[74]=mn,e[75]=Zt):Zt=e[75];let rn;e[76]!==lt||e[77]!==nt||e[78]!==Zt?(rn=h.jsxs("div",{children:[Ee,Ie,h.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[lt,nt,Zt]})]}),e[76]=lt,e[77]=nt,e[78]=Zt,e[79]=rn):rn=e[79];let Jt,ve;e[80]===Symbol.for("react.memo_cache_sentinel")?(Jt=h.jsx(_n,{}),ve=h.jsx(xt,{className:"text-sm font-medium mb-3 block",children:"Notification Sounds"}),e[80]=Jt,e[81]=ve):(Jt=e[80],ve=e[81]);let He;e[82]===Symbol.for("react.memo_cache_sentinel")?(He=h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($N,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm",children:"Chat completion"})]}),e[82]=He):He=e[82];let et;e[83]!==m||e[84]!==p?(et=()=>p(!m),e[83]=m,e[84]=p,e[85]=et):et=e[85];const Me=`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${m?"bg-primary":"bg-muted"}`,Oe=`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${m?"translate-x-6":"translate-x-1"}`;let ot;e[86]!==Oe?(ot=h.jsx("span",{className:Oe}),e[86]=Oe,e[87]=ot):ot=e[87];let Tt;e[88]!==et||e[89]!==Me||e[90]!==ot?(Tt=h.jsxs("div",{className:"flex items-center justify-between",children:[He,h.jsx("button",{type:"button",onClick:et,className:Me,children:ot})]}),e[88]=et,e[89]=Me,e[90]=ot,e[91]=Tt):Tt=e[91];let Gt;e[92]===Symbol.for("react.memo_cache_sentinel")?(Gt=h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(VN,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm",children:"Permission requests"})]}),e[92]=Gt):Gt=e[92];let Kt;e[93]!==x||e[94]!==g?(Kt=()=>x(!g),e[93]=x,e[94]=g,e[95]=Kt):Kt=e[95];const lr=`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${g?"bg-primary":"bg-muted"}`,An=`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${g?"translate-x-6":"translate-x-1"}`;let vn;e[96]!==An?(vn=h.jsx("span",{className:An}),e[96]=An,e[97]=vn):vn=e[97];let Nn;e[98]!==Kt||e[99]!==lr||e[100]!==vn?(Nn=h.jsxs("div",{className:"flex items-center justify-between",children:[Gt,h.jsx("button",{type:"button",onClick:Kt,className:lr,children:vn})]}),e[98]=Kt,e[99]=lr,e[100]=vn,e[101]=Nn):Nn=e[101];let Rn;e[102]!==Tt||e[103]!==Nn?(Rn=h.jsxs("div",{children:[ve,h.jsxs("div",{className:"flex flex-col gap-3",children:[Tt,Nn]})]}),e[102]=Tt,e[103]=Nn,e[104]=Rn):Rn=e[104];let Mt,Nt,Dt;e[105]===Symbol.for("react.memo_cache_sentinel")?(Mt=h.jsx(_n,{}),Nt=h.jsx(xt,{className:"text-sm font-medium",children:"Color Scheme"}),Dt=h.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose your preferred color palette"}),e[105]=Mt,e[106]=Nt,e[107]=Dt):(Mt=e[105],Nt=e[106],Dt=e[107]);let jn;e[108]!==y||e[109]!==b?(jn=h.jsxs("div",{children:[Nt,Dt,h.jsxs("div",{className:"grid grid-cols-5 gap-2",children:[h.jsx(ac,{scheme:"neutral",currentScheme:y,onClick:b}),h.jsx(ac,{scheme:"ocean",currentScheme:y,onClick:b}),h.jsx(ac,{scheme:"forest",currentScheme:y,onClick:b}),h.jsx(ac,{scheme:"sunset",currentScheme:y,onClick:b}),h.jsx(ac,{scheme:"amethyst",currentScheme:y,onClick:b})]})]}),e[108]=y,e[109]=b,e[110]=jn):jn=e[110],e[111]!==rn||e[112]!==Rn||e[113]!==jn?(Q=h.jsx(Us,{value:"appearance",className:"mt-4",children:h.jsxs("div",{className:"flex flex-col gap-4",children:[rn,Jt,Rn,Mt,jn]})}),e[111]=rn,e[112]=Rn,e[113]=jn,e[114]=Q):Q=e[114];const bs=Us,Zs="permissions",Js="mt-4",xs="flex flex-col gap-4";let kr;e[115]===Symbol.for("react.memo_cache_sentinel")?(kr=h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm font-medium",children:"Always-allowed Operations"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Tools you've approved to run without asking"})]}),e[115]=kr):kr=e[115];let Er;e[116]===Symbol.for("react.memo_cache_sentinel")?(Er=h.jsx(Pi,{className:"size-4"}),e[116]=Er):Er=e[116];let Bn;e[117]!==l?(Bn=h.jsx(Te,{variant:"outline",size:"icon",onClick:l,className:"size-8",children:Er}),e[117]=l,e[118]=Bn):Bn=e[118];const Wn=Ae.length>0&&h.jsxs(Te,{variant:"destructive",size:"sm",onClick:()=>k(!0),children:[h.jsx(Br,{className:"size-4","data-icon":"inline-start"}),"Revoke All"]});let Gn;e[119]!==Bn||e[120]!==Wn?(Gn=h.jsxs("div",{className:"flex items-center justify-between",children:[kr,h.jsxs("div",{className:"flex gap-2",children:[Bn,Wn]})]}),e[119]=Bn,e[120]=Wn,e[121]=Gn):Gn=e[121];let wn;e[122]===Symbol.for("react.memo_cache_sentinel")?(wn=h.jsx(_n,{}),e[122]=wn):wn=e[122];const en=ds,Ur="h-[300px]",_s=Ae.length===0&&De.length===0&&h.jsxs("div",{className:"text-center py-8 text-muted-foreground text-sm",children:["No permissions granted yet.",h.jsx("br",{}),'Approve tool requests with "Always allow" to add them here.']}),Zn=Ae.length>0&&h.jsxs("div",{className:"mb-4",children:[h.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Active (",Ae.length,")"]}),Ae.map(ur=>h.jsx(Hx,{permission:ur,onRevoke:c},ur.id))]}),cr=De.length>0&&h.jsxs("div",{children:[h.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Revoked (",De.length,")"]}),De.map(ur=>h.jsx(Hx,{permission:ur,onRevoke:c},ur.id))]});let rs;e[123]!==en||e[124]!==Ur||e[125]!==_s||e[126]!==Zn||e[127]!==cr?(rs=h.jsxs(en,{className:Ur,children:[_s,Zn,cr]}),e[123]=en,e[124]=Ur,e[125]=_s,e[126]=Zn,e[127]=cr,e[128]=rs):rs=e[128];let Jn;e[129]!==xs||e[130]!==Gn||e[131]!==wn||e[132]!==rs?(Jn=h.jsxs("div",{className:xs,children:[Gn,wn,rs]}),e[129]=xs,e[130]=Gn,e[131]=wn,e[132]=rs,e[133]=Jn):Jn=e[133],e[134]!==bs||e[135]!==Zs||e[136]!==Js||e[137]!==Jn?(H=h.jsx(bs,{value:Zs,className:Js,children:Jn}),e[134]=bs,e[135]=Zs,e[136]=Js,e[137]=Jn,e[138]=H):H=e[138],D=Us,Y="keybinds",I="mt-4",z="flex flex-col gap-2",X=Se.map($L),e[0]=u,e[1]=m,e[2]=C,e[3]=p,e[4]=d,e[5]=r,e[6]=x,e[7]=l,e[8]=c,e[9]=n,e[10]=g,e[11]=i,e[12]=y,e[13]=w,e[14]=S,e[15]=b,e[16]=D,e[17]=E,e[18]=O,e[19]=L,e[20]=z,e[21]=H,e[22]=$,e[23]=q,e[24]=G,e[25]=W,e[26]=X,e[27]=Y,e[28]=I,e[29]=M,e[30]=P,e[31]=B,e[32]=F,e[33]=Q}else D=e[16],E=e[17],O=e[18],L=e[19],z=e[20],H=e[21],$=e[22],q=e[23],G=e[24],W=e[25],X=e[26],Y=e[27],I=e[28],M=e[29],P=e[30],B=e[31],F=e[32],Q=e[33];let J;e[139]!==z||e[140]!==X?(J=h.jsx("div",{className:z,children:X}),e[139]=z,e[140]=X,e[141]=J):J=e[141];let ee;e[142]!==D||e[143]!==J||e[144]!==Y||e[145]!==I?(ee=h.jsx(D,{value:Y,className:I,children:J}),e[142]=D,e[143]=J,e[144]=Y,e[145]=I,e[146]=ee):ee=e[146];let K;e[147]!==E||e[148]!==H||e[149]!==ee||e[150]!==M||e[151]!==P||e[152]!==B||e[153]!==F||e[154]!==Q?(K=h.jsxs(E,{defaultValue:M,className:P,children:[B,F,Q,H,ee]}),e[147]=E,e[148]=H,e[149]=ee,e[150]=M,e[151]=P,e[152]=B,e[153]=F,e[154]=Q,e[155]=K):K=e[155];let V;e[156]!==O||e[157]!==$||e[158]!==q||e[159]!==K?(V=h.jsxs(O,{className:$,children:[q,K]}),e[156]=O,e[157]=$,e[158]=q,e[159]=K,e[160]=V):V=e[160];let te;e[161]!==a?(te=()=>{a(),k(!1)},e[161]=a,e[162]=te):te=e[162];let re;e[163]!==_||e[164]!==te?(re=h.jsx(jc,{open:_,onOpenChange:k,title:"Revoke All Permissions",description:"This will revoke all always-allowed permissions for this workspace. You'll need to approve these tools again when they're used.",confirmLabel:"Revoke All",variant:"destructive",onConfirm:te}),e[163]=_,e[164]=te,e[165]=re):re=e[165];let ae;return e[166]!==L||e[167]!==G||e[168]!==W||e[169]!==V||e[170]!==re?(ae=h.jsxs(L,{open:G,onOpenChange:W,children:[V,re]}),e[166]=L,e[167]=G,e[168]=W,e[169]=V,e[170]=re,e[171]=ae):ae=e[171],ae}function $L(t,e){return h.jsxs("div",{className:"flex items-center justify-between py-1",children:[h.jsx("div",{className:"flex items-center gap-1",children:t.keys.map((n,r)=>h.jsxs("span",{children:[h.jsx("kbd",{className:"font-mono bg-muted rounded px-2 py-1 text-xs",children:n}),r<t.keys.length-1&&h.jsx("span",{className:"mx-1 text-muted-foreground",children:"+"})]},r))}),h.jsx("span",{className:"text-sm text-muted-foreground",children:t.description})]},e)}function UL(t){return t.revokedAt}function VL(t){return!t.revokedAt}const qL=Ja("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function Rd(t){const e=he.c(10);let n,r,i;e[0]!==t?({className:n,variant:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let l;e[4]!==n||e[5]!==i?(l=Ne(qL({variant:i}),n),e[4]=n,e[5]=i,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==l?(c=h.jsx("div",{"data-slot":"alert",role:"alert",className:l,...r}),e[7]=r,e[8]=l,e[9]=c):c=e[9],c}function jd(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx("div",{"data-slot":"alert-description",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function WL(t){const e=he.c(6),{status:n}=t;switch(n.status){case"connected":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"default",className:"bg-green-600",children:[h.jsx(Mc,{className:"size-3 mr-1"}),"Connected"]}),e[0]=r):r=e[0],r}case"disabled":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"secondary",children:[h.jsx(cf,{className:"size-3 mr-1"}),"Disabled"]}),e[1]=r):r=e[1],r}case"failed":{let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"destructive",children:[h.jsx(To,{className:"size-3 mr-1"}),"Failed"]}),e[2]=r):r=e[2],r}case"needs_auth":{let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"outline",className:"border-yellow-500 text-yellow-600",children:[h.jsx(To,{className:"size-3 mr-1"}),"Needs Auth"]}),e[3]=r):r=e[3],r}case"needs_client_registration":{let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"outline",className:"border-orange-500 text-orange-600",children:[h.jsx(To,{className:"size-3 mr-1"}),"Needs Registration"]}),e[4]=r):r=e[4],r}default:{let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(Ft,{variant:"secondary",children:"Unknown"}),e[5]=r):r=e[5],r}}}function GL({open:t,onOpenChange:e,workspaceId:n,workspacePath:r,serverUrl:i,apiToken:l}){const{fetchWithAuth:c}=ns(),[a,u]=R.useState({}),[d,m]=R.useState(!1),[p,g]=R.useState(null),[x,w]=R.useState(null),C=R.useCallback(async()=>{if(n){m(!0),w(null);try{const k=await c(`/api/workspaces/${n}/mcp/status`,{},{serverUrl:i,token:l});if(!k.ok)throw new Error("Failed to load MCP status");const j=await k.json();u(j.status||{})}catch(k){const j=k instanceof Error?k.message:"Unknown error";w(j)}finally{m(!1)}}},[n,c,i,l]);R.useEffect(()=>{t&&n&&C()},[t,n,C]);const y=async k=>{if(n){g(k);try{if(!(await c(`/api/workspaces/${n}/mcp/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:i,token:l})).ok)throw new Error("Failed to connect");await C()}catch(j){const N=j instanceof Error?j.message:"Unknown error";w(N)}finally{g(null)}}},S=async k=>{if(n){g(k);try{if(!(await c(`/api/workspaces/${n}/mcp/disconnect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:i,token:l})).ok)throw new Error("Failed to disconnect");await C()}catch(j){const N=j instanceof Error?j.message:"Unknown error";w(N)}finally{g(null)}}},b=async k=>{if(n){g(k);try{const j=await c(`/api/workspaces/${n}/mcp/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:i,token:l});if(!j.ok)throw new Error("Failed to start auth");const N=await j.json();N.authorizationUrl&&window.open(N.authorizationUrl,"_blank"),await C()}catch(j){const N=j instanceof Error?j.message:"Unknown error";w(N)}finally{g(null)}}},_=Object.entries(a);return h.jsx(Ki,{open:t,onOpenChange:e,children:h.jsxs(Yi,{className:"sm:max-w-[600px] max-h-[80vh]",children:[h.jsxs(Xi,{children:[h.jsxs(Qi,{className:"flex items-center gap-2",children:[h.jsx(Do,{className:"size-5"}),"MCP Servers"]}),h.jsx($o,{children:"Manage Model Context Protocol servers for this workspace"})]}),h.jsxs("div",{className:"mt-4 space-y-4",children:[x&&h.jsxs(Rd,{variant:"destructive",children:[h.jsx(To,{className:"size-4"}),h.jsx(jd,{children:x})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure servers in ",h.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})]}),h.jsx(Te,{variant:"outline",size:"sm",onClick:C,disabled:d,children:h.jsx(Pi,{className:`size-4 ${d?"animate-spin":""}`})})]}),h.jsx(ds,{className:"h-[400px]",children:d&&_.length===0?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):_.length===0?h.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[h.jsx(Do,{className:"size-12 mx-auto mb-3 opacity-50"}),h.jsx("p",{className:"font-medium",children:"No MCP servers configured"}),h.jsxs("p",{className:"text-sm mt-1",children:["Create ",h.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})," in your workspace to add servers."]})]}):h.jsx("div",{className:"space-y-3",children:_.map(([k,{config:j,status:N}])=>{var D;return h.jsxs("div",{className:"border rounded-lg p-4",children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(Do,{className:"size-5 text-muted-foreground mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium",children:k}),h.jsx("div",{className:"text-sm text-muted-foreground",children:(j==null?void 0:j.type)==="local"?h.jsxs("span",{children:["Local - ",((D=j.command)==null?void 0:D[0])||"command"]}):(j==null?void 0:j.type)==="remote"?h.jsxs("span",{className:"flex items-center gap-1",children:["Remote - ",j.url]}):"Unknown type"}),N.status==="failed"&&"error"in N&&h.jsx(Rd,{variant:"destructive",className:"mt-2 py-2",children:h.jsx(jd,{className:"text-xs",children:N.error})}),N.status==="needs_client_registration"&&"error"in N&&h.jsx(Rd,{className:"mt-2 py-2 border-orange-500",children:h.jsx(jd,{className:"text-xs",children:N.error})})]})]}),h.jsx("div",{className:"flex items-center gap-2",children:h.jsx(WL,{status:N})})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t",children:[N.status==="connected"&&h.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>S(k),disabled:p===k,children:[p===k?h.jsx(Wt,{className:"size-4 animate-spin"}):h.jsx(pN,{className:"size-4"}),h.jsx("span",{className:"ml-1",children:"Disconnect"})]}),(N.status==="disabled"||N.status==="failed")&&h.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>y(k),disabled:p===k,children:[p===k?h.jsx(Wt,{className:"size-4 animate-spin"}):h.jsx(gN,{className:"size-4"}),h.jsx("span",{className:"ml-1",children:"Connect"})]}),N.status==="needs_auth"&&h.jsxs(Te,{variant:"default",size:"sm",onClick:()=>b(k),disabled:p===k,children:[p===k?h.jsx(Wt,{className:"size-4 animate-spin"}):h.jsx(xc,{className:"size-4"}),h.jsx("span",{className:"ml-1",children:"Authenticate"})]})]})]},k)})})})]})]})})}function KL({serverUrl:t,apiToken:e}){const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState([]),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,x]=R.useState(""),[w,C]=R.useState(!1),[y,S]=R.useState(null),b=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const D=await n(`${r}/api/config/providers`,{headers:{Authorization:`Bearer ${e}`}});if(!D.ok)throw new Error("Failed to load providers");const E=await D.json();l(E.providers)}catch(D){d(D instanceof Error?D.message:"Failed to load providers")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{b()},[b]);const _=async D=>{if(g.trim()){S(D);try{const E=await n(`${r}/api/config/providers/${D}`,{method:"PUT",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({apiKey:g.trim()})});if(!E.ok){const O=await E.json().catch(()=>({}));throw new Error(O.message||"Failed to set key")}p(null),x(""),C(!1),await b()}catch(E){d(E instanceof Error?E.message:"Failed to set key")}finally{S(null)}}},k=async D=>{S(D);try{const E=await n(`${r}/api/config/providers/${D}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!E.ok){const O=await E.json().catch(()=>({}));throw new Error(O.message||"Failed to clear key")}await b()}catch(E){d(E instanceof Error?E.message:"Failed to clear key")}finally{S(null)}},j={anthropic:"Anthropic",google:"Google",minimax:"MiniMax",openai:"OpenAI",openrouter:"OpenRouter",zhipu:"Z.AI","zhipu-coding":"Z.AI Coding"},N=D=>j[D]||D.split("-").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join(" ");return c?h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):u&&i.length===0?h.jsx("div",{className:"p-4 text-sm text-destructive",children:u}):h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for LLM providers. Keys are stored in ~/.jean2/.env and never exposed to the client."}),h.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"OAuth-based providers are managed in the OAuth tab."}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsx("div",{className:"space-y-2",children:i.map(D=>h.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(NS,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm font-medium",children:N(D.provider)}),h.jsx(Ft,{variant:D.configured?"default":"secondary",children:D.configured?"Configured":"Not set"})]}),h.jsx("div",{className:"flex items-center gap-2",children:m===D.provider?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx(an,{type:w?"text":"password",value:g,onChange:E=>x(E.target.value),placeholder:"Enter API key...",className:"w-full sm:w-48 h-8 text-sm pr-8",onKeyDown:E=>{E.key==="Enter"&&_(D.provider),E.key==="Escape"&&(p(null),x(""))},autoFocus:!0}),h.jsx(Te,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-8 w-8",onClick:()=>C(!w),children:w?h.jsx(AS,{className:"size-3"}):h.jsx(Hg,{className:"size-3"})})]}),h.jsx(Te,{size:"sm",onClick:()=>_(D.provider),disabled:!g.trim()||y===D.provider,children:y===D.provider?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Vn,{className:"size-3"})}),h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>{p(null),x("")},children:h.jsx(zn,{className:"size-3"})})]}):h.jsxs(h.Fragment,{children:[h.jsx(Te,{size:"sm",variant:"outline",onClick:()=>{p(D.provider),x(""),C(!1)},disabled:y===D.provider,children:D.configured?"Update":"Set Key"}),D.configured&&h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>k(D.provider),disabled:y===D.provider,children:y===D.provider?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Br,{className:"size-3"})})]})})]},D.provider))})]})}function YL({serverUrl:t,apiToken:e}){const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState([]),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,x]=R.useState({}),[w,C]=R.useState(null),y=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const k=await n(`${r}/api/providers`,{headers:{Authorization:`Bearer ${e}`}});if(!k.ok)throw new Error("Failed to load providers");const j=await k.json();l(j.providers||[])}catch(k){d(k instanceof Error?k.message:"Failed to load providers")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{y()},[y]);const S=async k=>{p(k),x(j=>({...j,[k]:""})),d(null);try{const j=await n(`${r}/api/providers/${k}/connect`,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!j.ok)throw new Error("Failed to connect provider");const N=await j.json();N.authorizationUrl&&x(D=>({...D,[k]:N.authorizationUrl}))}catch(j){d(j instanceof Error?j.message:"Failed to connect provider"),x(N=>({...N,[k]:""}))}finally{p(null)}},b=async k=>{d(null);try{if(!(await n(`${r}/api/providers/${k}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}})).ok)throw new Error("Failed to disconnect provider");await y()}catch(j){d(j instanceof Error?j.message:"Failed to disconnect provider")}},_=async(k,j)=>{try{await navigator.clipboard.writeText(k),C(j),setTimeout(()=>C(null),2e3)}catch{}};return c?h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect subscription-based providers using OAuth. No API keys needed."}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),i.length===0?h.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No OAuth providers available."}):h.jsx("div",{className:"flex flex-col gap-3",children:i.map(k=>h.jsxs("div",{className:"rounded-lg border p-3 sm:p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`size-2 rounded-full ${k.connected?"bg-green-500":"bg-muted-foreground"}`}),h.jsx("span",{className:"text-sm font-medium",children:k.displayName||k.provider})]}),k.connected&&h.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),k.error&&h.jsx("p",{className:"text-xs text-destructive",children:k.error}),k.connected&&k.connectedAt&&h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Connected ",new Date(k.connectedAt).toLocaleDateString()]}),h.jsxs("div",{className:"flex gap-2",children:[!k.connected&&!g[k.provider]&&h.jsxs(Te,{size:"sm",onClick:()=>S(k.provider),disabled:m===k.provider,children:[m===k.provider?h.jsx(Wt,{className:"size-3 animate-spin"}):null,"Connect"]}),k.connected&&h.jsxs(Te,{variant:"destructive",size:"sm",onClick:()=>b(k.provider),children:[h.jsx(BN,{className:"size-3"}),h.jsx("span",{className:"hidden sm:inline",children:"Disconnect"})]})]}),!k.connected&&g[k.provider]&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-xs text-muted-foreground",children:"Open this URL in your browser to complete the connection:"}),h.jsx("div",{className:"rounded-md bg-muted p-2",children:h.jsx("a",{href:g[k.provider],target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs text-blue-500 underline break-all",children:g[k.provider]})}),h.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>_(g[k.provider],k.provider),children:[w===k.provider?h.jsx(Vn,{className:"size-3"}):h.jsx(bc,{className:"size-3"}),w===k.provider?"Copied":"Copy URL"]})]})]},k.provider))})]})}function Td(t){const e=he.c(11);let n,r,i;e[0]!==t?({className:n,size:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const l=i===void 0?"default":i;let c;e[4]!==n?(c=Ne("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",n),e[4]=n,e[5]=c):c=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx(GM,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"}),e[6]=a):a=e[6];let u;return e[7]!==r||e[8]!==l||e[9]!==c?(u=h.jsx(WM,{"data-slot":"switch","data-size":l,className:c,...r,children:a}),e[7]=r,e[8]=l,e[9]=c,e[10]=u):u=e[10],u}function XL(t){const e=he.c(9),{tier:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={variant:"secondary",icon:h.jsx("span",{className:"text-[10px] font-bold",children:"B"})},e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={variant:"default",icon:h.jsx("span",{className:"text-[10px] font-bold",children:"S"})},e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l={budget:r,standard:i,premium:{variant:"outline",icon:h.jsx(_c,{className:"size-2.5"})}},e[2]=l):l=e[2];const c=l,{variant:a,icon:u}=c[n];let d;e[3]!==n?(d=h.jsx("span",{className:"hidden sm:inline",children:n}),e[3]=n,e[4]=d):d=e[4];let m;return e[5]!==u||e[6]!==d||e[7]!==a?(m=h.jsxs(Ft,{variant:a,className:"text-[10px] gap-0.5",children:[u,d]}),e[5]=u,e[6]=d,e[7]=a,e[8]=m):m=e[8],m}function QL(t){const e=he.c(3),{status:n}=t;if(n.usable){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsxs(Ft,{variant:"default",className:"bg-emerald-500/20 text-emerald-600 dark:text-emerald-400 border-emerald-500/30 text-[10px]",children:[h.jsx(Vn,{className:"size-2.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Usable"})]}),e[0]=i):i=e[0],i}if(n.providerSupported&&!n.providerConfigured){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsxs(Ft,{variant:"secondary",className:"text-[10px]",children:[h.jsx(To,{className:"size-2.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Needs config"})]}),e[1]=i):i=e[1],i}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsxs(Ft,{variant:"outline",className:"text-[10px] text-muted-foreground",children:[h.jsx(zn,{className:"size-2.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Unsupported"})]}),e[2]=r):r=e[2],r}const Wx={id:"",name:""},Gx={id:"",name:"",contextWindow:128e3,maxOutputTokens:void 0,tier:"standard"};function ZL({serverUrl:t,apiToken:e}){var oe,me,Ee,Ie,Fe,Ge,Ze,lt,ze,qe,Pe,nt,kt,mn,gn,Zt,rn,Jt;const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState(null),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,x]=R.useState(!1),[w,C]=R.useState(Wx),[y,S]=R.useState(!1),[b,_]=R.useState(null),[k,j]=R.useState(!1),[N,D]=R.useState(null),[E,O]=R.useState(null),[L,z]=R.useState(Gx),[H,$]=R.useState(!1),[q,G]=R.useState(null),[W,X]=R.useState(!1),[Y,I]=R.useState({}),[M,P]=R.useState(!1),[B,F]=R.useState({defaultProvider:"",defaultModel:""}),[Q,J]=R.useState(!1);function ee(ve,He,et){var ot;const Me={...(ot=ve.capabilities)==null?void 0:ot.input};Me[He]=et;const Oe=Me.text||Me.image||Me.video||Array.isArray(Me.file)&&Me.file.length>0;return{...ve,capabilities:Oe?{input:Me}:void 0}}function K(ve,He){var ot;const et=He.trim()?He.split(",").map(Tt=>Tt.trim()).filter(Boolean):void 0,Me={...(ot=ve.capabilities)==null?void 0:ot.input,file:et},Oe=Me.text||Me.image||Me.video||Array.isArray(Me.file)&&Me.file.length>0;return{...ve,capabilities:Oe?{input:Me}:void 0}}const V=()=>{const ve={...L.variants||{}};let He="new",et=1;for(;ve[He];)He=`new-${et++}`;ve[He]={providerOptions:{}},z(Me=>({...Me,variants:ve}))},te=ve=>{const He={...L.variants||{}};delete He[ve];const et=Object.keys(He);z(Me=>({...Me,variants:et.length>0?He:void 0}))},re=(ve,He)=>{if(ve===He)return;const et={...L.variants||{}};if(et[He]&&He!==ve)return;const Me=et[ve];delete et[ve],et[He]=Me,z(Oe=>({...Oe,variants:Object.keys(et).length>0?et:void 0}))},ae=(ve,He)=>{try{const et=JSON.parse(He);if(typeof et!="object"||Array.isArray(et)){I(Oe=>({...Oe,[ve]:!0}));return}const Me={...L.variants||{}};Me[ve]={providerOptions:et},z(Oe=>({...Oe,variants:Me})),I(Oe=>({...Oe,[ve]:!1}))}catch{I(et=>({...et,[ve]:!0}))}},[se,Se]=R.useState(new Set),Ae=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const ve=await n(`${r}/api/config/models`,{headers:{Authorization:`Bearer ${e}`}});if(!ve.ok)throw new Error("Failed to load models config");const He=await ve.json();l(He),F({defaultProvider:He.defaultProvider,defaultModel:He.defaultModel})}catch(ve){d(ve instanceof Error?ve.message:"Failed to load models config")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{Ae()},[Ae]);const De=()=>{x(!0),p(null),C(Wx)},Ue=ve=>{p(ve.id),x(!1),C({id:ve.id,name:ve.name})},ce=async()=>{if(!(!w.id.trim()||!w.name.trim())){S(!0),d(null);try{const ve=g?`${r}/api/config/models/providers`:`${r}/api/config/models/providers/${m}`,He=g?"POST":"PUT",et=g?{id:w.id.trim(),name:w.name.trim()}:{name:w.name.trim()},Me=await n(ve,{method:He,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(et)});if(!Me.ok){const Oe=await Me.json().catch(()=>({}));throw new Error(Oe.message||"Failed to save provider")}x(!1),p(null),await Ae()}catch(ve){d(ve instanceof Error?ve.message:"Failed to save provider")}finally{S(!1)}}},je=async()=>{if(b){j(!0),d(null);try{const ve=await n(`${r}/api/config/models/providers/${b}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!ve.ok){const He=await ve.json().catch(()=>({}));throw new Error(He.message||"Failed to delete provider")}_(null),await Ae()}catch(ve){d(ve instanceof Error?ve.message:"Failed to delete provider")}finally{j(!1)}}},xe=ve=>{O(ve),D(null),z(Gx),I({})},Ve=ve=>{D({providerId:ve.providerId,modelId:ve.id}),O(null),z({id:ve.id,name:ve.name,contextWindow:ve.contextWindow,maxOutputTokens:ve.maxOutputTokens,tier:ve.tier,variants:ve.variants,capabilities:ve.capabilities}),I({})},We=async ve=>{if(!(!L.id.trim()||!L.name.trim())){$(!0),d(null);try{const He=E?`${r}/api/config/models/providers/${ve}/models`:`${r}/api/config/models/providers/${ve}/models/${N==null?void 0:N.modelId}`,et=E?"POST":"PUT",Me={...E?{id:L.id.trim()}:{},name:L.name.trim(),contextWindow:L.contextWindow,maxOutputTokens:L.maxOutputTokens,tier:L.tier,variants:L.variants,capabilities:L.capabilities},Oe=await n(He,{method:et,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(Me)});if(!Oe.ok){const ot=await Oe.json().catch(()=>({}));throw new Error(ot.message||"Failed to save model")}O(null),D(null),await Ae()}catch(He){d(He instanceof Error?He.message:"Failed to save model")}finally{$(!1)}}},it=async()=>{if(q){X(!0),d(null);try{const ve=await n(`${r}/api/config/models/providers/${q.providerId}/models/${q.modelId}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!ve.ok){const He=await ve.json().catch(()=>({}));throw new Error(He.message||"Failed to delete model")}G(null),await Ae()}catch(ve){d(ve instanceof Error?ve.message:"Failed to delete model")}finally{X(!1)}}},ge=async()=>{J(!0),d(null);try{const ve=await n(`${r}/api/config/models/defaults`,{method:"PUT",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({defaultProvider:B.defaultProvider,defaultModel:B.defaultModel})});if(!ve.ok){const He=await ve.json().catch(()=>({}));throw new Error(He.message||"Failed to save defaults")}P(!1),await Ae()}catch(ve){d(ve instanceof Error?ve.message:"Failed to save defaults")}finally{J(!1)}},Re=ve=>{Se(He=>{const et=new Set(He);return et.has(ve)?et.delete(ve):et.add(ve),et})},be=[];if(i==null||i.providers.forEach(ve=>{ve.models.forEach(He=>{be.push({providerId:ve.id,providerName:ve.name,modelId:He.id,modelName:He.name})})}),c)return h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})});if(g||m){const ve=i==null?void 0:i.providers.find(He=>He.id===m);return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-medium",children:g?"New Provider":`Edit: ${(ve==null?void 0:ve.name)||m}`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Te,{size:"sm",onClick:ce,disabled:y||!w.id.trim()||!w.name.trim(),children:[y?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Vn,{className:"size-3"}),"Save"]}),h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>{x(!1),p(null)},children:h.jsx(zn,{className:"size-3"})})]})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Provider ID"}),h.jsx(an,{value:w.id,onChange:He=>C(et=>({...et,id:He.target.value})),disabled:!g,placeholder:"e.g., openai",className:"mt-1 font-mono"}),!g&&h.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"ID cannot be changed"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Name"}),h.jsx(an,{value:w.name,onChange:He=>C(et=>({...et,name:He.target.value})),placeholder:"e.g., OpenAI",className:"mt-1"})]})]})]})}if(E||N){const ve=E||(N==null?void 0:N.providerId)||"",He=i==null?void 0:i.providers.find(Me=>Me.id===ve),et=!E&&N?He==null?void 0:He.models.find(Me=>Me.id===N.modelId):null;return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-medium",children:E?`New Model (${(He==null?void 0:He.name)||ve})`:`Edit: ${(et==null?void 0:et.name)||(N==null?void 0:N.modelId)}`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Te,{size:"sm",onClick:()=>We(ve),disabled:H||!L.id.trim()||!L.name.trim()||Object.values(Y).some(Boolean),children:[H?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Vn,{className:"size-3"}),"Save"]}),h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>{O(null),D(null)},children:h.jsx(zn,{className:"size-3"})})]})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Model ID"}),h.jsx(an,{value:L.id,onChange:Me=>z(Oe=>({...Oe,id:Me.target.value})),disabled:!E,placeholder:"e.g., gpt-4o",className:"mt-1 font-mono"}),!E&&h.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"ID cannot be changed"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Display Name"}),h.jsx(an,{value:L.name,onChange:Me=>z(Oe=>({...Oe,name:Me.target.value})),placeholder:"e.g., GPT-4o",className:"mt-1"})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Context Window"}),h.jsx(an,{type:"number",value:L.contextWindow,onChange:Me=>z(Oe=>({...Oe,contextWindow:parseInt(Me.target.value)||0})),min:1,className:"mt-1"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Max Output Tokens"}),h.jsx(an,{type:"number",value:(oe=L.maxOutputTokens)!=null?oe:"",onChange:Me=>z(Oe=>({...Oe,maxOutputTokens:Me.target.value?parseInt(Me.target.value):void 0})),min:1,placeholder:"Optional",className:"mt-1"})]})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Tier"}),h.jsxs("select",{value:L.tier,onChange:Me=>z(Oe=>({...Oe,tier:Me.target.value})),className:"mt-1 h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm",children:[h.jsx("option",{value:"budget",children:"Budget"}),h.jsx("option",{value:"standard",children:"Standard"}),h.jsx("option",{value:"premium",children:"Premium"})]})]}),h.jsx(_n,{className:"my-2"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(xt,{className:"text-xs font-medium",children:"Capabilities"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[h.jsx(Td,{checked:(Ie=(Ee=(me=L.capabilities)==null?void 0:me.input)==null?void 0:Ee.text)!=null?Ie:!1,onCheckedChange:Me=>z(Oe=>ee(Oe,"text",Me))}),h.jsx("span",{className:"text-xs",children:"Text"})]}),h.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[h.jsx(Td,{checked:(Ze=(Ge=(Fe=L.capabilities)==null?void 0:Fe.input)==null?void 0:Ge.image)!=null?Ze:!1,onCheckedChange:Me=>z(Oe=>ee(Oe,"image",Me))}),h.jsx("span",{className:"text-xs",children:"Image"})]}),h.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[h.jsx(Td,{checked:(qe=(ze=(lt=L.capabilities)==null?void 0:lt.input)==null?void 0:ze.video)!=null?qe:!1,onCheckedChange:Me=>z(Oe=>ee(Oe,"video",Me))}),h.jsx("span",{className:"text-xs",children:"Video"})]})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"File Types (MIME, comma-separated)"}),h.jsx(an,{value:(mn=(kt=(nt=(Pe=L.capabilities)==null?void 0:Pe.input)==null?void 0:nt.file)==null?void 0:kt.join(", "))!=null?mn:"",onChange:Me=>z(Oe=>K(Oe,Me.target.value)),placeholder:"e.g., application/pdf, text/csv",className:"mt-1 font-mono text-xs"})]})]}),h.jsx(_n,{className:"my-2"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(xt,{className:"text-xs font-medium",children:"Variants"}),h.jsxs(Te,{type:"button",size:"sm",variant:"ghost",onClick:V,children:[h.jsx(Qr,{className:"size-3"}),"Add Variant"]})]}),L.variants&&Object.keys(L.variants).length>0?h.jsx("div",{className:"space-y-2",children:Object.entries(L.variants).map(([Me,Oe])=>h.jsxs("div",{className:"border rounded p-2 space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(an,{value:Me,onChange:ot=>re(Me,ot.target.value),placeholder:"variant name",className:"h-7 text-xs font-mono w-24"}),h.jsx("div",{className:"flex-1"}),h.jsx(Te,{type:"button",size:"icon-xs",variant:"ghost",onClick:()=>te(Me),children:h.jsx(Br,{className:"size-3"})})]}),h.jsx(Rk,{value:JSON.stringify(Oe.providerOptions,null,2),onChange:ot=>ae(Me,ot.target.value),placeholder:"{}",className:"font-mono text-xs min-h-[60px]",rows:3}),Y[Me]&&h.jsx("p",{className:"text-[10px] text-destructive",children:"Invalid JSON"})]},Me))}):h.jsx("p",{className:"text-xs text-muted-foreground",children:"No variants configured"})]})]})]})}return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"border rounded-lg p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[h.jsx(wS,{className:"size-4"}),"Default Model"]}),h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>P(!M),children:M?h.jsx(zn,{className:"size-3"}):h.jsx(za,{className:"size-3"})})]}),M?h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Default Provider"}),h.jsxs("select",{value:B.defaultProvider,onChange:ve=>F(He=>({...He,defaultProvider:ve.target.value,defaultModel:""})),className:"mt-1 h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm",children:[h.jsx("option",{value:"",children:"Select provider..."}),i==null?void 0:i.providers.map(ve=>h.jsx("option",{value:ve.id,children:ve.name},ve.id))]})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-xs",children:"Default Model"}),h.jsxs("select",{value:B.defaultModel,onChange:ve=>F(He=>({...He,defaultModel:ve.target.value})),className:"mt-1 h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm",children:[h.jsx("option",{value:"",children:"Select model..."}),(gn=i==null?void 0:i.providers.find(ve=>ve.id===B.defaultProvider))==null?void 0:gn.models.map(ve=>h.jsx("option",{value:ve.id,children:ve.name},ve.id))]})]}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx(Te,{size:"sm",variant:"ghost",onClick:()=>P(!1),children:"Cancel"}),h.jsxs(Te,{size:"sm",onClick:ge,disabled:Q||!B.defaultProvider||!B.defaultModel,children:[Q?h.jsx(Wt,{className:"size-3 animate-spin"}):h.jsx(Vn,{className:"size-3"}),"Save"]})]})]}):h.jsx("div",{className:"text-sm text-muted-foreground",children:i!=null&&i.defaultProvider&&(i!=null&&i.defaultModel)?h.jsxs("span",{children:[((Zt=i.providers.find(ve=>ve.id===i.defaultProvider))==null?void 0:Zt.name)||i.defaultProvider," /"," ",((Jt=(rn=i.providers.find(ve=>ve.id===i.defaultProvider))==null?void 0:rn.models.find(ve=>ve.id===i.defaultModel))==null?void 0:Jt.name)||i.defaultModel]}):h.jsx("span",{className:"italic",children:"Not configured"})})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-sm text-muted-foreground",children:[(i==null?void 0:i.providers.length)||0," provider",((i==null?void 0:i.providers.length)||0)!==1?"s":""]}),h.jsxs(Te,{size:"sm",onClick:De,children:[h.jsx(Qr,{className:"size-3"}),h.jsx("span",{className:"hidden sm:inline",children:"Add Provider"})]})]}),(i==null?void 0:i.providers.length)===0?h.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No providers configured. Add one to get started."}):h.jsx("div",{className:"space-y-2",children:i==null?void 0:i.providers.map(ve=>{const He=se.has(ve.id),et=ve.id===i.defaultProvider;return h.jsxs(Ks,{open:!He,onOpenChange:()=>Re(ve.id),className:"border rounded-lg",children:[h.jsxs("div",{className:"flex items-center justify-between w-full px-3 py-2 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>Re(ve.id),children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx(Hr,{className:`size-4 transition-transform ${He?"":"rotate-90"}`}),h.jsx("span",{className:"text-sm font-medium truncate",children:ve.name}),h.jsxs(Ft,{variant:"secondary",className:"text-[10px] shrink-0",children:[ve.models.length," model",ve.models.length!==1?"s":""]}),et&&h.jsx(Ft,{variant:"outline",className:"text-[10px] shrink-0",children:"Default"})]}),h.jsxs("div",{className:"flex items-center gap-1 shrink-0",onClick:Me=>Me.stopPropagation(),children:[h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>xe(ve.id),title:"Add model",children:h.jsx(Qr,{className:"size-3"})}),h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>Ue(ve),title:"Edit provider",children:h.jsx(za,{className:"size-3"})}),h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>_(ve.id),title:"Delete provider",children:h.jsx(Br,{className:"size-3"})})]})]}),h.jsx(Ys,{children:h.jsx("div",{className:"border-t px-3 py-2 space-y-1 bg-muted/30",children:ve.models.length===0?h.jsx("div",{className:"text-sm text-muted-foreground py-2 pl-6",children:"No models. Add one to get started."}):ve.models.map(Me=>{var ot,Tt,Gt,Kt,lr,An,vn,Nn;const Oe=Me.id===i.defaultModel&&Me.providerId===i.defaultProvider;return h.jsxs("div",{className:"flex items-center justify-between py-1.5 pl-6 pr-2 rounded hover:bg-background",children:[h.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("span",{className:"text-sm truncate",children:Me.name}),h.jsx(XL,{tier:Me.tier}),h.jsx(QL,{status:Me.runtimeStatus}),Oe&&h.jsxs(Ft,{variant:"outline",className:"text-[10px]",children:[h.jsx(_c,{className:"size-2.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Default"})]})]}),h.jsxs("div",{className:"hidden sm:flex items-center gap-2",children:[h.jsx("code",{className:"text-[10px] text-muted-foreground bg-muted px-1 rounded",children:Me.id}),((Tt=(ot=Me.capabilities)==null?void 0:ot.input)==null?void 0:Tt.text)&&h.jsx(Ft,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:"Text"}),((Kt=(Gt=Me.capabilities)==null?void 0:Gt.input)==null?void 0:Kt.image)&&h.jsx(Ft,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:"Image"}),((An=(lr=Me.capabilities)==null?void 0:lr.input)==null?void 0:An.video)&&h.jsx(Ft,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:"Video"}),((Nn=(vn=Me.capabilities)==null?void 0:vn.input)==null?void 0:Nn.file)&&Me.capabilities.input.file.length>0&&h.jsxs(Ft,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:["Files (",Me.capabilities.input.file.length,")"]}),Me.variants&&Object.keys(Me.variants).length>0&&h.jsxs(Ft,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:[Object.keys(Me.variants).length," variant",Object.keys(Me.variants).length!==1?"s":""]})]})]}),h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>Ve(Me),title:"Edit model",children:h.jsx(za,{className:"size-2.5"})}),h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>G({providerId:Me.providerId,modelId:Me.id}),title:"Delete model",children:h.jsx(Br,{className:"size-2.5"})})]})]},Me.id)})})})]},ve.id)})}),h.jsx(jc,{open:b!==null,onOpenChange:ve=>{ve||_(null)},title:"Delete Provider",description:`Are you sure you want to delete "${b}"? All models under this provider will be removed.${(i==null?void 0:i.defaultProvider)===b?" Warning: This is the current default provider.":""}`,confirmLabel:"Delete",variant:"destructive",onConfirm:je}),h.jsx(jc,{open:q!==null,onOpenChange:ve=>{ve||G(null)},title:"Delete Model",description:`Are you sure you want to delete "${q==null?void 0:q.modelId}"?${(i==null?void 0:i.defaultModel)===(q==null?void 0:q.modelId)&&(i==null?void 0:i.defaultProvider)===(q==null?void 0:q.providerId)?" Warning: This is the current default model.":""}`,confirmLabel:"Delete",variant:"destructive",onConfirm:it})]})}function JL({serverUrl:t,apiToken:e}){const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState([]),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,x]=R.useState(!1),[w,C]=R.useState(""),[y,S]=R.useState(""),[b,_]=R.useState(!1),[k,j]=R.useState(null),N=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const H=await n(`${r}/api/config/prompts`,{headers:{Authorization:`Bearer ${e}`}});if(!H.ok)throw new Error("Failed to load prompts");const $=await H.json();l($.prompts)}catch(H){d(H instanceof Error?H.message:"Failed to load prompts")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{N()},[N]);const D=()=>{x(!0),p(null),C(""),S(`# New Prompt
|
|
570
|
-
|
|
571
|
-
`)},E=H=>{p(H),x(!1),C(H.name),S(H.content)},O=async()=>{if(w.trim()){_(!0),d(null);try{if(g){const H=await n(`${r}/api/config/prompts`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({name:w.trim(),content:y})});if(!H.ok){const $=await H.json().catch(()=>({}));throw new Error($.message||"Failed to create prompt")}}else if(m){const H=await n(`${r}/api/config/prompts/${m.name}`,{method:"PUT",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({content:y})});if(!H.ok){const $=await H.json().catch(()=>({}));throw new Error($.message||"Failed to update prompt")}}x(!1),p(null),await N()}catch(H){d(H instanceof Error?H.message:"Failed to save prompt")}finally{_(!1)}}},L=async()=>{if(k)try{const H=await n(`${r}/api/config/prompts/${k}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!H.ok){const $=await H.json().catch(()=>({}));throw new Error($.message||"Failed to delete prompt")}j(null),await N()}catch(H){d(H instanceof Error?H.message:"Failed to delete prompt")}},z=()=>{x(!1),p(null),C(""),S("")};return g||m?h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Te,{variant:"ghost",size:"icon",onClick:z,children:h.jsx(Fg,{className:"size-4"})}),h.jsx("h3",{className:"text-sm font-medium",children:g?"New Prompt":`Edit: ${m==null?void 0:m.name}`})]}),h.jsx(Te,{size:"sm",onClick:O,disabled:b||!w.trim(),children:b?h.jsx(Wt,{className:"size-3 animate-spin"}):"Save"})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Name"}),h.jsx(an,{value:w,onChange:H=>C(H.target.value),disabled:!g,placeholder:"prompt-name",className:"font-mono"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Content (Markdown)"}),h.jsx("textarea",{value:y,onChange:H=>S(H.target.value),className:"w-full h-64 p-3 rounded-lg border bg-background font-mono text-sm resize-y",placeholder:"# Prompt Title\\n\\nPrompt content here..."})]})]}):c?h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.length," prompt",i.length!==1?"s":""]}),h.jsxs(Te,{size:"sm",onClick:D,children:[h.jsx(Qr,{className:"size-3","data-icon":"inline-start"}),"New Prompt"]})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),i.length===0?h.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No prompts yet. Create one to get started."}):h.jsx("div",{className:"space-y-2",children:i.map(H=>h.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover:bg-muted/50 cursor-pointer",onClick:()=>E(H),children:[h.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[h.jsx(Oc,{className:"size-4 text-muted-foreground shrink-0"}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm font-medium truncate",children:H.name}),H.description&&h.jsx("div",{className:"text-xs text-muted-foreground truncate",children:H.description})]})]}),h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsx(Te,{size:"icon",variant:"ghost",className:"size-8",onClick:$=>{$.stopPropagation(),E(H)},children:h.jsx(za,{className:"size-3"})}),h.jsx(Te,{size:"icon",variant:"ghost",className:"size-8",onClick:$=>{$.stopPropagation(),j(H.name)},children:h.jsx(Br,{className:"size-3"})})]})]},H.name))}),h.jsx(jc,{open:k!==null,onOpenChange:H=>{H||j(null)},title:"Delete Prompt",description:`Are you sure you want to delete the prompt "${k}"? This cannot be undone.`,confirmLabel:"Delete",variant:"destructive",onConfirm:L})]})}const e7=[{value:"primary",label:"Primary"},{value:"subagent",label:"Subagent"},{value:"both",label:"Both"}],Dm={name:"",description:"",systemPrompt:"",mode:"primary",model:"",provider:"",variant:"",tools:[],settings:"",canSpawnSubagentsMode:"none",canSpawnSubagentsList:[],skills:[],isDefault:!1};function t7({serverUrl:t,apiToken:e}){const{fetchWithAuth:n}=ns(),r=t?Xn(t,""):"",[i,l]=R.useState([]),[c,a]=R.useState(!0),[u,d]=R.useState(null),[m,p]=R.useState(null),[g,x]=R.useState(!1),[w,C]=R.useState(Dm),[y,S]=R.useState(!1),[b,_]=R.useState(null),[k,j]=R.useState(!1),[N,D]=R.useState([]),[E,O]=R.useState(""),[L,z]=R.useState(""),[H,$]=R.useState(""),q=R.useCallback(async()=>{if(!(!e||!r)){a(!0),d(null);try{const M=await n(`${r}/api/preconfigs`,{headers:{Authorization:`Bearer ${e}`}});if(!M.ok)throw new Error("Failed to load preconfigs");const P=await M.json();l(P.preconfigs)}catch(M){d(M instanceof Error?M.message:"Failed to load preconfigs")}finally{a(!1)}}},[n,r,e]);R.useEffect(()=>{q()},[q]),R.useEffect(()=>{!e||!r||n(`${r}/api/tools`,{headers:{Authorization:`Bearer ${e}`}}).then(M=>M.json()).then(M=>D(M.tools||[])).catch(()=>{})},[n,r,e]);const G=()=>{x(!0),p(null),C(Dm),O(""),z(""),$("")},W=M=>{var P,B;p(M),x(!1),C({name:M.name,description:M.description||"",systemPrompt:M.systemPrompt||"",mode:M.mode||"primary",model:M.model||"",provider:M.provider||"",variant:M.variant||"",tools:(P=M.tools)!=null?P:[],settings:M.settings?JSON.stringify(M.settings,null,2):"",canSpawnSubagentsMode:M.canSpawnSubagents===!0?"all":M.canSpawnSubagents===!1||M.canSpawnSubagents===null||M.canSpawnSubagents===void 0?"none":"specific",canSpawnSubagentsList:Array.isArray(M.canSpawnSubagents)?M.canSpawnSubagents:[],skills:(B=M.skills)!=null?B:[],isDefault:M.isDefault}),O(""),z(""),$("")},X=async()=>{if(w.name.trim()){S(!0),d(null);try{let M=null;if(w.settings.trim())try{const F=JSON.parse(w.settings);if(typeof F=="object"&&!Array.isArray(F))M=F;else throw new Error("Settings must be a JSON object")}catch(F){d(F instanceof Error?F.message:"Invalid settings JSON"),S(!1);return}let P=null;w.canSpawnSubagentsMode==="all"?P=!0:w.canSpawnSubagentsMode==="specific"?P=w.canSpawnSubagentsList.length>0?w.canSpawnSubagentsList:[]:P=!1;const B={name:w.name.trim(),description:w.description.trim(),systemPrompt:w.systemPrompt,mode:w.mode,model:w.model.trim()||null,provider:w.provider.trim()||null,variant:w.variant.trim()||null,tools:w.tools.length>0?w.tools:null,settings:M,canSpawnSubagents:P,skills:w.skills.length>0?w.skills:null,isDefault:w.isDefault,format:"md"};if(g){const F=await n(`${r}/api/preconfigs`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(B)});if(!F.ok){const Q=await F.json().catch(()=>({}));throw new Error(Q.message||"Failed to create preconfig")}}else if(m){const F=await n(`${r}/api/preconfigs/${m.id}`,{method:"PUT",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(B)});if(!F.ok){const Q=await F.json().catch(()=>({}));throw new Error(Q.message||"Failed to update preconfig")}}x(!1),p(null),await q()}catch(M){d(M instanceof Error?M.message:"Failed to save preconfig")}finally{S(!1)}}},Y=async()=>{if(b){j(!0);try{const M=await n(`${r}/api/preconfigs/${b}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!M.ok){const P=await M.json().catch(()=>({}));throw new Error(P.message||"Failed to delete preconfig")}_(null),await q()}catch(M){d(M instanceof Error?M.message:"Failed to delete preconfig")}finally{j(!1)}}},I=()=>{x(!1),p(null),C(Dm),O(""),z(""),$("")};return g||m?h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Te,{variant:"ghost",size:"icon",onClick:I,children:h.jsx(Fg,{className:"size-4"})}),h.jsx("h3",{className:"text-sm font-medium",children:g?"New Preconfig":`Edit: ${m==null?void 0:m.name}`})]}),h.jsx(Te,{size:"sm",onClick:X,disabled:y||!w.name.trim(),children:y?h.jsx(Wt,{className:"size-3 animate-spin"}):"Save"})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Name"}),h.jsx(an,{value:w.name,onChange:M=>C({...w,name:M.target.value}),placeholder:"My Agent"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Description"}),h.jsx(an,{value:w.description,onChange:M=>C({...w,description:M.target.value}),placeholder:"Description..."})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Mode"}),h.jsx("select",{value:w.mode,onChange:M=>C({...w,mode:M.target.value}),className:"w-full h-9 rounded-md border bg-background px-3 text-sm",children:e7.map(M=>h.jsx("option",{value:M.value,children:M.label},M.value))})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Model (optional)"}),h.jsx(an,{value:w.model,onChange:M=>C({...w,model:M.target.value}),placeholder:"gpt-4o",className:"font-mono"})]}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Provider (optional)"}),h.jsx(an,{value:w.provider,onChange:M=>C({...w,provider:M.target.value}),placeholder:"openai",className:"font-mono"})]})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Variant (optional)"}),h.jsx(an,{value:w.variant,onChange:M=>C({...w,variant:M.target.value}),placeholder:"e.g., low, medium, high",className:"font-mono"}),h.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Model variant key from models.json"})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"Default Preconfig"}),h.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Only one preconfig can be the default"})]}),h.jsx(Td,{checked:w.isDefault,onCheckedChange:M=>C({...w,isDefault:M})})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(xt,{className:"text-sm",children:"Tools"}),h.jsx("p",{className:"text-[10px] text-muted-foreground",children:w.tools.length===0?"No tools selected — all available tools will be enabled":`${w.tools.length} tool${w.tools.length!==1?"s":""} selected`}),N.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:N.map(M=>{const P=w.tools.includes(M.name);return h.jsxs("button",{type:"button",onClick:()=>{C(B=>({...B,tools:P?B.tools.filter(F=>F!==M.name):[...B.tools,M.name]}))},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs border transition-colors ${P?"bg-primary text-primary-foreground border-primary":"bg-background border-border hover:bg-muted"}`,title:M.description,children:[P&&h.jsx(Vn,{className:"size-2.5"}),M.name]},M.name)})}),h.jsx("div",{className:"flex gap-1.5",children:h.jsx(an,{value:E,onChange:M=>O(M.target.value),placeholder:"Add custom tool ID...",className:"h-7 text-xs font-mono",onKeyDown:M=>{if(M.key==="Enter"&&E.trim()){M.preventDefault();const P=E.trim();w.tools.includes(P)||C(B=>({...B,tools:[...B.tools,P]})),O("")}}})}),w.tools.filter(M=>!N.some(P=>P.name===M)).length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.tools.filter(M=>!N.some(P=>P.name===M)).map(M=>h.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs bg-primary/10 border border-primary/30",children:[M,h.jsx("button",{type:"button",onClick:()=>C(P=>({...P,tools:P.tools.filter(B=>B!==M)})),className:"hover:text-destructive",children:h.jsx(zn,{className:"size-2.5"})})]},M))})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(xt,{className:"text-sm",children:"Settings"}),h.jsx("p",{className:"text-[10px] text-muted-foreground",children:"JSON object for model parameters (e.g., temperature)"}),h.jsx("textarea",{value:w.settings,onChange:M=>C({...w,settings:M.target.value}),className:"w-full h-20 p-2 rounded-lg border bg-background text-sm font-mono resize-y",placeholder:'{"temperature": 0.2}'})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(xt,{className:"text-sm",children:"Can Spawn Subagents"}),h.jsxs("select",{value:w.canSpawnSubagentsMode,onChange:M=>C({...w,canSpawnSubagentsMode:M.target.value}),className:"w-full h-9 rounded-md border bg-background px-3 text-sm",children:[h.jsx("option",{value:"none",children:"No — cannot spawn subagents"}),h.jsx("option",{value:"all",children:"Yes — all available subagents"}),h.jsx("option",{value:"specific",children:"Specific — choose which subagents"})]}),w.canSpawnSubagentsMode==="specific"&&h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Enter preconfig IDs that this agent can spawn"}),h.jsx("div",{className:"flex gap-1.5",children:h.jsx(an,{value:L,onChange:M=>z(M.target.value),placeholder:"Preconfig ID...",className:"h-7 text-xs font-mono",onKeyDown:M=>{if(M.key==="Enter"&&L.trim()){M.preventDefault();const P=L.trim();w.canSpawnSubagentsList.includes(P)||C(B=>({...B,canSpawnSubagentsList:[...B.canSpawnSubagentsList,P]})),z("")}}})}),w.canSpawnSubagentsList.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.canSpawnSubagentsList.map(M=>h.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs bg-primary/10 border border-primary/30 font-mono",children:[M,h.jsx("button",{type:"button",onClick:()=>C(P=>({...P,canSpawnSubagentsList:P.canSpawnSubagentsList.filter(B=>B!==M)})),className:"hover:text-destructive",children:h.jsx(zn,{className:"size-2.5"})})]},M))})]})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(xt,{className:"text-sm",children:"Skills"}),h.jsx("p",{className:"text-[10px] text-muted-foreground",children:w.skills.length===0?"No skills selected — all available skills will be enabled":`${w.skills.length} skill${w.skills.length!==1?"s":""} selected`}),h.jsx("div",{className:"flex gap-1.5",children:h.jsx(an,{value:H,onChange:M=>$(M.target.value),placeholder:"Skill name...",className:"h-7 text-xs font-mono",onKeyDown:M=>{if(M.key==="Enter"&&H.trim()){M.preventDefault();const P=H.trim();w.skills.includes(P)||C(B=>({...B,skills:[...B.skills,P]})),$("")}}})}),w.skills.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.skills.map(M=>h.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs bg-primary/10 border border-primary/30",children:[M,h.jsx("button",{type:"button",onClick:()=>C(P=>({...P,skills:P.skills.filter(B=>B!==M)})),className:"hover:text-destructive",children:h.jsx(zn,{className:"size-2.5"})})]},M))})]}),h.jsx(_n,{className:"my-1"}),h.jsxs("div",{children:[h.jsx(xt,{className:"text-sm",children:"System Prompt"}),h.jsx("textarea",{value:w.systemPrompt,onChange:M=>C({...w,systemPrompt:M.target.value}),className:"w-full h-48 p-3 rounded-lg border bg-background text-sm resize-y",placeholder:"System prompt content..."})]})]})]}):c?h.jsx("div",{className:"flex items-center justify-center p-8",children:h.jsx(Wt,{className:"size-6 animate-spin text-muted-foreground"})}):h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.length," preconfig",i.length!==1?"s":""]}),h.jsxs(Te,{size:"sm",onClick:G,children:[h.jsx(Qr,{className:"size-3"}),h.jsx("span",{className:"hidden sm:inline",children:"New Preconfig"})]})]}),u&&h.jsx("div",{className:"p-2 rounded bg-destructive/10 text-sm text-destructive",children:u}),i.length===0?h.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No preconfigs yet. Create one to get started."}):h.jsx("div",{className:"space-y-2",children:i.map(M=>h.jsxs("div",{className:"flex items-center justify-between p-2.5 sm:p-3 rounded-lg border hover:bg-muted/50 cursor-pointer",onClick:()=>W(M),children:[h.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-1 min-w-0",children:[h.jsx(RS,{className:"size-4 text-muted-foreground shrink-0 hidden sm:block"}),h.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5 sm:gap-1 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 min-w-0",children:[h.jsx("span",{className:"text-sm font-medium truncate",children:M.name}),M.isDefault&&h.jsxs(Ft,{variant:"default",className:"text-[10px] px-1 sm:px-1.5 py-0",children:[h.jsx(_c,{className:"size-2.5 sm:mr-0.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Default"})]}),M.mode&&M.mode!=="primary"&&h.jsxs(Ft,{variant:"secondary",className:"text-[10px] px-1 sm:px-1.5 py-0",children:[h.jsx("span",{className:"hidden sm:inline",children:M.mode}),h.jsx("span",{className:"sm:hidden",children:M.mode==="subagent"?"SA":"B"})]})]}),M.description&&h.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:M.description})]})]}),h.jsxs("div",{className:"flex items-center gap-0.5 sm:gap-1 shrink-0",onClick:P=>P.stopPropagation(),children:[h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>W(M),title:"Edit preconfig",children:h.jsx(za,{className:"size-3"})}),!M.isDefault&&h.jsx(Te,{size:"icon-xs",variant:"ghost",onClick:()=>_(M.id),title:"Delete preconfig",children:h.jsx(Br,{className:"size-3"})})]})]},M.id))}),h.jsx(jc,{open:b!==null,onOpenChange:M=>{M||_(null)},title:"Delete Preconfig",description:"Are you sure you want to delete this preconfig? This cannot be undone.",confirmLabel:"Delete",variant:"destructive",onConfirm:Y})]})}function n7(t){const e=he.c(31),{open:n,onOpenChange:r,serverUrl:i,apiToken:l}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsxs(Xi,{children:[h.jsx(Qi,{children:"Configuration"}),h.jsx($o,{children:"Manage credentials, OAuth providers, models, prompts, and preconfigs"})]}),e[0]=c):c=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsxs($s,{value:"providers",children:[h.jsx(NS,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Credentials"})]}),e[1]=a):a=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsxs($s,{value:"oauth",children:[h.jsx(KA,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"OAuth"})]}),e[2]=u):u=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=h.jsxs($s,{value:"models",children:[h.jsx(wS,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Models"})]}),e[3]=d):d=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=h.jsxs($s,{value:"prompts",children:[h.jsx(Oc,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Prompts"})]}),e[4]=m):m=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsxs(Bk,{className:"grid w-full grid-cols-5",children:[a,u,d,m,h.jsxs($s,{value:"preconfigs",children:[h.jsx(RS,{className:"size-4","data-icon":"inline-start"}),h.jsx("span",{className:"hidden sm:inline",children:"Preconfigs"})]})]}),e[5]=p):p=e[5];let g;e[6]!==l||e[7]!==i?(g=h.jsx(Us,{value:"providers",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx(KL,{serverUrl:i,apiToken:l})})}),e[6]=l,e[7]=i,e[8]=g):g=e[8];let x;e[9]!==l||e[10]!==i?(x=h.jsx(Us,{value:"oauth",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx(YL,{serverUrl:i,apiToken:l})})}),e[9]=l,e[10]=i,e[11]=x):x=e[11];let w;e[12]!==l||e[13]!==i?(w=h.jsx(Us,{value:"models",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx(ZL,{serverUrl:i,apiToken:l})})}),e[12]=l,e[13]=i,e[14]=w):w=e[14];let C;e[15]!==l||e[16]!==i?(C=h.jsx(Us,{value:"prompts",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx(JL,{serverUrl:i,apiToken:l})})}),e[15]=l,e[16]=i,e[17]=C):C=e[17];let y;e[18]!==l||e[19]!==i?(y=h.jsx(Us,{value:"preconfigs",className:"mt-4",children:h.jsx(ds,{className:"h-[calc(100dvh-14rem)] sm:h-[500px]",children:h.jsx(t7,{serverUrl:i,apiToken:l})})}),e[18]=l,e[19]=i,e[20]=y):y=e[20];let S;e[21]!==C||e[22]!==y||e[23]!==g||e[24]!==x||e[25]!==w?(S=h.jsxs(Yi,{className:"max-w-[calc(100vw-1rem)] sm:max-w-[800px] max-h-[calc(100dvh-2rem)] sm:max-h-[85vh]",children:[c,h.jsxs(zk,{defaultValue:"providers",className:"mt-4",children:[p,g,x,w,C,y]})]}),e[21]=C,e[22]=y,e[23]=g,e[24]=x,e[25]=w,e[26]=S):S=e[26];let b;return e[27]!==r||e[28]!==n||e[29]!==S?(b=h.jsx(Ki,{open:n,onOpenChange:r,children:S}),e[27]=r,e[28]=n,e[29]=S,e[30]=b):b=e[30],b}function r7(t){const e=he.c(70),{open:n,onOpenChange:r,editServer:i}=t,{prepareForServerAdd:l,addServer:c,editServer:a}=Qa(),[u,d]=R.useState(""),[m,p]=R.useState(""),[g,x]=R.useState(""),[w,C]=R.useState(!1),[y,S]=R.useState(null),b=i!=null;let _;e[0]!==i?(_=()=>{i?(d(i.name),p(i.url),x(i.token)):(d(""),p("localhost:8742"),x("")),S(null),C(!1)},e[0]=i,e[1]=_):_=e[1];let k;e[2]!==i||e[3]!==n?(k=[i,n],e[2]=i,e[3]=n,e[4]=k):k=e[4],R.useEffect(_,k);let j;e[5]!==c||e[6]!==i||e[7]!==b||e[8]!==u||e[9]!==r||e[10]!==l||e[11]!==g||e[12]!==a||e[13]!==m?(j=De=>{De.preventDefault(),S(null);const Ue=u.trim(),ce=m.trim(),je=g.trim();if(!Ue){S("Name is required");return}if(!ce){S("Server URL is required");return}if(!je){S("API token is required");return}if(!xS(je)){S("Token must be 64 hexadecimal characters");return}const xe=Od(ce);b?a(i.id,{name:Ue,url:xe,token:je}):(l(),c(Ue,xe,je)),r(!1)},e[5]=c,e[6]=i,e[7]=b,e[8]=u,e[9]=r,e[10]=l,e[11]=g,e[12]=a,e[13]=m,e[14]=j):j=e[14];const N=j,D=b?"Edit Server":"Add Server";let E;e[15]!==D?(E=h.jsx(Qi,{children:D}),e[15]=D,e[16]=E):E=e[16];const O=b?"Update server details":"Enter your server details";let L;e[17]!==O?(L=h.jsx($o,{children:O}),e[17]=O,e[18]=L):L=e[18];let z;e[19]!==E||e[20]!==L?(z=h.jsxs(Xi,{children:[E,L]}),e[19]=E,e[20]=L,e[21]=z):z=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(xt,{htmlFor:"server-name",children:"Name"}),e[22]=H):H=e[22];let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=De=>d(De.target.value),e[23]=$):$=e[23];let q;e[24]!==u?(q=h.jsxs("div",{className:"grid gap-2",children:[H,h.jsx(an,{id:"server-name",value:u,onChange:$,placeholder:"My Server"})]}),e[24]=u,e[25]=q):q=e[25];let G;e[26]===Symbol.for("react.memo_cache_sentinel")?(G=h.jsx(xt,{htmlFor:"server-url",children:"Server URL"}),e[26]=G):G=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=De=>p(De.target.value),e[27]=W):W=e[27];let X;e[28]!==m?(X=h.jsxs("div",{className:"grid gap-2",children:[G,h.jsx(an,{id:"server-url",value:m,onChange:W,placeholder:"localhost:8742"})]}),e[28]=m,e[29]=X):X=e[29];let Y;e[30]===Symbol.for("react.memo_cache_sentinel")?(Y=h.jsx(xt,{htmlFor:"server-token",children:"API Token"}),e[30]=Y):Y=e[30];const I=w?"text":"password";let M;e[31]===Symbol.for("react.memo_cache_sentinel")?(M=De=>x(De.target.value),e[31]=M):M=e[31];let P;e[32]!==I||e[33]!==g?(P=h.jsx(an,{id:"server-token",type:I,value:g,onChange:M,placeholder:"64-character hex string",className:"pr-10"}),e[32]=I,e[33]=g,e[34]=P):P=e[34];let B;e[35]!==w?(B=()=>C(!w),e[35]=w,e[36]=B):B=e[36];let F;e[37]!==w?(F=w?h.jsx(AS,{className:"size-4 text-muted-foreground"}):h.jsx(Hg,{className:"size-4 text-muted-foreground"}),e[37]=w,e[38]=F):F=e[38];let Q;e[39]!==B||e[40]!==F?(Q=h.jsx("button",{type:"button",onClick:B,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-transparent",children:F}),e[39]=B,e[40]=F,e[41]=Q):Q=e[41];let J;e[42]!==P||e[43]!==Q?(J=h.jsxs("div",{className:"grid gap-2",children:[Y,h.jsxs("div",{className:"relative",children:[P,Q]})]}),e[42]=P,e[43]=Q,e[44]=J):J=e[44];let ee;e[45]!==y?(ee=y&&h.jsx("p",{className:"text-sm text-destructive",children:y}),e[45]=y,e[46]=ee):ee=e[46];let K;e[47]!==q||e[48]!==X||e[49]!==J||e[50]!==ee?(K=h.jsxs("div",{className:"grid gap-4 py-4",children:[q,X,J,ee]}),e[47]=q,e[48]=X,e[49]=J,e[50]=ee,e[51]=K):K=e[51];let V;e[52]!==r?(V=h.jsx(Te,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e[52]=r,e[53]=V):V=e[53];const te=b?"Save":"Add";let re;e[54]!==te?(re=h.jsx(Te,{type:"submit",children:te}),e[54]=te,e[55]=re):re=e[55];let ae;e[56]!==V||e[57]!==re?(ae=h.jsxs(zf,{children:[V,re]}),e[56]=V,e[57]=re,e[58]=ae):ae=e[58];let se;e[59]!==N||e[60]!==K||e[61]!==ae?(se=h.jsxs("form",{onSubmit:N,children:[K,ae]}),e[59]=N,e[60]=K,e[61]=ae,e[62]=se):se=e[62];let Se;e[63]!==se||e[64]!==z?(Se=h.jsxs(Yi,{className:"sm:max-w-[425px]",children:[z,se]}),e[63]=se,e[64]=z,e[65]=Se):Se=e[65];let Ae;return e[66]!==r||e[67]!==n||e[68]!==Se?(Ae=h.jsx(Ki,{open:n,onOpenChange:r,children:Se}),e[66]=r,e[67]=n,e[68]=Se,e[69]=Ae):Ae=e[69],Ae}function s7(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const i7=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o7=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a7={};function Kx(t,e){return(a7.jsx?o7:i7).test(t)}const l7=/[ \t\n\f\r]/g;function c7(t){return typeof t=="object"?t.type==="text"?Yx(t.value):!1:Yx(t)}function Yx(t){return t.replace(l7,"")===""}class Kc{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Kc.prototype.normal={};Kc.prototype.property={};Kc.prototype.space=void 0;function qk(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Kc(n,r,e)}function kg(t){return t.toLowerCase()}class ar{constructor(e,n){this.attribute=n,this.property=e}}ar.prototype.attribute="";ar.prototype.booleanish=!1;ar.prototype.boolean=!1;ar.prototype.commaOrSpaceSeparated=!1;ar.prototype.commaSeparated=!1;ar.prototype.defined=!1;ar.prototype.mustUseProperty=!1;ar.prototype.number=!1;ar.prototype.overloadedBoolean=!1;ar.prototype.property="";ar.prototype.spaceSeparated=!1;ar.prototype.space=void 0;let u7=0;const dt=Vo(),pn=Vo(),Eg=Vo(),Le=Vo(),Vt=Vo(),$a=Vo(),xr=Vo();function Vo(){return 2**++u7}const Ag=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:pn,commaOrSpaceSeparated:xr,commaSeparated:$a,number:Le,overloadedBoolean:Eg,spaceSeparated:Vt},Symbol.toStringTag,{value:"Module"})),Mm=Object.keys(Ag);class Dv extends ar{constructor(e,n,r,i){let l=-1;if(super(e,n),Xx(this,"space",i),typeof r=="number")for(;++l<Mm.length;){const c=Mm[l];Xx(this,Mm[l],(r&Ag[c])===Ag[c])}}}Dv.prototype.defined=!0;function Xx(t,e,n){n&&(t[e]=n)}function al(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const l=new Dv(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),e[r]=l,n[kg(r)]=r,n[kg(l.attribute)]=r}return new Kc(e,n,t.space)}const Wk=al({properties:{ariaActiveDescendant:null,ariaAtomic:pn,ariaAutoComplete:null,ariaBusy:pn,ariaChecked:pn,ariaColCount:Le,ariaColIndex:Le,ariaColSpan:Le,ariaControls:Vt,ariaCurrent:null,ariaDescribedBy:Vt,ariaDetails:null,ariaDisabled:pn,ariaDropEffect:Vt,ariaErrorMessage:null,ariaExpanded:pn,ariaFlowTo:Vt,ariaGrabbed:pn,ariaHasPopup:null,ariaHidden:pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vt,ariaLevel:Le,ariaLive:null,ariaModal:pn,ariaMultiLine:pn,ariaMultiSelectable:pn,ariaOrientation:null,ariaOwns:Vt,ariaPlaceholder:null,ariaPosInSet:Le,ariaPressed:pn,ariaReadOnly:pn,ariaRelevant:null,ariaRequired:pn,ariaRoleDescription:Vt,ariaRowCount:Le,ariaRowIndex:Le,ariaRowSpan:Le,ariaSelected:pn,ariaSetSize:Le,ariaSort:null,ariaValueMax:Le,ariaValueMin:Le,ariaValueNow:Le,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Gk(t,e){return e in t?t[e]:e}function Kk(t,e){return Gk(t,e.toLowerCase())}const d7=al({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$a,acceptCharset:Vt,accessKey:Vt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Vt,autoFocus:dt,autoPlay:dt,blocking:Vt,capture:null,charSet:null,checked:dt,cite:null,className:Vt,cols:Le,colSpan:null,content:null,contentEditable:pn,controls:dt,controlsList:Vt,coords:Le|$a,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:Eg,draggable:pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Vt,height:Le,hidden:Eg,high:Le,href:null,hrefLang:null,htmlFor:Vt,httpEquiv:Vt,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Vt,itemRef:Vt,itemScope:dt,itemType:Vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:Le,manifest:null,max:null,maxLength:Le,media:null,method:null,min:null,minLength:Le,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dt,optimum:Le,pattern:null,ping:Vt,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Vt,required:dt,reversed:dt,rows:Le,rowSpan:Le,sandbox:Vt,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:Le,sizes:null,slot:null,span:Le,spellCheck:pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Le,step:null,style:null,tabIndex:Le,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:pn,width:Le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Vt,axis:null,background:null,bgColor:null,border:Le,borderColor:null,bottomMargin:Le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:Le,leftMargin:Le,link:null,longDesc:null,lowSrc:null,marginHeight:Le,marginWidth:Le,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:Le,rules:null,scheme:null,scrolling:pn,standby:null,summary:null,text:null,topMargin:Le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Le,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:Le,security:null,unselectable:null},space:"html",transform:Kk}),f7=al({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:xr,accentHeight:Le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Le,amplitude:Le,arabicForm:null,ascent:Le,attributeName:null,attributeType:null,azimuth:Le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Le,by:null,calcMode:null,capHeight:Le,className:Vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Le,diffuseConstant:Le,direction:null,display:null,dur:null,divisor:Le,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Le,enableBackground:null,end:null,event:null,exponent:Le,externalResourcesRequired:null,fill:null,fillOpacity:Le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$a,g2:$a,glyphName:$a,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Le,horizOriginX:Le,horizOriginY:Le,id:null,ideographic:Le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Le,k:Le,k1:Le,k2:Le,k3:Le,k4:Le,kernelMatrix:xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Le,overlineThickness:Le,paintOrder:null,panose1:null,path:null,pathLength:Le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Le,pointsAtY:Le,pointsAtZ:Le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xr,rev:xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xr,requiredFeatures:xr,requiredFonts:xr,requiredFormats:xr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Le,specularExponent:Le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Le,strikethroughThickness:Le,string:null,stroke:null,strokeDashArray:xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Le,strokeOpacity:Le,strokeWidth:null,style:null,surfaceScale:Le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xr,tabIndex:Le,tableValues:null,target:null,targetX:Le,targetY:Le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Le,underlineThickness:Le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Le,values:null,vAlphabetic:Le,vMathematical:Le,vectorEffect:null,vHanging:Le,vIdeographic:Le,version:null,vertAdvY:Le,vertOriginX:Le,vertOriginY:Le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gk}),Yk=al({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Xk=al({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Kk}),Qk=al({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),h7={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},p7=/[A-Z]/g,Qx=/-[a-z]/g,m7=/^data[-\w.:]+$/i;function g7(t,e){const n=kg(e);let r=e,i=ar;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&m7.test(e)){if(e.charAt(4)==="-"){const l=e.slice(5).replace(Qx,y7);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=e.slice(4);if(!Qx.test(l)){let c=l.replace(p7,v7);c.charAt(0)!=="-"&&(c="-"+c),e="data"+c}}i=Dv}return new i(r,e)}function v7(t){return"-"+t.toLowerCase()}function y7(t){return t.charAt(1).toUpperCase()}const b7=qk([Wk,d7,Yk,Xk,Qk],"html"),Mv=qk([Wk,f7,Yk,Xk,Qk],"svg");function x7(t){return t.join(" ").trim()}var Da={},Om,Zx;function _7(){if(Zx)return Om;Zx=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
572
|
-
`,d="/",m="*",p="",g="comment",x="declaration";function w(y,S){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];S=S||{};var b=1,_=1;function k(q){var G=q.match(e);G&&(b+=G.length);var W=q.lastIndexOf(u);_=~W?q.length-W:_+q.length}function j(){var q={line:b,column:_};return function(G){return G.position=new N(q),O(),G}}function N(q){this.start=q,this.end={line:b,column:_},this.source=S.source}N.prototype.content=y;function D(q){var G=new Error(S.source+":"+b+":"+_+": "+q);if(G.reason=q,G.filename=S.source,G.line=b,G.column=_,G.source=y,!S.silent)throw G}function E(q){var G=q.exec(y);if(G){var W=G[0];return k(W),y=y.slice(W.length),G}}function O(){E(n)}function L(q){var G;for(q=q||[];G=z();)G!==!1&&q.push(G);return q}function z(){var q=j();if(!(d!=y.charAt(0)||m!=y.charAt(1))){for(var G=2;p!=y.charAt(G)&&(m!=y.charAt(G)||d!=y.charAt(G+1));)++G;if(G+=2,p===y.charAt(G-1))return D("End of comment missing");var W=y.slice(2,G-2);return _+=2,k(W),y=y.slice(G),_+=2,q({type:g,comment:W})}}function H(){var q=j(),G=E(r);if(G){if(z(),!E(i))return D("property missing ':'");var W=E(l),X=q({type:x,property:C(G[0].replace(t,p)),value:W?C(W[0].replace(t,p)):p});return E(c),X}}function $(){var q=[];L(q);for(var G;G=H();)G!==!1&&(q.push(G),L(q));return q}return O(),$()}function C(y){return y?y.replace(a,p):p}return Om=w,Om}var Jx;function S7(){if(Jx)return Da;Jx=1;var t=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0}),Da.default=n;const e=t(_7());function n(r,i){let l=null;if(!r||typeof r!="string")return l;const c=(0,e.default)(r),a=typeof i=="function";return c.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:m}=u;a?i(d,m,u):m&&(l=l||{},l[d]=m)}),l}return Da}var lc={},e_;function w7(){if(e_)return lc;e_=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(d){return!d||n.test(d)||t.test(d)},c=function(d,m){return m.toUpperCase()},a=function(d,m){return"".concat(m,"-")},u=function(d,m){return m===void 0&&(m={}),l(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(i,a):d=d.replace(r,a),d.replace(e,c))};return lc.camelCase=u,lc}var cc,t_;function C7(){if(t_)return cc;t_=1;var t=cc&&cc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(S7()),n=w7();function r(i,l){var c={};return!i||typeof i!="string"||(0,e.default)(i,function(a,u){a&&u&&(c[(0,n.camelCase)(a,l)]=u)}),c}return r.default=r,cc=r,cc}var k7=C7();const E7=sf(k7),Zk=Jk("end"),Ov=Jk("start");function Jk(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function A7(t){const e=Ov(t),n=Zk(t);if(e&&n)return{start:e,end:n}}function mc(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?n_(t.position):"start"in t||"end"in t?n_(t):"line"in t||"column"in t?Ng(t):""}function Ng(t){return r_(t&&t.line)+":"+r_(t&&t.column)}function n_(t){return Ng(t&&t.start)+"-"+Ng(t&&t.end)}function r_(t){return t&&typeof t=="number"?t:1}class qn extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},c=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof e=="string"?i=e:!l.cause&&e&&(c=!0,i=e.message,l.cause=e),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=mc(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=c&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qn.prototype.file="";qn.prototype.name="";qn.prototype.reason="";qn.prototype.message="";qn.prototype.stack="";qn.prototype.column=void 0;qn.prototype.line=void 0;qn.prototype.ancestors=void 0;qn.prototype.cause=void 0;qn.prototype.fatal=void 0;qn.prototype.place=void 0;qn.prototype.ruleId=void 0;qn.prototype.source=void 0;const Lv={}.hasOwnProperty,N7=new Map,R7=/[A-Z]/g,j7=new Set(["table","tbody","thead","tfoot","tr"]),T7=new Set(["td","th"]),eE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function D7(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=F7(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=B7(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Mv:b7,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},l=tE(i,t,void 0);return l&&typeof l!="string"?l:i.create(t,i.Fragment,{children:l||void 0},void 0)}function tE(t,e,n){if(e.type==="element")return M7(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return O7(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return I7(t,e,n);if(e.type==="mdxjsEsm")return L7(t,e);if(e.type==="root")return P7(t,e,n);if(e.type==="text")return z7(t,e)}function M7(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Mv,t.schema=i),t.ancestors.push(e);const l=rE(t,e.tagName,!1),c=H7(t,e);let a=Pv(t,e);return j7.has(e.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!c7(u):!0})),nE(t,c,l,e),Iv(c,a),t.ancestors.pop(),t.schema=r,t.create(e,l,c,n)}function O7(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Tc(t,e.position)}function L7(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Tc(t,e.position)}function I7(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Mv,t.schema=i),t.ancestors.push(e);const l=e.name===null?t.Fragment:rE(t,e.name,!0),c=$7(t,e),a=Pv(t,e);return nE(t,c,l,e),Iv(c,a),t.ancestors.pop(),t.schema=r,t.create(e,l,c,n)}function P7(t,e,n){const r={};return Iv(r,Pv(t,e)),t.create(e,t.Fragment,r,n)}function z7(t,e){return e.value}function nE(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Iv(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function B7(t,e,n){return r;function r(i,l,c,a){const d=Array.isArray(c.children)?n:e;return a?d(l,c,a):d(l,c)}}function F7(t,e){return n;function n(r,i,l,c){const a=Array.isArray(l.children),u=Ov(r);return e(i,l,c,a,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function H7(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Lv.call(e.properties,i)){const l=U7(t,i,e.properties[i]);if(l){const[c,a]=l;t.tableCellAlignToStyle&&c==="align"&&typeof a=="string"&&T7.has(e.tagName)?r=a:n[c]=a}}if(r){const l=n.style||(n.style={});l[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function $7(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];l.type;const c=l.expression;c.type;const a=c.properties[0];a.type,Object.assign(n,t.evaluater.evaluateExpression(a.argument))}else Tc(t,e.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const a=r.value.data.estree.body[0];a.type,l=t.evaluater.evaluateExpression(a.expression)}else Tc(t,e.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Pv(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:N7;for(;++r<e.children.length;){const l=e.children[r];let c;if(t.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const d=i.get(u)||0;c=u+"-"+d,i.set(u,d+1)}}const a=tE(t,l,c);a!==void 0&&n.push(a)}return n}function U7(t,e,n){const r=g7(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?s7(n):x7(n)),r.property==="style"){let i=typeof n=="object"?n:V7(t,String(n));return t.stylePropertyNameCase==="css"&&(i=q7(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?h7[r.property]||r.property:r.attribute,n]}}function V7(t,e){try{return E7(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new qn("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=eE+"#cannot-parse-style-attribute",i}}function rE(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let l=-1,c;for(;++l<i.length;){const a=Kx(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};c=c?{type:"MemberExpression",object:c,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=c}else r=Kx(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return Lv.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);Tc(t)}function Tc(t,e){const n=new qn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=eE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function q7(t){const e={};let n;for(n in t)Lv.call(t,n)&&(e[W7(n)]=t[n]);return e}function W7(t){let e=t.replace(R7,G7);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function G7(t){return"-"+t.toLowerCase()}const Lm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},K7={};function zv(t,e){const n=K7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return sE(t,r,i)}function sE(t,e,n){if(Y7(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return s_(t.children,e,n)}return Array.isArray(t)?s_(t,e,n):""}function s_(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=sE(t[i],e,n);return r.join("")}function Y7(t){return!!(t&&typeof t=="object")}const i_=document.createElement("i");function Bv(t){const e="&"+t+";";i_.innerHTML=e;const n=i_.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Cr(t,e,n,r){const i=t.length;let l=0,c;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)c=Array.from(r),c.unshift(e,n),t.splice(...c);else for(n&&t.splice(e,n);l<r.length;)c=r.slice(l,l+1e4),c.unshift(e,0),t.splice(...c),l+=1e4,e+=1e4}function zr(t,e){return t.length>0?(Cr(t,t.length,0,e),t):e}const o_={}.hasOwnProperty;function iE(t){const e={};let n=-1;for(;++n<t.length;)X7(e,t[n]);return e}function X7(t,e){let n;for(n in e){const i=(o_.call(t,n)?t[n]:void 0)||(t[n]={}),l=e[n];let c;if(l)for(c in l){o_.call(i,c)||(i[c]=[]);const a=l[c];Q7(i[c],Array.isArray(a)?a:a?[a]:[])}}}function Q7(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Cr(t,0,0,r)}function oE(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Zr(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yn=Zi(/[A-Za-z]/),Un=Zi(/[\dA-Za-z]/),Z7=Zi(/[#-'*+\--9=?A-Z^-~]/);function Jd(t){return t!==null&&(t<32||t===127)}const Rg=Zi(/\d/),J7=Zi(/[\dA-Fa-f]/),eI=Zi(/[!-/:-@[-`{-~]/);function rt(t){return t!==null&&t<-2}function Ut(t){return t!==null&&(t<0||t===32)}function vt(t){return t===-2||t===-1||t===32}const Wf=Zi(new RegExp("\\p{P}|\\p{S}","u")),zo=Zi(/\s/);function Zi(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function ll(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const l=t.charCodeAt(n);let c="";if(l===37&&Un(t.charCodeAt(n+1))&&Un(t.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const a=t.charCodeAt(n+1);l<56320&&a>56319&&a<57344?(c=String.fromCharCode(l,a),i=1):c="�"}else c=String.fromCharCode(l);c&&(e.push(t.slice(r,n),encodeURIComponent(c)),r=n+i+1,c=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Ct(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(u){return vt(u)?(t.enter(n),a(u)):e(u)}function a(u){return vt(u)&&l++<i?(t.consume(u),a):(t.exit(n),e(u))}}const tI={tokenize:nI};function nI(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Ct(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),l(a)}function l(a){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,c(a)}function c(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return rt(a)?(t.consume(a),t.exit("chunkText"),l):(t.consume(a),c)}}const rI={tokenize:sI},a_={tokenize:iI};function sI(t){const e=this,n=[];let r=0,i,l,c;return a;function a(_){if(r<n.length){const k=n[r];return e.containerState=k[1],t.attempt(k[0].continuation,u,d)(_)}return d(_)}function u(_){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&b();const k=e.events.length;let j=k,N;for(;j--;)if(e.events[j][0]==="exit"&&e.events[j][1].type==="chunkFlow"){N=e.events[j][1].end;break}S(r);let D=k;for(;D<e.events.length;)e.events[D][1].end={...N},D++;return Cr(e.events,j+1,0,e.events.slice(k)),e.events.length=D,d(_)}return a(_)}function d(_){if(r===n.length){if(!i)return g(_);if(i.currentConstruct&&i.currentConstruct.concrete)return w(_);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(a_,m,p)(_)}function m(_){return i&&b(),S(r),g(_)}function p(_){return e.parser.lazy[e.now().line]=r!==n.length,c=e.now().offset,w(_)}function g(_){return e.containerState={},t.attempt(a_,x,w)(_)}function x(_){return r++,n.push([e.currentConstruct,e.containerState]),g(_)}function w(_){if(_===null){i&&b(),S(0),t.consume(_);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),C(_)}function C(_){if(_===null){y(t.exit("chunkFlow"),!0),S(0),t.consume(_);return}return rt(_)?(t.consume(_),y(t.exit("chunkFlow")),r=0,e.interrupt=void 0,a):(t.consume(_),C)}function y(_,k){const j=e.sliceStream(_);if(k&&j.push(null),_.previous=l,l&&(l.next=_),l=_,i.defineSkip(_.start),i.write(j),e.parser.lazy[_.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<c&&(!i.events[N][1].end||i.events[N][1].end.offset>c))return;const D=e.events.length;let E=D,O,L;for(;E--;)if(e.events[E][0]==="exit"&&e.events[E][1].type==="chunkFlow"){if(O){L=e.events[E][1].end;break}O=!0}for(S(r),N=D;N<e.events.length;)e.events[N][1].end={...L},N++;Cr(e.events,E+1,0,e.events.slice(D)),e.events.length=N}}function S(_){let k=n.length;for(;k-- >_;){const j=n[k];e.containerState=j[1],j[0].exit.call(e,t)}n.length=_}function b(){i.write([null]),l=void 0,i=void 0,e.containerState._closeFlow=void 0}}function iI(t,e,n){return Ct(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ka(t){if(t===null||Ut(t)||zo(t))return 1;if(Wf(t))return 2}function Gf(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const l=t[i].resolveAll;l&&!r.includes(l)&&(e=l(e,n),r.push(l))}return e}const jg={name:"attention",resolveAll:oI,tokenize:aI};function oI(t,e){let n=-1,r,i,l,c,a,u,d,m;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const p={...t[r][1].end},g={...t[n][1].start};l_(p,-u),l_(g,u),c={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...t[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},l={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...c.start},end:{...a.end}},t[r][1].end={...c.start},t[n][1].start={...a.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=zr(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=zr(d,[["enter",i,e],["enter",c,e],["exit",c,e],["enter",l,e]]),d=zr(d,Gf(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=zr(d,[["exit",l,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(m=2,d=zr(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):m=0,Cr(t,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function aI(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ka(r);let l;return c;function c(u){return l=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===l)return t.consume(u),a;const d=t.exit("attentionSequence"),m=Ka(u),p=!m||m===2&&i||n.includes(u),g=!i||i===2&&m||n.includes(r);return d._open=!!(l===42?p:p&&(i||!g)),d._close=!!(l===42?g:g&&(m||!p)),e(u)}}function l_(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const lI={name:"autolink",tokenize:cI};function cI(t,e,n){let r=0;return i;function i(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),l}function l(x){return Yn(x)?(t.consume(x),c):x===64?n(x):d(x)}function c(x){return x===43||x===45||x===46||Un(x)?(r=1,a(x)):d(x)}function a(x){return x===58?(t.consume(x),r=0,u):(x===43||x===45||x===46||Un(x))&&r++<32?(t.consume(x),a):(r=0,d(x))}function u(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):x===null||x===32||x===60||Jd(x)?n(x):(t.consume(x),u)}function d(x){return x===64?(t.consume(x),m):Z7(x)?(t.consume(x),d):n(x)}function m(x){return Un(x)?p(x):n(x)}function p(x){return x===46?(t.consume(x),r=0,m):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):g(x)}function g(x){if((x===45||Un(x))&&r++<63){const w=x===45?g:p;return t.consume(x),w}return n(x)}}const Yc={partial:!0,tokenize:uI};function uI(t,e,n){return r;function r(l){return vt(l)?Ct(t,i,"linePrefix")(l):i(l)}function i(l){return l===null||rt(l)?e(l):n(l)}}const aE={continuation:{tokenize:fI},exit:hI,name:"blockQuote",tokenize:dI};function dI(t,e,n){const r=this;return i;function i(c){if(c===62){const a=r.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(c),t.exit("blockQuoteMarker"),l}return n(c)}function l(c){return vt(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(c))}}function fI(t,e,n){const r=this;return i;function i(c){return vt(c)?Ct(t,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return t.attempt(aE,e,n)(c)}}function hI(t){t.exit("blockQuote")}const lE={name:"characterEscape",tokenize:pI};function pI(t,e,n){return r;function r(l){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(l),t.exit("escapeMarker"),i}function i(l){return eI(l)?(t.enter("characterEscapeValue"),t.consume(l),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(l)}}const cE={name:"characterReference",tokenize:mI};function mI(t,e,n){const r=this;let i=0,l,c;return a;function a(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),u}function u(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),d):(t.enter("characterReferenceValue"),l=31,c=Un,m(p))}function d(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),l=6,c=J7,m):(t.enter("characterReferenceValue"),l=7,c=Rg,m(p))}function m(p){if(p===59&&i){const g=t.exit("characterReferenceValue");return c===Un&&!Bv(r.sliceSerialize(g))?n(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return c(p)&&i++<l?(t.consume(p),m):n(p)}}const c_={partial:!0,tokenize:vI},u_={concrete:!0,name:"codeFenced",tokenize:gI};function gI(t,e,n){const r=this,i={partial:!0,tokenize:j};let l=0,c=0,a;return u;function u(N){return d(N)}function d(N){const D=r.events[r.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,a=N,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),m(N)}function m(N){return N===a?(c++,t.consume(N),m):c<3?n(N):(t.exit("codeFencedFenceSequence"),vt(N)?Ct(t,p,"whitespace")(N):p(N))}function p(N){return N===null||rt(N)?(t.exit("codeFencedFence"),r.interrupt?e(N):t.check(c_,C,k)(N)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||rt(N)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(N)):vt(N)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ct(t,x,"whitespace")(N)):N===96&&N===a?n(N):(t.consume(N),g)}function x(N){return N===null||rt(N)?p(N):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===null||rt(N)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(N)):N===96&&N===a?n(N):(t.consume(N),w)}function C(N){return t.attempt(i,k,y)(N)}function y(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),S}function S(N){return l>0&&vt(N)?Ct(t,b,"linePrefix",l+1)(N):b(N)}function b(N){return N===null||rt(N)?t.check(c_,C,k)(N):(t.enter("codeFlowValue"),_(N))}function _(N){return N===null||rt(N)?(t.exit("codeFlowValue"),b(N)):(t.consume(N),_)}function k(N){return t.exit("codeFenced"),e(N)}function j(N,D,E){let O=0;return L;function L(G){return N.enter("lineEnding"),N.consume(G),N.exit("lineEnding"),z}function z(G){return N.enter("codeFencedFence"),vt(G)?Ct(N,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):H(G)}function H(G){return G===a?(N.enter("codeFencedFenceSequence"),$(G)):E(G)}function $(G){return G===a?(O++,N.consume(G),$):O>=c?(N.exit("codeFencedFenceSequence"),vt(G)?Ct(N,q,"whitespace")(G):q(G)):E(G)}function q(G){return G===null||rt(G)?(N.exit("codeFencedFence"),D(G)):E(G)}}}function vI(t,e,n){const r=this;return i;function i(c){return c===null?n(c):(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l)}function l(c){return r.parser.lazy[r.now().line]?n(c):e(c)}}const Im={name:"codeIndented",tokenize:bI},yI={partial:!0,tokenize:xI};function bI(t,e,n){const r=this;return i;function i(d){return t.enter("codeIndented"),Ct(t,l,"linePrefix",5)(d)}function l(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?c(d):n(d)}function c(d){return d===null?u(d):rt(d)?t.attempt(yI,c,u)(d):(t.enter("codeFlowValue"),a(d))}function a(d){return d===null||rt(d)?(t.exit("codeFlowValue"),c(d)):(t.consume(d),a)}function u(d){return t.exit("codeIndented"),e(d)}}function xI(t,e,n){const r=this;return i;function i(c){return r.parser.lazy[r.now().line]?n(c):rt(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),i):Ct(t,l,"linePrefix",5)(c)}function l(c){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(c):rt(c)?i(c):n(c)}}const _I={name:"codeText",previous:wI,resolve:SI,tokenize:CI};function SI(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function wI(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function CI(t,e,n){let r=0,i,l;return c;function c(p){return t.enter("codeText"),t.enter("codeTextSequence"),a(p)}function a(p){return p===96?(t.consume(p),r++,a):(t.exit("codeTextSequence"),u(p))}function u(p){return p===null?n(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),u):p===96?(l=t.enter("codeTextSequence"),i=0,m(p)):rt(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),u):(t.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||rt(p)?(t.exit("codeTextData"),u(p)):(t.consume(p),d)}function m(p){return p===96?(t.consume(p),i++,m):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(l.type="codeTextData",d(p))}}class kI{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n==null?Number.POSITIVE_INFINITY:n;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&uc(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),uc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),uc(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);uc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);uc(this.left,n.reverse())}}}function uc(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function uE(t){const e={};let n=-1,r,i,l,c,a,u,d;const m=new kI(t);for(;++n<m.length;){for(;n in e;)n=e[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,EI(m,n)),n=e[n],d=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(c=m.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),c[1].type="lineEnding",i=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},a=m.slice(i,n),a.unshift(r),m.splice(i,n-i+1,a))}}return Cr(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function EI(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const l=[];let c=n._tokenizer;c||(c=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const a=c.events,u=[],d={};let m,p,g=-1,x=n,w=0,C=0;const y=[C];for(;x;){for(;t.get(++i)[1]!==x;);l.push(i),x._tokenizer||(m=r.sliceStream(x),x.next||m.push(null),p&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(m),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(C=g+1,y.push(C),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):y.pop(),g=y.length;g--;){const S=a.slice(y[g],y[g+1]),b=l.pop();u.push([b,b+S.length-1]),t.splice(b,2,S)}for(u.reverse(),g=-1;++g<u.length;)d[w+u[g][0]]=w+u[g][1],w+=u[g][1]-u[g][0]-1;return d}const AI={resolve:RI,tokenize:jI},NI={partial:!0,tokenize:TI};function RI(t){return uE(t),t}function jI(t,e){let n;return r;function r(a){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):rt(a)?t.check(NI,c,l)(a):(t.consume(a),i)}function l(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function c(a){return t.consume(a),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function TI(t,e,n){const r=this;return i;function i(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),Ct(t,l,"linePrefix")}function l(c){if(c===null||rt(c))return n(c);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(c):t.interrupt(r.parser.constructs.flow,n,e)(c)}}function dE(t,e,n,r,i,l,c,a,u){const d=u||Number.POSITIVE_INFINITY;let m=0;return p;function p(S){return S===60?(t.enter(r),t.enter(i),t.enter(l),t.consume(S),t.exit(l),g):S===null||S===32||S===41||Jd(S)?n(S):(t.enter(r),t.enter(c),t.enter(a),t.enter("chunkString",{contentType:"string"}),C(S))}function g(S){return S===62?(t.enter(l),t.consume(S),t.exit(l),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===62?(t.exit("chunkString"),t.exit(a),g(S)):S===null||S===60||rt(S)?n(S):(t.consume(S),S===92?w:x)}function w(S){return S===60||S===62||S===92?(t.consume(S),x):x(S)}function C(S){return!m&&(S===null||S===41||Ut(S))?(t.exit("chunkString"),t.exit(a),t.exit(c),t.exit(r),e(S)):m<d&&S===40?(t.consume(S),m++,C):S===41?(t.consume(S),m--,C):S===null||S===32||S===40||Jd(S)?n(S):(t.consume(S),S===92?y:C)}function y(S){return S===40||S===41||S===92?(t.consume(S),C):C(S)}}function fE(t,e,n,r,i,l){const c=this;let a=0,u;return d;function d(x){return t.enter(r),t.enter(i),t.consume(x),t.exit(i),t.enter(l),m}function m(x){return a>999||x===null||x===91||x===93&&!u||x===94&&!a&&"_hiddenFootnoteSupport"in c.parser.constructs?n(x):x===93?(t.exit(l),t.enter(i),t.consume(x),t.exit(i),t.exit(r),e):rt(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||rt(x)||a++>999?(t.exit("chunkString"),m(x)):(t.consume(x),u||(u=!vt(x)),x===92?g:p)}function g(x){return x===91||x===92||x===93?(t.consume(x),a++,p):p(x)}}function hE(t,e,n,r,i,l){let c;return a;function a(g){return g===34||g===39||g===40?(t.enter(r),t.enter(i),t.consume(g),t.exit(i),c=g===40?41:g,u):n(g)}function u(g){return g===c?(t.enter(i),t.consume(g),t.exit(i),t.exit(r),e):(t.enter(l),d(g))}function d(g){return g===c?(t.exit(l),u(c)):g===null?n(g):rt(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),Ct(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===c||g===null||rt(g)?(t.exit("chunkString"),d(g)):(t.consume(g),g===92?p:m)}function p(g){return g===c||g===92?(t.consume(g),m):m(g)}}function gc(t,e){let n;return r;function r(i){return rt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):vt(i)?Ct(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const DI={name:"definition",tokenize:OI},MI={partial:!0,tokenize:LI};function OI(t,e,n){const r=this;let i;return l;function l(x){return t.enter("definition"),c(x)}function c(x){return fE.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function a(x){return i=Zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),u):n(x)}function u(x){return Ut(x)?gc(t,d)(x):d(x)}function d(x){return dE(t,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return t.attempt(MI,p,p)(x)}function p(x){return vt(x)?Ct(t,g,"whitespace")(x):g(x)}function g(x){return x===null||rt(x)?(t.exit("definition"),r.parser.defined.push(i),e(x)):n(x)}}function LI(t,e,n){return r;function r(a){return Ut(a)?gc(t,i)(a):n(a)}function i(a){return hE(t,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return vt(a)?Ct(t,c,"whitespace")(a):c(a)}function c(a){return a===null||rt(a)?e(a):n(a)}}const II={name:"hardBreakEscape",tokenize:PI};function PI(t,e,n){return r;function r(l){return t.enter("hardBreakEscape"),t.consume(l),i}function i(l){return rt(l)?(t.exit("hardBreakEscape"),e(l)):n(l)}}const zI={name:"headingAtx",resolve:BI,tokenize:FI};function BI(t,e){let n=t.length-2,r=3,i,l;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},l={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Cr(t,r,n-r+1,[["enter",i,e],["enter",l,e],["exit",l,e],["exit",i,e]])),t}function FI(t,e,n){let r=0;return i;function i(m){return t.enter("atxHeading"),l(m)}function l(m){return t.enter("atxHeadingSequence"),c(m)}function c(m){return m===35&&r++<6?(t.consume(m),c):m===null||Ut(m)?(t.exit("atxHeadingSequence"),a(m)):n(m)}function a(m){return m===35?(t.enter("atxHeadingSequence"),u(m)):m===null||rt(m)?(t.exit("atxHeading"),e(m)):vt(m)?Ct(t,a,"whitespace")(m):(t.enter("atxHeadingText"),d(m))}function u(m){return m===35?(t.consume(m),u):(t.exit("atxHeadingSequence"),a(m))}function d(m){return m===null||m===35||Ut(m)?(t.exit("atxHeadingText"),a(m)):(t.consume(m),d)}}const HI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],d_=["pre","script","style","textarea"],$I={concrete:!0,name:"htmlFlow",resolveTo:qI,tokenize:WI},UI={partial:!0,tokenize:KI},VI={partial:!0,tokenize:GI};function qI(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function WI(t,e,n){const r=this;let i,l,c,a,u;return d;function d(F){return m(F)}function m(F){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(F),p}function p(F){return F===33?(t.consume(F),g):F===47?(t.consume(F),l=!0,C):F===63?(t.consume(F),i=3,r.interrupt?e:M):Yn(F)?(t.consume(F),c=String.fromCharCode(F),y):n(F)}function g(F){return F===45?(t.consume(F),i=2,x):F===91?(t.consume(F),i=5,a=0,w):Yn(F)?(t.consume(F),i=4,r.interrupt?e:M):n(F)}function x(F){return F===45?(t.consume(F),r.interrupt?e:M):n(F)}function w(F){const Q="CDATA[";return F===Q.charCodeAt(a++)?(t.consume(F),a===Q.length?r.interrupt?e:H:w):n(F)}function C(F){return Yn(F)?(t.consume(F),c=String.fromCharCode(F),y):n(F)}function y(F){if(F===null||F===47||F===62||Ut(F)){const Q=F===47,J=c.toLowerCase();return!Q&&!l&&d_.includes(J)?(i=1,r.interrupt?e(F):H(F)):HI.includes(c.toLowerCase())?(i=6,Q?(t.consume(F),S):r.interrupt?e(F):H(F)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):l?b(F):_(F))}return F===45||Un(F)?(t.consume(F),c+=String.fromCharCode(F),y):n(F)}function S(F){return F===62?(t.consume(F),r.interrupt?e:H):n(F)}function b(F){return vt(F)?(t.consume(F),b):L(F)}function _(F){return F===47?(t.consume(F),L):F===58||F===95||Yn(F)?(t.consume(F),k):vt(F)?(t.consume(F),_):L(F)}function k(F){return F===45||F===46||F===58||F===95||Un(F)?(t.consume(F),k):j(F)}function j(F){return F===61?(t.consume(F),N):vt(F)?(t.consume(F),j):_(F)}function N(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(t.consume(F),u=F,D):vt(F)?(t.consume(F),N):E(F)}function D(F){return F===u?(t.consume(F),u=null,O):F===null||rt(F)?n(F):(t.consume(F),D)}function E(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||Ut(F)?j(F):(t.consume(F),E)}function O(F){return F===47||F===62||vt(F)?_(F):n(F)}function L(F){return F===62?(t.consume(F),z):n(F)}function z(F){return F===null||rt(F)?H(F):vt(F)?(t.consume(F),z):n(F)}function H(F){return F===45&&i===2?(t.consume(F),W):F===60&&i===1?(t.consume(F),X):F===62&&i===4?(t.consume(F),P):F===63&&i===3?(t.consume(F),M):F===93&&i===5?(t.consume(F),I):rt(F)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(UI,B,$)(F)):F===null||rt(F)?(t.exit("htmlFlowData"),$(F)):(t.consume(F),H)}function $(F){return t.check(VI,q,B)(F)}function q(F){return t.enter("lineEnding"),t.consume(F),t.exit("lineEnding"),G}function G(F){return F===null||rt(F)?$(F):(t.enter("htmlFlowData"),H(F))}function W(F){return F===45?(t.consume(F),M):H(F)}function X(F){return F===47?(t.consume(F),c="",Y):H(F)}function Y(F){if(F===62){const Q=c.toLowerCase();return d_.includes(Q)?(t.consume(F),P):H(F)}return Yn(F)&&c.length<8?(t.consume(F),c+=String.fromCharCode(F),Y):H(F)}function I(F){return F===93?(t.consume(F),M):H(F)}function M(F){return F===62?(t.consume(F),P):F===45&&i===2?(t.consume(F),M):H(F)}function P(F){return F===null||rt(F)?(t.exit("htmlFlowData"),B(F)):(t.consume(F),P)}function B(F){return t.exit("htmlFlow"),e(F)}}function GI(t,e,n){const r=this;return i;function i(c){return rt(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l):n(c)}function l(c){return r.parser.lazy[r.now().line]?n(c):e(c)}}function KI(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Yc,e,n)}}const YI={name:"htmlText",tokenize:XI};function XI(t,e,n){const r=this;let i,l,c;return a;function a(M){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(M),u}function u(M){return M===33?(t.consume(M),d):M===47?(t.consume(M),j):M===63?(t.consume(M),_):Yn(M)?(t.consume(M),E):n(M)}function d(M){return M===45?(t.consume(M),m):M===91?(t.consume(M),l=0,w):Yn(M)?(t.consume(M),b):n(M)}function m(M){return M===45?(t.consume(M),x):n(M)}function p(M){return M===null?n(M):M===45?(t.consume(M),g):rt(M)?(c=p,X(M)):(t.consume(M),p)}function g(M){return M===45?(t.consume(M),x):p(M)}function x(M){return M===62?W(M):M===45?g(M):p(M)}function w(M){const P="CDATA[";return M===P.charCodeAt(l++)?(t.consume(M),l===P.length?C:w):n(M)}function C(M){return M===null?n(M):M===93?(t.consume(M),y):rt(M)?(c=C,X(M)):(t.consume(M),C)}function y(M){return M===93?(t.consume(M),S):C(M)}function S(M){return M===62?W(M):M===93?(t.consume(M),S):C(M)}function b(M){return M===null||M===62?W(M):rt(M)?(c=b,X(M)):(t.consume(M),b)}function _(M){return M===null?n(M):M===63?(t.consume(M),k):rt(M)?(c=_,X(M)):(t.consume(M),_)}function k(M){return M===62?W(M):_(M)}function j(M){return Yn(M)?(t.consume(M),N):n(M)}function N(M){return M===45||Un(M)?(t.consume(M),N):D(M)}function D(M){return rt(M)?(c=D,X(M)):vt(M)?(t.consume(M),D):W(M)}function E(M){return M===45||Un(M)?(t.consume(M),E):M===47||M===62||Ut(M)?O(M):n(M)}function O(M){return M===47?(t.consume(M),W):M===58||M===95||Yn(M)?(t.consume(M),L):rt(M)?(c=O,X(M)):vt(M)?(t.consume(M),O):W(M)}function L(M){return M===45||M===46||M===58||M===95||Un(M)?(t.consume(M),L):z(M)}function z(M){return M===61?(t.consume(M),H):rt(M)?(c=z,X(M)):vt(M)?(t.consume(M),z):O(M)}function H(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(t.consume(M),i=M,$):rt(M)?(c=H,X(M)):vt(M)?(t.consume(M),H):(t.consume(M),q)}function $(M){return M===i?(t.consume(M),i=void 0,G):M===null?n(M):rt(M)?(c=$,X(M)):(t.consume(M),$)}function q(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Ut(M)?O(M):(t.consume(M),q)}function G(M){return M===47||M===62||Ut(M)?O(M):n(M)}function W(M){return M===62?(t.consume(M),t.exit("htmlTextData"),t.exit("htmlText"),e):n(M)}function X(M){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),Y}function Y(M){return vt(M)?Ct(t,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):I(M)}function I(M){return t.enter("htmlTextData"),c(M)}}const Fv={name:"labelEnd",resolveAll:e9,resolveTo:t9,tokenize:n9},QI={tokenize:r9},ZI={tokenize:s9},JI={tokenize:i9};function e9(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&Cr(t,0,t.length,n),t}function t9(t,e){let n=t.length,r=0,i,l,c,a;for(;n--;)if(i=t[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(c){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(c=n);const u={type:t[l][1].type==="labelLink"?"link":"image",start:{...t[l][1].start},end:{...t[t.length-1][1].end}},d={type:"label",start:{...t[l][1].start},end:{...t[c][1].end}},m={type:"labelText",start:{...t[l+r+2][1].end},end:{...t[c-2][1].start}};return a=[["enter",u,e],["enter",d,e]],a=zr(a,t.slice(l+1,l+r+3)),a=zr(a,[["enter",m,e]]),a=zr(a,Gf(e.parser.constructs.insideSpan.null,t.slice(l+r+4,c-3),e)),a=zr(a,[["exit",m,e],t[c-2],t[c-1],["exit",d,e]]),a=zr(a,t.slice(c+1)),a=zr(a,[["exit",u,e]]),Cr(t,l,t.length,a),t}function n9(t,e,n){const r=this;let i=r.events.length,l,c;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(g){return l?l._inactive?p(g):(c=r.parser.defined.includes(Zr(r.sliceSerialize({start:l.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),u):n(g)}function u(g){return g===40?t.attempt(QI,m,c?m:p)(g):g===91?t.attempt(ZI,m,c?d:p)(g):c?m(g):p(g)}function d(g){return t.attempt(JI,m,p)(g)}function m(g){return e(g)}function p(g){return l._balanced=!0,n(g)}}function r9(t,e,n){return r;function r(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),i}function i(p){return Ut(p)?gc(t,l)(p):l(p)}function l(p){return p===41?m(p):dE(t,c,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function c(p){return Ut(p)?gc(t,u)(p):m(p)}function a(p){return n(p)}function u(p){return p===34||p===39||p===40?hE(t,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function d(p){return Ut(p)?gc(t,m)(p):m(p)}function m(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):n(p)}}function s9(t,e,n){const r=this;return i;function i(a){return fE.call(r,t,l,c,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(a):n(a)}function c(a){return n(a)}}function i9(t,e,n){return r;function r(l){return t.enter("reference"),t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),i}function i(l){return l===93?(t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),t.exit("reference"),e):n(l)}}const o9={name:"labelStartImage",resolveAll:Fv.resolveAll,tokenize:a9};function a9(t,e,n){const r=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),l}function l(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),c):n(a)}function c(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const l9={name:"labelStartLink",resolveAll:Fv.resolveAll,tokenize:c9};function c9(t,e,n){const r=this;return i;function i(c){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):e(c)}}const Pm={name:"lineEnding",tokenize:u9};function u9(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Ct(t,e,"linePrefix")}}const Dd={name:"thematicBreak",tokenize:d9};function d9(t,e,n){let r=0,i;return l;function l(d){return t.enter("thematicBreak"),c(d)}function c(d){return i=d,a(d)}function a(d){return d===i?(t.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||rt(d))?(t.exit("thematicBreak"),e(d)):n(d)}function u(d){return d===i?(t.consume(d),r++,u):(t.exit("thematicBreakSequence"),vt(d)?Ct(t,a,"whitespace")(d):a(d))}}const ir={continuation:{tokenize:m9},exit:v9,name:"list",tokenize:p9},f9={partial:!0,tokenize:y9},h9={partial:!0,tokenize:g9};function p9(t,e,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,c=0;return a;function a(x){const w=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:Rg(x)){if(r.containerState.type||(r.containerState.type=w,t.enter(w,{_container:!0})),w==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(Dd,n,d)(x):d(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(x)}return n(x)}function u(x){return Rg(x)&&++c<10?(t.consume(x),u):(!r.interrupt||c<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),d(x)):n(x)}function d(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(Yc,r.interrupt?n:m,t.attempt(f9,g,p))}function m(x){return r.containerState.initialBlankLine=!0,l++,g(x)}function p(x){return vt(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),g):n(x)}function g(x){return r.containerState.size=l+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function m9(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Yc,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ct(t,e,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!vt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(h9,e,c)(a))}function c(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ct(t,t.attempt(ir,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function g9(t,e,n){const r=this;return Ct(t,i,"listItemIndent",r.containerState.size+1);function i(l){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?e(l):n(l)}}function v9(t){t.exit(this.containerState.type)}function y9(t,e,n){const r=this;return Ct(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const c=r.events[r.events.length-1];return!vt(l)&&c&&c[1].type==="listItemPrefixWhitespace"?e(l):n(l)}}const f_={name:"setextUnderline",resolveTo:b9,tokenize:x9};function b9(t,e){let n=t.length,r,i,l;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!l&&t[n][1].type==="definition"&&(l=n);const c={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",l?(t.splice(i,0,["enter",c,e]),t.splice(l+1,0,["exit",t[r][1],e]),t[r][1].end={...t[l][1].end}):t[r][1]=c,t.push(["exit",c,e]),t}function x9(t,e,n){const r=this;let i;return l;function l(d){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(t.enter("setextHeadingLine"),i=d,c(d)):n(d)}function c(d){return t.enter("setextHeadingLineSequence"),a(d)}function a(d){return d===i?(t.consume(d),a):(t.exit("setextHeadingLineSequence"),vt(d)?Ct(t,u,"lineSuffix")(d):u(d))}function u(d){return d===null||rt(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const _9={tokenize:S9};function S9(t){const e=this,n=t.attempt(Yc,r,t.attempt(this.parser.constructs.flowInitial,i,Ct(t,t.attempt(this.parser.constructs.flow,i,t.attempt(AI,i)),"linePrefix")));return n;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEndingBlank"),t.consume(l),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const w9={resolveAll:mE()},C9=pE("string"),k9=pE("text");function pE(t){return{resolveAll:mE(t==="text"?E9:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],l=n.attempt(i,c,a);return c;function c(m){return d(m)?l(m):a(m)}function a(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),u}function u(m){return d(m)?(n.exit("data"),l(m)):(n.consume(m),u)}function d(m){if(m===null)return!0;const p=i[m];let g=-1;if(p)for(;++g<p.length;){const x=p[g];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function mE(t){return e;function e(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return t?t(n,r):n}}function E9(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let l=i.length,c=-1,a=0,u;for(;l--;){const d=i[l];if(typeof d=="string"){for(c=d.length;d.charCodeAt(c-1)===32;)a++,c--;if(c)break;c=-1}else if(d===-2)u=!0,a++;else if(d!==-1){l++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(a=0),a){const d={type:n===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:r.start._bufferIndex+c,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(t.splice(n,0,["enter",d,e],["exit",d,e]),n+=2)}n++}return t}const A9={42:ir,43:ir,45:ir,48:ir,49:ir,50:ir,51:ir,52:ir,53:ir,54:ir,55:ir,56:ir,57:ir,62:aE},N9={91:DI},R9={[-2]:Im,[-1]:Im,32:Im},j9={35:zI,42:Dd,45:[f_,Dd],60:$I,61:f_,95:Dd,96:u_,126:u_},T9={38:cE,92:lE},D9={[-5]:Pm,[-4]:Pm,[-3]:Pm,33:o9,38:cE,42:jg,60:[lI,YI],91:l9,92:[II,lE],93:Fv,95:jg,96:_I},M9={null:[jg,w9]},O9={null:[42,95]},L9={null:[]},I9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:O9,contentInitial:N9,disable:L9,document:A9,flow:j9,flowInitial:R9,insideSpan:M9,string:T9,text:D9},Symbol.toStringTag,{value:"Module"}));function P9(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let c=[],a=[];const u={attempt:D(j),check:D(N),consume:b,enter:_,exit:k,interrupt:D(N,{interrupt:!0})},d={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:t,previous:null,sliceSerialize:g,sliceStream:x,write:p};let m=e.tokenize.call(d,u);return e.resolveAll&&l.push(e),d;function p(z){return c=zr(c,z),y(),c[c.length-1]!==null?[]:(E(e,0),d.events=Gf(l,d.events,d),d.events)}function g(z,H){return B9(x(z),H)}function x(z){return z9(c,z)}function w(){const{_bufferIndex:z,_index:H,line:$,column:q,offset:G}=r;return{_bufferIndex:z,_index:H,line:$,column:q,offset:G}}function C(z){i[z.line]=z.column,L()}function y(){let z;for(;r._index<c.length;){const H=c[r._index];if(typeof H=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<H.length;)S(H.charCodeAt(r._bufferIndex));else S(H)}}function S(z){m=m(z)}function b(z){rt(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,L()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=z}function _(z,H){const $=H||{};return $.type=z,$.start=w(),d.events.push(["enter",$,d]),a.push($),$}function k(z){const H=a.pop();return H.end=w(),d.events.push(["exit",H,d]),H}function j(z,H){E(z,H.from)}function N(z,H){H.restore()}function D(z,H){return $;function $(q,G,W){let X,Y,I,M;return Array.isArray(q)?B(q):"tokenize"in q?B([q]):P(q);function P(ee){return K;function K(V){const te=V!==null&&ee[V],re=V!==null&&ee.null,ae=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(re)?re:re?[re]:[]];return B(ae)(V)}}function B(ee){return X=ee,Y=0,ee.length===0?W:F(ee[Y])}function F(ee){return K;function K(V){return M=O(),I=ee,ee.partial||(d.currentConstruct=ee),ee.name&&d.parser.constructs.disable.null.includes(ee.name)?J():ee.tokenize.call(H?Object.assign(Object.create(d),H):d,u,Q,J)(V)}}function Q(ee){return z(I,M),G}function J(ee){return M.restore(),++Y<X.length?F(X[Y]):W}}}function E(z,H){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&Cr(d.events,H,d.events.length-H,z.resolve(d.events.slice(H),d)),z.resolveTo&&(d.events=z.resolveTo(d.events,d))}function O(){const z=w(),H=d.previous,$=d.currentConstruct,q=d.events.length,G=Array.from(a);return{from:q,restore:W};function W(){r=z,d.previous=H,d.currentConstruct=$,d.events.length=q,a=G,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function z9(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,l=e.end._bufferIndex;let c;if(n===i)c=[t[n].slice(r,l)];else{if(c=t.slice(n,i),r>-1){const a=c[0];typeof a=="string"?c[0]=a.slice(r):c.shift()}l>0&&c.push(t[i].slice(0,l))}return c}function B9(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const l=t[n];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
|
|
573
|
-
`;break}case-3:{c=`\r
|
|
574
|
-
`;break}case-2:{c=e?" ":" ";break}case-1:{if(!e&&i)continue;c=" ";break}default:c=String.fromCharCode(l)}i=l===-2,r.push(c)}return r.join("")}function F9(t){const r={constructs:iE([I9,...(t||{}).extensions||[]]),content:i(tI),defined:[],document:i(rI),flow:i(_9),lazy:{},string:i(C9),text:i(k9)};return r;function i(l){return c;function c(a){return P9(r,l,a)}}}function H9(t){for(;!uE(t););return t}const h_=/[\0\t\n\r]/g;function $9(){let t=1,e="",n=!0,r;return i;function i(l,c,a){const u=[];let d,m,p,g,x;for(l=e+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),p=0,e="",n&&(l.charCodeAt(0)===65279&&p++,n=void 0);p<l.length;){if(h_.lastIndex=p,d=h_.exec(l),g=d&&d.index!==void 0?d.index:l.length,x=l.charCodeAt(g),!d){e=l.slice(p);break}if(x===10&&p===g&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<g&&(u.push(l.slice(p,g)),t+=g-p),x){case 0:{u.push(65533),t++;break}case 9:{for(m=Math.ceil(t/4)*4,u.push(-2);t++<m;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}p=g+1}return a&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const U9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function V9(t){return t.replace(U9,q9)}function q9(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return oE(n.slice(l?2:1),l?16:10)}return Bv(n)||t}const gE={}.hasOwnProperty;function W9(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),G9(n)(H9(F9(n).document().write($9()(t,e,!0))))}function G9(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(xe),autolinkProtocol:O,autolinkEmail:O,atxHeading:l(De),blockQuote:l(re),characterEscape:O,characterReference:O,codeFenced:l(ae),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(ae,c),codeText:l(se,c),codeTextData:O,data:O,codeFlowValue:O,definition:l(Se),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(Ae),hardBreakEscape:l(Ue),hardBreakTrailing:l(Ue),htmlFlow:l(ce,c),htmlFlowData:O,htmlText:l(ce,c),htmlTextData:O,image:l(je),label:c,link:l(xe),listItem:l(We),listItemValue:g,listOrdered:l(Ve,p),listUnordered:l(Ve),paragraph:l(it),reference:F,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(De),strong:l(ge),thematicBreak:l(be)},exit:{atxHeading:u(),atxHeadingSequence:j,autolink:u(),autolinkEmail:te,autolinkProtocol:V,blockQuote:u(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ee,characterReference:K,codeFenced:u(y),codeFencedFence:C,codeFencedFenceInfo:x,codeFencedFenceMeta:w,codeFlowValue:L,codeIndented:u(S),codeText:u(G),codeTextData:L,data:L,definition:u(),definitionDestinationString:k,definitionLabelString:b,definitionTitleString:_,emphasis:u(),hardBreakEscape:u(H),hardBreakTrailing:u(H),htmlFlow:u($),htmlFlowData:L,htmlText:u(q),htmlTextData:L,image:u(X),label:I,labelText:Y,lineEnding:z,link:u(W),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Q,resourceDestinationString:M,resourceTitleString:P,resource:B,setextHeading:u(E),setextHeadingLineSequence:D,setextHeadingText:N,strong:u(),thematicBreak:u()}};vE(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(oe){let me={type:"root",children:[]};const Ee={stack:[me],tokenStack:[],config:e,enter:a,exit:d,buffer:c,resume:m,data:n},Ie=[];let Fe=-1;for(;++Fe<oe.length;)if(oe[Fe][1].type==="listOrdered"||oe[Fe][1].type==="listUnordered")if(oe[Fe][0]==="enter")Ie.push(Fe);else{const Ge=Ie.pop();Fe=i(oe,Ge,Fe)}for(Fe=-1;++Fe<oe.length;){const Ge=e[oe[Fe][0]];gE.call(Ge,oe[Fe][1].type)&&Ge[oe[Fe][1].type].call(Object.assign({sliceSerialize:oe[Fe][2].sliceSerialize},Ee),oe[Fe][1])}if(Ee.tokenStack.length>0){const Ge=Ee.tokenStack[Ee.tokenStack.length-1];(Ge[1]||p_).call(Ee,void 0,Ge[0])}for(me.position={start:Mi(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Mi(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<e.transforms.length;)me=e.transforms[Fe](me)||me;return me}function i(oe,me,Ee){let Ie=me-1,Fe=-1,Ge=!1,Ze,lt,ze,qe;for(;++Ie<=Ee;){const Pe=oe[Ie];switch(Pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pe[0]==="enter"?Fe++:Fe--,qe=void 0;break}case"lineEndingBlank":{Pe[0]==="enter"&&(Ze&&!qe&&!Fe&&!ze&&(ze=Ie),qe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qe=void 0}if(!Fe&&Pe[0]==="enter"&&Pe[1].type==="listItemPrefix"||Fe===-1&&Pe[0]==="exit"&&(Pe[1].type==="listUnordered"||Pe[1].type==="listOrdered")){if(Ze){let nt=Ie;for(lt=void 0;nt--;){const kt=oe[nt];if(kt[1].type==="lineEnding"||kt[1].type==="lineEndingBlank"){if(kt[0]==="exit")continue;lt&&(oe[lt][1].type="lineEndingBlank",Ge=!0),kt[1].type="lineEnding",lt=nt}else if(!(kt[1].type==="linePrefix"||kt[1].type==="blockQuotePrefix"||kt[1].type==="blockQuotePrefixWhitespace"||kt[1].type==="blockQuoteMarker"||kt[1].type==="listItemIndent"))break}ze&&(!lt||ze<lt)&&(Ze._spread=!0),Ze.end=Object.assign({},lt?oe[lt][1].start:Pe[1].end),oe.splice(lt||Ie,0,["exit",Ze,Pe[2]]),Ie++,Ee++}if(Pe[1].type==="listItemPrefix"){const nt={type:"listItem",_spread:!1,start:Object.assign({},Pe[1].start),end:void 0};Ze=nt,oe.splice(Ie,0,["enter",nt,Pe[2]]),Ie++,Ee++,ze=void 0,qe=!0}}}return oe[me][1]._spread=Ge,Ee}function l(oe,me){return Ee;function Ee(Ie){a.call(this,oe(Ie),Ie),me&&me.call(this,Ie)}}function c(){this.stack.push({type:"fragment",children:[]})}function a(oe,me,Ee){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([me,Ee||void 0]),oe.position={start:Mi(me.start),end:void 0}}function u(oe){return me;function me(Ee){oe&&oe.call(this,Ee),d.call(this,Ee)}}function d(oe,me){const Ee=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==oe.type&&(me?me.call(this,oe,Ie[0]):(Ie[1]||p_).call(this,oe,Ie[0]));else throw new Error("Cannot close `"+oe.type+"` ("+mc({start:oe.start,end:oe.end})+"): it’s not open");Ee.position.end=Mi(oe.end)}function m(){return zv(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(oe){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function x(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.lang=oe}function w(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.meta=oe}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe.replace(/(\r?\n|\r)$/g,"")}function b(oe){const me=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=me,Ee.identifier=Zr(this.sliceSerialize(oe)).toLowerCase()}function _(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.title=oe}function k(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.url=oe}function j(oe){const me=this.stack[this.stack.length-1];if(!me.depth){const Ee=this.sliceSerialize(oe).length;me.depth=Ee}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function D(oe){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function O(oe){const Ee=this.stack[this.stack.length-1].children;let Ie=Ee[Ee.length-1];(!Ie||Ie.type!=="text")&&(Ie=Re(),Ie.position={start:Mi(oe.start),end:void 0},Ee.push(Ie)),this.stack.push(Ie)}function L(oe){const me=this.stack.pop();me.value+=this.sliceSerialize(oe),me.position.end=Mi(oe.end)}function z(oe){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=me.children[me.children.length-1];Ee.position.end=Mi(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(me.type)&&(O.call(this,oe),L.call(this,oe))}function H(){this.data.atHardBreak=!0}function $(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function q(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function G(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function W(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=me,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function X(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=me,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Y(oe){const me=this.sliceSerialize(oe),Ee=this.stack[this.stack.length-2];Ee.label=V9(me),Ee.identifier=Zr(me).toLowerCase()}function I(){const oe=this.stack[this.stack.length-1],me=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ie=oe.children;Ee.children=Ie}else Ee.alt=me}function M(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.url=oe}function P(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.title=oe}function B(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Q(oe){const me=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=me,Ee.identifier=Zr(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function J(oe){this.data.characterReferenceType=oe.type}function ee(oe){const me=this.sliceSerialize(oe),Ee=this.data.characterReferenceType;let Ie;Ee?(Ie=oE(me,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=Bv(me);const Fe=this.stack[this.stack.length-1];Fe.value+=Ie}function K(oe){const me=this.stack.pop();me.position.end=Mi(oe.end)}function V(oe){L.call(this,oe);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(oe)}function te(oe){L.call(this,oe);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(oe)}function re(){return{type:"blockquote",children:[]}}function ae(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function De(){return{type:"heading",depth:0,children:[]}}function Ue(){return{type:"break"}}function ce(){return{type:"html",value:""}}function je(){return{type:"image",title:null,url:"",alt:null}}function xe(){return{type:"link",title:null,url:"",children:[]}}function Ve(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function We(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function it(){return{type:"paragraph",children:[]}}function ge(){return{type:"strong",children:[]}}function Re(){return{type:"text",value:""}}function be(){return{type:"thematicBreak"}}}function Mi(t){return{line:t.line,column:t.column,offset:t.offset}}function vE(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?vE(t,r):K9(t,r)}}function K9(t,e){let n;for(n in e)if(gE.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function p_(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+mc({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+mc({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+mc({start:e.start,end:e.end})+") is still open")}function Y9(t){const e=this;e.parser=n;function n(r){return W9(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function X9(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function Q9(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
575
|
-
`}]}function Z9(t,e){const n=e.value?e.value+`
|
|
576
|
-
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(l.data={meta:e.meta}),t.patch(e,l),l=t.applyData(e,l),l={type:"element",tagName:"pre",properties:{},children:[l]},t.patch(e,l),l}function J9(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function eP(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function tP(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=ll(r.toLowerCase()),l=t.footnoteOrder.indexOf(r);let c,a=t.footnoteCounts.get(r);a===void 0?(a=0,t.footnoteOrder.push(r),c=t.footnoteOrder.length):c=l+1,a+=1,t.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};t.patch(e,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,d),t.applyData(e,d)}function nP(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function rP(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function yE(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const c=i[i.length-1];return c&&c.type==="text"?c.value+=r:i.push({type:"text",value:r}),i}function sP(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return yE(t,e);const i={src:ll(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,l),t.applyData(e,l)}function iP(t,e){const n={src:ll(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function oP(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function aP(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return yE(t,e);const i={href:ll(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,l),t.applyData(e,l)}function lP(t,e){const n={href:ll(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function cP(t,e,n){const r=t.all(e),i=n?uP(n):bE(e),l={},c=[];if(typeof e.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const m=r[a];(i||a!==0||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
577
|
-
`}),m.type==="element"&&m.tagName==="p"&&!i?c.push(...m.children):c.push(m)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&c.push({type:"text",value:`
|
|
578
|
-
`});const d={type:"element",tagName:"li",properties:l,children:c};return t.patch(e,d),t.applyData(e,d)}function uP(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=bE(n[r])}return e}function bE(t){const e=t.spread;return e==null?t.children.length>1:e}function dP(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const c=r[i];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,l),t.applyData(e,l)}function fP(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function hP(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function pP(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function mP(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const c={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],c),i.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=Ov(e.children[1]),u=Zk(e.children[e.children.length-1]);a&&u&&(c.position={start:a,end:u}),i.push(c)}const l={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,l),t.applyData(e,l)}function gP(t,e,n){const r=n?n.children:void 0,l=(r?r.indexOf(e):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,a=c?c.length:e.children.length;let u=-1;const d=[];for(;++u<a;){const p=e.children[u],g={},x=c?c[u]:void 0;x&&(g.align=x);let w={type:"element",tagName:l,properties:g,children:[]};p&&(w.children=t.all(p),t.patch(p,w),w=t.applyData(p,w)),d.push(w)}const m={type:"element",tagName:"tr",properties:{},children:t.wrap(d,!0)};return t.patch(e,m),t.applyData(e,m)}function vP(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const m_=9,g_=32;function yP(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const l=[];for(;r;)l.push(v_(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return l.push(v_(e.slice(i),i>0,!1)),l.join("")}function v_(t,e,n){let r=0,i=t.length;if(e){let l=t.codePointAt(r);for(;l===m_||l===g_;)r++,l=t.codePointAt(r)}if(n){let l=t.codePointAt(i-1);for(;l===m_||l===g_;)i--,l=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function bP(t,e){const n={type:"text",value:yP(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function xP(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const _P={blockquote:X9,break:Q9,code:Z9,delete:J9,emphasis:eP,footnoteReference:tP,heading:nP,html:rP,imageReference:sP,image:iP,inlineCode:oP,linkReference:aP,link:lP,listItem:cP,list:dP,paragraph:fP,root:hP,strong:pP,table:mP,tableCell:vP,tableRow:gP,text:bP,thematicBreak:xP,toml:_d,yaml:_d,definition:_d,footnoteDefinition:_d};function _d(){}const xE=-1,Kf=0,vc=1,ef=2,Hv=3,$v=4,Uv=5,Vv=6,_E=7,SE=8,y_=typeof self=="object"?self:globalThis,SP=(t,e)=>{const n=(i,l)=>(t.set(l,i),i),r=i=>{if(t.has(i))return t.get(i);const[l,c]=e[i];switch(l){case Kf:case xE:return n(c,i);case vc:{const a=n([],i);for(const u of c)a.push(r(u));return a}case ef:{const a=n({},i);for(const[u,d]of c)a[r(u)]=r(d);return a}case Hv:return n(new Date(c),i);case $v:{const{source:a,flags:u}=c;return n(new RegExp(a,u),i)}case Uv:{const a=n(new Map,i);for(const[u,d]of c)a.set(r(u),r(d));return a}case Vv:{const a=n(new Set,i);for(const u of c)a.add(r(u));return a}case _E:{const{name:a,message:u}=c;return n(new y_[a](u),i)}case SE:return n(BigInt(c),i);case"BigInt":return n(Object(BigInt(c)),i);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:a}=new Uint8Array(c);return n(new DataView(a),c)}}return n(new y_[l](c),i)};return r},b_=t=>SP(new Map,t)(0),Ma="",{toString:wP}={},{keys:CP}=Object,dc=t=>{const e=typeof t;if(e!=="object"||!t)return[Kf,e];const n=wP.call(t).slice(8,-1);switch(n){case"Array":return[vc,Ma];case"Object":return[ef,Ma];case"Date":return[Hv,Ma];case"RegExp":return[$v,Ma];case"Map":return[Uv,Ma];case"Set":return[Vv,Ma];case"DataView":return[vc,n]}return n.includes("Array")?[vc,n]:n.includes("Error")?[_E,n]:[ef,n]},Sd=([t,e])=>t===Kf&&(e==="function"||e==="symbol"),kP=(t,e,n,r)=>{const i=(c,a)=>{const u=r.push(c)-1;return n.set(a,u),u},l=c=>{if(n.has(c))return n.get(c);let[a,u]=dc(c);switch(a){case Kf:{let m=c;switch(u){case"bigint":a=SE,m=c.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return i([xE],c)}return i([a,m],c)}case vc:{if(u){let g=c;return u==="DataView"?g=new Uint8Array(c.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(c)),i([u,[...g]],c)}const m=[],p=i([a,m],c);for(const g of c)m.push(l(g));return p}case ef:{if(u)switch(u){case"BigInt":return i([u,c.toString()],c);case"Boolean":case"Number":case"String":return i([u,c.valueOf()],c)}if(e&&"toJSON"in c)return l(c.toJSON());const m=[],p=i([a,m],c);for(const g of CP(c))(t||!Sd(dc(c[g])))&&m.push([l(g),l(c[g])]);return p}case Hv:return i([a,c.toISOString()],c);case $v:{const{source:m,flags:p}=c;return i([a,{source:m,flags:p}],c)}case Uv:{const m=[],p=i([a,m],c);for(const[g,x]of c)(t||!(Sd(dc(g))||Sd(dc(x))))&&m.push([l(g),l(x)]);return p}case Vv:{const m=[],p=i([a,m],c);for(const g of c)(t||!Sd(dc(g)))&&m.push(l(g));return p}}const{message:d}=c;return i([a,{name:u,message:d}],c)};return l},x_=(t,{json:e,lossy:n}={})=>{const r=[];return kP(!(e||n),!!e,new Map,r)(t),r},tf=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?b_(x_(t,e)):structuredClone(t):(t,e)=>b_(x_(t,e));function EP(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function AP(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function NP(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||EP,r=t.options.footnoteBackLabel||AP,i=t.options.footnoteLabel||"Footnotes",l=t.options.footnoteLabelTagName||"h2",c=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<t.footnoteOrder.length;){const d=t.footnoteById.get(t.footnoteOrder[u]);if(!d)continue;const m=t.all(d),p=String(d.identifier).toUpperCase(),g=ll(p.toLowerCase());let x=0;const w=[],C=t.footnoteCounts.get(p);for(;C!==void 0&&++x<=C;){w.length>0&&w.push({type:"text",value:" "});let b=typeof n=="string"?n:n(u,x);typeof b=="string"&&(b={type:"text",value:b}),w.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,x),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=m[m.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...w)}else m.push(...w);const S={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(m,!0)};t.patch(d,S),a.push(S)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...tf(c),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
579
|
-
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:`
|
|
580
|
-
`}]}}const Yf=(function(t){if(t==null)return DP;if(typeof t=="function")return Xf(t);if(typeof t=="object")return Array.isArray(t)?RP(t):jP(t);if(typeof t=="string")return TP(t);throw new Error("Expected function, string, or object as test")});function RP(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Yf(t[n]);return Xf(r);function r(...i){let l=-1;for(;++l<e.length;)if(e[l].apply(this,i))return!0;return!1}}function jP(t){const e=t;return Xf(n);function n(r){const i=r;let l;for(l in t)if(i[l]!==e[l])return!1;return!0}}function TP(t){return Xf(e);function e(n){return n&&n.type===t}}function Xf(t){return e;function e(n,r,i){return!!(MP(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function DP(){return!0}function MP(t){return t!==null&&typeof t=="object"&&"type"in t}const wE=[],OP=!0,Tg=!1,LP="skip";function CE(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const l=Yf(i),c=r?-1:1;a(t,void 0,[])();function a(u,d,m){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(u.type+(x?"<"+x+">":""))+")"})}return g;function g(){let x=wE,w,C,y;if((!e||l(u,d,m[m.length-1]||void 0))&&(x=IP(n(u,m)),x[0]===Tg))return x;if("children"in u&&u.children){const S=u;if(S.children&&x[0]!==LP)for(C=(r?S.children.length:-1)+c,y=m.concat(S);C>-1&&C<S.children.length;){const b=S.children[C];if(w=a(b,C,y)(),w[0]===Tg)return w;C=typeof w[1]=="number"?w[1]:C+c}}return x}}}function IP(t){return Array.isArray(t)?t:typeof t=="number"?[OP,t]:t==null?wE:[t]}function qv(t,e,n,r){let i,l,c;typeof e=="function"&&typeof n!="function"?(l=void 0,c=e,i=n):(l=e,c=n,i=r),CE(t,l,a,i);function a(u,d){const m=d[d.length-1],p=m?m.children.indexOf(u):void 0;return c(u,p,m)}}const Dg={}.hasOwnProperty,PP={};function zP(t,e){const n=e||PP,r=new Map,i=new Map,l=new Map,c={..._P,...n.handlers},a={all:d,applyData:FP,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:c,one:u,options:n,patch:BP,wrap:$P};return qv(t,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();p.has(g)||p.set(g,m)}}),a;function u(m,p){const g=m.type,x=a.handlers[g];if(Dg.call(a.handlers,g)&&x)return x(a,m,p);if(a.options.passThrough&&a.options.passThrough.includes(g)){if("children"in m){const{children:C,...y}=m,S=tf(y);return S.children=a.all(m),S}return tf(m)}return(a.options.unknownHandler||HP)(a,m,p)}function d(m){const p=[];if("children"in m){const g=m.children;let x=-1;for(;++x<g.length;){const w=a.one(g[x],m);if(w){if(x&&g[x-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=__(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=__(C.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function BP(t,e){t.position&&(e.position=A7(t))}function FP(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,l=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const c="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:c}}n.type==="element"&&l&&Object.assign(n.properties,tf(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function HP(t,e){const n=e.data||{},r="value"in e&&!(Dg.call(n,"hProperties")||Dg.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function $P(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
581
|
-
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
582
|
-
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
583
|
-
`}),n}function __(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function S_(t,e){const n=zP(t,e),r=n.one(t,void 0),i=NP(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
584
|
-
`},i),l}function UP(t,e){return t&&"run"in t?async function(n,r){const i=S_(n,{file:r,...e});await t.run(i,r)}:function(n,r){return S_(n,{file:r,...t||e})}}function w_(t){if(t)throw t}var zm,C_;function VP(){if(C_)return zm;C_=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},l=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var m=t.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!p)return!1;var g;for(g in d);return typeof g>"u"||t.call(d,g)},c=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},a=function(d,m){if(m==="__proto__")if(t.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return zm=function u(){var d,m,p,g,x,w,C=arguments[0],y=1,S=arguments.length,b=!1;for(typeof C=="boolean"&&(b=C,C=arguments[1]||{},y=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});y<S;++y)if(d=arguments[y],d!=null)for(m in d)p=a(C,m),g=a(d,m),C!==g&&(b&&g&&(l(g)||(x=i(g)))?(x?(x=!1,w=p&&i(p)?p:[]):w=p&&l(p)?p:{},c(C,{name:m,newValue:u(b,w,g)})):typeof g<"u"&&c(C,{name:m,newValue:g}));return C},zm}var qP=VP();const Bm=sf(qP);function Mg(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function WP(){const t=[],e={run:n,use:r};return e;function n(...i){let l=-1;const c=i.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);a(null,...i);function a(u,...d){const m=t[++l];let p=-1;if(u){c(u);return}for(;++p<i.length;)(d[p]===null||d[p]===void 0)&&(d[p]=i[p]);i=d,m?GP(m,a)(...d):c(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function GP(t,e){let n;return r;function r(...c){const a=t.length>c.length;let u;a&&c.push(i);try{u=t.apply(this,c)}catch(d){const m=d;if(a&&n)throw m;return i(m)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(c,...a){n||(n=!0,e(c,...a))}function l(c){i(null,c)}}const cs={basename:KP,dirname:YP,extname:XP,join:QP,sep:"/"};function KP(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Xc(t);let n=0,r=-1,i=t.length,l;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let c=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(l){n=i+1;break}}else c<0&&(l=!0,c=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=c));return n===r?r=c:r<0&&(r=t.length),t.slice(n,r)}function YP(t){if(Xc(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function XP(t){Xc(t);let e=t.length,n=-1,r=0,i=-1,l=0,c;for(;e--;){const a=t.codePointAt(e);if(a===47){if(c){r=e+1;break}continue}n<0&&(c=!0,n=e+1),a===46?i<0?i=e:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function QP(...t){let e=-1,n;for(;++e<t.length;)Xc(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":ZP(n)}function ZP(t){Xc(t);const e=t.codePointAt(0)===47;let n=JP(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function JP(t,e){let n="",r=0,i=-1,l=0,c=-1,a,u;for(;++c<=t.length;){if(c<t.length)a=t.codePointAt(c);else{if(a===47)break;a=47}if(a===47){if(!(i===c-1||l===1))if(i!==c-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=c,l=0;continue}}else if(n.length>0){n="",r=0,i=c,l=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,c):n=t.slice(i+1,c),r=c-i-1;i=c,l=0}else a===46&&l>-1?l++:l=-1}return n}function Xc(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const ez={cwd:tz};function tz(){return"/"}function Og(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function nz(t){if(typeof t=="string")t=new URL(t);else if(!Og(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return rz(t)}function rz(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Fm=["history","path","basename","stem","extname","dirname"];class kE{constructor(e){let n;e?Og(e)?n={path:e}:typeof e=="string"||sz(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":ez.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Fm.length;){const l=Fm[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)Fm.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?cs.basename(this.path):void 0}set basename(e){$m(e,"basename"),Hm(e,"basename"),this.path=cs.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?cs.dirname(this.path):void 0}set dirname(e){k_(this.basename,"dirname"),this.path=cs.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?cs.extname(this.path):void 0}set extname(e){if(Hm(e,"extname"),k_(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=cs.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Og(e)&&(e=nz(e)),$m(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?cs.basename(this.path,this.extname):void 0}set stem(e){$m(e,"stem"),Hm(e,"stem"),this.path=cs.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new qn(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Hm(t,e){if(t&&t.includes(cs.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+cs.sep+"`")}function $m(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function k_(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function sz(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const iz=(function(t){const r=this.constructor.prototype,i=r[t],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),oz={}.hasOwnProperty;class Wv extends iz{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=WP()}copy(){const e=new Wv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(Bm(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(qm("data",this.frozen),this.namespace[e]=n,this):oz.call(this.namespace,e)&&this.namespace[e]||void 0:e?(qm("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=wd(e),r=this.parser||this.Parser;return Um("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),Um("process",this.parser||this.Parser),Vm("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,c){const a=wd(e),u=r.parse(a);r.run(u,a,function(m,p,g){if(m||!p||!g)return d(m);const x=p,w=r.stringify(x,g);cz(w)?g.value=w:g.result=w,d(m,g)});function d(m,p){m||!p?c(m):l?l(p):n(void 0,p)}}}processSync(e){let n=!1,r;return this.freeze(),Um("processSync",this.parser||this.Parser),Vm("processSync",this.compiler||this.Compiler),this.process(e,i),A_("processSync","process",n),r;function i(l,c){n=!0,w_(l),r=c}}run(e,n,r){E_(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(c,a){const u=wd(n);i.run(e,u,d);function d(m,p,g){const x=p||e;m?a(m):c?c(x):r(void 0,x,g)}}}runSync(e,n){let r=!1,i;return this.run(e,n,l),A_("runSync","run",r),i;function l(c,a){w_(c),i=a,r=!0}}stringify(e,n){this.freeze();const r=wd(n),i=this.compiler||this.Compiler;return Vm("stringify",i),E_(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(qm("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?a(e):c(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function l(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...p]=d;u(m,p)}else c(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function c(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(d.plugins),d.settings&&(i.settings=Bm(!0,i.settings,d.settings))}function a(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const p=d[m];l(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,m){let p=-1,g=-1;for(;++p<r.length;)if(r[p][0]===d){g=p;break}if(g===-1)r.push([d,...m]);else if(m.length>0){let[x,...w]=m;const C=r[g][1];Mg(C)&&Mg(x)&&(x=Bm(!0,C,x)),r[g]=[d,x,...w]}}}}const az=new Wv().freeze();function Um(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Vm(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function qm(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function E_(t){if(!Mg(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function A_(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function wd(t){return lz(t)?t:new kE(t)}function lz(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function cz(t){return typeof t=="string"||uz(t)}function uz(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const dz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",N_=[],R_={allowDangerousHtml:!0},fz=/^(https?|ircs?|mailto|xmpp)$/i,hz=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function pz(t){const e=mz(t),n=gz(t);return vz(e.runSync(e.parse(n),n),t)}function mz(t){const e=t.rehypePlugins||N_,n=t.remarkPlugins||N_,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...R_}:R_;return az().use(Y9).use(n).use(UP,r).use(e)}function gz(t){const e=t.children||"",n=new kE;return typeof e=="string"&&(n.value=e),n}function vz(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,l=e.disallowedElements,c=e.skipHtml,a=e.unwrapDisallowed,u=e.urlTransform||yz;for(const m of hz)Object.hasOwn(e,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+dz+m.id,void 0);return qv(t,d),D7(t,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function d(m,p,g){if(m.type==="raw"&&g&&typeof p=="number")return c?g.children.splice(p,1):g.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let x;for(x in Lm)if(Object.hasOwn(Lm,x)&&Object.hasOwn(m.properties,x)){const w=m.properties[x],C=Lm[x];(C===null||C.includes(m.tagName))&&(m.properties[x]=u(String(w||""),x,m))}}if(m.type==="element"){let x=n?!n.includes(m.tagName):l?l.includes(m.tagName):!1;if(!x&&r&&typeof p=="number"&&(x=!r(m,p,g)),x&&g&&typeof p=="number")return a&&m.children?g.children.splice(p,1,...m.children):g.children.splice(p,1),p}}}function yz(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||fz.test(t.slice(0,e))?t:""}function j_(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function bz(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function xz(t,e,n){const i=Yf((n||{}).ignore||[]),l=_z(e);let c=-1;for(;++c<l.length;)CE(t,"text",a);function a(d,m){let p=-1,g;for(;++p<m.length;){const x=m[p],w=g?g.children:void 0;if(i(x,w?w.indexOf(x):void 0,g))return;g=x}if(g)return u(d,m)}function u(d,m){const p=m[m.length-1],g=l[c][0],x=l[c][1];let w=0;const y=p.children.indexOf(d);let S=!1,b=[];g.lastIndex=0;let _=g.exec(d.value);for(;_;){const k=_.index,j={index:_.index,input:_.input,stack:[...m,d]};let N=x(..._,j);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?g.lastIndex=k+1:(w!==k&&b.push({type:"text",value:d.value.slice(w,k)}),Array.isArray(N)?b.push(...N):N&&b.push(N),w=k+_[0].length,S=!0),!g.global)break;_=g.exec(d.value)}return S?(w<d.value.length&&b.push({type:"text",value:d.value.slice(w)}),p.children.splice(y,1,...b)):b=[d],y+b.length}}function _z(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([Sz(i[0]),wz(i[1])])}return e}function Sz(t){return typeof t=="string"?new RegExp(bz(t),"g"):t}function wz(t){return typeof t=="function"?t:function(){return t}}const Wm="phrasing",Gm=["autolink","link","image","label"];function Cz(){return{transforms:[Tz],enter:{literalAutolink:Ez,literalAutolinkEmail:Km,literalAutolinkHttp:Km,literalAutolinkWww:Km},exit:{literalAutolink:jz,literalAutolinkEmail:Rz,literalAutolinkHttp:Az,literalAutolinkWww:Nz}}}function kz(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Wm,notInConstruct:Gm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Wm,notInConstruct:Gm},{character:":",before:"[ps]",after:"\\/",inConstruct:Wm,notInConstruct:Gm}]}}function Ez(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Km(t){this.config.enter.autolinkProtocol.call(this,t)}function Az(t){this.config.exit.autolinkProtocol.call(this,t)}function Nz(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function Rz(t){this.config.exit.autolinkEmail.call(this,t)}function jz(t){this.exit(t)}function Tz(t){xz(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Dz],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Mz]],{ignore:["link","linkReference"]})}function Dz(t,e,n,r,i){let l="";if(!EE(i)||(/^w/i.test(e)&&(n=e+n,e="",l="http://"),!Oz(n)))return!1;const c=Lz(n+r);if(!c[0])return!1;const a={type:"link",title:null,url:l+e+c[0],children:[{type:"text",value:e+c[0]}]};return c[1]?[a,{type:"text",value:c[1]}]:a}function Mz(t,e,n,r){return!EE(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function Oz(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function Lz(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=j_(t,"(");let l=j_(t,")");for(;r!==-1&&i>l;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[t,n]}function EE(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||zo(n)||Wf(n))&&(!e||n!==47)}AE.peek=Vz;function Iz(){this.buffer()}function Pz(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function zz(){this.buffer()}function Bz(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Fz(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Hz(t){this.exit(t)}function $z(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Uz(t){this.exit(t)}function Vz(){return"["}function AE(t,e,n,r){const i=n.createTracker(r);let l=i.move("[^");const c=n.enter("footnoteReference"),a=n.enter("reference");return l+=i.move(n.safe(n.associationId(t),{after:"]",before:l})),a(),c(),l+=i.move("]"),l}function qz(){return{enter:{gfmFootnoteCallString:Iz,gfmFootnoteCall:Pz,gfmFootnoteDefinitionLabelString:zz,gfmFootnoteDefinition:Bz},exit:{gfmFootnoteCallString:Fz,gfmFootnoteCall:Hz,gfmFootnoteDefinitionLabelString:$z,gfmFootnoteDefinition:Uz}}}function Wz(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:AE},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,c){const a=l.createTracker(c);let u=a.move("[^");const d=l.enter("footnoteDefinition"),m=l.enter("label");return u+=a.move(l.safe(l.associationId(r),{before:u,after:"]"})),m(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((e?`
|
|
585
|
-
`:" ")+l.indentLines(l.containerFlow(r,a.current()),e?NE:Gz))),d(),u}}function Gz(t,e,n){return e===0?t:NE(t,e,n)}function NE(t,e,n){return(n?"":" ")+t}const Kz=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];RE.peek=Jz;function Yz(){return{canContainEols:["delete"],enter:{strikethrough:Qz},exit:{strikethrough:Zz}}}function Xz(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Kz}],handlers:{delete:RE}}}function Qz(t){this.enter({type:"delete",children:[]},t)}function Zz(t){this.exit(t)}function RE(t,e,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let c=i.move("~~");return c+=n.containerPhrasing(t,{...i.current(),before:c,after:"~"}),c+=i.move("~~"),l(),c}function Jz(){return"~"}function eB(t){return t.length}function tB(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||eB,l=[],c=[],a=[],u=[];let d=0,m=-1;for(;++m<t.length;){const C=[],y=[];let S=-1;for(t[m].length>d&&(d=t[m].length);++S<t[m].length;){const b=nB(t[m][S]);if(n.alignDelimiters!==!1){const _=i(b);y[S]=_,(u[S]===void 0||_>u[S])&&(u[S]=_)}C.push(b)}c[m]=C,a[m]=y}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)l[p]=T_(r[p]);else{const C=T_(r);for(;++p<d;)l[p]=C}p=-1;const g=[],x=[];for(;++p<d;){const C=l[p];let y="",S="";C===99?(y=":",S=":"):C===108?y=":":C===114&&(S=":");let b=n.alignDelimiters===!1?1:Math.max(1,u[p]-y.length-S.length);const _=y+"-".repeat(b)+S;n.alignDelimiters!==!1&&(b=y.length+b+S.length,b>u[p]&&(u[p]=b),x[p]=b),g[p]=_}c.splice(1,0,g),a.splice(1,0,x),m=-1;const w=[];for(;++m<c.length;){const C=c[m],y=a[m];p=-1;const S=[];for(;++p<d;){const b=C[p]||"";let _="",k="";if(n.alignDelimiters!==!1){const j=u[p]-(y[p]||0),N=l[p];N===114?_=" ".repeat(j):N===99?j%2?(_=" ".repeat(j/2+.5),k=" ".repeat(j/2-.5)):(_=" ".repeat(j/2),k=_):k=" ".repeat(j)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(_),S.push(b),n.alignDelimiters!==!1&&S.push(k),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&S.push("|")}w.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(`
|
|
586
|
-
`)}function nB(t){return t==null?"":String(t)}function T_(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function rB(t,e,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const c=n.indentLines(n.containerFlow(t,l.current()),sB);return i(),c}function sB(t,e,n){return">"+(n?"":" ")+t}function iB(t,e){return D_(t,e.inConstruct,!0)&&!D_(t,e.notInConstruct,!1)}function D_(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function M_(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
587
|
-
`&&iB(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
588
|
-
`}function oB(t,e){const n=String(t);let r=n.indexOf(e),i=r,l=0,c=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>c&&(c=l):l=1,i=r+e.length,r=n.indexOf(e,i);return c}function aB(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function lB(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function cB(t,e,n,r){const i=lB(n),l=t.value||"",c=i==="`"?"GraveAccent":"Tilde";if(aB(t,n)){const p=n.enter("codeIndented"),g=n.indentLines(l,uB);return p(),g}const a=n.createTracker(r),u=i.repeat(Math.max(oB(l,i)+1,3)),d=n.enter("codeFenced");let m=a.move(u);if(t.lang){const p=n.enter(`codeFencedLang${c}`);m+=a.move(n.safe(t.lang,{before:m,after:" ",encode:["`"],...a.current()})),p()}if(t.lang&&t.meta){const p=n.enter(`codeFencedMeta${c}`);m+=a.move(" "),m+=a.move(n.safe(t.meta,{before:m,after:`
|
|
589
|
-
`,encode:["`"],...a.current()})),p()}return m+=a.move(`
|
|
590
|
-
`),l&&(m+=a.move(l+`
|
|
591
|
-
`)),m+=a.move(u),d(),m}function uB(t,e,n){return(n?"":" ")+t}function Gv(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function dB(t,e,n,r){const i=Gv(n),l=i==='"'?"Quote":"Apostrophe",c=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(t),{before:d,after:"]",...u.current()})),d+=u.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":`
|
|
592
|
-
`,...u.current()}))),a(),t.title&&(a=n.enter(`title${l}`),d+=u.move(" "+i),d+=u.move(n.safe(t.title,{before:d,after:i,...u.current()})),d+=u.move(i),a()),c(),d}function fB(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Dc(t){return"&#x"+t.toString(16).toUpperCase()+";"}function nf(t,e,n){const r=Ka(t),i=Ka(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}jE.peek=hB;function jE(t,e,n,r){const i=fB(n),l=n.enter("emphasis"),c=n.createTracker(r),a=c.move(i);let u=c.move(n.containerPhrasing(t,{after:i,before:a,...c.current()}));const d=u.charCodeAt(0),m=nf(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Dc(d)+u.slice(1));const p=u.charCodeAt(u.length-1),g=nf(r.after.charCodeAt(0),p,i);g.inside&&(u=u.slice(0,-1)+Dc(p));const x=c.move(i);return l(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},a+u+x}function hB(t,e,n){return n.options.emphasis||"*"}function pB(t,e){let n=!1;return qv(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Tg}),!!((!t.depth||t.depth<3)&&zv(t)&&(e.options.setext||n))}function mB(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),l=n.createTracker(r);if(pB(t,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),g=n.containerPhrasing(t,{...l.current(),before:`
|
|
593
|
-
`,after:`
|
|
594
|
-
`});return p(),m(),g+`
|
|
595
|
-
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
|
|
596
|
-
`))+1))}const c="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");l.move(c+" ");let d=n.containerPhrasing(t,{before:"# ",after:`
|
|
597
|
-
`,...l.current()});return/^[\t ]/.test(d)&&(d=Dc(d.charCodeAt(0))+d.slice(1)),d=d?c+" "+d:c,n.options.closeAtx&&(d+=" "+c),u(),a(),d}TE.peek=gB;function TE(t){return t.value||""}function gB(){return"<"}DE.peek=vB;function DE(t,e,n,r){const i=Gv(n),l=i==='"'?"Quote":"Apostrophe",c=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(t.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":")",...u.current()}))),a(),t.title&&(a=n.enter(`title${l}`),d+=u.move(" "+i),d+=u.move(n.safe(t.title,{before:d,after:i,...u.current()})),d+=u.move(i),a()),d+=u.move(")"),c(),d}function vB(){return"!"}ME.peek=yB;function ME(t,e,n,r){const i=t.referenceType,l=n.enter("imageReference");let c=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const d=n.safe(t.alt,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),c();const m=n.stack;n.stack=[],c=n.enter("reference");const p=n.safe(n.associationId(t),{before:u,after:"]",...a.current()});return c(),n.stack=m,l(),i==="full"||!d||d!==p?u+=a.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function yB(){return"!"}OE.peek=bB;function OE(t,e,n){let r=t.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const c=n.unsafe[l],a=n.compilePattern(c);let u;if(c.atBreak)for(;u=a.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function bB(){return"`"}function LE(t,e){const n=zv(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}IE.peek=xB;function IE(t,e,n,r){const i=Gv(n),l=i==='"'?"Quote":"Apostrophe",c=n.createTracker(r);let a,u;if(LE(t,n)){const m=n.stack;n.stack=[],a=n.enter("autolink");let p=c.move("<");return p+=c.move(n.containerPhrasing(t,{before:p,after:">",...c.current()})),p+=c.move(">"),a(),n.stack=m,p}a=n.enter("link"),u=n.enter("label");let d=c.move("[");return d+=c.move(n.containerPhrasing(t,{before:d,after:"](",...c.current()})),d+=c.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(u=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":")",...c.current()}))),u(),t.title&&(u=n.enter(`title${l}`),d+=c.move(" "+i),d+=c.move(n.safe(t.title,{before:d,after:i,...c.current()})),d+=c.move(i),u()),d+=c.move(")"),a(),d}function xB(t,e,n){return LE(t,n)?"<":"["}PE.peek=_B;function PE(t,e,n,r){const i=t.referenceType,l=n.enter("linkReference");let c=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const d=n.containerPhrasing(t,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),c();const m=n.stack;n.stack=[],c=n.enter("reference");const p=n.safe(n.associationId(t),{before:u,after:"]",...a.current()});return c(),n.stack=m,l(),i==="full"||!d||d!==p?u+=a.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function _B(){return"["}function Kv(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function SB(t){const e=Kv(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function wB(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function zE(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function CB(t,e,n,r){const i=n.enter("list"),l=n.bulletCurrent;let c=t.ordered?wB(n):Kv(n);const a=t.ordered?c==="."?")":".":SB(n);let u=e&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!t.ordered){const m=t.children?t.children[0]:void 0;if((c==="*"||c==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),zE(n)===c&&m){let p=-1;for(;++p<t.children.length;){const g=t.children[p];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(c=a),n.bulletCurrent=c;const d=n.containerFlow(t,r);return n.bulletLastUsed=c,n.bulletCurrent=l,i(),d}function kB(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function EB(t,e,n,r){const i=kB(n);let l=n.bulletCurrent||Kv(n);e&&e.type==="list"&&e.ordered&&(l=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+l);let c=l.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(c=Math.ceil(c/4)*4);const a=n.createTracker(r);a.move(l+" ".repeat(c-l.length)),a.shift(c);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,a.current()),m);return u(),d;function m(p,g,x){return g?(x?"":" ".repeat(c))+p:(x?l:l+" ".repeat(c-l.length))+p}}function AB(t,e,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),c=n.containerPhrasing(t,r);return l(),i(),c}const NB=Yf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RB(t,e,n,r){return(t.children.some(function(c){return NB(c)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function jB(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}BE.peek=TB;function BE(t,e,n,r){const i=jB(n),l=n.enter("strong"),c=n.createTracker(r),a=c.move(i+i);let u=c.move(n.containerPhrasing(t,{after:i,before:a,...c.current()}));const d=u.charCodeAt(0),m=nf(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Dc(d)+u.slice(1));const p=u.charCodeAt(u.length-1),g=nf(r.after.charCodeAt(0),p,i);g.inside&&(u=u.slice(0,-1)+Dc(p));const x=c.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},a+u+x}function TB(t,e,n){return n.options.strong||"*"}function DB(t,e,n,r){return n.safe(t.value,r)}function MB(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function OB(t,e,n){const r=(zE(n)+(n.options.ruleSpaces?" ":"")).repeat(MB(n));return n.options.ruleSpaces?r.slice(0,-1):r}const FE={blockquote:rB,break:M_,code:cB,definition:dB,emphasis:jE,hardBreak:M_,heading:mB,html:TE,image:DE,imageReference:ME,inlineCode:OE,link:IE,linkReference:PE,list:CB,listItem:EB,paragraph:AB,root:RB,strong:BE,text:DB,thematicBreak:OB};function LB(){return{enter:{table:IB,tableData:O_,tableHeader:O_,tableRow:zB},exit:{codeText:BB,table:PB,tableData:Ym,tableHeader:Ym,tableRow:Ym}}}function IB(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function PB(t){this.exit(t),this.data.inTable=void 0}function zB(t){this.enter({type:"tableRow",children:[]},t)}function Ym(t){this.exit(t)}function O_(t){this.enter({type:"tableCell",children:[]},t)}function BB(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,FB));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function FB(t,e){return e==="|"?e:t}function HB(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
598
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:c,tableCell:u,tableRow:a}};function c(x,w,C,y){return d(m(x,C,y),x.align)}function a(x,w,C,y){const S=p(x,C,y),b=d([S]);return b.slice(0,b.indexOf(`
|
|
599
|
-
`))}function u(x,w,C,y){const S=C.enter("tableCell"),b=C.enter("phrasing"),_=C.containerPhrasing(x,{...y,before:l,after:l});return b(),S(),_}function d(x,w){return tB(x,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function m(x,w,C){const y=x.children;let S=-1;const b=[],_=w.enter("table");for(;++S<y.length;)b[S]=p(y[S],w,C);return _(),b}function p(x,w,C){const y=x.children;let S=-1;const b=[],_=w.enter("tableRow");for(;++S<y.length;)b[S]=u(y[S],x,w,C);return _(),b}function g(x,w,C){let y=FE.inlineCode(x,w,C);return C.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function $B(){return{exit:{taskListCheckValueChecked:L_,taskListCheckValueUnchecked:L_,paragraph:VB}}}function UB(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:qB}}}function L_(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function VB(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let l=-1,c;for(;++l<i.length;){const a=i[l];if(a.type==="paragraph"){c=a;break}}c===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function qB(t,e,n,r){const i=t.children[0],l=typeof t.checked=="boolean"&&i&&i.type==="paragraph",c="["+(t.checked?"x":" ")+"] ",a=n.createTracker(r);l&&a.move(c);let u=FE.listItem(t,e,n,{...r,...a.current()});return l&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(m){return m+c}}function WB(){return[Cz(),qz(),Yz(),LB(),$B()]}function GB(t){return{extensions:[kz(),Wz(t),Xz(),HB(t),UB()]}}const KB={tokenize:eF,partial:!0},HE={tokenize:tF,partial:!0},$E={tokenize:nF,partial:!0},UE={tokenize:rF,partial:!0},YB={tokenize:sF,partial:!0},VE={name:"wwwAutolink",tokenize:ZB,previous:WE},qE={name:"protocolAutolink",tokenize:JB,previous:GE},Qs={name:"emailAutolink",tokenize:QB,previous:KE},ys={};function XB(){return{text:ys}}let No=48;for(;No<123;)ys[No]=Qs,No++,No===58?No=65:No===91&&(No=97);ys[43]=Qs;ys[45]=Qs;ys[46]=Qs;ys[95]=Qs;ys[72]=[Qs,qE];ys[104]=[Qs,qE];ys[87]=[Qs,VE];ys[119]=[Qs,VE];function QB(t,e,n){const r=this;let i,l;return c;function c(p){return!Lg(p)||!KE.call(r,r.previous)||Yv(r.events)?n(p):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(p))}function a(p){return Lg(p)?(t.consume(p),a):p===64?(t.consume(p),u):n(p)}function u(p){return p===46?t.check(YB,m,d)(p):p===45||p===95||Un(p)?(l=!0,t.consume(p),u):m(p)}function d(p){return t.consume(p),i=!0,u}function m(p){return l&&i&&Yn(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(p)):n(p)}}function ZB(t,e,n){const r=this;return i;function i(c){return c!==87&&c!==119||!WE.call(r,r.previous)||Yv(r.events)?n(c):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(KB,t.attempt(HE,t.attempt($E,l),n),n)(c))}function l(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(c)}}function JB(t,e,n){const r=this;let i="",l=!1;return c;function c(p){return(p===72||p===104)&&GE.call(r,r.previous)&&!Yv(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),t.consume(p),a):n(p)}function a(p){if(Yn(p)&&i.length<5)return i+=String.fromCodePoint(p),t.consume(p),a;if(p===58){const g=i.toLowerCase();if(g==="http"||g==="https")return t.consume(p),u}return n(p)}function u(p){return p===47?(t.consume(p),l?d:(l=!0,u)):n(p)}function d(p){return p===null||Jd(p)||Ut(p)||zo(p)||Wf(p)?n(p):t.attempt(HE,t.attempt($E,m),n)(p)}function m(p){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(p)}}function eF(t,e,n){let r=0;return i;function i(c){return(c===87||c===119)&&r<3?(r++,t.consume(c),i):c===46&&r===3?(t.consume(c),l):n(c)}function l(c){return c===null?n(c):e(c)}}function tF(t,e,n){let r,i,l;return c;function c(d){return d===46||d===95?t.check(UE,u,a)(d):d===null||Ut(d)||zo(d)||d!==45&&Wf(d)?u(d):(l=!0,t.consume(d),c)}function a(d){return d===95?r=!0:(i=r,r=void 0),t.consume(d),c}function u(d){return i||r||!l?n(d):e(d)}}function nF(t,e){let n=0,r=0;return i;function i(c){return c===40?(n++,t.consume(c),i):c===41&&r<n?l(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?t.check(UE,e,l)(c):c===null||Ut(c)||zo(c)?e(c):(t.consume(c),i)}function l(c){return c===41&&r++,t.consume(c),i}}function rF(t,e,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),r):a===38?(t.consume(a),l):a===93?(t.consume(a),i):a===60||a===null||Ut(a)||zo(a)?e(a):n(a)}function i(a){return a===null||a===40||a===91||Ut(a)||zo(a)?e(a):r(a)}function l(a){return Yn(a)?c(a):n(a)}function c(a){return a===59?(t.consume(a),r):Yn(a)?(t.consume(a),c):n(a)}}function sF(t,e,n){return r;function r(l){return t.consume(l),i}function i(l){return Un(l)?n(l):e(l)}}function WE(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ut(t)}function GE(t){return!Yn(t)}function KE(t){return!(t===47||Lg(t))}function Lg(t){return t===43||t===45||t===46||t===95||Un(t)}function Yv(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const iF={tokenize:hF,partial:!0};function oF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:uF,continuation:{tokenize:dF},exit:fF}},text:{91:{name:"gfmFootnoteCall",tokenize:cF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aF,resolveTo:lF}}}}function aF(t,e,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){c=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!c||!c._balanced)return n(u);const d=Zr(r.sliceSerialize({start:c.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function lF(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},a=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",l,e],["enter",c,e],["exit",c,e],["exit",l,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...a),t}function cF(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,c;return a;function a(p){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(t.enter("gfmFootnoteCallMarker"),t.consume(p),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(p){if(l>999||p===93&&!c||p===null||p===91||Ut(p))return n(p);if(p===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return i.includes(Zr(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(p)}return Ut(p)||(c=!0),l++,t.consume(p),p===92?m:d}function m(p){return p===91||p===92||p===93?(t.consume(p),l++,d):d(p)}}function uF(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,c=0,a;return u;function u(w){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(w),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(w),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",m):n(w)}function m(w){if(c>999||w===93&&!a||w===null||w===91||Ut(w))return n(w);if(w===93){t.exit("chunkString");const C=t.exit("gfmFootnoteDefinitionLabelString");return l=Zr(r.sliceSerialize(C)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(w),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return Ut(w)||(a=!0),c++,t.consume(w),w===92?p:m}function p(w){return w===91||w===92||w===93?(t.consume(w),c++,m):m(w)}function g(w){return w===58?(t.enter("definitionMarker"),t.consume(w),t.exit("definitionMarker"),i.includes(l)||i.push(l),Ct(t,x,"gfmFootnoteDefinitionWhitespace")):n(w)}function x(w){return e(w)}}function dF(t,e,n){return t.check(Yc,e,t.attempt(iF,e,n))}function fF(t){t.exit("gfmFootnoteDefinition")}function hF(t,e,n){const r=this;return Ct(t,i,"gfmFootnoteDefinitionIndent",5);function i(l){const c=r.events[r.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?e(l):n(l)}}function pF(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(c,a){let u=-1;for(;++u<c.length;)if(c[u][0]==="enter"&&c[u][1].type==="strikethroughSequenceTemporary"&&c[u][1]._close){let d=u;for(;d--;)if(c[d][0]==="exit"&&c[d][1].type==="strikethroughSequenceTemporary"&&c[d][1]._open&&c[u][1].end.offset-c[u][1].start.offset===c[d][1].end.offset-c[d][1].start.offset){c[u][1].type="strikethroughSequence",c[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},c[d][1].start),end:Object.assign({},c[u][1].end)},p={type:"strikethroughText",start:Object.assign({},c[d][1].end),end:Object.assign({},c[u][1].start)},g=[["enter",m,a],["enter",c[d][1],a],["exit",c[d][1],a],["enter",p,a]],x=a.parser.constructs.insideSpan.null;x&&Cr(g,g.length,0,Gf(x,c.slice(d+1,u),a)),Cr(g,g.length,0,[["exit",p,a],["enter",c[u][1],a],["exit",c[u][1],a],["exit",m,a]]),Cr(c,d-1,u-d+3,g),u=d+g.length-2;break}}for(u=-1;++u<c.length;)c[u][1].type==="strikethroughSequenceTemporary"&&(c[u][1].type="data");return c}function l(c,a,u){const d=this.previous,m=this.events;let p=0;return g;function g(w){return d===126&&m[m.length-1][1].type!=="characterEscape"?u(w):(c.enter("strikethroughSequenceTemporary"),x(w))}function x(w){const C=Ka(d);if(w===126)return p>1?u(w):(c.consume(w),p++,x);if(p<2&&!n)return u(w);const y=c.exit("strikethroughSequenceTemporary"),S=Ka(w);return y._open=!S||S===2&&!!C,y._close=!C||C===2&&!!S,a(w)}}}class mF{constructor(){this.map=[]}add(e,n,r){gF(this,e,n,r)}consume(e){if(this.map.sort(function(l,c){return l[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const l of i)e.push(l);i=r.pop()}this.map.length=0}}function gF(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function vF(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function yF(){return{flow:{null:{name:"table",tokenize:bF,resolveAll:xF}}}}function bF(t,e,n){const r=this;let i=0,l=0,c;return a;function a(L){let z=r.events.length-1;for(;z>-1;){const q=r.events[z][1].type;if(q==="lineEnding"||q==="linePrefix")z--;else break}const H=z>-1?r.events[z][1].type:null,$=H==="tableHead"||H==="tableRow"?N:u;return $===N&&r.parser.lazy[r.now().line]?n(L):$(L)}function u(L){return t.enter("tableHead"),t.enter("tableRow"),d(L)}function d(L){return L===124||(c=!0,l+=1),m(L)}function m(L){return L===null?n(L):rt(L)?l>1?(l=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),x):n(L):vt(L)?Ct(t,m,"whitespace")(L):(l+=1,c&&(c=!1,i+=1),L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),c=!0,m):(t.enter("data"),p(L)))}function p(L){return L===null||L===124||Ut(L)?(t.exit("data"),m(L)):(t.consume(L),L===92?g:p)}function g(L){return L===92||L===124?(t.consume(L),p):p(L)}function x(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(t.enter("tableDelimiterRow"),c=!1,vt(L)?Ct(t,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):w(L))}function w(L){return L===45||L===58?y(L):L===124?(c=!0,t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),C):j(L)}function C(L){return vt(L)?Ct(t,y,"whitespace")(L):y(L)}function y(L){return L===58?(l+=1,c=!0,t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),S):L===45?(l+=1,S(L)):L===null||rt(L)?k(L):j(L)}function S(L){return L===45?(t.enter("tableDelimiterFiller"),b(L)):j(L)}function b(L){return L===45?(t.consume(L),b):L===58?(c=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),_):(t.exit("tableDelimiterFiller"),_(L))}function _(L){return vt(L)?Ct(t,k,"whitespace")(L):k(L)}function k(L){return L===124?w(L):L===null||rt(L)?!c||i!==l?j(L):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(L)):j(L)}function j(L){return n(L)}function N(L){return t.enter("tableRow"),D(L)}function D(L){return L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),D):L===null||rt(L)?(t.exit("tableRow"),e(L)):vt(L)?Ct(t,D,"whitespace")(L):(t.enter("data"),E(L))}function E(L){return L===null||L===124||Ut(L)?(t.exit("data"),D(L)):(t.consume(L),L===92?O:E)}function O(L){return L===92||L===124?(t.consume(L),E):E(L)}}function xF(t,e){let n=-1,r=!0,i=0,l=[0,0,0,0],c=[0,0,0,0],a=!1,u=0,d,m,p;const g=new mF;for(;++n<t.length;){const x=t[n],w=x[1];x[0]==="enter"?w.type==="tableHead"?(a=!1,u!==0&&(I_(g,e,u,d,m),m=void 0,u=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},g.add(n,0,[["enter",d,e]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,p=void 0,l=[0,0,0,0],c=[0,n+1,0,0],a&&(a=!1,m={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},g.add(n,0,[["enter",m,e]])),i=w.type==="tableDelimiterRow"?2:m?3:1):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,c[2]===0&&(l[1]!==0&&(c[0]=c[1],p=Cd(g,e,l,i,void 0,p),l=[0,0,0,0]),c[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(c[0]=c[1],p=Cd(g,e,l,i,void 0,p)),l=c,c=[l[1],n,0,0])):w.type==="tableHead"?(a=!0,u=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(u=n,l[1]!==0?(c[0]=c[1],p=Cd(g,e,l,i,n,p)):c[1]!==0&&(p=Cd(g,e,c,i,n,p)),i=0):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(c[3]=n)}for(u!==0&&I_(g,e,u,d,m),g.consume(e.events),n=-1;++n<e.events.length;){const x=e.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=vF(e.events,n))}return t}function Cd(t,e,n,r,i,l){const c=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(l.end=Object.assign({},Pa(e.events,n[0])),t.add(n[0],0,[["exit",l,e]]));const u=Pa(e.events,n[1]);if(l={type:c,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",l,e]]),n[2]!==0){const d=Pa(e.events,n[2]),m=Pa(e.events,n[3]),p={type:a,start:Object.assign({},d),end:Object.assign({},m)};if(t.add(n[2],0,[["enter",p,e]]),r!==2){const g=e.events[n[2]],x=e.events[n[3]];if(g[1].end=Object.assign({},x[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,C=n[3]-n[2]-1;t.add(w,C,[])}}t.add(n[3]+1,0,[["exit",p,e]])}return i!==void 0&&(l.end=Object.assign({},Pa(e.events,i)),t.add(i,0,[["exit",l,e]]),l=void 0),l}function I_(t,e,n,r,i){const l=[],c=Pa(e.events,n);i&&(i.end=Object.assign({},c),l.push(["exit",i,e])),r.end=Object.assign({},c),l.push(["exit",r,e]),t.add(n+1,0,l)}function Pa(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const _F={name:"tasklistCheck",tokenize:wF};function SF(){return{text:{91:_F}}}function wF(t,e,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),l)}function l(u){return Ut(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),c):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),c):n(u)}function c(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):n(u)}function a(u){return rt(u)?e(u):vt(u)?t.check({tokenize:CF},e,n)(u):n(u)}}function CF(t,e,n){return Ct(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function kF(t){return iE([XB(),oF(),pF(t),yF(),SF()])}const EF={};function AF(t){const e=this,n=t||EF,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),c=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kF(n)),l.push(WB()),c.push(GB(n))}var NF=Object.create,Qf=Object.defineProperty,RF=Object.defineProperties,jF=Object.getOwnPropertyDescriptor,TF=Object.getOwnPropertyDescriptors,YE=Object.getOwnPropertyNames,rf=Object.getOwnPropertySymbols,DF=Object.getPrototypeOf,Xv=Object.prototype.hasOwnProperty,XE=Object.prototype.propertyIsEnumerable,P_=(t,e,n)=>e in t?Qf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ps=(t,e)=>{for(var n in e||(e={}))Xv.call(e,n)&&P_(t,n,e[n]);if(rf)for(var n of rf(e))XE.call(e,n)&&P_(t,n,e[n]);return t},Zf=(t,e)=>RF(t,TF(e)),QE=(t,e)=>{var n={};for(var r in t)Xv.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&rf)for(var r of rf(t))e.indexOf(r)<0&&XE.call(t,r)&&(n[r]=t[r]);return n},MF=(t,e)=>function(){return e||(0,t[YE(t)[0]])((e={exports:{}}).exports,e),e.exports},OF=(t,e)=>{for(var n in e)Qf(t,n,{get:e[n],enumerable:!0})},LF=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of YE(e))!Xv.call(t,i)&&i!==n&&Qf(t,i,{get:()=>e[i],enumerable:!(r=jF(e,i))||r.enumerable});return t},IF=(t,e,n)=>(n=t!=null?NF(DF(t)):{},LF(!t||!t.__esModule?Qf(n,"default",{value:t,enumerable:!0}):n,t)),PF=MF({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(t,e){var n=(function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,l={},c={util:{encode:function w(C){return C instanceof a?new a(C.type,w(C.content),C.alias):Array.isArray(C)?C.map(w):C.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(w){return Object.prototype.toString.call(w).slice(8,-1)},objId:function(w){return w.__id||Object.defineProperty(w,"__id",{value:++i}),w.__id},clone:function w(C,y){y=y||{};var S,b;switch(c.util.type(C)){case"Object":if(b=c.util.objId(C),y[b])return y[b];S={},y[b]=S;for(var _ in C)C.hasOwnProperty(_)&&(S[_]=w(C[_],y));return S;case"Array":return b=c.util.objId(C),y[b]?y[b]:(S=[],y[b]=S,C.forEach(function(k,j){S[j]=w(k,y)}),S);default:return C}},getLanguage:function(w){for(;w;){var C=r.exec(w.className);if(C)return C[1].toLowerCase();w=w.parentElement}return"none"},setLanguage:function(w,C){w.className=w.className.replace(RegExp(r,"gi"),""),w.classList.add("language-"+C)},isActive:function(w,C,y){for(var S="no-"+C;w;){var b=w.classList;if(b.contains(C))return!0;if(b.contains(S))return!1;w=w.parentElement}return!!y}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(w,C){var y=c.util.clone(c.languages[w]);for(var S in C)y[S]=C[S];return y},insertBefore:function(w,C,y,S){S=S||c.languages;var b=S[w],_={};for(var k in b)if(b.hasOwnProperty(k)){if(k==C)for(var j in y)y.hasOwnProperty(j)&&(_[j]=y[j]);y.hasOwnProperty(k)||(_[k]=b[k])}var N=S[w];return S[w]=_,c.languages.DFS(c.languages,function(D,E){E===N&&D!=w&&(this[D]=_)}),_},DFS:function w(C,y,S,b){b=b||{};var _=c.util.objId;for(var k in C)if(C.hasOwnProperty(k)){y.call(C,k,C[k],S||k);var j=C[k],N=c.util.type(j);N==="Object"&&!b[_(j)]?(b[_(j)]=!0,w(j,y,null,b)):N==="Array"&&!b[_(j)]&&(b[_(j)]=!0,w(j,y,k,b))}}},plugins:{},highlight:function(w,C,y){var S={code:w,grammar:C,language:y};if(c.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=c.tokenize(S.code,S.grammar),c.hooks.run("after-tokenize",S),a.stringify(c.util.encode(S.tokens),S.language)},tokenize:function(w,C){var y=C.rest;if(y){for(var S in y)C[S]=y[S];delete C.rest}var b=new m;return p(b,b.head,w),d(w,b,C,b.head,0),x(b)},hooks:{all:{},add:function(w,C){var y=c.hooks.all;y[w]=y[w]||[],y[w].push(C)},run:function(w,C){var y=c.hooks.all[w];if(!(!y||!y.length))for(var S=0,b;b=y[S++];)b(C)}},Token:a};function a(w,C,y,S){this.type=w,this.content=C,this.alias=y,this.length=(S||"").length|0}a.stringify=function w(C,y){if(typeof C=="string")return C;if(Array.isArray(C)){var S="";return C.forEach(function(N){S+=w(N,y)}),S}var b={type:C.type,content:w(C.content,y),tag:"span",classes:["token",C.type],attributes:{},language:y},_=C.alias;_&&(Array.isArray(_)?Array.prototype.push.apply(b.classes,_):b.classes.push(_)),c.hooks.run("wrap",b);var k="";for(var j in b.attributes)k+=" "+j+'="'+(b.attributes[j]||"").replace(/"/g,""")+'"';return"<"+b.tag+' class="'+b.classes.join(" ")+'"'+k+">"+b.content+"</"+b.tag+">"};function u(w,C,y,S){w.lastIndex=C;var b=w.exec(y);if(b&&S&&b[1]){var _=b[1].length;b.index+=_,b[0]=b[0].slice(_)}return b}function d(w,C,y,S,b,_){for(var k in y)if(!(!y.hasOwnProperty(k)||!y[k])){var j=y[k];j=Array.isArray(j)?j:[j];for(var N=0;N<j.length;++N){if(_&&_.cause==k+","+N)return;var D=j[N],E=D.inside,O=!!D.lookbehind,L=!!D.greedy,z=D.alias;if(L&&!D.pattern.global){var H=D.pattern.toString().match(/[imsuy]*$/)[0];D.pattern=RegExp(D.pattern.source,H+"g")}for(var $=D.pattern||D,q=S.next,G=b;q!==C.tail&&!(_&&G>=_.reach);G+=q.value.length,q=q.next){var W=q.value;if(C.length>w.length)return;if(!(W instanceof a)){var X=1,Y;if(L){if(Y=u($,G,w,O),!Y||Y.index>=w.length)break;var B=Y.index,I=Y.index+Y[0].length,M=G;for(M+=q.value.length;B>=M;)q=q.next,M+=q.value.length;if(M-=q.value.length,G=M,q.value instanceof a)continue;for(var P=q;P!==C.tail&&(M<I||typeof P.value=="string");P=P.next)X++,M+=P.value.length;X--,W=w.slice(G,M),Y.index-=G}else if(Y=u($,0,W,O),!Y)continue;var B=Y.index,F=Y[0],Q=W.slice(0,B),J=W.slice(B+F.length),ee=G+W.length;_&&ee>_.reach&&(_.reach=ee);var K=q.prev;Q&&(K=p(C,K,Q),G+=Q.length),g(C,K,X);var V=new a(k,E?c.tokenize(F,E):F,z,F);if(q=p(C,K,V),J&&p(C,q,J),X>1){var te={cause:k+","+N,reach:ee};d(w,C,y,q.prev,G,te),_&&te.reach>_.reach&&(_.reach=te.reach)}}}}}}function m(){var w={value:null,prev:null,next:null},C={value:null,prev:w,next:null};w.next=C,this.head=w,this.tail=C,this.length=0}function p(w,C,y){var S=C.next,b={value:y,prev:C,next:S};return C.next=b,S.prev=b,w.length++,b}function g(w,C,y){for(var S=C.next,b=0;b<y&&S!==w.tail;b++)S=S.next;C.next=S,S.prev=C,w.length-=b}function x(w){for(var C=[],y=w.head.next;y!==w.tail;)C.push(y.value),y=y.next;return C}return c})();e.exports=n,n.default=n}}),ke=IF(PF());ke.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ke.languages.markup.tag.inside["attr-value"].inside.entity=ke.languages.markup.entity,ke.languages.markup.doctype.inside["internal-subset"].inside=ke.languages.markup,ke.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&/,"&"))}),Object.defineProperty(ke.languages.markup.tag,"addInlined",{value:function(t,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ke.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:ke.languages[r]},{});r[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:n},ke.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(ke.languages.markup.tag,"addAttribute",{value:function(t,e){ke.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:ke.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ke.languages.html=ke.languages.markup,ke.languages.mathml=ke.languages.markup,ke.languages.svg=ke.languages.markup,ke.languages.xml=ke.languages.extend("markup",{}),ke.languages.ssml=ke.languages.xml,ke.languages.atom=ke.languages.xml,ke.languages.rss=ke.languages.xml,(function(t){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(ke),ke.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ke.languages.javascript=ke.languages.extend("clike",{"class-name":[ke.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ke.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ke.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ke.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ke.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ke.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ke.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ke.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ke.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ke.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ke.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ke.languages.markup&&(ke.languages.markup.tag.addInlined("script","javascript"),ke.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ke.languages.js=ke.languages.javascript,ke.languages.actionscript=ke.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ke.languages.actionscript["class-name"].alias="function",delete ke.languages.actionscript.parameter,delete ke.languages.actionscript["literal-property"],ke.languages.markup&&ke.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ke.languages.markup}}),(function(t){var e=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};t.languages.coffeescript=t.languages.extend("javascript",{comment:e,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:e,interpolation:n}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript})(ke),(function(t){var e=t.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(e,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var l=function(p){p.inside||(p.inside={}),p.inside.rest=r},c="doc-comment";if(a=t.languages[i]){var a,u=a[c];if((u=u||(a=t.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[c])instanceof RegExp&&(u=a[c]={pattern:u}),Array.isArray(u))for(var d=0,m=u.length;d<m;d++)u[d]instanceof RegExp&&(u[d]={pattern:u[d]}),l(u[d]);else l(u)}})}}),e.addSupport(["java","javascript","php"],e)})(ke),(function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,e=(t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css,t.languages.markup);e&&(e.tag.addInlined("style","css"),e.tag.addAttribute("style","css"))})(ke),(function(t){var e=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,e=(t.languages.css.selector={pattern:t.languages.css.selector.pattern,lookbehind:!0,inside:e={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+e.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[e,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=e,t.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};t.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:e,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:e,number:n})})(ke),(function(t){var e=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),l=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function c(a,u){u=(u||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(d,u)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+l+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(l),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(ke),(function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(d){return d=d.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),l=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,c=(t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+l+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+l+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+l+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(d){["url","bold","italic","strike","code-snippet"].forEach(function(m){d!==m&&(t.languages.markdown[d].inside.content.inside[m]=t.languages.markdown[m])})}),t.hooks.add("after-tokenize",function(d){d.language!=="markdown"&&d.language!=="md"||(function m(p){if(p&&typeof p!="string")for(var g=0,x=p.length;g<x;g++){var w,C=p[g];C.type!=="code"?m(C.content):(w=C.content[1],C=C.content[3],w&&C&&w.type==="code-language"&&C.type==="code-block"&&typeof w.content=="string"&&(w=w.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),w="language-"+(w=(/[a-z][\w-]*/i.exec(w)||[""])[0].toLowerCase()),C.alias?typeof C.alias=="string"?C.alias=[C.alias,w]:C.alias.push(w):C.alias=[w]))}})(d.tokens)}),t.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var m="",p=0,g=d.classes.length;p<g;p++){var x=d.classes[p],x=/language-(.+)/.exec(x);if(x){m=x[1];break}}var w,C=t.languages[m];C?d.content=t.highlight((function(y){return y=y.replace(c,""),y=y.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(S,b){var _;return(b=b.toLowerCase())[0]==="#"?(_=b[1]==="x"?parseInt(b.slice(2),16):Number(b.slice(1)),u(_)):a[b]||S})})(d.content),C,m):m&&m!=="none"&&t.plugins.autoloader&&(w="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),d.attributes.id=w,t.plugins.autoloader.loadLanguages(m,function(){var y=document.getElementById(w);y&&(y.innerHTML=t.highlight(y.textContent,t.languages[m],m))}))}}),RegExp(t.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown})(ke),ke.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ke.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ke.hooks.add("after-tokenize",function(t){if(t.language==="graphql")for(var e=t.tokens.filter(function(w){return typeof w!="string"&&w.type!=="comment"&&w.type!=="scalar"}),n=0;n<e.length;){var r=e[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(p(["definition-mutation","punctuation"])&&m(1).content==="("){n+=2;var l=g(/^\($/,/^\)$/);if(l===-1)continue;for(;n<l;n++){var c=m(0);c.type==="variable"&&(x(c,"variable-input"),i.push(c.content))}n=l+1}if(p(["punctuation","property-query"])&&m(0).content==="{"&&(n++,x(m(0),"property-mutation"),0<i.length)){var a=g(/^\{$/,/^\}$/);if(a!==-1)for(var u=n;u<a;u++){var d=e[u];d.type==="variable"&&0<=i.indexOf(d.content)&&x(d,"variable-input")}}}}function m(w){return e[n+w]}function p(w,C){C=C||0;for(var y=0;y<w.length;y++){var S=m(y+C);if(!S||S.type!==w[y])return}return 1}function g(w,C){for(var y=1,S=n;S<e.length;S++){var b=e[S],_=b.content;if(b.type==="punctuation"&&typeof _=="string"){if(w.test(_))y++;else if(C.test(_)&&--y===0)return S}}return-1}function x(w,C){var y=w.alias;y?Array.isArray(y)||(w.alias=y=[y]):w.alias=y=[],y.push(C)}}),ke.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(t){var e=t.languages.javascript["template-string"],n=e.pattern.source,r=e.inside.interpolation,i=r.inside["interpolation-punctuation"],l=r.pattern.source;function c(p,g){if(t.languages[p])return{pattern:RegExp("((?:"+g+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:p}}}}function a(p,g,x){return p={code:p,grammar:g,language:x},t.hooks.run("before-tokenize",p),p.tokens=t.tokenize(p.code,p.grammar),t.hooks.run("after-tokenize",p),p.tokens}function u(p,g,x){var y=t.tokenize(p,{interpolation:{pattern:RegExp(l),lookbehind:!0}}),w=0,C={},y=a(y.map(function(b){if(typeof b=="string")return b;for(var _,k,b=b.content;p.indexOf((k=w++,_="___"+x.toUpperCase()+"_"+k+"___"))!==-1;);return C[_]=b,_}).join(""),g,x),S=Object.keys(C);return w=0,(function b(_){for(var k=0;k<_.length;k++){if(w>=S.length)return;var j,N,D,E,O,L,z,H=_[k];typeof H=="string"||typeof H.content=="string"?(j=S[w],(z=(L=typeof H=="string"?H:H.content).indexOf(j))!==-1&&(++w,N=L.substring(0,z),O=C[j],D=void 0,(E={})["interpolation-punctuation"]=i,(E=t.tokenize(O,E)).length===3&&((D=[1,1]).push.apply(D,a(E[1],t.languages.javascript,"javascript")),E.splice.apply(E,D)),D=new t.Token("interpolation",E,r.alias,O),E=L.substring(z+j.length),O=[],N&&O.push(N),O.push(D),E&&(b(L=[E]),O.push.apply(O,L)),typeof H=="string"?(_.splice.apply(_,[k,1].concat(O)),k+=O.length-1):H.content=O)):(z=H.content,Array.isArray(z)?b(z):b([z]))}})(y),new t.Token(x,y,"language-"+x,p)}t.languages.javascript["template-string"]=[c("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),c("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),c("svg",/\bsvg/.source),c("markdown",/\b(?:markdown|md)/.source),c("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),c("sql",/\bsql/.source),e].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function m(p){return typeof p=="string"?p:Array.isArray(p)?p.map(m).join(""):m(p.content)}t.hooks.add("after-tokenize",function(p){p.language in d&&(function g(x){for(var w=0,C=x.length;w<C;w++){var y,S,b,_=x[w];typeof _!="string"&&(y=_.content,Array.isArray(y)?_.type==="template-string"?(_=y[1],y.length===3&&typeof _!="string"&&_.type==="embedded-code"&&(S=m(_),_=_.alias,_=Array.isArray(_)?_[0]:_,b=t.languages[_])&&(y[1]=u(S,b,_))):g(y):typeof y!="string"&&g([y]))}})(p.tokens)})})(ke),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript})(ke),(function(t){var e=t.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";t.languages.jsdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),t.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:e,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:e.string,number:e.number,boolean:e.boolean,keyword:t.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:e,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)})(ke),(function(t){t.languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),t.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(ke),ke.languages.n4js=ke.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ke.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ke.languages.n4jsd=ke.languages.n4js,(function(t){function e(c,a){return RegExp(c.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}t.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+t.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),t.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+t.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),t.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),t.languages.insertBefore("javascript","keyword",{imports:{pattern:e(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:t.languages.javascript},exports:{pattern:e(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:t.languages.javascript}}),t.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),t.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),t.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:e(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var l=n[r],i=t.languages.javascript[l],l=(i=t.util.type(i)==="RegExp"?t.languages.javascript[l]={pattern:i}:i).inside||{};(i.inside=l)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(ke),(function(t){var e=t.util.clone(t.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function l(u,d){return u=u.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(u,d)}i=l(i).source,t.languages.jsx=t.languages.extend("markup",e),t.languages.jsx.tag.pattern=l(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=e.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:l(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:l(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);function c(u){for(var d=[],m=0;m<u.length;m++){var p=u[m],g=!1;typeof p!="string"&&(p.type==="tag"&&p.content[0]&&p.content[0].type==="tag"?p.content[0].content[0].content==="</"?0<d.length&&d[d.length-1].tagName===a(p.content[0].content[1])&&d.pop():p.content[p.content.length-1].content!=="/>"&&d.push({tagName:a(p.content[0].content[1]),openedBraces:0}):0<d.length&&p.type==="punctuation"&&p.content==="{"?d[d.length-1].openedBraces++:0<d.length&&0<d[d.length-1].openedBraces&&p.type==="punctuation"&&p.content==="}"?d[d.length-1].openedBraces--:g=!0),(g||typeof p=="string")&&0<d.length&&d[d.length-1].openedBraces===0&&(g=a(p),m<u.length-1&&(typeof u[m+1]=="string"||u[m+1].type==="plain-text")&&(g+=a(u[m+1]),u.splice(m+1,1)),0<m&&(typeof u[m-1]=="string"||u[m-1].type==="plain-text")&&(g=a(u[m-1])+g,u.splice(m-1,1),m--),u[m]=new t.Token("plain-text",g,null,g)),p.content&&typeof p.content!="string"&&c(p.content)}}var a=function(u){return u?typeof u=="string"?u:typeof u.content=="string"?u.content:u.content.map(a).join(""):""};t.hooks.add("after-tokenize",function(u){u.language!=="jsx"&&u.language!=="tsx"||c(u.tokens)})})(ke),(function(t){var e=t.util.clone(t.languages.typescript),e=(t.languages.tsx=t.languages.extend("jsx",e),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"],t.languages.tsx.tag);e.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+e.pattern.source+")",e.pattern.flags),e.lookbehind=!0})(ke),ke.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ke.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=ke.languages.swift}),(function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var e={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:e},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:e},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(ke),ke.languages.c=ke.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ke.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ke.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ke.languages.c.string],char:ke.languages.c.char,comment:ke.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ke.languages.c}}}}),ke.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ke.languages.c.boolean,ke.languages.objectivec=ke.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ke.languages.objectivec["class-name"],ke.languages.objc=ke.languages.objectivec,ke.languages.reason=ke.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ke.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ke.languages.reason.function,(function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(ke),ke.languages.go=ke.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ke.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ke.languages.go["class-name"],(function(t){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(ke),ke.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ke.languages.python["string-interpolation"].inside.interpolation.inside.rest=ke.languages.python,ke.languages.py=ke.languages.python,ke.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ke.languages.webmanifest=ke.languages.json;var cl={};OF(cl,{dracula:()=>BF,duotoneDark:()=>HF,duotoneLight:()=>UF,github:()=>qF,gruvboxMaterialDark:()=>xH,gruvboxMaterialLight:()=>SH,jettwaveDark:()=>fH,jettwaveLight:()=>pH,nightOwl:()=>GF,nightOwlLight:()=>YF,oceanicNext:()=>QF,okaidia:()=>JF,oneDark:()=>gH,oneLight:()=>yH,palenight:()=>tH,shadesOfPurple:()=>rH,synthwave84:()=>iH,ultramin:()=>aH,vsDark:()=>ZE,vsLight:()=>uH});var zF={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},BF=zF,FF={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},HF=FF,$F={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},UF=$F,VF={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},qF=VF,WF={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},GF=WF,KF={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},YF=KF,br={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},XF={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:br.keyword}},{types:["attr-value"],style:{color:br.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:br.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:br.primitive}},{types:["boolean"],style:{color:br.boolean}},{types:["tag"],style:{color:br.tag}},{types:["string"],style:{color:br.string}},{types:["punctuation"],style:{color:br.string}},{types:["selector","char","builtin","inserted"],style:{color:br.char}},{types:["function"],style:{color:br.function}},{types:["operator","entity","url","variable"],style:{color:br.variable}},{types:["keyword"],style:{color:br.keyword}},{types:["atrule","class-name"],style:{color:br.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},QF=XF,ZF={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},JF=ZF,eH={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},tH=eH,nH={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},rH=nH,sH={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},iH=sH,oH={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},aH=oH,lH={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},ZE=lH,cH={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},uH=cH,dH={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},fH=dH,hH={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},pH=hH,mH={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},gH=mH,vH={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},yH=vH,bH={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},xH=bH,_H={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},SH=_H,wH=t=>R.useCallback(e=>{var n=e,{className:r,style:i,line:l}=n,c=QE(n,["className","style","line"]);const a=Zf(ps({},c),{className:uf("token-line",r)});return typeof t=="object"&&"plain"in t&&(a.style=t.plain),typeof i=="object"&&(a.style=ps(ps({},a.style||{}),i)),a},[t]),CH=t=>{const e=R.useCallback(({types:n,empty:r})=>{if(t!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return t[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>t[i]))}},[t]);return R.useCallback(n=>{var r=n,{token:i,className:l,style:c}=r,a=QE(r,["token","className","style"]);const u=Zf(ps({},a),{className:uf("token",...i.types,l),children:i.content,style:e(i)});return c!=null&&(u.style=ps(ps({},u.style||{}),c)),u},[e])},kH=/\r\n|\r|\n/,z_=t=>{t.length===0?t.push({types:["plain"],content:`
|
|
600
|
-
`,empty:!0}):t.length===1&&t[0].content===""&&(t[0].content=`
|
|
601
|
-
`,t[0].empty=!0)},B_=(t,e)=>{const n=t.length;return n>0&&t[n-1]===e?t:t.concat(e)},EH=t=>{const e=[[]],n=[t],r=[0],i=[t.length];let l=0,c=0,a=[];const u=[a];for(;c>-1;){for(;(l=r[c]++)<i[c];){let d,m=e[c];const g=n[c][l];if(typeof g=="string"?(m=c>0?m:["plain"],d=g):(m=B_(m,g.type),g.alias&&(m=B_(m,g.alias)),d=g.content),typeof d!="string"){c++,e.push(m),n.push(d),r.push(0),i.push(d.length);continue}const x=d.split(kH),w=x.length;a.push({types:m,content:x[0]});for(let C=1;C<w;C++)z_(a),u.push(a=[]),a.push({types:m,content:x[C]})}c--,e.pop(),n.pop(),r.pop(),i.pop()}return z_(a),u},F_=EH,AH=({prism:t,code:e,grammar:n,language:r})=>R.useMemo(()=>{if(n==null)return F_([e]);const i={code:e,grammar:n,language:r,tokens:[]};return t.hooks.run("before-tokenize",i),i.tokens=t.tokenize(e,n),t.hooks.run("after-tokenize",i),F_(i.tokens)},[e,n,r,t]),NH=(t,e)=>{const{plain:n}=t,r=t.styles.reduce((i,l)=>{const{languages:c,style:a}=l;return c&&!c.includes(e)||l.types.forEach(u=>{const d=ps(ps({},i[u]),a);i[u]=d}),i},{});return r.root=n,r.plain=Zf(ps({},n),{backgroundColor:void 0}),r},RH=NH,jH=({children:t,language:e,code:n,theme:r,prism:i})=>{const l=e.toLowerCase(),c=RH(r,l),a=wH(c),u=CH(c),d=i.languages[l],m=AH({prism:i,language:l,code:n,grammar:d});return t({tokens:m,className:`prism-code language-${l}`,style:c!=null?c.root:{},getLineProps:a,getTokenProps:u})},Jf=t=>R.createElement(jH,Zf(ps({},t),{prism:t.prism||ke,theme:t.theme||ZE,code:t.code,language:t.language}));/*! Bundled license information:
|
|
602
|
-
|
|
603
|
-
prismjs/prism.js:
|
|
604
|
-
(**
|
|
605
|
-
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
606
|
-
*
|
|
607
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
608
|
-
* @author Lea Verou <https://lea.verou.me>
|
|
609
|
-
* @namespace
|
|
610
|
-
* @public
|
|
611
|
-
*)
|
|
612
|
-
*/const TH=cl.oneDark,DH=cl.nightOwl,JE=R.memo(function(e){const n=he.c(11),{children:r,className:i,inverted:l}=e,c=l===void 0?!1:l;let a;n[0]!==c?(a={code(x){const{className:w,children:C,...y}=x,S=/language-(\w+)/.exec(w||""),b=S?S[1]:"",_=!b,k=Array.isArray(C)?C.join(""):String(C);return!_&&b?h.jsx("div",{className:"w-full max-w-full overflow-x-auto my-2 min-w-0",children:h.jsx(Jf,{theme:c?DH:TH,code:k.trim(),language:b,children:MH})}):h.jsx("code",{className:Ne("px-1.5 py-0.5 rounded text-sm font-mono",c?"bg-primary-foreground/20 text-primary-foreground":"bg-muted",w),...y,children:C})},a(x){const{href:w,children:C,...y}=x;return h.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:Ne("underline underline-offset-2 transition-colors",c?"text-primary-foreground/80 hover:text-primary-foreground":"text-primary hover:text-primary/80"),...y,children:C})},p(x){const{children:w}=x;return h.jsx("p",{className:"last:mb-0 leading-relaxed wrap-break-words",children:w})},ul(x){const{children:w}=x;return h.jsx("ul",{className:"list-outside list-disc pl-8",children:w})},ol(x){const{children:w}=x;return h.jsx("ol",{className:"list-outside list-decimal pl-8",children:w})},li(x){const{children:w,className:C}=x,y=C==null?void 0:C.includes("nested");return h.jsx("li",{className:Ne("leading-snug",y&&"ml-8"),children:w})},h1(x){const{children:w}=x;return h.jsx("h1",{className:"text-lg font-semibold mb-1.5 mt-3 first:mt-0",children:w})},h2(x){const{children:w}=x;return h.jsx("h2",{className:"text-base font-semibold mb-1.5 mt-2.5 first:mt-0",children:w})},h3(x){const{children:w}=x;return h.jsx("h3",{className:"text-sm font-semibold mb-1 mt-2 first:mt-0",children:w})},blockquote(x){const{children:w}=x;return h.jsx("blockquote",{className:Ne("border-l-2 pl-3 my-1.5 italic",c?"border-primary-foreground/40 text-primary-foreground/70":"border-muted-foreground/40 text-muted-foreground"),children:w})},strong(x){const{children:w}=x;return h.jsx("strong",{className:Ne("font-semibold",c&&"text-primary-foreground"),children:w})},em(x){const{children:w}=x;return h.jsx("em",{className:"italic",children:w})},hr(){return h.jsx("hr",{className:Ne("my-3",c?"border-primary-foreground/30":"border-border")})},table(x){const{children:w}=x;return h.jsx("div",{className:"my-2 overflow-x-auto max-w-full",children:h.jsx("table",{className:"w-full border-collapse text-sm",children:w})})},th(x){const{children:w}=x;return h.jsx("th",{className:Ne("border border-border px-2 py-1.5 text-left font-semibold",c?"bg-primary-foreground/10 text-primary-foreground":"bg-muted"),children:w})},td(x){const{children:w}=x;return h.jsx("td",{className:Ne("border px-2 py-1.5",c?"border-primary-foreground/20":"border-border"),children:w})}},n[0]=c,n[1]=a):a=n[1];const u=a;let d;n[2]!==i?(d=Ne("w-full markdown-render overflow-x-auto wrap-break-words break",i),n[2]=i,n[3]=d):d=n[3];let m;n[4]===Symbol.for("react.memo_cache_sentinel")?(m=[AF],n[4]=m):m=n[4];let p;n[5]!==r||n[6]!==u?(p=h.jsx(pz,{remarkPlugins:m,components:u,children:r}),n[5]=r,n[6]=u,n[7]=p):p=n[7];let g;return n[8]!==d||n[9]!==p?(g=h.jsx("div",{className:d,children:p}),n[8]=d,n[9]=p,n[10]=g):g=n[10],g});function MH(t){const{className:e,style:n,tokens:r,getLineProps:i,getTokenProps:l}=t;return h.jsx("pre",{className:Ne("rounded-lg text-sm p-3",e),style:n,children:r.map((c,a)=>h.jsx("div",{...i({line:c}),children:c.map((u,d)=>h.jsx("span",{...l({token:u})},d))},a))})}const OH=cl.oneDark;function H_(t){const e=he.c(8),{content:n,language:r,showLineNumbers:i}=t,l=i===void 0?!0:i;let c,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Ne("h-full overflow-auto bg-[#282c34] chat-transcript-scrollbar"),a={WebkitOverflowScrolling:"touch"},e[0]=c,e[1]=a):(c=e[0],a=e[1]);const u=r||"plaintext";let d;e[2]!==l?(d=p=>{const{style:g,tokens:x,getLineProps:w,getTokenProps:C}=p;return h.jsx("pre",{className:"text-sm p-4 min-h-full font-mono",style:g,children:x.map((y,S)=>h.jsxs("div",{...w({line:y}),className:"table-row",children:[l&&h.jsx("span",{className:"table-cell pr-4 text-right select-none opacity-50 text-xs w-12",children:S+1}),h.jsx("span",{className:"table-cell",children:y.map((b,_)=>h.jsx("span",{...C({token:b})},_))})]},S))})},e[2]=l,e[3]=d):d=e[3];let m;return e[4]!==n||e[5]!==u||e[6]!==d?(m=h.jsx("div",{className:c,style:a,children:h.jsx(Jf,{theme:OH,code:n,language:u,children:d})}),e[4]=n,e[5]=u,e[6]=d,e[7]=m):m=e[7],m}function Xm(t){const e=he.c(13),{icon:n,title:r,reason:i,name:l}=t;let c;e[0]!==n?(c=h.jsx(n,{className:"size-10 text-muted-foreground mb-4"}),e[0]=n,e[1]=c):c=e[1];let a;e[2]!==r?(a=h.jsx("p",{className:"text-sm font-medium mb-1",children:r}),e[2]=r,e[3]=a):a=e[3];let u;e[4]!==i?(u=h.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:i}),e[4]=i,e[5]=u):u=e[5];let d;e[6]!==l?(d=h.jsx("p",{className:"text-xs text-muted-foreground",children:l}),e[6]=l,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==a||e[10]!==u||e[11]!==d?(m=h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[c,a,u,d]}),e[8]=c,e[9]=a,e[10]=u,e[11]=d,e[12]=m):m=e[12],m}function LH(t){const e=he.c(20),{preview:n}=t;if(n.kind==="markdown"){let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={WebkitOverflowScrolling:"touch"},e[0]=r):r=e[0];let i;return e[1]!==n.content?(i=h.jsx("div",{className:"h-full overflow-auto p-6 chat-transcript-scrollbar",style:r,children:h.jsx(JE,{children:n.content})}),e[1]=n.content,e[2]=i):i=e[2],i}if(n.kind==="code"){let r;return e[3]!==n.content||e[4]!==n.language||e[5]!==n.path?(r=h.jsx(H_,{content:n.content,path:n.path,language:n.language,showLineNumbers:!0}),e[3]=n.content,e[4]=n.language,e[5]=n.path,e[6]=r):r=e[6],r}if(n.kind==="text"){let r;return e[7]!==n.content||e[8]!==n.language||e[9]!==n.path?(r=h.jsx(H_,{content:n.content,path:n.path,language:n.language,showLineNumbers:!1}),e[7]=n.content,e[8]=n.language,e[9]=n.path,e[10]=r):r=e[10],r}if(n.kind==="binary"){let r;return e[11]!==n.name||e[12]!==n.reason?(r=h.jsx(Xm,{icon:AA,title:"Binary file",reason:n.reason,name:n.name}),e[11]=n.name,e[12]=n.reason,e[13]=r):r=e[13],r}if(n.kind==="unsupported"){let r;return e[14]!==n.name||e[15]!==n.reason?(r=h.jsx(Xm,{icon:CA,title:"Unsupported file",reason:n.reason,name:n.name}),e[14]=n.name,e[15]=n.reason,e[16]=r):r=e[16],r}if(n.kind==="too_large"){let r;return e[17]!==n.name||e[18]!==n.reason?(r=h.jsx(Xm,{icon:xA,title:"File too large",reason:n.reason,name:n.name}),e[17]=n.name,e[18]=n.reason,e[19]=r):r=e[19],r}return null}function IH({workspaceId:t,path:e,serverUrl:n,apiToken:r,enabled:i}){const{fetchWithAuth:l}=ns(),[c,a]=R.useState(null),[u,d]=R.useState(!1),[m,p]=R.useState(null),g=R.useRef(null),x=R.useCallback(async()=>{if(!i||!t||!e||!n||!r)return;g.current&&g.current.abort();const C=new AbortController;g.current=C,d(!0),p(null);try{const y=`/api/workspaces/${t}/file-preview?path=${encodeURIComponent(e)}`,S=await l(y,{signal:C.signal},{serverUrl:n,token:r});if(!S.ok){let _="Failed to fetch file preview";try{_=(await S.json()).message||_}catch{_=S.statusText||_}p(_),a(null),d(!1);return}const b=await S.json();a(b),d(!1)}catch(y){if(y instanceof Error&&y.name==="AbortError")return;const S=y instanceof Error?y.message:"Unknown error occurred";p(S),a(null),d(!1)}},[i,t,e,n,r,l]),w=R.useCallback(()=>{x()},[x]);return R.useEffect(()=>(x(),()=>{g.current&&g.current.abort()}),[x]),{data:c,loading:u,error:m,reload:w}}function PH(t){const e=he.c(37),{workspaceId:n,target:r,serverUrl:i,apiToken:l,open:c,onOpenChange:a}=t,u=r==null?void 0:r.path,d=c&&!!r&&!!n;let m;e[0]!==l||e[1]!==i||e[2]!==u||e[3]!==d||e[4]!==n?(m={workspaceId:n,path:u,serverUrl:i,apiToken:l,enabled:d},e[0]=l,e[1]=i,e[2]=u,e[3]=d,e[4]=n,e[5]=m):m=e[5];const{data:p,loading:g,error:x,reload:w}=IH(m);if(!r)return null;const C=zH;let y;e[6]!==r.name?(y=h.jsx(Qi,{className:"text-base font-semibold truncate",children:r.name}),e[6]=r.name,e[7]=y):y=e[7];let S;e[8]!==r.path?(S=h.jsx($o,{className:"text-xs text-muted-foreground truncate",children:r.path}),e[8]=r.path,e[9]=S):S=e[9];let b;e[10]!==p?(b=p&&h.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[h.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground capitalize",children:p.kind}),h.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:"read-only"}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:[C(p.size),p.language&&` · ${p.language}`]})]}),e[10]=p,e[11]=b):b=e[11];let _;e[12]!==y||e[13]!==S||e[14]!==b?(_=h.jsxs(Xi,{className:"px-6 pt-5 pb-3 border-b border-border shrink-0",children:[y,S,b]}),e[12]=y,e[13]=S,e[14]=b,e[15]=_):_=e[15];let k;e[16]!==g?(k=g&&h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(Wt,{className:"size-5 animate-spin text-muted-foreground"})}),e[16]=g,e[17]=k):k=e[17];let j;e[18]!==x||e[19]!==g||e[20]!==w?(j=x&&!g&&h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[h.jsx(To,{className:"size-8 text-muted-foreground mb-3"}),h.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:x}),h.jsxs(Te,{variant:"outline",size:"sm",onClick:w,children:[h.jsx(Pi,{className:"size-3.5 mr-1.5"}),"Retry"]})]}),e[18]=x,e[19]=g,e[20]=w,e[21]=j):j=e[21];let N;e[22]!==p||e[23]!==x||e[24]!==g?(N=p&&!g&&!x&&h.jsx(LH,{preview:p}),e[22]=p,e[23]=x,e[24]=g,e[25]=N):N=e[25];let D;e[26]!==N||e[27]!==k||e[28]!==j?(D=h.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden",children:[k,j,N]}),e[26]=N,e[27]=k,e[28]=j,e[29]=D):D=e[29];let E;e[30]!==D||e[31]!==_?(E=h.jsxs(Yi,{showCloseButton:!0,className:"sm:max-w-5xl w-[min(92vw,1100px)] h-[85vh] flex flex-col p-0 gap-0",children:[_,D]}),e[30]=D,e[31]=_,e[32]=E):E=e[32];let O;return e[33]!==a||e[34]!==c||e[35]!==E?(O=h.jsx(Ki,{open:c,onOpenChange:a,children:E}),e[33]=a,e[34]=c,e[35]=E,e[36]=O):O=e[36],O}function zH(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}function BH(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function eh(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}function FH(){return!!(globalThis||window).isTauri}const HH="/assets/chat-finish-Kb8mnIhV.mp3",$H="/assets/chat-permission-BltPnMpz.mp3",UH={chatFinish:HH,chatPermission:$H};function VH(){const t=R.useRef(null),e=R.useRef({}),n=R.useRef(!1),r=R.useRef(null),i=R.useRef(0),l=R.useCallback(async()=>{let w=t.current;return(!w||w.state==="closed")&&(w=new AudioContext,t.current=w,e.current={}),w.state==="suspended"&&await w.resume(),w},[]),c=R.useCallback(async(w,C)=>{var y;if(e.current[w])return(y=e.current[w])!=null?y:null;try{const S=await fetch(UH[w]);if(!S.ok)throw new Error(`HTTP ${S.status}`);const b=await S.arrayBuffer(),_=await C.decodeAudioData(b);return e.current[w]=_,_}catch(S){return console.warn("[useNotificationSound] Failed to load",w,S),null}},[]),a=R.useCallback((w,C)=>{try{const y=C.createBufferSource();y.buffer=w,y.connect(C.destination),y.start(0)}catch(y){console.warn("[useNotificationSound] Playback error",y)}},[]),u=R.useCallback(async()=>{if(n.current)return;const w=await l();if(w.state!=="running")return;const C=r.current;if(r.current=null,C){const y=await c(C,w);y&&a(y,w)}n.current=!0},[l,c,a]),d=R.useCallback(()=>{const w=()=>{document.removeEventListener("click",w),document.removeEventListener("keydown",w),document.removeEventListener("touchstart",w),u()};document.addEventListener("click",w),document.addEventListener("keydown",w),document.addEventListener("touchstart",w)},[u]),m=R.useCallback(async w=>{if(n.current){const C=await l();if(C.state!=="running")return;const y=await c(w,C);y&&a(y,C);return}r.current=w,d()},[l,c,a,d]),p=R.useCallback(async w=>{if(FH()){const C=Date.now();if(C>i.current)try{await eh("play_sound",{soundKey:w});return}catch(y){const S=y instanceof Error?y.message:String(y);console.warn(`[useNotificationSound] Native playback failed for ${w}, error: ${S}`),i.current=C+1e3}}else await m(w)},[m]),g=R.useCallback(()=>{p("chatFinish")},[p]),x=R.useCallback(()=>{p("chatPermission")},[p]);return R.useEffect(()=>()=>{const w=t.current;w&&w.state!=="closed"&&w.close(),t.current=null},[]),{playChatFinishSound:g,playPermissionSound:x,playSound:p}}const qH=(t,e)=>t&&e?Gd(e,`/ws?token=${t}`):null,WH=1e4,GH=3e4,KH=1e3,YH=3e4;function XH({apiToken:t,serverUrl:e,wsRef:n,serverEpochRef:r,currentSessionIdRef:i,clearPendingPermissions:l,handleLogout:c,setWs:a,setConnected:u,setAuthError:d,setConnectionTimedOut:m,setRetryCount:p,setNextRetryIn:g,setReconnectTrigger:x,reconnectTrigger:w,connected:C,connectionTimedOut:y,retryCount:S,onMessage:b}){const _=R.useRef(Date.now());R.useEffect(()=>{if(!t||!e)return;const k=qH(t,e);if(!k)return;const j=new WebSocket(k),N=r.current;return j.onopen=()=>{r.current===N&&(_.current=Date.now(),u(!0),d(null),p(0),m(!1),l(),i.current&&j.send(JSON.stringify({type:"session.resume",sessionId:i.current})),j.send(JSON.stringify({type:"permissions.sync"})))},j.onclose=D=>{r.current===N&&(u(!1),(D.code===1008||D.code===401)&&c())},j.onerror=D=>{r.current===N&&console.error("WebSocket error:",D)},j.onmessage=D=>{if(r.current!==N)return;_.current=Date.now();const E=JSON.parse(D.data);b(E)},a(j),()=>j.close()},[t,e,c,w]),R.useEffect(()=>{if(t&&e&&!C&&!y){const k=setTimeout(()=>{C||m(!0)},WH);return()=>clearTimeout(k)}},[t,e,C,y,m]),R.useEffect(()=>{const k=r.current;if(y&&!C&&t&&e){const j=Math.min(KH*Math.pow(2,S),GH);let N=Math.floor(j/1e3);g(N);const D=setInterval(()=>{N-=1,g(Math.max(0,N))},1e3),E=setTimeout(()=>{r.current===k&&(p(O=>O+1),x(O=>O+1))},j);return()=>{clearInterval(D),clearTimeout(E)}}},[y,C,t,e,S,r,x,g]),R.useEffect(()=>{const k=r.current,j=()=>{if(r.current!==k||document.visibilityState!=="visible")return;const N=n.current;if(!(!N||!t||!e))if(N.readyState===WebSocket.OPEN){if(Date.now()-_.current<YH)return;N.onclose=null,N.close(),u(!1),p(0),m(!1),x(E=>E+1)}else(N.readyState===WebSocket.CLOSED||N.readyState===WebSocket.CLOSING)&&(u(!1),p(0),m(!1),x(D=>D+1))};return document.addEventListener("visibilitychange",j),()=>document.removeEventListener("visibilitychange",j)},[t,e,r,x,u,p,m,_]),R.useEffect(()=>{const k=r.current,j=()=>{if(r.current!==k||!t||!e)return;const N=n.current;N&&N.readyState===WebSocket.OPEN||(u(!1),p(0),m(!1),x(D=>D+1))};return window.addEventListener("online",j),()=>window.removeEventListener("online",j)},[t,e,r,x,u,p,m])}const QH=t=>t?Xn(t,"/api"):null;function ZH(t){const e=he.c(38),{apiToken:n,serverUrl:r,reconnectTrigger:i,serverEpochRef:l,fetchWithAuth:c,clearSwitchingState:a,setSessions:u,setPreconfigs:d,setPrompts:m,setModels:p,setDefaultModel:g,setProviderStatuses:x,setWorkspaces:w,setActiveWorkspace:C,activeWorkspace:y,setIsLoadingServerData:S,setAuthError:b,pendingWorkspaceIdRef:_}=t,k=R.useRef(null);let j,N;e[0]!==y?(j=()=>{y&&localStorage.setItem("activeWorkspaceId",y.id)},N=[y],e[0]=y,e[1]=j,e[2]=N):(j=e[1],N=e[2]),R.useEffect(j,N);let D;e[3]!==n||e[4]!==a||e[5]!==c||e[6]!==_||e[7]!==l||e[8]!==r||e[9]!==C||e[10]!==b||e[11]!==g||e[12]!==S||e[13]!==p||e[14]!==d||e[15]!==m||e[16]!==x||e[17]!==u||e[18]!==w?(D=()=>{var H;if(!n||!r)return;(H=k.current)==null||H.abort(),k.current=new AbortController;const O=k.current.signal,L=QH(r);if(!L)return;const z=l.current;return S(!0),Promise.all([c(`${L}/sessions`,{signal:O}).then(i$),c(`${L}/preconfigs`,{signal:O}).then(s$),c(`${L}/prompts`,{signal:O}).then(r$),c(`${L}/models`,{signal:O}).then(n$),c(`${L}/workspaces`,{signal:O}).then(t$),c(`${L}/providers`,{signal:O}).then(e$)]).then($=>{const[q,G,W,X,Y,I]=$;if(l.current!==z)return;u(q.sessions||[]),d(G.preconfigs||[]),m(W.prompts||[]),p((X.models||[]).filter(JH)),g(X.defaultModel||"gpt-4o"),x(I.providers||[]);const M=Y.workspaces||[];if(w(M),_.current){const P=M.find(B=>B.id===_.current);P&&C(P),_.current=null}else{const P=localStorage.getItem("activeWorkspaceId"),B=M.find(F=>F.id===P);C(B||M[0])}a(),S(!1)}).catch($=>{var q;if($.name==="AbortError"){console.log("Fetch aborted due to server switch");return}console.error("Failed to load server data:",$),S(!1),(q=$.message)!=null&&q.includes("Unauthorized")||b("Failed to connect to server")}),()=>{var $;($=k.current)==null||$.abort()}},e[3]=n,e[4]=a,e[5]=c,e[6]=_,e[7]=l,e[8]=r,e[9]=C,e[10]=b,e[11]=g,e[12]=S,e[13]=p,e[14]=d,e[15]=m,e[16]=x,e[17]=u,e[18]=w,e[19]=D):D=e[19];let E;e[20]!==n||e[21]!==a||e[22]!==c||e[23]!==_||e[24]!==i||e[25]!==l||e[26]!==r||e[27]!==C||e[28]!==b||e[29]!==g||e[30]!==S||e[31]!==p||e[32]!==d||e[33]!==m||e[34]!==x||e[35]!==u||e[36]!==w?(E=[n,r,i,l,c,a,u,d,m,p,g,x,w,C,S,b,_],e[20]=n,e[21]=a,e[22]=c,e[23]=_,e[24]=i,e[25]=l,e[26]=r,e[27]=C,e[28]=b,e[29]=g,e[30]=S,e[31]=p,e[32]=d,e[33]=m,e[34]=x,e[35]=u,e[36]=w,e[37]=E):E=e[37],R.useEffect(D,E)}function JH(t){var e;return(e=t.runtimeStatus)==null?void 0:e.usable}function e$(t){return t.json()}function t$(t){return t.json()}function n$(t){return t.json()}function r$(t){return t.json()}function s$(t){return t.json()}function i$(t){return t.json()}function o$(t){const e=he.c(108),{ws:n,currentSession:r,sessions:i,workspaces:l,activeWorkspace:c,currentModel:a,streamingSessionIds:u,isCompacting:d,primaryPreconfigs:m,setCurrentSession:p,setActiveWorkspace:g,setCompactionSuccess:x,setCurrentModel:w,setSelectedVariant:C,removePendingPermissionByToolCallId:y,removePendingPermissionsBySessionId:S,clearStreamingSessions:b,pendingSessionCreateRef:_,partAppendRafRef:k,pendingPartAppendsRef:j,skipFinishSoundSessionIdsRef:N}=t;let D;e[0]!==n?(D=(ze,qe)=>{n&&n.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:ze,...qe}))},e[0]=n,e[1]=D):D=e[1];const E=D;let O;e[2]!==(c==null?void 0:c.id)||e[3]!==k||e[4]!==j||e[5]!==_||e[6]!==E||e[7]!==x?(O=(ze,qe)=>{_.current=!0,k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),j.current.clear(),E("session.create",{preconfigId:ze,title:qe,workspaceId:c==null?void 0:c.id}),x(!1)},e[2]=c==null?void 0:c.id,e[3]=k,e[4]=j,e[5]=_,e[6]=E,e[7]=x,e[8]=O):O=e[8];const L=O;let z;e[9]!==(c==null?void 0:c.id)||e[10]!==b||e[11]!==k||e[12]!==j||e[13]!==S||e[14]!==E||e[15]!==i||e[16]!==g||e[17]!==x||e[18]!==p||e[19]!==N||e[20]!==l?(z=ze=>{S(ze),N.current=new Set(ng.getState().streamingSessionIds),b(),x(!1);const qe=i.find(Pe=>Pe.id===ze);if(qe!=null&&qe.workspaceId&&qe.workspaceId!==(c==null?void 0:c.id)){const Pe=l.find(nt=>nt.id===qe.workspaceId);Pe&&g(Pe)}k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),j.current.clear(),qe&&p(qe),E("session.resume",{sessionId:ze})},e[9]=c==null?void 0:c.id,e[10]=b,e[11]=k,e[12]=j,e[13]=S,e[14]=E,e[15]=i,e[16]=g,e[17]=x,e[18]=p,e[19]=N,e[20]=l,e[21]=z):z=e[21];const H=z;let $;e[22]!==E?($=ze=>{E("session.close",{sessionId:ze})},e[22]=E,e[23]=$):$=e[23];const q=$;let G;e[24]!==E?(G=(ze,qe)=>{E("session.revert",{sessionId:ze,messageId:qe})},e[24]=E,e[25]=G):G=e[25];const W=G;let X;e[26]!==E?(X=(ze,qe)=>{E("session.fork",{sessionId:ze,messageId:qe})},e[26]=E,e[27]=X):X=e[27];const Y=X;let I;e[28]!==E?(I=ze=>{E("session.compact",{sessionId:ze})},e[28]=E,e[29]=I):I=e[29];const M=I;let P;e[30]!==E?(P=ze=>{E("session.reopen",{sessionId:ze})},e[30]=E,e[31]=P):P=e[31];const B=P;let F;e[32]!==E?(F=ze=>{E("session.delete",{sessionId:ze})},e[32]=E,e[33]=F):F=e[33];const Q=F;let J;e[34]!==r||e[35]!==E?(J=ze=>{r&&E("session.update",{sessionId:r.id,preconfigId:ze})},e[34]=r,e[35]=E,e[36]=J):J=e[36];const ee=J;let K;e[37]!==r||e[38]!==E||e[39]!==w||e[40]!==C?(K=(ze,qe)=>{w(ze),C(null),r&&E("session.update_model",{sessionId:r.id,modelId:ze,providerId:qe})},e[37]=r,e[38]=E,e[39]=w,e[40]=C,e[41]=K):K=e[41];const V=K;let te;e[42]!==a||e[43]!==r||e[44]!==E||e[45]!==C?(te=ze=>{r&&(E("session.update_model",{sessionId:r.id,modelId:r.selectedModel||a,providerId:r.selectedProvider||"openai",variant:ze}),C(ze))},e[42]=a,e[43]=r,e[44]=E,e[45]=C,e[46]=te):te=e[46];const re=te;let ae;e[47]!==E?(ae=(ze,qe)=>{E("session.rename",{sessionId:ze,title:qe})},e[47]=E,e[48]=ae):ae=e[48];const se=ae;let Se;e[49]!==r||e[50]!==H?(Se=()=>{r!=null&&r.parentId&&H(r.parentId)},e[49]=r,e[50]=H,e[51]=Se):Se=e[51];const Ae=Se;let De;e[52]!==E?(De=(ze,qe,Pe)=>{E("queue.add",{sessionId:ze,content:qe,...Pe&&Pe.length>0?{attachments:Pe}:{}})},e[52]=E,e[53]=De):De=e[53];const Ue=De;let ce;e[54]!==E?(ce=ze=>{E("queue.remove",{queueId:ze})},e[54]=E,e[55]=ce):ce=e[55];const je=ce;let xe;e[56]!==Ue||e[57]!==r||e[58]!==d||e[59]!==E||e[60]!==u?(xe=(ze,qe)=>{!r||d||(r.runningAt||u.has(r.id)?Ue(r.id,ze,qe):E("chat.message",{sessionId:r.id,content:ze,...qe&&qe.length>0?{attachments:qe}:{}}))},e[56]=Ue,e[57]=r,e[58]=d,e[59]=E,e[60]=u,e[61]=xe):xe=e[61];const Ve=xe;let We;e[62]!==y||e[63]!==E?(We=(ze,qe,Pe)=>{y(ze),E("permission.response",{toolCallId:ze,allowed:qe,alwaysAllow:Pe})},e[62]=y,e[63]=E,e[64]=We):We=e[64];const it=We;let ge;e[65]!==r||e[66]!==E?(ge=()=>{r&&E("session.interrupt",{sessionId:r.id})},e[65]=r,e[66]=E,e[67]=ge):ge=e[67];const Re=ge;let be;e[68]!==c||e[69]!==E?(be=()=>{c&&E("permission.list",{workspaceId:c.id})},e[68]=c,e[69]=E,e[70]=be):be=e[70];const oe=be;let me;e[71]!==E?(me=ze=>{E("provider.connect",{provider:ze})},e[71]=E,e[72]=me):me=e[72];const Ee=me;let Ie;e[73]!==E?(Ie=ze=>{E("provider.disconnect",{provider:ze})},e[73]=E,e[74]=Ie):Ie=e[74];const Fe=Ie;let Ge;e[75]!==k||e[76]!==j||e[77]!==_||e[78]!==m||e[79]!==E||e[80]!==g||e[81]!==x||e[82]!==l?(Ge=ze=>{var Pe;g(l.find(nt=>nt.id===ze)||null),_.current=!0,k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),j.current.clear();const qe=(Pe=m[0])==null?void 0:Pe.id;E("session.create",{preconfigId:qe,workspaceId:ze}),x(!1)},e[75]=k,e[76]=j,e[77]=_,e[78]=m,e[79]=E,e[80]=g,e[81]=x,e[82]=l,e[83]=Ge):Ge=e[83];const Ze=Ge;let lt;return e[84]!==Ue||e[85]!==q||e[86]!==M||e[87]!==Ee||e[88]!==L||e[89]!==Ze||e[90]!==Fe||e[91]!==Y||e[92]!==Re||e[93]!==Ae||e[94]!==it||e[95]!==se||e[96]!==Q||e[97]!==oe||e[98]!==je||e[99]!==B||e[100]!==H||e[101]!==W||e[102]!==Ve||e[103]!==E||e[104]!==V||e[105]!==ee||e[106]!==re?(lt={sendMessage:E,createSession:L,resumeSession:H,closeSession:q,reopenSession:B,permanentlyDeleteSession:Q,handleRenameSession:se,revertSession:W,forkSession:Y,compactSession:M,addToQueue:Ue,removeFromQueue:je,sendChatMessage:Ve,handlePermissionResponse:it,handleInterruptSession:Re,updateSessionPreconfig:ee,updateSessionModel:V,updateSessionVariant:re,handleNavigateBack:Ae,refreshPermissions:oe,connectProvider:Ee,disconnectProvider:Fe,createSessionInWorkspace:Ze},e[84]=Ue,e[85]=q,e[86]=M,e[87]=Ee,e[88]=L,e[89]=Ze,e[90]=Fe,e[91]=Y,e[92]=Re,e[93]=Ae,e[94]=it,e[95]=se,e[96]=Q,e[97]=oe,e[98]=je,e[99]=B,e[100]=H,e[101]=W,e[102]=Ve,e[103]=E,e[104]=V,e[105]=ee,e[106]=re,e[107]=lt):lt=e[107],lt}const a$=400,l$=typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window);var uS;const c$=typeof navigator<"u"&&((uS=navigator.platform)==null?void 0:uS.toUpperCase().includes("MAC"))===!0;function u$(){const t=['[data-slot="dialog-overlay"][data-state="open"]','[data-slot="dialog-content"][data-state="open"]','[role="dialog"][data-state="open"]'];for(const n of t)if(document.querySelector(n))return!0;const e=document.querySelectorAll('[role="dialog"]');for(const n of e)if(n instanceof HTMLElement&&d$(n))return!0;return!1}function d$(t){if(!t.isConnected)return!1;const e=window.getComputedStyle(t);return e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity)>0&&t.getBoundingClientRect().width>0&&t.getBoundingClientRect().height>0}function f$(){var e,n;const t=document.activeElement;return t?!!((e=t.hasAttribute)!=null&&e.call(t,"data-chat-input")||(n=t.closest)!=null&&n.call(t,'[data-chat-input="true"]')):!1}function h$(t){const e=he.c(5),n=R.useRef(t);let r;e[0]!==t?(r=()=>{n.current=t},e[0]=t,e[1]=r):r=e[1],R.useLayoutEffect(r);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={lastEscTime:0,armed:!1},e[2]=i):i=e[2];const l=R.useRef(i);let c,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const u=d=>{if(d.isComposing||d.repeat||d.key==="Escape"&&u$())return;const{onCloseFocusedPanel:m,onFocusChatInput:p,onStopStreaming:g,onOpenSidebar:x,onOpenTerminal:w,onOpenFilesPanel:C,onNewWindow:y,onNewSession:S,onToggleViewMode:b,onToggleAutoFollow:_}=n.current;if(d.shiftKey&&d.key==="Escape"){d.preventDefault(),m();return}if(d.key==="Escape"&&!d.metaKey&&!d.ctrlKey){const D=f$(),E=Date.now(),{lastEscTime:O,armed:L}=l.current,z=E-O;if(D&&L&&z<a$){d.preventDefault(),l.current={lastEscTime:0,armed:!1},g();return}if(D){l.current={lastEscTime:E,armed:!0};return}d.preventDefault(),p();return}const k=d.target,j=k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable,N=d.metaKey||d.ctrlKey;if(!(j&&!N)){if(!l$||!c$){if(N&&d.code==="Digit1"){d.preventDefault(),x();return}if(N&&d.code==="KeyT"){d.preventDefault(),w();return}}if(N&&d.code==="Digit2"){d.preventDefault(),C();return}if(N&&d.shiftKey&&d.code==="KeyN"){d.preventDefault(),y();return}if(N&&d.code==="KeyN"){d.preventDefault(),S();return}if(N&&d.code==="KeyO"){d.preventDefault(),b();return}if(N&&d.shiftKey&&d.code==="KeyF"){d.preventDefault(),_();return}}};return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},a=[],e[3]=c,e[4]=a):(c=e[3],a=e[4]),R.useEffect(c,a)}var $_;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})($_||($_={}));async function p$(t,e){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(t,e),await eh("plugin:event|unlisten",{event:t,eventId:e})}async function U_(t,e,n){var r;const i=(r=void 0)!==null&&r!==void 0?r:{kind:"Any"};return eh("plugin:event|listen",{event:t,target:i,handler:BH(e)}).then(l=>async()=>p$(t,l))}function m$(t){const e=he.c(39),{sidebarRef:n,terminalPanelRef:r,filesPanelRef:i,chatInputRef:l,activeWorkspace:c,primaryPreconfigs:a,handleInterruptSession:u,handleSidebarViewModeChange:d,createSession:m,setSidebarOpen:p,onToggleAutoFollow:g}=t;let x;e[0]!==p||e[1]!==n?(x=()=>{p(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var V;(V=n.current)==null||V.focusSessionPanel()})})},e[0]=p,e[1]=n,e[2]=x):x=e[2];const w=x;let C;e[3]!==r?(C=()=>{qt.getState().setShowTerminalPanel(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var V;(V=r.current)==null||V.focus()})})},e[3]=r,e[4]=C):C=e[4];const y=C,S=R.useRef(w);let b;e[5]!==w?(b=()=>{S.current=w},e[5]=w,e[6]=b):b=e[6],R.useLayoutEffect(b);const _=R.useRef(y);let k;e[7]!==y?(k=()=>{_.current=y},e[7]=y,e[8]=k):k=e[8],R.useLayoutEffect(k);const j=x$;let N;e[9]!==i?(N=()=>{requestAnimationFrame(()=>{var V;(V=i.current)==null||V.focus()})},e[9]=i,e[10]=N):N=e[10];const D=N,E=R.useRef(D);let O;e[11]!==D?(O=()=>{E.current=D},e[11]=D,e[12]=O):O=e[12],R.useLayoutEffect(O);let L;e[13]!==l?(L=()=>{var V;(V=l.current)==null||V.focus()},e[13]=l,e[14]=L):L=e[14];const z=L;let H;e[15]!==c||e[16]!==m||e[17]!==a?(H=()=>{c&&a[0]&&m(a[0].id)},e[15]=c,e[16]=m,e[17]=a,e[18]=H):H=e[18];const $=H,q=y$;let G;e[19]!==d?(G=()=>{d(v$)},e[19]=d,e[20]=G):G=e[20];const W=G;let X;e[21]!==p?(X=()=>{const V=document.activeElement;V!=null&&V.closest("[data-terminal-panel]")?j():V!=null&&V.closest('[data-panel-id="files"]')?qt.getState().setShowFilesPanel(!1):V!=null&&V.closest('[data-sidebar="sidebar"]')&&p(!1)},e[21]=p,e[22]=X):X=e[22];const Y=X;let I;e[23]!==u?(I=()=>{u()},e[23]=u,e[24]=I):I=e[24];const M=I;let P,B,F;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=()=>S.current(),B=()=>_.current(),F=()=>E.current(),e[25]=P,e[26]=B,e[27]=F):(P=e[25],B=e[26],F=e[27]);let Q;e[28]!==g?(Q=()=>g==null?void 0:g(),e[28]=g,e[29]=Q):Q=e[29];let J;e[30]!==z||e[31]!==Y||e[32]!==$||e[33]!==M||e[34]!==W||e[35]!==Q?(J={onOpenSidebar:P,onOpenTerminal:B,onOpenFilesPanel:F,onNewSession:$,onNewWindow:q,onToggleViewMode:W,onCloseFocusedPanel:Y,onFocusChatInput:z,onStopStreaming:M,onToggleAutoFollow:Q},e[30]=z,e[31]=Y,e[32]=$,e[33]=M,e[34]=W,e[35]=Q,e[36]=J):J=e[36],h$(J);let ee,K;e[37]===Symbol.for("react.memo_cache_sentinel")?(ee=()=>{if(!(typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window)))return;let te=!1;const re=[];return(async()=>{try{const se=await U_("jean2://accelerator/open-sidebar",()=>{S.current()});if(te){se();return}re.push(se)}catch(se){console.error("Failed to register open-sidebar accelerator listener:",se)}try{const se=await U_("jean2://accelerator/open-terminal",()=>{_.current()});if(te){se();return}re.push(se)}catch(se){console.error("Failed to register open-terminal accelerator listener:",se)}})(),()=>{te=!0,re.forEach(g$)}},K=[],e[37]=ee,e[38]=K):(ee=e[37],K=e[38]),R.useLayoutEffect(ee,K)}function g$(t){return t()}function v$(t){return t==="overview"?"default":"overview"}function y$(){eh("create_new_window").catch(b$)}function b$(){}function x$(){qt.getState().setShowTerminalPanel(!1)}function _$(t){const e=he.c(3),{setOpen:n}=Gc();let r;return e[0]!==t||e[1]!==n?(r={...t,setSidebarOpen:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],m$(r),null}function V_(t){const e=he.c(17),{onServerSwitch:n,onSelectWorkspace:r}=t,[i,l]=R.useState(!1),c=R.useRef(!1),a=ol(),{quickConnections:u,switchServer:d,removeFromQuickConnections:m,isSwitching:p}=Qa(),g=L=>{d(L.serverId)&&(c.current=!0,n==null||n(),L.workspaceId&&r&&r(L.workspaceId))};let x,w;e[0]!==p||e[1]!==i?(x=()=>{!p&&i&&c.current&&(l(!1),c.current=!1)},w=[p,i],e[0]=p,e[1]=i,e[2]=x,e[3]=w):(x=e[2],w=e[3]),R.useEffect(x,w);let C;e[4]!==m?(C=(L,z)=>{L.stopPropagation(),m(z)},e[4]=m,e[5]=C):C=e[5];const y=C,S=()=>h.jsx(Nv,{children:h.jsx(Rv,{className:"max-h-[50vh] overflow-y-auto",children:u.length>0?h.jsx(Ec,{heading:"Quick Switch",children:u.map(L=>h.jsxs(Ha,{onSelect:()=>g(L),className:"justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Do,{className:"size-4 text-muted-foreground"}),h.jsxs("span",{children:[L.serverName,L.workspaceName&&h.jsxs("span",{className:"text-muted-foreground",children:[" / ",L.workspaceName]})]})]}),h.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",onClick:z=>y(z,L.id),children:h.jsx(Br,{className:"size-3 text-destructive"})})]},L.id))}):h.jsx(jv,{className:"py-6",children:h.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[h.jsx(hm,{className:"size-8"}),h.jsx("p",{className:"text-sm font-medium",children:"No favorites yet"}),h.jsx("p",{className:"text-xs",children:"Star a workspace to add it here"})]})})})});if(a){let L;e[6]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx(Z8,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:h.jsx(hm,{className:"size-4"})})}),e[6]=L):L=e[6];let z;return e[7]===Symbol.for("react.memo_cache_sentinel")?(z=h.jsx(Vf,{children:h.jsx(qf,{children:"Quick Switch"})}),e[7]=z):z=e[7],h.jsxs($f,{open:i,onOpenChange:l,children:[L,h.jsxs(Uf,{side:"bottom",className:"max-h-[80vh]",children:[z,h.jsx("div",{className:"mt-4",children:S()})]})]})}const b=Ff;let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx(Tv,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:h.jsx(hm,{className:"size-4"})})}),e[8]=_):_=e[8];const k=Hf,j="w-[300px] p-0",N="start",D=S();let E;e[9]!==k||e[10]!==D?(E=h.jsx(k,{className:j,align:N,children:D}),e[9]=k,e[10]=D,e[11]=E):E=e[11];let O;return e[12]!==b||e[13]!==i||e[14]!==_||e[15]!==E?(O=h.jsxs(b,{open:i,onOpenChange:l,children:[_,E]}),e[12]=b,e[13]=i,e[14]=_,e[15]=E,e[16]=O):O=e[16],O}function q_(t){const e=he.c(13),{viewMode:n,onViewModeChange:r}=t;let i;e[0]!==r||e[1]!==n?(i=()=>{r(n==="overview"?"default":"overview")},e[0]=r,e[1]=n,e[2]=i):i=e[2];const l=i,c=n==="overview";let a;e[3]!==c?(a=c?h.jsx(WA,{className:"h-4 w-4"}):h.jsx(VA,{className:"h-4 w-4"}),e[3]=c,e[4]=a):a=e[4];let u;e[5]!==a||e[6]!==l?(u=h.jsx(Nc,{asChild:!0,children:h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:l,children:a})}),e[5]=a,e[6]=l,e[7]=u):u=e[7];const d=c?"Single workspace":"Overview";let m;e[8]!==d?(m=h.jsx(Rc,{children:d}),e[8]=d,e[9]=m):m=e[9];let p;return e[10]!==u||e[11]!==m?(p=h.jsx(Kd,{children:h.jsxs(Ac,{children:[u,m]})}),e[10]=u,e[11]=m,e[12]=p):p=e[12],p}function S$(t){const e=he.c(69),{headerTitle:n,isLoggedIn:r,activeWorkspace:i,onServerSwitch:l,onSelectWorkspace:c,onSidebarViewModeChange:a}=t,u=qt(A$),d=qt(E$),m=qt(k$),p=qt(C$),g=qt(w$);let x;e[0]!==r?(x=r&&h.jsx(Px,{}),e[0]=r,e[1]=x):x=e[1];let w;e[2]!==n?(w=h.jsx("span",{className:"font-semibold",children:n}),e[2]=n,e[3]=w):w=e[3];let C;e[4]!==x||e[5]!==w?(C=h.jsxs("div",{className:"flex items-center gap-2",children:[x,w]}),e[4]=x,e[5]=w,e[6]=C):C=e[6];let y;e[7]!==r||e[8]!==c||e[9]!==l?(y=r&&h.jsx(V_,{onServerSwitch:l,onSelectWorkspace:c}),e[7]=r,e[8]=c,e[9]=l,e[10]=y):y=e[10];let S;e[11]!==r||e[12]!==a||e[13]!==u?(S=r&&h.jsx(q_,{viewMode:u,onViewModeChange:a}),e[11]=r,e[12]=a,e[13]=u,e[14]=S):S=e[14];let b;e[15]!==i||e[16]!==r||e[17]!==p||e[18]!==d?(b=r&&i&&h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>p(!d),title:d?"Hide Files":"Show Files",children:h.jsx(sg,{className:"w-4 h-4"})}),e[15]=i,e[16]=r,e[17]=p,e[18]=d,e[19]=b):b=e[19];let _;e[20]!==i||e[21]!==r||e[22]!==g||e[23]!==m?(_=r&&i&&h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>g(!m),title:m?"Hide Terminal":"Show Terminal",children:h.jsx(Yb,{className:"w-4 h-4"})}),e[20]=i,e[21]=r,e[22]=g,e[23]=m,e[24]=_):_=e[24];let k;e[25]!==y||e[26]!==S||e[27]!==b||e[28]!==_?(k=h.jsxs("div",{className:"flex items-center gap-1",children:[y,S,b,_]}),e[25]=y,e[26]=S,e[27]=b,e[28]=_,e[29]=k):k=e[29];let j;e[30]!==C||e[31]!==k?(j=h.jsxs("header",{className:"md:hidden flex items-center justify-between p-3 border-b border-border bg-background sticky top-0 z-10",children:[C,k]}),e[30]=C,e[31]=k,e[32]=j):j=e[32];let N;e[33]!==r?(N=r&&h.jsx(Px,{}),e[33]=r,e[34]=N):N=e[34];let D;e[35]!==n?(D=h.jsx("span",{className:"font-semibold",children:n}),e[35]=n,e[36]=D):D=e[36];let E;e[37]!==N||e[38]!==D?(E=h.jsxs("div",{className:"flex items-center gap-2",children:[N,D]}),e[37]=N,e[38]=D,e[39]=E):E=e[39];let O;e[40]!==r||e[41]!==c||e[42]!==l?(O=r&&h.jsx(V_,{onServerSwitch:l,onSelectWorkspace:c}),e[40]=r,e[41]=c,e[42]=l,e[43]=O):O=e[43];let L;e[44]!==r||e[45]!==a||e[46]!==u?(L=r&&h.jsx(q_,{viewMode:u,onViewModeChange:a}),e[44]=r,e[45]=a,e[46]=u,e[47]=L):L=e[47];let z;e[48]!==i||e[49]!==r||e[50]!==p||e[51]!==d?(z=r&&i&&h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>p(!d),title:d?"Hide Files":"Show Files",children:h.jsx(sg,{className:"w-4 h-4"})}),e[48]=i,e[49]=r,e[50]=p,e[51]=d,e[52]=z):z=e[52];let H;e[53]!==i||e[54]!==r||e[55]!==g||e[56]!==m?(H=r&&i&&h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>g(!m),title:m?"Hide Terminal":"Show Terminal",children:h.jsx(Yb,{className:"w-4 h-4"})}),e[53]=i,e[54]=r,e[55]=g,e[56]=m,e[57]=H):H=e[57];let $;e[58]!==O||e[59]!==L||e[60]!==z||e[61]!==H?($=h.jsxs("div",{className:"flex items-center gap-2",children:[O,L,z,H]}),e[58]=O,e[59]=L,e[60]=z,e[61]=H,e[62]=$):$=e[62];let q;e[63]!==E||e[64]!==$?(q=h.jsxs("header",{className:"hidden md:flex items-center justify-between p-3 border-b border-border",children:[E,$]}),e[63]=E,e[64]=$,e[65]=q):q=e[65];let G;return e[66]!==q||e[67]!==j?(G=h.jsxs(h.Fragment,{children:[j,q]}),e[66]=q,e[67]=j,e[68]=G):G=e[68],G}function w$(t){return t.setShowTerminalPanel}function C$(t){return t.setShowFilesPanel}function k$(t){return t.showTerminalPanel}function E$(t){return t.showFilesPanel}function A$(t){return t.sidebarViewMode}function N$({cachedTerminal:t}){const e=R.useRef(null);return R.useEffect(()=>{const n=e.current;if(!n)return;const{terminal:r,fitAddon:i}=t;t.isOpened?r.element&&n.appendChild(r.element):(r.open(n),t.isOpened=!0),requestAnimationFrame(()=>{try{i.fit()}catch{}if(r.cols<=1||r.rows<=1){const c=()=>{try{if(i.fit(),r.cols>1&&r.rows>1)return}catch{}requestAnimationFrame(c)};requestAnimationFrame(c)}}),r.focus();const l=new ResizeObserver(()=>{requestAnimationFrame(()=>{try{i.fit()}catch{}})});return l.observe(n),()=>{l.disconnect(),r.element&&r.element.parentElement&&r.element.parentElement.removeChild(r.element)}},[t]),h.jsx("div",{ref:e,className:"w-full h-full",onFocus:()=>t.terminal.focus()})}var Qm={exports:{}},W_;function R$(){return W_||(W_=1,(function(t,e){(function(n,r){t.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(c,a,u){var d=this&&this.__decorate||function(b,_,k,j){var N,D=arguments.length,E=D<3?_:j===null?j=Object.getOwnPropertyDescriptor(_,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,_,k,j);else for(var O=b.length-1;O>=0;O--)(N=b[O])&&(E=(D<3?N(E):D>3?N(_,k,E):N(_,k))||E);return D>3&&E&&Object.defineProperty(_,k,E),E},m=this&&this.__param||function(b,_){return function(k,j){_(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const p=u(9042),g=u(9924),x=u(844),w=u(4725),C=u(2585),y=u(3656);let S=a.AccessibilityManager=class extends x.Disposable{constructor(b,_,k,j){super(),this._terminal=b,this._coreBrowserService=k,this._renderService=j,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;N<this._terminal.rows;N++)this._rowElements[N]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[N]);if(this._topBoundaryFocusListener=N=>this._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new g.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
613
|
-
`)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(b){for(let _=0;_<b;_++)this._handleChar(" ")}_handleChar(b){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==b&&(this._charsToAnnounce+=b):this._charsToAnnounce+=b,b===`
|
|
614
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(b){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(b)||this._charsToConsume.push(b)}_refreshRows(b,_){this._liveRegionDebouncer.refresh(b,_,this._terminal.rows)}_renderRows(b,_){const k=this._terminal.buffer,j=k.lines.length.toString();for(let N=b;N<=_;N++){const D=k.lines.get(k.ydisp+N),E=[],O=(D==null?void 0:D.translateToString(!0,void 0,void 0,E))||"",L=(k.ydisp+N+1).toString(),z=this._rowElements[N];z&&(O.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=O,this._rowColumns.set(z,E)),z.setAttribute("aria-posinset",L),z.setAttribute("aria-setsize",j))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(b,_){const k=b.target,j=this._rowElements[_===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(_===0?"1":`${this._terminal.buffer.lines.length}`)||b.relatedTarget!==j)return;let N,D;if(_===0?(N=k,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(N=this._rowElements.shift(),D=k,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),_===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(_===0?-1:1),this._rowElements[_===0?1:this._rowElements.length-2].focus(),b.preventDefault(),b.stopImmediatePropagation()}_handleSelectionChange(){var O,L;if(this._rowElements.length===0)return;const b=document.getSelection();if(!b)return;if(b.isCollapsed)return void(this._rowContainer.contains(b.anchorNode)&&this._terminal.clearSelection());if(!b.anchorNode||!b.focusNode)return void console.error("anchorNode and/or focusNode are null");let _={node:b.anchorNode,offset:b.anchorOffset},k={node:b.focusNode,offset:b.focusOffset};if((_.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||_.node===k.node&&_.offset>k.offset)&&([_,k]=[k,_]),_.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(_={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(_.node))return;const j=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(j)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:j,offset:(L=(O=j.textContent)==null?void 0:O.length)!=null?L:0}),!this._rowContainer.contains(k.node))return;const N=({node:z,offset:H})=>{const $=z instanceof Text?z.parentNode:z;let q=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const G=this._rowColumns.get($);if(!G)return console.warn("columns is null. Race condition?"),null;let W=H<G.length?G[H]:G.slice(-1)[0]+1;return W>=this._terminal.cols&&(++q,W=0),{row:q,column:W}},D=N(_),E=N(k);if(D&&E){if(D.row>E.row||D.row===E.row&&D.column>=E.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(E.row-D.row)*this._terminal.cols-D.column+E.column)}}_handleResize(b){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let _=this._rowContainer.children.length;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);for(;this._rowElements.length>b;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const b=this._coreBrowserService.mainDocument.createElement("div");return b.setAttribute("role","listitem"),b.tabIndex=-1,this._refreshRowDimensions(b),b}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let b=0;b<this._terminal.rows;b++)this._refreshRowDimensions(this._rowElements[b])}}_refreshRowDimensions(b){b.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=S=d([m(1,C.IInstantiationService),m(2,w.ICoreBrowserService),m(3,w.IRenderService)],S)},3614:(c,a)=>{function u(g){return g.replace(/\r?\n/g,"\r")}function d(g,x){return x?"\x1B[200~"+g+"\x1B[201~":g}function m(g,x,w,C){g=d(g=u(g),w.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(g,!0),x.value=""}function p(g,x,w){const C=w.getBoundingClientRect(),y=g.clientX-C.left-10,S=g.clientY-C.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${y}px`,x.style.top=`${S}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=u,a.bracketTextForPaste=d,a.copyHandler=function(g,x){g.clipboardData&&g.clipboardData.setData("text/plain",x.selectionText),g.preventDefault()},a.handlePasteEvent=function(g,x,w,C){g.stopPropagation(),g.clipboardData&&m(g.clipboardData.getData("text/plain"),x,w,C)},a.paste=m,a.moveTextAreaUnderMouseCursor=p,a.rightClickHandler=function(g,x,w,C,y){p(g,x,w),y&&C.rightClickSelect(g),x.value=C.selectionText,x.select()}},7239:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const d=u(1505);a.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(m,p,g){this._css.set(m,p,g)}getCss(m,p){return this._css.get(m,p)}setColor(m,p,g){this._color.set(m,p,g)}getColor(m,p){return this._color.get(m,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(u,d,m,p){u.addEventListener(d,m,p);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(d,m,p))}}}},3551:function(c,a,u){var d=this&&this.__decorate||function(S,b,_,k){var j,N=arguments.length,D=N<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,_):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,b,_,k);else for(var E=S.length-1;E>=0;E--)(j=S[E])&&(D=(N<3?j(D):N>3?j(b,_,D):j(b,_))||D);return N>3&&D&&Object.defineProperty(b,_,D),D},m=this&&this.__param||function(S,b){return function(_,k){b(_,k,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const p=u(3656),g=u(8460),x=u(844),w=u(2585),C=u(4725);let y=a.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(S,b,_,k,j){super(),this._element=S,this._mouseService=b,this._renderService=_,this._bufferService=k,this._linkProviderService=j,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const b=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!b)return;this._isMouseOut=!1;const _=S.composedPath();for(let k=0;k<_.length;k++){const j=_[k];if(j.classList.contains("xterm"))break;if(j.classList.contains("xterm-hover"))return}this._lastBufferCell&&b.x===this._lastBufferCell.x&&b.y===this._lastBufferCell.y||(this._handleHover(b),this._lastBufferCell=b)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,b){var k,j;this._activeProviderReplies&&b||((k=this._activeProviderReplies)==null||k.forEach((N=>{N==null||N.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let _=!1;for(const[N,D]of this._linkProviderService.linkProviders.entries())b?(j=this._activeProviderReplies)!=null&&j.get(N)&&(_=this._checkLinkProviderResult(N,S,_)):D.provideLinks(S.y,(E=>{var L,z;if(this._isMouseOut)return;const O=E==null?void 0:E.map((H=>({link:H})));(L=this._activeProviderReplies)==null||L.set(N,O),_=this._checkLinkProviderResult(N,S,_),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,b){const _=new Set;for(let k=0;k<b.size;k++){const j=b.get(k);if(j)for(let N=0;N<j.length;N++){const D=j[N],E=D.link.range.start.y<S?0:D.link.range.start.x,O=D.link.range.end.y>S?this._bufferService.cols:D.link.range.end.x;for(let L=E;L<=O;L++){if(_.has(L)){j.splice(N--,1);break}_.add(L)}}}}_checkLinkProviderResult(S,b,_){var N;if(!this._activeProviderReplies)return _;const k=this._activeProviderReplies.get(S);let j=!1;for(let D=0;D<S;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(j=!0);if(!j&&k){const D=k.find((E=>this._linkAtPosition(E.link,b)));D&&(_=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!_)for(let D=0;D<this._activeProviderReplies.size;D++){const E=(N=this._activeProviderReplies.get(D))==null?void 0:N.find((O=>this._linkAtPosition(O.link,b)));if(E){_=!0,this._handleNewLink(E);break}}return _}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const b=this._positionFromMouseEvent(S,this._element,this._mouseService);b&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,b)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,b){this._currentLink&&this._lastMouseEvent&&(!S||!b||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=b)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._linkAtPosition(S.link,b)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var _,k;return(k=(_=this._currentLink)==null?void 0:_.state)==null?void 0:k.decorations.pointerCursor},set:_=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==_&&(this._currentLink.state.decorations.pointerCursor=_,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",_))}},underline:{get:()=>{var _,k;return(k=(_=this._currentLink)==null?void 0:_.state)==null?void 0:k.decorations.underline},set:_=>{var k,j,N;(k=this._currentLink)!=null&&k.state&&((N=(j=this._currentLink)==null?void 0:j.state)==null?void 0:N.decorations.underline)!==_&&(this._currentLink.state.decorations.underline=_,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,_))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((_=>{if(!this._currentLink)return;const k=_.start===0?0:_.start+1+this._bufferService.buffer.ydisp,j=this._bufferService.buffer.ydisp+1+_.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=j&&(this._clearCurrentLink(k,j),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(S,b,_){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(b,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),b.hover&&b.hover(_,b.text)}_fireUnderlineEvent(S,b){const _=S.range,k=this._bufferService.buffer.ydisp,j=this._createLinkUnderlineEvent(_.start.x-1,_.start.y-k-1,_.end.x,_.end.y-k-1,void 0);(b?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(j)}_linkLeave(S,b,_){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(b,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),b.leave&&b.leave(_,b.text)}_linkAtPosition(S,b){const _=S.range.start.y*this._bufferService.cols+S.range.start.x,k=S.range.end.y*this._bufferService.cols+S.range.end.x,j=b.y*this._bufferService.cols+b.x;return _<=j&&j<=k}_positionFromMouseEvent(S,b,_){const k=_.getCoords(S,b,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,b,_,k,j){return{x1:S,y1:b,x2:_,y2:k,cols:this._bufferService.cols,fg:j}}};a.Linkifier=y=d([m(1,C.IMouseService),m(2,C.IRenderService),m(3,w.IBufferService),m(4,C.ILinkProviderService)],y)},9042:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(c,a,u){var d=this&&this.__decorate||function(C,y,S,b){var _,k=arguments.length,j=k<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(C,y,S,b);else for(var N=C.length-1;N>=0;N--)(_=C[N])&&(j=(k<3?_(j):k>3?_(y,S,j):_(y,S))||j);return k>3&&j&&Object.defineProperty(y,S,j),j},m=this&&this.__param||function(C,y){return function(S,b){y(S,b,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const p=u(511),g=u(2585);let x=a.OscLinkProvider=class{constructor(C,y,S){this._bufferService=C,this._optionsService=y,this._oscLinkService=S}provideLinks(C,y){var O;const S=this._bufferService.buffer.lines.get(C-1);if(!S)return void y(void 0);const b=[],_=this._optionsService.rawOptions.linkHandler,k=new p.CellData,j=S.getTrimmedLength();let N=-1,D=-1,E=!1;for(let L=0;L<j;L++)if(D!==-1||S.hasContent(L)){if(S.loadCell(L,k),k.hasExtendedAttrs()&&k.extended.urlId){if(D===-1){D=L,N=k.extended.urlId;continue}E=k.extended.urlId!==N}else D!==-1&&(E=!0);if(E||D!==-1&&L===j-1){const z=(O=this._oscLinkService.getLinkData(N))==null?void 0:O.uri;if(z){const H={start:{x:D+1,y:C},end:{x:L+(E||L!==j-1?0:1),y:C}};let $=!1;if(!(_!=null&&_.allowNonHttpProtocols))try{const q=new URL(z);["http:","https:"].includes(q.protocol)||($=!0)}catch{$=!0}$||b.push({text:z,range:H,activate:(q,G)=>_?_.activate(q,G,H):w(0,G),hover:(q,G)=>{var W;return(W=_==null?void 0:_.hover)==null?void 0:W.call(_,q,G,H)},leave:(q,G)=>{var W;return(W=_==null?void 0:_.leave)==null?void 0:W.call(_,q,G,H)}})}E=!1,k.hasExtendedAttrs()&&k.extended.urlId?(D=L,N=k.extended.urlId):(D=-1,N=-1)}}y(b)}};function w(C,y){if(confirm(`Do you want to navigate to ${y}?
|
|
615
|
-
|
|
616
|
-
WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=x=d([m(0,g.IBufferService),m(1,g.IOptionsService),m(2,g.IOscLinkService)],x)},6193:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,m){this._rowCount=m,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const d=u(3614),m=u(3656),p=u(3551),g=u(9042),x=u(3730),w=u(1680),C=u(3107),y=u(5744),S=u(2950),b=u(1296),_=u(428),k=u(4269),j=u(5114),N=u(8934),D=u(3230),E=u(9312),O=u(4725),L=u(6731),z=u(8055),H=u(8969),$=u(8460),q=u(844),G=u(6114),W=u(8437),X=u(2584),Y=u(7399),I=u(5941),M=u(9074),P=u(2585),B=u(5435),F=u(4567),Q=u(779);class J extends H.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(K={}){super(K),this.browser=G,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new q.MutableDisposable),this._onCursorMove=this.register(new $.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new $.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new $.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new $.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new $.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new $.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new $.EventEmitter),this._onBlur=this.register(new $.EventEmitter),this._onA11yCharEmitter=this.register(new $.EventEmitter),this._onA11yTabEmitter=this.register(new $.EventEmitter),this._onWillOpen=this.register(new $.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(O.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((V,te)=>this.refresh(V,te)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((V=>this._reportWindowsOptions(V)))),this.register(this._inputHandler.onColor((V=>this._handleColorEvent(V)))),this.register((0,$.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,$.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((V=>this._afterResize(V.cols,V.rows)))),this.register((0,q.toDisposable)((()=>{var V,te;this._customKeyEventHandler=void 0,(te=(V=this.element)==null?void 0:V.parentNode)==null||te.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const V of K){let te,re="";switch(V.index){case 256:te="foreground",re="10";break;case 257:te="background",re="11";break;case 258:te="cursor",re="12";break;default:te="ansi",re="4;"+V.index}switch(V.type){case 0:const ae=z.color.toColorRGB(te==="ansi"?this._themeService.colors.ansi[V.index]:this._themeService.colors[te]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${re};${(0,I.toRgbString)(ae)}${X.C1_ESCAPED.ST}`);break;case 1:if(te==="ansi")this._themeService.modifyColors((se=>se.ansi[V.index]=z.channels.toColor(...V.color)));else{const se=te;this._themeService.modifyColors((Se=>Se[se]=z.channels.toColor(...V.color)))}break;case 2:this._themeService.restoreColor(V.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const K=this.buffer.ybase+this.buffer.y,V=this.buffer.lines.get(K);if(!V)return;const te=Math.min(this.buffer.x,this.cols-1),re=this._renderService.dimensions.css.cell.height,ae=V.getWidth(te),se=this._renderService.dimensions.css.cell.width*ae,Se=this.buffer.y*this._renderService.dimensions.css.cell.height,Ae=te*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ae+"px",this.textarea.style.top=Se+"px",this.textarea.style.width=se+"px",this.textarea.style.height=re+"px",this.textarea.style.lineHeight=re+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(V=>{this.hasSelection()&&(0,d.copyHandler)(V,this._selectionService)})));const K=V=>(0,d.handlePasteEvent)(V,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,m.addDisposableDomListener)(this.element,"paste",K)),G.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(V=>{V.button===2&&(0,d.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(V=>{(0,d.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),G.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(V=>{V.button===1&&(0,d.moveTextAreaUnderMouseCursor)(V,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var te,re,ae;if(!K)throw new Error("Terminal requires a parent element.");if(K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((te=this.element)==null?void 0:te.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=K.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"),K.appendChild(this.element);const V=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),V.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),V.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),G.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(j.CoreBrowserService,this.textarea,(re=K.ownerDocument.defaultView)!=null?re:window,((ae=this._document)!=null?ae:typeof window<"u")?window.document:null)),this._instantiationService.setService(O.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(O.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(O.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(O.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(O.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(O.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(p.Linkifier,this.screenElement)),this.element.appendChild(V);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(O.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(b.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,V=this.element;function te(se){const Se=K._mouseService.getMouseReportCoords(se,K.screenElement);if(!Se)return!1;let Ae,De;switch(se.overrideType||se.type){case"mousemove":De=32,se.buttons===void 0?(Ae=3,se.button!==void 0&&(Ae=se.button<3?se.button:3)):Ae=1&se.buttons?0:4&se.buttons?1:2&se.buttons?2:3;break;case"mouseup":De=0,Ae=se.button<3?se.button:3;break;case"mousedown":De=1,Ae=se.button<3?se.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(se)===!1||K.viewport.getLinesScrolled(se)===0)return!1;De=se.deltaY<0?0:1,Ae=4;break;default:return!1}return!(De===void 0||Ae===void 0||Ae>4)&&K.coreMouseService.triggerMouseEvent({col:Se.col,row:Se.row,x:Se.x,y:Se.y,button:Ae,action:De,ctrl:se.ctrlKey,alt:se.altKey,shift:se.shiftKey})}const re={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ae={mouseup:se=>(te(se),se.buttons||(this._document.removeEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.removeEventListener("mousemove",re.mousedrag)),this.cancel(se)),wheel:se=>(te(se),this.cancel(se,!0)),mousedrag:se=>{se.buttons&&te(se)},mousemove:se=>{se.buttons||te(se)}};this.register(this.coreMouseService.onProtocolChange((se=>{se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(se)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&se?re.mousemove||(V.addEventListener("mousemove",ae.mousemove),re.mousemove=ae.mousemove):(V.removeEventListener("mousemove",re.mousemove),re.mousemove=null),16&se?re.wheel||(V.addEventListener("wheel",ae.wheel,{passive:!1}),re.wheel=ae.wheel):(V.removeEventListener("wheel",re.wheel),re.wheel=null),2&se?re.mouseup||(re.mouseup=ae.mouseup):(this._document.removeEventListener("mouseup",re.mouseup),re.mouseup=null),4&se?re.mousedrag||(re.mousedrag=ae.mousedrag):(this._document.removeEventListener("mousemove",re.mousedrag),re.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(V,"mousedown",(se=>{if(se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(se))return te(se),re.mouseup&&this._document.addEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.addEventListener("mousemove",re.mousedrag),this.cancel(se)}))),this.register((0,m.addDisposableDomListener)(V,"wheel",(se=>{if(!re.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(se)===!1)return!1;if(!this.buffer.hasScrollback){const Se=this.viewport.getLinesScrolled(se);if(Se===0)return;const Ae=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(se.deltaY<0?"A":"B");let De="";for(let Ue=0;Ue<Math.abs(Se);Ue++)De+=Ae;return this.coreService.triggerDataEvent(De,!0),this.cancel(se,!0)}return this.viewport.handleWheel(se)?this.cancel(se):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(V,"touchstart",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(se),this.cancel(se)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(V,"touchmove",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(se)?void 0:this.cancel(se)}),{passive:!1}))}refresh(K,V){var te;(te=this._renderService)==null||te.refreshRows(K,V)}updateCursorStyle(K){var V;(V=this._selectionService)!=null&&V.shouldColumnSelect(K)?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(K,V,te=0){var re;te===1?(super.scrollLines(K,V,te),this.refresh(0,this.rows-1)):(re=this.viewport)==null||re.scrollLines(K)}paste(K){(0,d.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const V=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),V}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,V,te){this._selectionService.setSelection(K,V,te)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,V){var te;(te=this._selectionService)==null||te.selectLines(K,V)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const V=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!V&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;V||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const te=(0,Y.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),te.type===3||te.type===2){const re=this.rows-1;return this.scrollLines(te.type===2?-re:re),this.cancel(K,!0)}return te.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(te.cancel&&this.cancel(K,!0),!te.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(te.key!==X.C0.ETX&&te.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:te.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(te.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,V){const te=K.isMac&&!this.options.macOptionIsMeta&&V.altKey&&!V.ctrlKey&&!V.metaKey||K.isWindows&&V.altKey&&V.ctrlKey&&!V.metaKey||K.isWindows&&V.getModifierState("AltGraph");return V.type==="keypress"?te:te&&(!V.keyCode||V.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function(V){return V.keyCode===16||V.keyCode===17||V.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let V;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)V=K.charCode;else if(K.which===null||K.which===void 0)V=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;V=K.which}return!(!V||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(V=String.fromCharCode(V),this._onKey.fire({key:V,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(V,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const V=K.data;return this.coreService.triggerDataEvent(V,!0),this.cancel(K),!0}return!1}resize(K,V){K!==this.cols||V!==this.rows?super.resize(K,V):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,V){var te,re;(te=this._charSizeService)==null||te.measure(),(re=this.viewport)==null||re.syncScrollArea(!0)}clear(){var K;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 V=1;V<this.rows;V++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var V,te;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),(V=this._selectionService)==null||V.reset(),this._decorationService.reset(),(te=this.viewport)==null||te.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const V=this._renderService.dimensions.css.canvas.width.toFixed(0),te=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${te};${V}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const re=this._renderService.dimensions.css.cell.width.toFixed(0),ae=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${ae};${re}t`)}}cancel(K,V){if(this.options.cancelEvents||V)return K.preventDefault(),K.stopPropagation(),!1}}a.Terminal=J},9924:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,m){this._rowCount=m,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=p-this._lastRefreshMs,x=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(c,a,u){var d=this&&this.__decorate||function(S,b,_,k){var j,N=arguments.length,D=N<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,_):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,b,_,k);else for(var E=S.length-1;E>=0;E--)(j=S[E])&&(D=(N<3?j(D):N>3?j(b,_,D):j(b,_))||D);return N>3&&D&&Object.defineProperty(b,_,D),D},m=this&&this.__param||function(S,b){return function(_,k){b(_,k,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const p=u(3656),g=u(4725),x=u(8460),w=u(844),C=u(2585);let y=a.Viewport=class extends w.Disposable{constructor(S,b,_,k,j,N,D,E){super(),this._viewportElement=S,this._scrollArea=b,this._bufferService=_,this._optionsService=k,this._charSizeService=j,this._renderService=N,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((O=>this._activeBuffer=O.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((O=>this._renderDimensions=O))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((O=>this._handleThemeChange(O)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const b=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==b&&(this._lastRecordedBufferHeight=b,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const b=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,b){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(b<0&&this._viewportElement.scrollTop!==0||b>0&&_<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const b=this._getPixelsScrolled(S);return b!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+b:this._smoothScrollState.target+=b,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=b,this._bubbleScroll(S,b))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const b=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+b,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let b=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?b*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._currentRowHeight*this._bufferService.rows),b}getBufferElements(S,b){var E;let _,k="";const j=[],N=b!=null?b:this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let O=S;O<N;O++){const L=D.get(O);if(!L)continue;const z=(E=D.get(O+1))==null?void 0:E.isWrapped;if(k+=L.translateToString(!z),!z||O===D.length-1){const H=document.createElement("div");H.textContent=k,j.push(H),k.length>0&&(_=H),k=""}}return{bufferElements:j,cursorElement:_}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let b=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(b/=this._currentRowHeight+0,this._wheelPartialScroll+=b,b=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._bufferService.rows),b}_applyScrollModifier(S,b){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&b.altKey||_==="ctrl"&&b.ctrlKey||_==="shift"&&b.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const b=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,b!==0&&(this._viewportElement.scrollTop+=b,this._bubbleScroll(S,b))}};a.Viewport=y=d([m(2,C.IBufferService),m(3,C.IOptionsService),m(4,g.ICharSizeService),m(5,g.IRenderService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],y)},3107:function(c,a,u){var d=this&&this.__decorate||function(C,y,S,b){var _,k=arguments.length,j=k<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(C,y,S,b);else for(var N=C.length-1;N>=0;N--)(_=C[N])&&(j=(k<3?_(j):k>3?_(y,S,j):_(y,S))||j);return k>3&&j&&Object.defineProperty(y,S,j),j},m=this&&this.__param||function(C,y){return function(S,b){y(S,b,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const p=u(4725),g=u(844),x=u(2585);let w=a.BufferDecorationRenderer=class extends g.Disposable{constructor(C,y,S,b,_){super(),this._screenElement=C,this._bufferService=y,this._coreBrowserService=S,this._decorationService=b,this._renderService=_,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((k=>this._removeDecoration(k)))),this.register((0,g.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var b,_;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((b=C==null?void 0:C.options)==null?void 0:b.layer)==="top"),y.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=(_=C.options.x)!=null?_:0;return S&&S>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(C,y),y}_refreshStyle(C){const y=C.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let S=this._decorationElements.get(C);S||(S=this._createElement(C),C.element=S,this._decorationElements.set(C,S),this._container.appendChild(S),C.onDispose((()=>{this._decorationElements.delete(C),S.remove()}))),S.style.top=y*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(S)}}_refreshXPosition(C,y=C.element){var b;if(!y)return;const S=(b=C.options.x)!=null?b:0;(C.options.anchor||"left")==="right"?y.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var y;(y=this._decorationElements.get(C))==null||y.remove(),this._decorationElements.delete(C),C.dispose()}};a.BufferDecorationRenderer=w=d([m(1,x.IBufferService),m(2,p.ICoreBrowserService),m(3,x.IDecorationService),m(4,p.IRenderService)],w)},5871:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,m){return d>=u.startBufferLine-this._linePadding[m||"full"]&&d<=u.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(c,a,u){var d=this&&this.__decorate||function(_,k,j,N){var D,E=arguments.length,O=E<3?k:N===null?N=Object.getOwnPropertyDescriptor(k,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(_,k,j,N);else for(var L=_.length-1;L>=0;L--)(D=_[L])&&(O=(E<3?D(O):E>3?D(k,j,O):D(k,j))||O);return E>3&&O&&Object.defineProperty(k,j,O),O},m=this&&this.__param||function(_,k){return function(j,N){k(j,N,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const p=u(5871),g=u(4725),x=u(844),w=u(2585),C={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let b=a.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,k,j,N,D,E,O){var z;super(),this._viewportElement=_,this._screenElement=k,this._bufferService=j,this._decorationService=N,this._renderService=D,this._optionsService=E,this._coreBrowserService=O,this._colorZoneStore=new p.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var H;(H=this._canvas)==null||H.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const _=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=_,y.center=k,y.right=_,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=y.left,S.right=y.left+y.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowserService.dpr);C.left=k,C.center=k,C.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const k of _)k.position!=="full"&&this._renderColorZone(k);for(const k of _)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(S[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-C[_.position||"full"]/2),y[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[_.position||"full"]))}_queueRefresh(_,k){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=b=d([m(2,w.IBufferService),m(3,w.IDecorationService),m(4,g.IRenderService),m(5,w.IOptionsService),m(6,g.ICoreBrowserService)],b)},2950:function(c,a,u){var d=this&&this.__decorate||function(C,y,S,b){var _,k=arguments.length,j=k<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(C,y,S,b);else for(var N=C.length-1;N>=0;N--)(_=C[N])&&(j=(k<3?_(j):k>3?_(y,S,j):_(y,S))||j);return k>3&&j&&Object.defineProperty(y,S,j),j},m=this&&this.__param||function(C,y){return function(S,b){y(S,b,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const p=u(4725),g=u(2585),x=u(2584);let w=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,y,S,b,_,k){this._textarea=C,this._compositionView=y,this._bufferService=S,this._optionsService=b,this._coreService=_,this._renderService=k,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,S=y.replace(C,"");this._dataAlreadySent=S,y.length>C.length?this._coreService.triggerDataEvent(S,!0):y.length<C.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):y.length===C.length&&y!==C&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,b=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,_=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=_+"px",this._compositionView.style.top=b+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=_+"px",this._textarea.style.top=b+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=w=d([m(2,g.IBufferService),m(3,g.IOptionsService),m(4,g.ICoreService),m(5,p.IRenderService)],w)},9806:(c,a)=>{function u(d,m,p){const g=p.getBoundingClientRect(),x=d.getComputedStyle(p),w=parseInt(x.getPropertyValue("padding-left")),C=parseInt(x.getPropertyValue("padding-top"));return[m.clientX-g.left-w,m.clientY-g.top-C]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=u,a.getCoords=function(d,m,p,g,x,w,C,y,S){if(!w)return;const b=u(d,m,p);return b?(b[0]=Math.ceil((b[0]+(S?C/2:0))/C),b[1]=Math.ceil(b[1]/y),b[0]=Math.min(Math.max(b[0],1),g+(S?1:0)),b[1]=Math.min(Math.max(b[1],1),x),b):void 0}},9504:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const d=u(2584);function m(y,S,b,_){const k=y-p(y,b),j=S-p(S,b),N=Math.abs(k-j)-(function(D,E,O){let L=0;const z=D-p(D,O),H=E-p(E,O);for(let $=0;$<Math.abs(z-H);$++){const q=g(D,E)==="A"?-1:1,G=O.buffer.lines.get(z+q*$);G!=null&&G.isWrapped&&L++}return L})(y,S,b);return C(N,w(g(y,S),_))}function p(y,S){let b=0,_=S.buffer.lines.get(y),k=_==null?void 0:_.isWrapped;for(;k&&y>=0&&y<S.rows;)b++,_=S.buffer.lines.get(--y),k=_==null?void 0:_.isWrapped;return b}function g(y,S){return y>S?"A":"B"}function x(y,S,b,_,k,j){let N=y,D=S,E="";for(;N!==b||D!==_;)N+=k?1:-1,k&&N>j.cols-1?(E+=j.buffer.translateBufferLineToString(D,!1,y,N),N=0,y=0,D++):!k&&N<0&&(E+=j.buffer.translateBufferLineToString(D,!1,0,y+1),N=j.cols-1,y=N,D--);return E+j.buffer.translateBufferLineToString(D,!1,y,N)}function w(y,S){const b=S?"O":"[";return d.C0.ESC+b+y}function C(y,S){y=Math.floor(y);let b="";for(let _=0;_<y;_++)b+=S;return b}a.moveToCellSequence=function(y,S,b,_){const k=b.buffer.x,j=b.buffer.y;if(!b.buffer.hasScrollback)return(function(E,O,L,z,H,$){return m(O,z,H,$).length===0?"":C(x(E,O,E,O-p(O,H),!1,H).length,w("D",$))})(k,j,0,S,b,_)+m(j,S,b,_)+(function(E,O,L,z,H,$){let q;q=m(O,z,H,$).length>0?z-p(z,H):O;const G=z,W=(function(X,Y,I,M,P,B){let F;return F=m(I,M,P,B).length>0?M-p(M,P):Y,X<I&&F<=M||X>=I&&F<M?"C":"D"})(E,O,L,z,H,$);return C(x(E,q,L,G,W==="C",H).length,w(W,$))})(k,j,y,S,b,_);let N;if(j===S)return N=k>y?"D":"C",C(Math.abs(k-y),w(N,_));N=j>S?"D":"C";const D=Math.abs(j-S);return C((function(E,O){return O.cols-E})(j>S?y:k,b)+(D-1)*b.cols+1+((j>S?k:y)-1),w(N,_))}},1296:function(c,a,u){var d=this&&this.__decorate||function($,q,G,W){var X,Y=arguments.length,I=Y<3?q:W===null?W=Object.getOwnPropertyDescriptor(q,G):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate($,q,G,W);else for(var M=$.length-1;M>=0;M--)(X=$[M])&&(I=(Y<3?X(I):Y>3?X(q,G,I):X(q,G))||I);return Y>3&&I&&Object.defineProperty(q,G,I),I},m=this&&this.__param||function($,q){return function(G,W){q(G,W,$)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const p=u(3787),g=u(2550),x=u(2223),w=u(6171),C=u(6052),y=u(4725),S=u(8055),b=u(8460),_=u(844),k=u(2585),j="xterm-dom-renderer-owner-",N="xterm-rows",D="xterm-fg-",E="xterm-bg-",O="xterm-focus",L="xterm-selection";let z=1,H=a.DomRenderer=class extends _.Disposable{constructor($,q,G,W,X,Y,I,M,P,B,F,Q,J){super(),this._terminal=$,this._document=q,this._element=G,this._screenElement=W,this._viewportElement=X,this._helperContainer=Y,this._linkifier2=I,this._charSizeService=P,this._optionsService=B,this._bufferService=F,this._coreBrowserService=Q,this._themeService=J,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new b.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),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(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ee=>this._injectCss(ee)))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(j+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ee=>this._handleLinkHover(ee)))),this.register(this._linkifier2.onHideLinkUnderline((ee=>this._handleLinkLeave(ee)))),this.register((0,_.toDisposable)((()=>{this._element.classList.remove(j+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const $=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*$,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*$),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/$),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/$),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const G of this._rowElements)G.style.width=`${this.dimensions.css.canvas.width}px`,G.style.height=`${this.dimensions.css.cell.height}px`,G.style.lineHeight=`${this.dimensions.css.cell.height}px`,G.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const q=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=q,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($){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let q=`${this._terminalSelector} .${N} { color: ${$.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;q+=`${this._terminalSelector} .${N} .xterm-dim { color: ${S.color.multiplyOpacity($.foreground,.5).css};}`,q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const G=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;q+=`@keyframes ${G} { 50% { border-bottom-style: hidden; }}`,q+=`@keyframes ${W} { 50% { box-shadow: none; }}`,q+=`@keyframes ${X} { 0% { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css}; } 50% { background-color: inherit; color: ${$.cursor.css}; }}`,q+=`${this._terminalSelector} .${N}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${N}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${N}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${$.cursor.css} !important; color: ${$.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${$.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${$.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${$.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,q+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${$.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${$.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,I]of $.ansi.entries())q+=`${this._terminalSelector} .${D}${Y} { color: ${I.css}; }${this._terminalSelector} .${D}${Y}.xterm-dim { color: ${S.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${E}${Y} { background-color: ${I.css}; }`;q+=`${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque($.background).css}; }${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque($.background),.5).css}; }${this._terminalSelector} .${E}${x.INVERTED_DEFAULT_COLOR} { background-color: ${$.foreground.css}; }`,this._themeStyleElement.textContent=q}_setDefaultSpacing(){const $=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${$}px`,this._rowFactory.defaultSpacing=$}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements($,q){for(let G=this._rowElements.length;G<=q;G++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize($,q){this._refreshRowElements($,q),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(O),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(O),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged($,q,G){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged($,q,G),this.renderRows(0,this._bufferService.rows-1),!$||!q)return;this._selectionRenderModel.update(this._terminal,$,q,G);const W=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||I<0)return;const M=this._document.createDocumentFragment();if(G){const P=$[0]>q[0];M.appendChild(this._createSelectionElement(Y,P?q[0]:$[0],P?$[0]:q[0],I-Y+1))}else{const P=W===Y?$[0]:0,B=Y===X?q[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(Y,P,B));const F=I-Y-1;if(M.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,F)),Y!==I){const Q=X===I?q[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(I,0,Q))}}this._selectionContainer.appendChild(M)}_createSelectionElement($,q,G,W=1){const X=this._document.createElement("div"),Y=q*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(G-q);return Y+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-Y),X.style.height=W*this.dimensions.css.cell.height+"px",X.style.top=$*this.dimensions.css.cell.height+"px",X.style.left=`${Y}px`,X.style.width=`${I}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const $ of this._rowElements)$.replaceChildren()}renderRows($,q){const G=this._bufferService.buffer,W=G.ybase+G.y,X=Math.min(G.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=$;P<=q;P++){const B=P+G.ydisp,F=this._rowElements[P],Q=G.lines.get(B);if(!F||!Q)break;F.replaceChildren(...this._rowFactory.createRow(Q,B,B===W,I,M,X,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${j}${this._terminalClass}`}_handleLinkHover($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!0)}_handleLinkLeave($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!1)}_setCellUnderline($,q,G,W,X,Y){G<0&&($=0),W<0&&(q=0);const I=this._bufferService.rows-1;G=Math.max(Math.min(G,I),0),W=Math.max(Math.min(W,I),0),X=Math.min(X,this._bufferService.cols);const M=this._bufferService.buffer,P=M.ybase+M.y,B=Math.min(M.x,X-1),F=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=G;ee<=W;++ee){const K=ee+M.ydisp,V=this._rowElements[ee],te=M.lines.get(K);if(!V||!te)break;V.replaceChildren(...this._rowFactory.createRow(te,K,K===P,Q,J,B,F,this.dimensions.css.cell.width,this._widthCache,Y?ee===G?$:0:-1,Y?(ee===W?q:X)-1:-1))}}};a.DomRenderer=H=d([m(7,k.IInstantiationService),m(8,y.ICharSizeService),m(9,k.IOptionsService),m(10,k.IBufferService),m(11,y.ICoreBrowserService),m(12,y.IThemeService)],H)},3787:function(c,a,u){var d=this&&this.__decorate||function(N,D,E,O){var L,z=arguments.length,H=z<3?D:O===null?O=Object.getOwnPropertyDescriptor(D,E):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(N,D,E,O);else for(var $=N.length-1;$>=0;$--)(L=N[$])&&(H=(z<3?L(H):z>3?L(D,E,H):L(D,E))||H);return z>3&&H&&Object.defineProperty(D,E,H),H},m=this&&this.__param||function(N,D){return function(E,O){D(E,O,N)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const p=u(2223),g=u(643),x=u(511),w=u(2585),C=u(8055),y=u(4725),S=u(4269),b=u(6171),_=u(3734);let k=a.DomRendererRowFactory=class{constructor(N,D,E,O,L,z,H){this._document=N,this._characterJoinerService=D,this._optionsService=E,this._coreBrowserService=O,this._coreService=L,this._decorationService=z,this._themeService=H,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,D,E){this._selectionStart=N,this._selectionEnd=D,this._columnSelectMode=E}createRow(N,D,E,O,L,z,H,$,q,G,W){const X=[],Y=this._characterJoinerService.getJoinedCharacters(D),I=this._themeService.colors;let M,P=N.getNoBgTrimmedLength();E&&P<z+1&&(P=z+1);let B=0,F="",Q=0,J=0,ee=0,K=!1,V=0,te=!1,re=0;const ae=[],se=G!==-1&&W!==-1;for(let Se=0;Se<P;Se++){N.loadCell(Se,this._workCell);let Ae=this._workCell.getWidth();if(Ae===0)continue;let De=!1,Ue=Se,ce=this._workCell;if(Y.length>0&&Se===Y[0][0]){De=!0;const Ze=Y.shift();ce=new S.JoinedCellData(this._workCell,N.translateToString(!0,Ze[0],Ze[1]),Ze[1]-Ze[0]),Ue=Ze[1]-1,Ae=ce.getWidth()}const je=this._isCellInSelection(Se,D),xe=E&&Se===z,Ve=se&&Se>=G&&Se<=W;let We=!1;this._decorationService.forEachDecorationAtCell(Se,D,void 0,(Ze=>{We=!0}));let it=ce.getChars()||g.WHITESPACE_CELL_CHAR;if(it===" "&&(ce.isUnderline()||ce.isOverline())&&(it=" "),re=Ae*$-q.get(it,ce.isBold(),ce.isItalic()),M){if(B&&(je&&te||!je&&!te&&ce.bg===Q)&&(je&&te&&I.selectionForeground||ce.fg===J)&&ce.extended.ext===ee&&Ve===K&&re===V&&!xe&&!De&&!We){ce.isInvisible()?F+=g.WHITESPACE_CELL_CHAR:F+=it,B++;continue}B&&(M.textContent=F),M=this._document.createElement("span"),B=0,F=""}else M=this._document.createElement("span");if(Q=ce.bg,J=ce.fg,ee=ce.extended.ext,K=Ve,V=re,te=je,De&&z>=Se&&z<=Ue&&(z=Se),!this._coreService.isCursorHidden&&xe&&this._coreService.isCursorInitialized){if(ae.push("xterm-cursor"),this._coreBrowserService.isFocused)H&&ae.push("xterm-cursor-blink"),ae.push(O==="bar"?"xterm-cursor-bar":O==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":ae.push("xterm-cursor-outline");break;case"block":ae.push("xterm-cursor-block");break;case"bar":ae.push("xterm-cursor-bar");break;case"underline":ae.push("xterm-cursor-underline")}}if(ce.isBold()&&ae.push("xterm-bold"),ce.isItalic()&&ae.push("xterm-italic"),ce.isDim()&&ae.push("xterm-dim"),F=ce.isInvisible()?g.WHITESPACE_CELL_CHAR:ce.getChars()||g.WHITESPACE_CELL_CHAR,ce.isUnderline()&&(ae.push(`xterm-underline-${ce.extended.underlineStyle}`),F===" "&&(F=" "),!ce.isUnderlineColorDefault()))if(ce.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(ce.getUnderlineColor()).join(",")})`;else{let Ze=ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ce.isBold()&&Ze<8&&(Ze+=8),M.style.textDecorationColor=I.ansi[Ze].css}ce.isOverline()&&(ae.push("xterm-overline"),F===" "&&(F=" ")),ce.isStrikethrough()&&ae.push("xterm-strikethrough"),Ve&&(M.style.textDecoration="underline");let ge=ce.getFgColor(),Re=ce.getFgColorMode(),be=ce.getBgColor(),oe=ce.getBgColorMode();const me=!!ce.isInverse();if(me){const Ze=ge;ge=be,be=Ze;const lt=Re;Re=oe,oe=lt}let Ee,Ie,Fe,Ge=!1;switch(this._decorationService.forEachDecorationAtCell(Se,D,void 0,(Ze=>{Ze.options.layer!=="top"&&Ge||(Ze.backgroundColorRGB&&(oe=50331648,be=Ze.backgroundColorRGB.rgba>>8&16777215,Ee=Ze.backgroundColorRGB),Ze.foregroundColorRGB&&(Re=50331648,ge=Ze.foregroundColorRGB.rgba>>8&16777215,Ie=Ze.foregroundColorRGB),Ge=Ze.options.layer==="top")})),!Ge&&je&&(Ee=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,be=Ee.rgba>>8&16777215,oe=50331648,Ge=!0,I.selectionForeground&&(Re=50331648,ge=I.selectionForeground.rgba>>8&16777215,Ie=I.selectionForeground)),Ge&&ae.push("xterm-decoration-top"),oe){case 16777216:case 33554432:Fe=I.ansi[be],ae.push(`xterm-bg-${be}`);break;case 50331648:Fe=C.channels.toColor(be>>16,be>>8&255,255&be),this._addStyle(M,`background-color:#${j((be>>>0).toString(16),"0",6)}`);break;default:me?(Fe=I.foreground,ae.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):Fe=I.background}switch(Ee||ce.isDim()&&(Ee=C.color.multiplyOpacity(Fe,.5)),Re){case 16777216:case 33554432:ce.isBold()&&ge<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ge+=8),this._applyMinimumContrast(M,Fe,I.ansi[ge],ce,Ee,void 0)||ae.push(`xterm-fg-${ge}`);break;case 50331648:const Ze=C.channels.toColor(ge>>16&255,ge>>8&255,255&ge);this._applyMinimumContrast(M,Fe,Ze,ce,Ee,Ie)||this._addStyle(M,`color:#${j(ge.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,Fe,I.foreground,ce,Ee,Ie)||me&&ae.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}ae.length&&(M.className=ae.join(" "),ae.length=0),xe||De||We?M.textContent=F:B++,re!==this.defaultSpacing&&(M.style.letterSpacing=`${re}px`),X.push(M),Se=Ue}return M&&B&&(M.textContent=F),X}_applyMinimumContrast(N,D,E,O,L,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,b.treatGlyphAsBackgroundColor)(O.getCode()))return!1;const H=this._getContrastCache(O);let $;if(L||z||($=H.getColor(D.rgba,E.rgba)),$===void 0){const q=this._optionsService.rawOptions.minimumContrastRatio/(O.isDim()?2:1);$=C.color.ensureContrastRatio(L||D,z||E,q),H.setColor((L||D).rgba,(z||E).rgba,$!=null?$:null)}return!!$&&(this._addStyle(N,`color:${$.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,D){N.setAttribute("style",`${N.getAttribute("style")||""}${D};`)}_isCellInSelection(N,D){const E=this._selectionStart,O=this._selectionEnd;return!(!E||!O)&&(this._columnSelectMode?E[0]<=O[0]?N>=E[0]&&D>=E[1]&&N<O[0]&&D<=O[1]:N<E[0]&&D>=E[1]&&N>=O[0]&&D<=O[1]:D>E[1]&&D<O[1]||E[1]===O[1]&&D===E[1]&&N>=E[0]&&N<O[0]||E[1]<O[1]&&D===O[1]&&N<O[0]||E[1]<O[1]&&D===E[1]&&N>=E[0])}};function j(N,D,E){for(;N.length<E;)N=D+N;return N}a.DomRendererRowFactory=k=d([m(1,y.ICharacterJoinerService),m(2,w.IOptionsService),m(3,y.ICoreBrowserService),m(4,w.ICoreService),m(5,w.IDecorationService),m(6,y.IThemeService)],k)},2550:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=u.createElement("span");m.classList.add("xterm-char-measure-element");const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[m,p,g,x],this._container.appendChild(m),this._container.appendChild(p),this._container.appendChild(g),this._container.appendChild(x),d.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(u,d,m,p){u===this._font&&d===this._fontSize&&m===this._weight&&p===this._weightBold||(this._font=u,this._fontSize=d,this._weight=m,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(u,d,m){let p=0;if(!d&&!m&&u.length===1&&(p=u.charCodeAt(0))<256){if(this._flat[p]!==-9999)return this._flat[p];const w=this._measure(u,0);return w>0&&(this._flat[p]=w),w}let g=u;d&&(g+="B"),m&&(g+="I");let x=this._holey.get(g);if(x===void 0){let w=0;d&&(w|=1),m&&(w|=2),x=this._measure(u,w),x>0&&this._holey.set(g,x)}return x}_measure(u,d){const m=this._measureElements[d];return m.textContent=u.repeat(32),m.offsetWidth/32}}},2223:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(c,a)=>{function u(m){return 57508<=m&&m<=57558}function d(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},a.isPowerlineGlyph=u,a.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},a.isEmoji=d,a.allowRescaling=function(m,p,g,x){return p===1&&g>Math.ceil(1.5*x)&&m!==void 0&&m>255&&!d(m)&&!u(m)&&!(function(w){return 57344<=w&&w<=63743})(m)},a.treatGlyphAsBackgroundColor=function(m){return u(m)||(function(p){return 9472<=p&&p<=9631})(m)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(m,p,g=0){return(m-(2*Math.round(p)-g))%(2*Math.round(p))}},6052:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class u{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(m,p,g,x=!1){if(this.selectionStart=p,this.selectionEnd=g,!p||!g||p[0]===g[0]&&p[1]===g[1])return void this.clear();const w=m.buffers.active.ydisp,C=p[1]-w,y=g[1]-w,S=Math.max(C,0),b=Math.min(y,m.rows-1);S>=m.rows||b<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=C,this.viewportEndRow=y,this.viewportCappedStartRow=S,this.viewportCappedEndRow=b,this.startCol=p[0],this.endCol=g[0])}isCellSelected(m,p,g){return!!this.hasSelection&&(g-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?p>=this.startCol&&g>=this.viewportCappedStartRow&&p<this.endCol&&g<=this.viewportCappedEndRow:p<this.startCol&&g>=this.viewportCappedStartRow&&p>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&p>=this.startCol&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&p>=this.startCol)}}a.createSelectionRenderModel=function(){return new u}},456:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(c,a,u){var d=this&&this.__decorate||function(b,_,k,j){var N,D=arguments.length,E=D<3?_:j===null?j=Object.getOwnPropertyDescriptor(_,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,_,k,j);else for(var O=b.length-1;O>=0;O--)(N=b[O])&&(E=(D<3?N(E):D>3?N(_,k,E):N(_,k))||E);return D>3&&E&&Object.defineProperty(_,k,E),E},m=this&&this.__param||function(b,_){return function(k,j){_(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const p=u(2585),g=u(8460),x=u(844);let w=a.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(b,_,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new y(b,_,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const b=this._measureStrategy.measure();b.width===this.width&&b.height===this.height||(this.width=b.width,this.height=b.height,this._onCharSizeChange.fire())}};a.CharSizeService=w=d([m(2,p.IOptionsService)],w);class C extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(_,k){_!==void 0&&_>0&&k!==void 0&&k>0&&(this._result.width=_,this._result.height=k)}}class y extends C{constructor(_,k,j){super(),this._document=_,this._parentElement=k,this._optionsService=j,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class S extends C{constructor(_){super(),this._optionsService=_,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const _=this._ctx.measureText("W");return this._validateAndSet(_.width,_.fontBoundingBoxAscent+_.fontBoundingBoxDescent),this._result}}},4269:function(c,a,u){var d=this&&this.__decorate||function(S,b,_,k){var j,N=arguments.length,D=N<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,_):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,b,_,k);else for(var E=S.length-1;E>=0;E--)(j=S[E])&&(D=(N<3?j(D):N>3?j(b,_,D):j(b,_))||D);return N>3&&D&&Object.defineProperty(b,_,D),D},m=this&&this.__param||function(S,b){return function(_,k){b(_,k,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const p=u(3734),g=u(643),x=u(511),w=u(2585);class C extends p.AttributeData{constructor(b,_,k){super(),this.content=0,this.combinedData="",this.fg=b.fg,this.bg=b.bg,this.combinedData=_,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(b){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=C;let y=a.CharacterJoinerService=class e3{constructor(b){this._bufferService=b,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(b){const _={id:this._nextCharacterJoinerId++,handler:b};return this._characterJoiners.push(_),_.id}deregister(b){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===b)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(b){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(b);if(!_||_.length===0)return[];const k=[],j=_.translateToString(!0);let N=0,D=0,E=0,O=_.getFg(0),L=_.getBg(0);for(let z=0;z<_.getTrimmedLength();z++)if(_.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==O||this._workCell.bg!==L){if(z-N>1){const H=this._getJoinedRanges(j,E,D,_,N);for(let $=0;$<H.length;$++)k.push(H[$])}N=z,E=D,O=this._workCell.fg,L=this._workCell.bg}D+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const z=this._getJoinedRanges(j,E,D,_,N);for(let H=0;H<z.length;H++)k.push(z[H])}return k}_getJoinedRanges(b,_,k,j,N){const D=b.substring(_,k);let E=[];try{E=this._characterJoiners[0].handler(D)}catch(O){console.error(O)}for(let O=1;O<this._characterJoiners.length;O++)try{const L=this._characterJoiners[O].handler(D);for(let z=0;z<L.length;z++)e3._mergeRanges(E,L[z])}catch(L){console.error(L)}return this._stringRangesToCellRanges(E,j,N),E}_stringRangesToCellRanges(b,_,k){let j=0,N=!1,D=0,E=b[j];if(E){for(let O=k;O<this._bufferService.cols;O++){const L=_.getWidth(O),z=_.getString(O).length||g.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!N&&E[0]<=D&&(E[0]=O,N=!0),E[1]<=D){if(E[1]=O,E=b[++j],!E)break;E[0]<=D?(E[0]=O,N=!0):N=!1}D+=z}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(b,_){let k=!1;for(let j=0;j<b.length;j++){const N=b[j];if(k){if(_[1]<=N[0])return b[j-1][1]=_[1],b;if(_[1]<=N[1])return b[j-1][1]=Math.max(_[1],N[1]),b.splice(j,1),b;b.splice(j,1),j--}else{if(_[1]<=N[0])return b.splice(j,0,_),b;if(_[1]<=N[1])return N[0]=Math.min(_[0],N[0]),b;_[0]<N[1]&&(N[0]=Math.min(_[0],N[0]),k=!0)}}return k?b[b.length-1][1]=_[1]:b.push(_),b}};a.CharacterJoinerService=y=d([m(0,w.IBufferService)],y)},5114:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const d=u(844),m=u(8460),p=u(3656);class g extends d.Disposable{constructor(C,y,S){super(),this._textarea=C,this._window=y,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((b=>this._screenDprMonitor.setWindow(b)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(C){this._window!==C&&(this._window=C,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}}a.CoreBrowserService=g;class x extends d.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,p.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const d=u(844);class m extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const x=this.linkProviders.indexOf(g);x!==-1&&this.linkProviders.splice(x,1)}}}}a.LinkProviderService=m},8934:function(c,a,u){var d=this&&this.__decorate||function(w,C,y,S){var b,_=arguments.length,k=_<3?C:S===null?S=Object.getOwnPropertyDescriptor(C,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(w,C,y,S);else for(var j=w.length-1;j>=0;j--)(b=w[j])&&(k=(_<3?b(k):_>3?b(C,y,k):b(C,y))||k);return _>3&&k&&Object.defineProperty(C,y,k),k},m=this&&this.__param||function(w,C){return function(y,S){C(y,S,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const p=u(4725),g=u(9806);let x=a.MouseService=class{constructor(w,C){this._renderService=w,this._charSizeService=C}getCoords(w,C,y,S,b){return(0,g.getCoords)(window,w,C,y,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,b)}getMouseReportCoords(w,C){const y=(0,g.getCoordsRelativeToElement)(window,w,C);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};a.MouseService=x=d([m(0,p.IRenderService),m(1,p.ICharSizeService)],x)},3230:function(c,a,u){var d=this&&this.__decorate||function(b,_,k,j){var N,D=arguments.length,E=D<3?_:j===null?j=Object.getOwnPropertyDescriptor(_,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,_,k,j);else for(var O=b.length-1;O>=0;O--)(N=b[O])&&(E=(D<3?N(E):D>3?N(_,k,E):N(_,k))||E);return D>3&&E&&Object.defineProperty(_,k,E),E},m=this&&this.__param||function(b,_){return function(k,j){_(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const p=u(6193),g=u(4725),x=u(8460),w=u(844),C=u(7226),y=u(2585);let S=a.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(b,_,k,j,N,D,E,O){super(),this._rowCount=b,this._charSizeService=j,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(((L,z)=>this._renderRows(L,z)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(O.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,_),this.register(E.onWindowChange((L=>this._registerIntersectionObserver(L,_))))}_registerIntersectionObserver(b,_){if("IntersectionObserver"in b){const k=new b.IntersectionObserver((j=>this._handleIntersectionChange(j[j.length-1])),{threshold:0});k.observe(_),this._observerDisposable.value=(0,w.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(b){this._isPaused=b.isIntersecting===void 0?b.intersectionRatio===0:!b.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(b,_,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(b,_,this._rowCount))}_renderRows(b,_){this._renderer.value&&(b=Math.min(b,this._rowCount-1),_=Math.min(_,this._rowCount-1),this._renderer.value.renderRows(b,_),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:b,end:_}),this._onRender.fire({start:b,end:_}),this._isNextRenderRedrawOnly=!0)}resize(b,_){this._rowCount=_,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(b){this._renderer.value=b,this._renderer.value&&(this._renderer.value.onRequestRedraw((_=>this.refreshRows(_.start,_.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(b){return this._renderDebouncer.addRefreshCallback(b)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var b,_;this._renderer.value&&((_=(b=this._renderer.value).clearTextureAtlas)==null||_.call(b),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(b,_){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(b,_)})):this._renderer.value.handleResize(b,_),this._fullRefresh())}handleCharSizeChanged(){var b;(b=this._renderer.value)==null||b.handleCharSizeChanged()}handleBlur(){var b;(b=this._renderer.value)==null||b.handleBlur()}handleFocus(){var b;(b=this._renderer.value)==null||b.handleFocus()}handleSelectionChanged(b,_,k){var j;this._selectionState.start=b,this._selectionState.end=_,this._selectionState.columnSelectMode=k,(j=this._renderer.value)==null||j.handleSelectionChanged(b,_,k)}handleCursorMove(){var b;(b=this._renderer.value)==null||b.handleCursorMove()}clear(){var b;(b=this._renderer.value)==null||b.clear()}};a.RenderService=S=d([m(2,y.IOptionsService),m(3,g.ICharSizeService),m(4,y.IDecorationService),m(5,y.IBufferService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],S)},9312:function(c,a,u){var d=this&&this.__decorate||function(E,O,L,z){var H,$=arguments.length,q=$<3?O:z===null?z=Object.getOwnPropertyDescriptor(O,L):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(E,O,L,z);else for(var G=E.length-1;G>=0;G--)(H=E[G])&&(q=($<3?H(q):$>3?H(O,L,q):H(O,L))||q);return $>3&&q&&Object.defineProperty(O,L,q),q},m=this&&this.__param||function(E,O){return function(L,z){O(L,z,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const p=u(9806),g=u(9504),x=u(456),w=u(4725),C=u(8460),y=u(844),S=u(6114),b=u(4841),_=u(511),k=u(2585),j=" ",N=new RegExp(j,"g");let D=a.SelectionService=class extends y.Disposable{constructor(E,O,L,z,H,$,q,G,W){super(),this._element=E,this._screenElement=O,this._linkifier=L,this._bufferService=z,this._coreService=H,this._mouseService=$,this._optionsService=q,this._renderService=G,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,y.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const E=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!E||!O||E[0]===O[0]&&E[1]===O[1])}get selectionText(){const E=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;if(!E||!O)return"";const L=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(E[0]===O[0])return"";const H=E[0]<O[0]?E[0]:O[0],$=E[0]<O[0]?O[0]:E[0];for(let q=E[1];q<=O[1];q++){const G=L.translateBufferLineToString(q,!0,H,$);z.push(G)}}else{const H=E[1]===O[1]?O[0]:void 0;z.push(L.translateBufferLineToString(E[1],!0,E[0],H));for(let $=E[1]+1;$<=O[1]-1;$++){const q=L.lines.get($),G=L.translateBufferLineToString($,!0);q!=null&&q.isWrapped?z[z.length-1]+=G:z.push(G)}if(E[1]!==O[1]){const $=L.lines.get(O[1]),q=L.translateBufferLineToString(O[1],!0,0,O[0]);$&&$.isWrapped?z[z.length-1]+=q:z.push(q)}}return z.map((H=>H.replace(N," "))).join(S.isWindows?`\r
|
|
617
|
-
`:`
|
|
618
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&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){const O=this._getMouseBufferCoords(E),L=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(L&&z&&O)&&this._areCoordsInSelection(O,L,z)}isCellInSelection(E,O){const L=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!L||!z)&&this._areCoordsInSelection([E,O],L,z)}_areCoordsInSelection(E,O,L){return E[1]>O[1]&&E[1]<L[1]||O[1]===L[1]&&E[1]===O[1]&&E[0]>=O[0]&&E[0]<L[0]||O[1]<L[1]&&E[1]===L[1]&&E[0]<L[0]||O[1]<L[1]&&E[1]===O[1]&&E[0]>=O[0]}_selectWordAtCursor(E,O){var H,$;const L=($=(H=this._linkifier.currentLink)==null?void 0:H.link)==null?void 0:$.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,b.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(E);return!!z&&(this._selectWordAt(z,O),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,O){this._model.clearSelection(),E=Math.max(E,0),O=Math.min(O,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,O],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const O=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(O)return O[0]--,O[1]--,O[1]+=this._bufferService.buffer.ydisp,O}_getMouseEventScrollAmount(E){let O=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return O>=0&&O<=L?0:(O>L&&(O-=L),O=Math.min(Math.max(O,-50),50),O/=50,O/Math.abs(O)+Math.round(14*O))}shouldForceSelection(E){return S.isMac?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()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(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;const O=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);O&&O.length!==this._model.selectionStart[0]&&O.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const O=this._getMouseBufferCoords(E);O&&(this._activeSelectionMode=2,this._selectLineAt(O[1]))}shouldColumnSelect(E){return E.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const O=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const z=L.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}O&&O[0]===this._model.selectionEnd[0]&&O[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const 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){const O=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&O<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const z=(0,g.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,O=this._model.finalSelectionEnd,L=!(!E||!O||E[0]===O[0]&&E[1]===O[1]);L?E&&O&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&O[0]===this._oldSelectionEnd[0]&&O[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,O,L)):this._oldHasSelection&&this._fireOnSelectionChange(E,O,L)}_fireOnSelectionChange(E,O,L){this._oldSelectionStart=E,this._oldSelectionEnd=O,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((O=>this._handleTrim(O)))}_convertViewportColToCharacterIndex(E,O){let L=O;for(let z=0;O>=z;z++){const H=E.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:H>1&&O!==z&&(L+=H-1)}return L}setSelection(E,O,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,O],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,O,L=!0,z=!0){if(E[0]>=this._bufferService.cols)return;const H=this._bufferService.buffer,$=H.lines.get(E[1]);if(!$)return;const q=H.translateBufferLineToString(E[1],!1);let G=this._convertViewportColToCharacterIndex($,E[0]),W=G;const X=E[0]-G;let Y=0,I=0,M=0,P=0;if(q.charAt(G)===" "){for(;G>0&&q.charAt(G-1)===" ";)G--;for(;W<q.length&&q.charAt(W+1)===" ";)W++}else{let Q=E[0],J=E[0];$.getWidth(Q)===0&&(Y++,Q--),$.getWidth(J)===2&&(I++,J++);const ee=$.getString(J).length;for(ee>1&&(P+=ee-1,W+=ee-1);Q>0&&G>0&&!this._isCharWordSeparator($.loadCell(Q-1,this._workCell));){$.loadCell(Q-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,Q--):K>1&&(M+=K-1,G-=K-1),G--,Q--}for(;J<$.length&&W+1<q.length&&!this._isCharWordSeparator($.loadCell(J+1,this._workCell));){$.loadCell(J+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,J++):K>1&&(P+=K-1,W+=K-1),W++,J++}}W++;let B=G+X-Y+M,F=Math.min(this._bufferService.cols,W-G+Y+I-M-P);if(O||q.slice(G,W).trim()!==""){if(L&&B===0&&$.getCodePoint(0)!==32){const Q=H.lines.get(E[1]-1);if(Q&&$.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(J){const ee=this._bufferService.cols-J.start;B-=ee,F+=ee}}}if(z&&B+F===this._bufferService.cols&&$.getCodePoint(this._bufferService.cols-1)!==32){const Q=H.lines.get(E[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const J=this._getWordAt([0,E[1]+1],!1,!1,!0);J&&(F+=J.length)}}return{start:B,length:F}}}_selectWordAt(E,O){const L=this._getWordAt(E,O);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[L.start,E[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(E){const O=this._getWordAt(E,!0);if(O){let L=E[1];for(;O.start<0;)O.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;O.start+O.length>this._bufferService.cols;)O.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?O.start:O.start+O.length,L]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const O=this._bufferService.buffer.getWrappedRangeForLine(E),L={start:{x:0,y:O.first},end:{x:this._bufferService.cols-1,y:O.last}};this._model.selectionStart=[0,O.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,b.getRangeLength)(L,this._bufferService.cols)}};a.SelectionService=D=d([m(3,k.IBufferService),m(4,k.ICoreService),m(5,w.IMouseService),m(6,k.IOptionsService),m(7,w.IRenderService),m(8,w.ICoreBrowserService)],D)},4725:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const d=u(8343);a.ICharSizeService=(0,d.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),a.IMouseService=(0,d.createDecorator)("MouseService"),a.IRenderService=(0,d.createDecorator)("RenderService"),a.ISelectionService=(0,d.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,d.createDecorator)("ThemeService"),a.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(c,a,u){var d=this&&this.__decorate||function(D,E,O,L){var z,H=arguments.length,$=H<3?E:L===null?L=Object.getOwnPropertyDescriptor(E,O):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(D,E,O,L);else for(var q=D.length-1;q>=0;q--)(z=D[q])&&($=(H<3?z($):H>3?z(E,O,$):z(E,O))||$);return H>3&&$&&Object.defineProperty(E,O,$),$},m=this&&this.__param||function(D,E){return function(O,L){E(O,L,D)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const p=u(7239),g=u(8055),x=u(8460),w=u(844),C=u(2585),y=g.css.toColor("#ffffff"),S=g.css.toColor("#000000"),b=g.css.toColor("#ffffff"),_=g.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let O=0;O<216;O++){const L=E[O/36%6|0],z=E[O/6%6|0],H=E[O%6];D.push({css:g.channels.toCss(L,z,H),rgba:g.channels.toRgba(L,z,H)})}for(let O=0;O<24;O++){const L=8+10*O;D.push({css:g.channels.toCss(L,L,L),rgba:g.channels.toRgba(L,L,L)})}return D})());let j=a.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:S,cursor:b,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:g.color.blend(S,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:g.color.blend(S,k),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const E=this._colors;if(E.foreground=N(D.foreground,y),E.background=N(D.background,S),E.cursor=N(D.cursor,b),E.cursorAccent=N(D.cursorAccent,_),E.selectionBackgroundTransparent=N(D.selectionBackground,k),E.selectionBackgroundOpaque=g.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=N(D.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=g.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=D.selectionForeground?N(D.selectionForeground,g.NULL_COLOR):void 0,E.selectionForeground===g.NULL_COLOR&&(E.selectionForeground=void 0),g.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=g.color.opacity(E.selectionBackgroundTransparent,.3)),g.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=g.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=a.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=N(D.black,a.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=N(D.red,a.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=N(D.green,a.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=N(D.yellow,a.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=N(D.blue,a.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=N(D.magenta,a.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=N(D.cyan,a.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=N(D.white,a.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=N(D.brightBlack,a.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=N(D.brightRed,a.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=N(D.brightGreen,a.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=N(D.brightYellow,a.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=N(D.brightBlue,a.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=N(D.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=N(D.brightCyan,a.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=N(D.brightWhite,a.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const O=Math.min(E.ansi.length-16,D.extendedAnsi.length);for(let L=0;L<O;L++)E.ansi[L+16]=N(D.extendedAnsi[L],a.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function N(D,E){if(D!==void 0)try{return g.css.toColor(D)}catch{}return E}a.ThemeService=j=d([m(0,C.IOptionsService)],j)},6349:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const d=u(8460),m=u(844);class p extends m.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const w=new Array(x);for(let C=0;C<Math.min(x,this.length);C++)w[C]=this._array[this._getCyclicIndex(C)];this._array=w,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let w=this._length;w<x;w++)this._array[w]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,w){this._array[this._getCyclicIndex(x)]=w}push(x){this._array[this._getCyclicIndex(this._length)]=x,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(x,w,...C){if(w){for(let y=x;y<this._length-w;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+w)];this._length-=w,this.onDeleteEmitter.fire({index:x,amount:w})}for(let y=this._length-1;y>=x;y--)this._array[this._getCyclicIndex(y+C.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<C.length;y++)this._array[this._getCyclicIndex(x+y)]=C[y];if(C.length&&this.onInsertEmitter.fire({index:x,amount:C.length}),this._length+C.length>this._maxLength){const y=this._length+C.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=C.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,w,C){if(!(w<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let S=w-1;S>=0;S--)this.set(x+S+C,this.get(x+S));const y=x+w+C-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<w;y++)this.set(x+y+C,this.get(x+y))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}a.CircularList=p},1439:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function u(d,m=5){if(typeof d!="object")return d;const p=Array.isArray(d)?[]:{};for(const g in d)p[g]=m<=1?d[g]:d[g]&&u(d[g],m-1);return p}},8055:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let u=0,d=0,m=0,p=0;var g,x,w,C,y;function S(_){const k=_.toString(16);return k.length<2?"0"+k:k}function b(_,k){return _<k?(k+.05)/(_+.05):(_+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(_){_.toCss=function(k,j,N,D){return D!==void 0?`#${S(k)}${S(j)}${S(N)}${S(D)}`:`#${S(k)}${S(j)}${S(N)}`},_.toRgba=function(k,j,N,D=255){return(k<<24|j<<16|N<<8|D)>>>0},_.toColor=function(k,j,N,D){return{css:_.toCss(k,j,N,D),rgba:_.toRgba(k,j,N,D)}}})(g||(a.channels=g={})),(function(_){function k(j,N){return p=Math.round(255*N),[u,d,m]=y.toChannels(j.rgba),{css:g.toCss(u,d,m,p),rgba:g.toRgba(u,d,m,p)}}_.blend=function(j,N){if(p=(255&N.rgba)/255,p===1)return{css:N.css,rgba:N.rgba};const D=N.rgba>>24&255,E=N.rgba>>16&255,O=N.rgba>>8&255,L=j.rgba>>24&255,z=j.rgba>>16&255,H=j.rgba>>8&255;return u=L+Math.round((D-L)*p),d=z+Math.round((E-z)*p),m=H+Math.round((O-H)*p),{css:g.toCss(u,d,m),rgba:g.toRgba(u,d,m)}},_.isOpaque=function(j){return(255&j.rgba)==255},_.ensureContrastRatio=function(j,N,D){const E=y.ensureContrastRatio(j.rgba,N.rgba,D);if(E)return g.toColor(E>>24&255,E>>16&255,E>>8&255)},_.opaque=function(j){const N=(255|j.rgba)>>>0;return[u,d,m]=y.toChannels(N),{css:g.toCss(u,d,m),rgba:N}},_.opacity=k,_.multiplyOpacity=function(j,N){return p=255&j.rgba,k(j,p*N/255)},_.toColorRGB=function(j){return[j.rgba>>24&255,j.rgba>>16&255,j.rgba>>8&255]}})(x||(a.color=x={})),(function(_){let k,j;try{const N=document.createElement("canvas");N.width=1,N.height=1;const D=N.getContext("2d",{willReadFrequently:!0});D&&(k=D,k.globalCompositeOperation="copy",j=k.createLinearGradient(0,0,1,1))}catch{}_.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return u=parseInt(N.slice(1,2).repeat(2),16),d=parseInt(N.slice(2,3).repeat(2),16),m=parseInt(N.slice(3,4).repeat(2),16),g.toColor(u,d,m);case 5:return u=parseInt(N.slice(1,2).repeat(2),16),d=parseInt(N.slice(2,3).repeat(2),16),m=parseInt(N.slice(3,4).repeat(2),16),p=parseInt(N.slice(4,5).repeat(2),16),g.toColor(u,d,m,p);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const D=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),d=parseInt(D[2]),m=parseInt(D[3]),p=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),g.toColor(u,d,m,p);if(!k||!j)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=j,k.fillStyle=N,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[u,d,m,p]=k.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,d,m,p),css:N}}})(w||(a.css=w={})),(function(_){function k(j,N,D){const E=j/255,O=N/255,L=D/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}_.relativeLuminance=function(j){return k(j>>16&255,j>>8&255,255&j)},_.relativeLuminance2=k})(C||(a.rgb=C={})),(function(_){function k(N,D,E){const O=N>>24&255,L=N>>16&255,z=N>>8&255;let H=D>>24&255,$=D>>16&255,q=D>>8&255,G=b(C.relativeLuminance2(H,$,q),C.relativeLuminance2(O,L,z));for(;G<E&&(H>0||$>0||q>0);)H-=Math.max(0,Math.ceil(.1*H)),$-=Math.max(0,Math.ceil(.1*$)),q-=Math.max(0,Math.ceil(.1*q)),G=b(C.relativeLuminance2(H,$,q),C.relativeLuminance2(O,L,z));return(H<<24|$<<16|q<<8|255)>>>0}function j(N,D,E){const O=N>>24&255,L=N>>16&255,z=N>>8&255;let H=D>>24&255,$=D>>16&255,q=D>>8&255,G=b(C.relativeLuminance2(H,$,q),C.relativeLuminance2(O,L,z));for(;G<E&&(H<255||$<255||q<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),$=Math.min(255,$+Math.ceil(.1*(255-$))),q=Math.min(255,q+Math.ceil(.1*(255-q))),G=b(C.relativeLuminance2(H,$,q),C.relativeLuminance2(O,L,z));return(H<<24|$<<16|q<<8|255)>>>0}_.blend=function(N,D){if(p=(255&D)/255,p===1)return D;const E=D>>24&255,O=D>>16&255,L=D>>8&255,z=N>>24&255,H=N>>16&255,$=N>>8&255;return u=z+Math.round((E-z)*p),d=H+Math.round((O-H)*p),m=$+Math.round((L-$)*p),g.toRgba(u,d,m)},_.ensureContrastRatio=function(N,D,E){const O=C.relativeLuminance(N>>8),L=C.relativeLuminance(D>>8);if(b(O,L)<E){if(L<O){const $=k(N,D,E),q=b(O,C.relativeLuminance($>>8));if(q<E){const G=j(N,D,E);return q>b(O,C.relativeLuminance(G>>8))?$:G}return $}const z=j(N,D,E),H=b(O,C.relativeLuminance(z>>8));if(H<E){const $=k(N,D,E);return H>b(O,C.relativeLuminance($>>8))?z:$}return z}},_.reduceLuminance=k,_.increaseLuminance=j,_.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(y||(a.rgba=y={})),a.toPaddedHex=S,a.contrastRatio=b},8969:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const d=u(844),m=u(2585),p=u(4348),g=u(7866),x=u(744),w=u(7302),C=u(6975),y=u(8460),S=u(1753),b=u(1480),_=u(7994),k=u(9282),j=u(5435),N=u(5981),D=u(2660);let E=!1;class O extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((z=>{var H;(H=this._onScrollApi)==null||H.fire(z.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(z){for(const H in z)this.optionsService.options[H]=z[H]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new w.OptionsService(z)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(b.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new j.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((H=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((H=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((H,$)=>this._inputHandler.parse(H,$)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,H){this._writeBuffer.write(z,H)}writeSync(z,H){this._logService.logLevel<=m.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(z,H)}input(z,H=!0){this.coreService.triggerDataEvent(z,H)}resize(z,H){isNaN(z)||isNaN(H)||(z=Math.max(z,x.MINIMUM_COLS),H=Math.max(H,x.MINIMUM_ROWS),this._bufferService.resize(z,H))}scroll(z,H=!1){this._bufferService.scroll(z,H)}scrollLines(z,H,$){this._bufferService.scrollLines(z,H,$)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const H=z-this._bufferService.buffer.ydisp;H!==0&&this.scrollLines(H)}registerEscHandler(z,H){return this._inputHandler.registerEscHandler(z,H)}registerDcsHandler(z,H){return this._inputHandler.registerDcsHandler(z,H)}registerCsiHandler(z,H){return this._inputHandler.registerCsiHandler(z,H)}registerOscHandler(z,H){return this._inputHandler.registerOscHandler(z,H)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const H=this.optionsService.rawOptions.windowsPty;H&&H.buildNumber!==void 0&&H.buildNumber!==void 0?z=H.backend==="conpty"&&H.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const H of z)H.dispose()}))}}}a.CoreTerminal=O},8460:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const m=[];for(let p=0;p<this._listeners.length;p++)m.push(this._listeners[p]);for(let p=0;p<m.length;p++)m[p].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,d){return u((m=>d.fire(m)))},a.runAndSubscribe=function(u,d){return d(void 0),u((m=>d(m)))}},5435:function(c,a,u){var d=this&&this.__decorate||function(Y,I,M,P){var B,F=arguments.length,Q=F<3?I:P===null?P=Object.getOwnPropertyDescriptor(I,M):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(Y,I,M,P);else for(var J=Y.length-1;J>=0;J--)(B=Y[J])&&(Q=(F<3?B(Q):F>3?B(I,M,Q):B(I,M))||Q);return F>3&&Q&&Object.defineProperty(I,M,Q),Q},m=this&&this.__param||function(Y,I){return function(M,P){I(M,P,Y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const p=u(2584),g=u(7116),x=u(2015),w=u(844),C=u(482),y=u(8437),S=u(8460),b=u(643),_=u(511),k=u(3734),j=u(2585),N=u(1480),D=u(6242),E=u(6351),O=u(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function H(Y,I){if(Y>24)return I.setWinLines||!1;switch(Y){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var $;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})($||(a.WindowsOptionsReportType=$={}));let q=0;class G extends w.Disposable{getAttrData(){return this._curAttrData}constructor(I,M,P,B,F,Q,J,ee,K=new x.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=M,this._coreService=P,this._logService=B,this._optionsService=F,this._oscLinkService=Q,this._coreMouseService=J,this._unicodeService=ee,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new _.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((V=>this._activeBuffer=V.activeBuffer))),this._parser.setCsiHandlerFallback(((V,te)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(V),params:te.toArray()})})),this._parser.setEscHandlerFallback((V=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(V)})})),this._parser.setExecuteHandlerFallback((V=>{this._logService.debug("Unknown EXECUTE code: ",{code:V})})),this._parser.setOscHandlerFallback(((V,te,re)=>{this._logService.debug("Unknown OSC code: ",{identifier:V,action:te,data:re})})),this._parser.setDcsHandlerFallback(((V,te,re)=>{te==="HOOK"&&(re=re.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(V),action:te,payload:re})})),this._parser.setPrintHandler(((V,te,re)=>this.print(V,te,re))),this._parser.registerCsiHandler({final:"@"},(V=>this.insertChars(V))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(V=>this.scrollLeft(V))),this._parser.registerCsiHandler({final:"A"},(V=>this.cursorUp(V))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(V=>this.scrollRight(V))),this._parser.registerCsiHandler({final:"B"},(V=>this.cursorDown(V))),this._parser.registerCsiHandler({final:"C"},(V=>this.cursorForward(V))),this._parser.registerCsiHandler({final:"D"},(V=>this.cursorBackward(V))),this._parser.registerCsiHandler({final:"E"},(V=>this.cursorNextLine(V))),this._parser.registerCsiHandler({final:"F"},(V=>this.cursorPrecedingLine(V))),this._parser.registerCsiHandler({final:"G"},(V=>this.cursorCharAbsolute(V))),this._parser.registerCsiHandler({final:"H"},(V=>this.cursorPosition(V))),this._parser.registerCsiHandler({final:"I"},(V=>this.cursorForwardTab(V))),this._parser.registerCsiHandler({final:"J"},(V=>this.eraseInDisplay(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(V=>this.eraseInDisplay(V,!0))),this._parser.registerCsiHandler({final:"K"},(V=>this.eraseInLine(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(V=>this.eraseInLine(V,!0))),this._parser.registerCsiHandler({final:"L"},(V=>this.insertLines(V))),this._parser.registerCsiHandler({final:"M"},(V=>this.deleteLines(V))),this._parser.registerCsiHandler({final:"P"},(V=>this.deleteChars(V))),this._parser.registerCsiHandler({final:"S"},(V=>this.scrollUp(V))),this._parser.registerCsiHandler({final:"T"},(V=>this.scrollDown(V))),this._parser.registerCsiHandler({final:"X"},(V=>this.eraseChars(V))),this._parser.registerCsiHandler({final:"Z"},(V=>this.cursorBackwardTab(V))),this._parser.registerCsiHandler({final:"`"},(V=>this.charPosAbsolute(V))),this._parser.registerCsiHandler({final:"a"},(V=>this.hPositionRelative(V))),this._parser.registerCsiHandler({final:"b"},(V=>this.repeatPrecedingCharacter(V))),this._parser.registerCsiHandler({final:"c"},(V=>this.sendDeviceAttributesPrimary(V))),this._parser.registerCsiHandler({prefix:">",final:"c"},(V=>this.sendDeviceAttributesSecondary(V))),this._parser.registerCsiHandler({final:"d"},(V=>this.linePosAbsolute(V))),this._parser.registerCsiHandler({final:"e"},(V=>this.vPositionRelative(V))),this._parser.registerCsiHandler({final:"f"},(V=>this.hVPosition(V))),this._parser.registerCsiHandler({final:"g"},(V=>this.tabClear(V))),this._parser.registerCsiHandler({final:"h"},(V=>this.setMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(V=>this.setModePrivate(V))),this._parser.registerCsiHandler({final:"l"},(V=>this.resetMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(V=>this.resetModePrivate(V))),this._parser.registerCsiHandler({final:"m"},(V=>this.charAttributes(V))),this._parser.registerCsiHandler({final:"n"},(V=>this.deviceStatus(V))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(V=>this.deviceStatusPrivate(V))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(V=>this.softReset(V))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(V=>this.setCursorStyle(V))),this._parser.registerCsiHandler({final:"r"},(V=>this.setScrollRegion(V))),this._parser.registerCsiHandler({final:"s"},(V=>this.saveCursor(V))),this._parser.registerCsiHandler({final:"t"},(V=>this.windowOptions(V))),this._parser.registerCsiHandler({final:"u"},(V=>this.restoreCursor(V))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(V=>this.insertColumns(V))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(V=>this.deleteColumns(V))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(V=>this.selectProtected(V))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(V=>this.requestMode(V,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(V=>this.requestMode(V,!1))),this._parser.setExecuteHandler(p.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(p.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(p.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(p.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(p.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(p.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(p.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(p.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(p.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((V=>(this.setTitle(V),this.setIconName(V),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((V=>this.setIconName(V)))),this._parser.registerOscHandler(2,new D.OscHandler((V=>this.setTitle(V)))),this._parser.registerOscHandler(4,new D.OscHandler((V=>this.setOrReportIndexedColor(V)))),this._parser.registerOscHandler(8,new D.OscHandler((V=>this.setHyperlink(V)))),this._parser.registerOscHandler(10,new D.OscHandler((V=>this.setOrReportFgColor(V)))),this._parser.registerOscHandler(11,new D.OscHandler((V=>this.setOrReportBgColor(V)))),this._parser.registerOscHandler(12,new D.OscHandler((V=>this.setOrReportCursorColor(V)))),this._parser.registerOscHandler(104,new D.OscHandler((V=>this.restoreIndexedColor(V)))),this._parser.registerOscHandler(110,new D.OscHandler((V=>this.restoreFgColor(V)))),this._parser.registerOscHandler(111,new D.OscHandler((V=>this.restoreBgColor(V)))),this._parser.registerOscHandler(112,new D.OscHandler((V=>this.restoreCursorColor(V)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const V in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:V},(()=>this.selectCharset("("+V))),this._parser.registerEscHandler({intermediates:")",final:V},(()=>this.selectCharset(")"+V))),this._parser.registerEscHandler({intermediates:"*",final:V},(()=>this.selectCharset("*"+V))),this._parser.registerEscHandler({intermediates:"+",final:V},(()=>this.selectCharset("+"+V))),this._parser.registerEscHandler({intermediates:"-",final:V},(()=>this.selectCharset("-"+V))),this._parser.registerEscHandler({intermediates:".",final:V},(()=>this.selectCharset("."+V))),this._parser.registerEscHandler({intermediates:"/",final:V},(()=>this.selectCharset("/"+V)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((V=>(this._logService.error("Parsing error: ",V),V))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((V,te)=>this.requestStatusString(V,te))))}_preserveStack(I,M,P,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=P,this._parseStack.position=B}_logSlowResolvingAsync(I){this._logService.logLevel<=j.LogLevelEnum.WARN&&Promise.race([I,new Promise(((M,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,M){let P,B=this._activeBuffer.x,F=this._activeBuffer.y,Q=0;const J=this._parseStack.paused;if(J){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(P),P;B=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>z&&(Q=this._parseStack.position+z)}if(this._logService.logLevel<=j.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(V=>String.fromCharCode(V))).join("")}"`),typeof I=="string"?I.split("").map((V=>V.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(I.length,z))),J||this._dirtyRowTracker.clearRange(),I.length>z)for(let V=Q;V<I.length;V+=z){const te=V+z<I.length?V+z:I.length,re=typeof I=="string"?this._stringDecoder.decode(I.substring(V,te),this._parseBuffer):this._utf8Decoder.decode(I.subarray(V,te),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,re))return this._preserveStack(B,F,re,V),this._logSlowResolvingAsync(P),P}else if(!J){const V=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,V))return this._preserveStack(B,F,V,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===B&&this._activeBuffer.y===F||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(I,M,P){let B,F;const Q=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,V=this._coreService.modes.insertMode,te=this._curAttrData;let re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-M>0&&re.getWidth(this._activeBuffer.x-1)===2&&re.setCellFromCodepoint(this._activeBuffer.x-1,0,1,te);let ae=this._parser.precedingJoinState;for(let se=M;se<P;++se){if(B=I[se],B<127&&Q){const Ue=Q[String.fromCharCode(B)];Ue&&(B=Ue.charCodeAt(0))}const Se=this._unicodeService.charProperties(B,ae);F=N.UnicodeService.extractWidth(Se);const Ae=N.UnicodeService.extractShouldJoin(Se),De=Ae?N.UnicodeService.extractWidth(ae):0;if(ae=Se,J&&this._onA11yChar.fire((0,C.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-De>ee){if(K){const Ue=re;let ce=this._activeBuffer.x-De;for(this._activeBuffer.x=De,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),re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),De>0&&re instanceof y.BufferLine&&re.copyCellsFrom(Ue,ce,0,De,!1);ce<ee;)Ue.setCellFromCodepoint(ce++,0,1,te)}else if(this._activeBuffer.x=ee-1,F===2)continue}if(Ae&&this._activeBuffer.x){const Ue=re.getWidth(this._activeBuffer.x-1)?1:2;re.addCodepointToCell(this._activeBuffer.x-Ue,B,F);for(let ce=F-De;--ce>=0;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}else if(V&&(re.insertCells(this._activeBuffer.x,F-De,this._activeBuffer.getNullCell(te)),re.getWidth(ee-1)===2&&re.setCellFromCodepoint(ee-1,b.NULL_CELL_CODE,b.NULL_CELL_WIDTH,te)),re.setCellFromCodepoint(this._activeBuffer.x++,B,F,te),F>0)for(;--F;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}this._parser.precedingJoinState=ae,this._activeBuffer.x<ee&&P-M>0&&re.getWidth(this._activeBuffer.x)===0&&!re.hasContent(this._activeBuffer.x)&&re.setCellFromCodepoint(this._activeBuffer.x,0,1,te),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,M){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,M):this._parser.registerCsiHandler(I,(P=>!H(P.params[0],this._optionsService.rawOptions.windowOptions)||M(P)))}registerDcsHandler(I,M){return this._parser.registerDcsHandler(I,new E.DcsHandler(M))}registerEscHandler(I,M){return this._parser.registerEscHandler(I,M)}registerOscHandler(I,M){return this._parser.registerOscHandler(I,new D.OscHandler(M))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;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&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=I,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+M)}cursorUp(I){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const M=I.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=I.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=I.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const M=I.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,M,P,B=!1,F=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Q.replaceCells(M,P,this._activeBuffer.getNullCell(this._eraseAttrData()),F),B&&(Q.isWrapped=!1)}_resetBufferLine(I,M=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),P.isWrapped=!1)}eraseInDisplay(I,M=!1){let P;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);P<this._bufferService.rows;P++)this._resetBufferLine(P,M);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,M);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(I,M=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let M=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;M--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let M=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;M--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let M=I.params[0]||1;for(;M--;)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(I){let M=I.params[0]||1;for(;M--;)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(y.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);B.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);B.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);B.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);B.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const M=this._parser.precedingJoinState;if(!M)return!0;const P=I.params[0]||1,B=N.UnicodeService.extractWidth(M),F=this._activeBuffer.x-B,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),J=new Uint32Array(Q.length*P);let ee=0;for(let V=0;V<Q.length;){const te=Q.codePointAt(V)||0;J[ee++]=te,V+=te>65535?2:1}let K=ee;for(let V=1;V<P;++V)J.copyWithin(K,0,ee),K+=ee;return this.print(J,0,K),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let M=0;M<I.length;M++)switch(I.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let M=0;M<I.length;M++)switch(I.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(I){for(let M=0;M<I.length;M++)switch(I.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let M=0;M<I.length;M++)switch(I.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),I.params[M]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(I,M){const P=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:F}=this._coreMouseService,Q=this._coreService,{buffers:J,cols:ee}=this._bufferService,{active:K,alt:V}=J,te=this._optionsService.rawOptions,re=Ae=>Ae?1:2,ae=I.params[0];return se=ae,Se=M?ae===2?4:ae===4?re(Q.modes.insertMode):ae===12?3:ae===20?re(te.convertEol):0:ae===1?re(P.applicationCursorKeys):ae===3?te.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:ae===6?re(P.origin):ae===7?re(P.wraparound):ae===8?3:ae===9?re(B==="X10"):ae===12?re(te.cursorBlink):ae===25?re(!Q.isCursorHidden):ae===45?re(P.reverseWraparound):ae===66?re(P.applicationKeypad):ae===67?4:ae===1e3?re(B==="VT200"):ae===1002?re(B==="DRAG"):ae===1003?re(B==="ANY"):ae===1004?re(P.sendFocus):ae===1005?4:ae===1006?re(F==="SGR"):ae===1015?4:ae===1016?re(F==="SGR_PIXELS"):ae===1048?1:ae===47||ae===1047||ae===1049?re(K===V):ae===2004?re(P.bracketedPasteMode):0,Q.triggerDataEvent(`${p.C0.ESC}[${M?"":"?"}${se};${Se}$y`),!0;var se,Se}_updateAttrColor(I,M,P,B,F){return M===2?(I|=50331648,I&=-16777216,I|=k.AttributeData.fromColorRGB([P,B,F])):M===5&&(I&=-50331904,I|=33554432|255&P),I}_extractColor(I,M,P){const B=[0,0,-1,0,0,0];let F=0,Q=0;do{if(B[Q+F]=I.params[M+Q],I.hasSubParams(M+Q)){const J=I.getSubParams(M+Q);let ee=0;do B[1]===5&&(F=1),B[Q+ee+1+F]=J[ee];while(++ee<J.length&&ee+Q+1+F<B.length);break}if(B[1]===5&&Q+F>=2||B[1]===2&&Q+F>=5)break;B[1]&&(F=1)}while(++Q+M<I.length&&Q+F<B.length);for(let J=2;J<B.length;++J)B[J]===-1&&(B[J]=0);switch(B[0]){case 38:P.fg=this._updateAttrColor(P.fg,B[1],B[3],B[4],B[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,B[1],B[3],B[4],B[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,B[1],B[3],B[4],B[5])}return Q}_processUnderline(I,M){M.extended=M.extended.clone(),(!~I||I>5)&&(I=1),M.extended.underlineStyle=I,M.fg|=268435456,I===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(I){I.fg=y.DEFAULT_ATTR_DATA.fg,I.bg=y.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=I.length;let P;const B=this._curAttrData;for(let F=0;F<M;F++)P=I.params[F],P>=30&&P<=37?(B.fg&=-50331904,B.fg|=16777216|P-30):P>=40&&P<=47?(B.bg&=-50331904,B.bg|=16777216|P-40):P>=90&&P<=97?(B.fg&=-50331904,B.fg|=16777224|P-90):P>=100&&P<=107?(B.bg&=-50331904,B.bg|=16777224|P-100):P===0?this._processSGR0(B):P===1?B.fg|=134217728:P===3?B.bg|=67108864:P===4?(B.fg|=268435456,this._processUnderline(I.hasSubParams(F)?I.getSubParams(F)[0]:1,B)):P===5?B.fg|=536870912:P===7?B.fg|=67108864:P===8?B.fg|=1073741824:P===9?B.fg|=2147483648:P===2?B.bg|=134217728:P===21?this._processUnderline(2,B):P===22?(B.fg&=-134217729,B.bg&=-134217729):P===23?B.bg&=-67108865:P===24?(B.fg&=-268435457,this._processUnderline(0,B)):P===25?B.fg&=-536870913:P===27?B.fg&=-67108865:P===28?B.fg&=-1073741825:P===29?B.fg&=2147483647:P===39?(B.fg&=-67108864,B.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):P===49?(B.bg&=-67108864,B.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?F+=this._extractColor(I,F,B):P===53?B.bg|=1073741824:P===55?B.bg&=-1073741825:P===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):P===100?(B.fg&=-67108864,B.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${M};${P}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const M=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${M};${P}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const M=I.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const P=M%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(I){const M=I.params[0]||1;let P;return(I.length<2||(P=I.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(I){if(!H(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire($.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire($.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const M=[],P=I.split(";");for(;P.length>1;){const B=P.shift(),F=P.shift();if(/^\d+$/.exec(B)){const Q=parseInt(B);if(X(Q))if(F==="?")M.push({type:0,index:Q});else{const J=(0,O.parseColor)(F);J&&M.push({type:1,index:Q,color:J})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(I){const M=I.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(I,M){this._getCurrentLinkId()&&this._finishHyperlink();const P=I.split(":");let B;const F=P.findIndex((Q=>Q.startsWith("id=")));return F!==-1&&(B=P[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,M){const P=I.split(";");for(let B=0;B<P.length&&!(M>=this._specialColors.length);++B,++M)if(P[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const F=(0,O.parseColor)(P[B]);F&&this._onColor.fire([{type:1,index:this._specialColors[M],color:F}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const M=[],P=I.split(";");for(let B=0;B<P.length;++B)if(/^\d+$/.exec(P[B])){const F=parseInt(P[B]);X(F)&&M.push({type:2,index:F})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(L[I[0]],g.CHARSETS[I[1]]||g.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new _.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const P=this._activeBuffer.ybase+this._activeBuffer.y+M,B=this._activeBuffer.lines.get(P);B&&(B.fill(I),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,M){const P=this._bufferService.buffer,B=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${F}${p.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,M){this._dirtyRowTracker.markRangeDirty(I,M)}}a.InputHandler=G;let W=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,I){Y>I&&(q=Y,Y=I,I=q),Y<this.start&&(this.start=Y),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(Y){return 0<=Y&&Y<256}W=d([m(0,j.IBufferService)],W)},844:(c,a)=>{function u(d){for(const m of d)m.dispose();d.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const m=this._disposables.indexOf(d);m!==-1&&this._disposables.splice(m,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var m;this._isDisposed||d===this._value||((m=this._value)==null||m.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},a.toDisposable=function(d){return{dispose:d}},a.disposeArray=u,a.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(m,p,g){this._data[m]||(this._data[m]={}),this._data[m][p]=g}get(m,p){return this._data[m]?this._data[m][p]:void 0}clear(){this._data={}}}a.TwoKeyMap=u,a.FourKeyMap=class{constructor(){this._data=new u}set(d,m,p,g,x){this._data.get(d,m)||this._data.set(d,m,new u),this._data.get(d,m).set(p,g,x)}get(d,m,p,g){var x;return(x=this._data.get(d,m))==null?void 0:x.get(p,g)}clear(){this._data.clear()}}},6114:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const u=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=u.includes("Firefox"),a.isLegacyEdge=u.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(u),a.getSafariVersion=function(){if(!a.isSafari)return 0;const m=u.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(u)},6106:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let u=0;a.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const m=this._getKey(d);if(m===void 0||(u=this._search(m),u===-1)||this._getKey(this._array[u])!==m)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===m);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,m){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do m(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let m=0,p=this._array.length-1;for(;p>=m;){let g=m+p>>1;const x=this._getKey(this._array[g]);if(x>d)p=g-1;else{if(!(x<d)){for(;g>0&&this._getKey(this._array[g-1])===d;)g--;return g}m=g+1}}return m}}},7226:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=u(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let w=0,C=0,y=x.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),C=Math.max(w,C),S=x.timeRemaining(),1.5*C>S)return y-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-w))}ms`),void this._start();y=S}this.clear()}}class p extends m{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const w=Date.now()+x;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}a.PriorityTaskQueue=p,a.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:p,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const d=u(643);a.updateWindowsModeWrappedState=function(m){const p=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=p==null?void 0:p.get(m.cols-1),x=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);x&&g&&(x.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new u;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}get underlineVariantOffset(){const p=(3758096384&this._ext)>>29;return p<0?4294967288^p:p}set underlineVariantOffset(p){this._ext&=536870911,this._ext|=p<<29&3758096384}constructor(p=0,g=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=d},9092:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const d=u(6349),m=u(7226),p=u(3734),g=u(8437),x=u(4634),w=u(511),C=u(643),y=u(4863),S=u(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(b,_,k){this._hasScrollback=b,this._optionsService=_,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(b){return b?(this._nullCell.fg=b.fg,this._nullCell.bg=b.bg,this._nullCell.extended=b.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(b){return b?(this._whitespaceCell.fg=b.fg,this._whitespaceCell.bg=b.bg,this._whitespaceCell.extended=b.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(b,_){return new g.BufferLine(this._bufferService.cols,this.getNullCell(b),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const b=this.ybase+this.y-this.ydisp;return b>=0&&b<this._rows}_getCorrectBufferLength(b){if(!this._hasScrollback)return b;const _=b+this._optionsService.rawOptions.scrollback;return _>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:_}fillViewportRows(b){if(this.lines.length===0){b===void 0&&(b=g.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(b))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(b,_){const k=this.getNullCell(g.DEFAULT_ATTR_DATA);let j=0;const N=this._getCorrectBufferLength(_);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols<b)for(let E=0;E<this.lines.length;E++)j+=+this.lines.get(E).resize(b,k);let D=0;if(this._rows<_)for(let E=this._rows;E<_;E++)this.lines.length<_+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(b,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(b,k)));else for(let E=this._rows;E>_;E--)this.lines.length>_+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N<this.lines.maxLength){const E=this.lines.length-N;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=N}this.x=Math.min(this.x,b-1),this.y=Math.min(this.y,_-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,b-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(b,_),this._cols>b))for(let D=0;D<this.lines.length;D++)j+=+this.lines.get(D).resize(b,k);this._cols=b,this._rows=_,this._memoryCleanupQueue.clear(),j>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let b=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,b=!1);let _=0;for(;this._memoryCleanupPosition<this.lines.length;)if(_+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),_>100)return!0;return b}get _isReflowEnabled(){const b=this._optionsService.rawOptions.windowsPty;return b&&b.buildNumber?this._hasScrollback&&b.backend==="conpty"&&b.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(b,_){this._cols!==b&&(b>this._cols?this._reflowLarger(b,_):this._reflowSmaller(b,_))}_reflowLarger(b,_){const k=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,b,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(k.length>0){const j=(0,x.reflowLargerCreateNewLayout)(this.lines,k);(0,x.reflowLargerApplyNewLayout)(this.lines,j.layout),this._reflowLargerAdjustViewport(b,_,j.countRemoved)}}_reflowLargerAdjustViewport(b,_,k){const j=this.getNullCell(g.DEFAULT_ATTR_DATA);let N=k;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new g.BufferLine(b,j))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(b,_){const k=this.getNullCell(g.DEFAULT_ATTR_DATA),j=[];let N=0;for(let D=this.lines.length-1;D>=0;D--){let E=this.lines.get(D);if(!E||!E.isWrapped&&E.getTrimmedLength()<=b)continue;const O=[E];for(;E.isWrapped&&D>0;)E=this.lines.get(--D),O.unshift(E);const L=this.ybase+this.y;if(L>=D&&L<D+O.length)continue;const z=O[O.length-1].getTrimmedLength(),H=(0,x.reflowSmallerGetNewLineLengths)(O,this._cols,b),$=H.length-O.length;let q;q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+$):Math.max(0,this.lines.length-this.lines.maxLength+$);const G=[];for(let P=0;P<$;P++){const B=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);G.push(B)}G.length>0&&(j.push({start:D+O.length+N,newLines:G}),N+=G.length),O.push(...G);let W=H.length-1,X=H[W];X===0&&(W--,X=H[W]);let Y=O.length-$-1,I=z;for(;Y>=0;){const P=Math.min(I,X);if(O[W]===void 0)break;if(O[W].copyCellsFrom(O[Y],I-P,X-P,P,!0),X-=P,X===0&&(W--,X=H[W]),I-=P,I===0){Y--;const B=Math.max(Y,0);I=(0,x.getWrappedLineTrimmedLength)(O,B,this._cols)}}for(let P=0;P<O.length;P++)H[P]<b&&O[P].setCell(H[P],k);let M=$-q;for(;M-- >0;)this.ybase===0?this.y<_-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+N)-_&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+$,this.ybase+_-1)}if(j.length>0){const D=[],E=[];for(let W=0;W<this.lines.length;W++)E.push(this.lines.get(W));const O=this.lines.length;let L=O-1,z=0,H=j[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+N);let $=0;for(let W=Math.min(this.lines.maxLength-1,O+N-1);W>=0;W--)if(H&&H.start>L+$){for(let X=H.newLines.length-1;X>=0;X--)this.lines.set(W--,H.newLines[X]);W++,D.push({index:L+1,amount:H.newLines.length}),$+=H.newLines.length,H=j[++z]}else this.lines.set(W,E[L--]);let q=0;for(let W=D.length-1;W>=0;W--)D[W].index+=q,this.lines.onInsertEmitter.fire(D[W]),q+=D[W].amount;const G=Math.max(0,O+N-this.lines.maxLength);G>0&&this.lines.onTrimEmitter.fire(G)}}translateBufferLineToString(b,_,k=0,j){const N=this.lines.get(b);return N?N.translateToString(_,k,j):""}getWrappedRangeForLine(b){let _=b,k=b;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:_,last:k}}setupTabStops(b){for(b!=null?this.tabs[b]||(b=this.prevStop(b)):(this.tabs={},b=0);b<this._cols;b+=this._optionsService.rawOptions.tabStopWidth)this.tabs[b]=!0}prevStop(b){for(b==null&&(b=this.x);!this.tabs[--b]&&b>0;);return b>=this._cols?this._cols-1:b<0?0:b}nextStop(b){for(b==null&&(b=this.x);!this.tabs[++b]&&b<this._cols;);return b>=this._cols?this._cols-1:b<0?0:b}clearMarkers(b){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].line===b&&(this.markers[_].dispose(),this.markers.splice(_--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].dispose(),this.markers.splice(b--,1);this._isClearing=!1}addMarker(b){const _=new y.Marker(b);return this.markers.push(_),_.register(this.lines.onTrim((k=>{_.line-=k,_.line<0&&_.dispose()}))),_.register(this.lines.onInsert((k=>{_.line>=k.index&&(_.line+=k.amount)}))),_.register(this.lines.onDelete((k=>{_.line>=k.index&&_.line<k.index+k.amount&&_.dispose(),_.line>k.index&&(_.line-=k.amount)}))),_.register(_.onDispose((()=>this._removeMarker(_)))),_}_removeMarker(b){this._isClearing||this.markers.splice(this.markers.indexOf(b),1)}}},8437:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const d=u(3734),m=u(511),p=u(643),g=u(482);a.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let x=0;class w{constructor(y,S,b=!1){this.isWrapped=b,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const _=S||m.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let k=0;k<y;++k)this.setCell(k,_);this.length=y}get(y){const S=this._data[3*y+0],b=2097151&S;return[this._data[3*y+1],2097152&S?this._combined[y]:b?(0,g.stringFromCodePoint)(b):"",S>>22,2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):b]}set(y,S){this._data[3*y+1]=S[p.CHAR_DATA_ATTR_INDEX],S[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=S[1],this._data[3*y+0]=2097152|y|S[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&S}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y]:2097151&S?(0,g.stringFromCodePoint)(2097151&S):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,S){return x=3*y,S.content=this._data[x+0],S.fg=this._data[x+1],S.bg=this._data[x+2],2097152&S.content&&(S.combinedData=this._combined[y]),268435456&S.bg&&(S.extended=this._extendedAttrs[y]),S}setCell(y,S){2097152&S.content&&(this._combined[y]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[y]=S.extended),this._data[3*y+0]=S.content,this._data[3*y+1]=S.fg,this._data[3*y+2]=S.bg}setCellFromCodepoint(y,S,b,_){268435456&_.bg&&(this._extendedAttrs[y]=_.extended),this._data[3*y+0]=S|b<<22,this._data[3*y+1]=_.fg,this._data[3*y+2]=_.bg}addCodepointToCell(y,S,b){let _=this._data[3*y+0];2097152&_?this._combined[y]+=(0,g.stringFromCodePoint)(S):2097151&_?(this._combined[y]=(0,g.stringFromCodePoint)(2097151&_)+(0,g.stringFromCodePoint)(S),_&=-2097152,_|=2097152):_=S|4194304,b&&(_&=-12582913,_|=b<<22),this._data[3*y+0]=_}insertCells(y,S,b){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,b),S<this.length-y){const _=new m.CellData;for(let k=this.length-y-S-1;k>=0;--k)this.setCell(y+S+k,this.loadCell(y+k,_));for(let k=0;k<S;++k)this.setCell(y+k,b)}else for(let _=y;_<this.length;++_)this.setCell(_,b);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,b)}deleteCells(y,S,b){if(y%=this.length,S<this.length-y){const _=new m.CellData;for(let k=0;k<this.length-y-S;++k)this.setCell(y+k,this.loadCell(y+S+k,_));for(let k=this.length-S;k<this.length;++k)this.setCell(k,b)}else for(let _=y;_<this.length;++_)this.setCell(_,b);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,b),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,b)}replaceCells(y,S,b,_=!1){if(_)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,b),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,b);y<S&&y<this.length;)this.isProtected(y)||this.setCell(y,b),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,b),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,b);y<S&&y<this.length;)this.setCell(y++,b)}resize(y,S){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const b=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*b)this._data=new Uint32Array(this._data.buffer,0,b);else{const _=new Uint32Array(b);_.set(this._data),this._data=_}for(let _=this.length;_<y;++_)this.setCell(_,S)}else{this._data=this._data.subarray(0,b);const _=Object.keys(this._combined);for(let j=0;j<_.length;j++){const N=parseInt(_[j],10);N>=y&&delete this._combined[N]}const k=Object.keys(this._extendedAttrs);for(let j=0;j<k.length;j++){const N=parseInt(k[j],10);N>=y&&delete this._extendedAttrs[N]}}return this.length=y,4*b*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const y=new Uint32Array(this._data.length);return y.set(this._data),this._data=y,1}return 0}fill(y,S=!1){if(S)for(let b=0;b<this.length;++b)this.isProtected(b)||this.setCell(b,y);else{this._combined={},this._extendedAttrs={};for(let b=0;b<this.length;++b)this.setCell(b,y)}}copyFrom(y){this.length!==y.length?this._data=new Uint32Array(y._data):this._data.set(y._data),this.length=y.length,this._combined={};for(const S in y._combined)this._combined[S]=y._combined[S];this._extendedAttrs={};for(const S in y._extendedAttrs)this._extendedAttrs[S]=y._extendedAttrs[S];this.isWrapped=y.isWrapped}clone(){const y=new w(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const S in this._combined)y._combined[S]=this._combined[S];for(const S in this._extendedAttrs)y._extendedAttrs[S]=this._extendedAttrs[S];return y.isWrapped=this.isWrapped,y}getTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,S,b,_,k){const j=y._data;if(k)for(let D=_-1;D>=0;D--){for(let E=0;E<3;E++)this._data[3*(b+D)+E]=j[3*(S+D)+E];268435456&j[3*(S+D)+2]&&(this._extendedAttrs[b+D]=y._extendedAttrs[S+D])}else for(let D=0;D<_;D++){for(let E=0;E<3;E++)this._data[3*(b+D)+E]=j[3*(S+D)+E];268435456&j[3*(S+D)+2]&&(this._extendedAttrs[b+D]=y._extendedAttrs[S+D])}const N=Object.keys(y._combined);for(let D=0;D<N.length;D++){const E=parseInt(N[D],10);E>=S&&(this._combined[E-S+b]=y._combined[E])}}translateToString(y,S,b,_){S=S!=null?S:0,b=b!=null?b:this.length,y&&(b=Math.min(b,this.getTrimmedLength())),_&&(_.length=0);let k="";for(;S<b;){const j=this._data[3*S+0],N=2097151&j,D=2097152&j?this._combined[S]:N?(0,g.stringFromCodePoint)(N):p.WHITESPACE_CELL_CHAR;if(k+=D,_)for(let E=0;E<D.length;++E)_.push(S);S+=j>>22||1}return _&&_.push(S),k}}a.BufferLine=w},4841:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(c,a)=>{function u(d,m,p){if(m===d.length-1)return d[m].getTrimmedLength();const g=!d[m].hasContent(p-1)&&d[m].getWidth(p-1)===1,x=d[m+1].getWidth(0)===2;return g&&x?p-1:p}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(d,m,p,g,x){const w=[];for(let C=0;C<d.length-1;C++){let y=C,S=d.get(++y);if(!S.isWrapped)continue;const b=[d.get(C)];for(;y<d.length&&S.isWrapped;)b.push(S),S=d.get(++y);if(g>=C&&g<y){C+=b.length-1;continue}let _=0,k=u(b,_,m),j=1,N=0;for(;j<b.length;){const E=u(b,j,m),O=E-N,L=p-k,z=Math.min(O,L);b[_].copyCellsFrom(b[j],N,k,z,!1),k+=z,k===p&&(_++,k=0),N+=z,N===E&&(j++,N=0),k===0&&_!==0&&b[_-1].getWidth(p-1)===2&&(b[_].copyCellsFrom(b[_-1],p-1,k++,1,!1),b[_-1].setCell(p-1,x))}b[_].replaceCells(k,p,x);let D=0;for(let E=b.length-1;E>0&&(E>_||b[E].getTrimmedLength()===0);E--)D++;D>0&&(w.push(C+b.length-D),w.push(D)),C+=b.length-1}return w},a.reflowLargerCreateNewLayout=function(d,m){const p=[];let g=0,x=m[g],w=0;for(let C=0;C<d.length;C++)if(x===C){const y=m[++g];d.onDeleteEmitter.fire({index:C-w,amount:y}),C+=y-1,w+=y,x=m[++g]}else p.push(C);return{layout:p,countRemoved:w}},a.reflowLargerApplyNewLayout=function(d,m){const p=[];for(let g=0;g<m.length;g++)p.push(d.get(m[g]));for(let g=0;g<p.length;g++)d.set(g,p[g]);d.length=m.length},a.reflowSmallerGetNewLineLengths=function(d,m,p){const g=[],x=d.map(((S,b)=>u(d,b,m))).reduce(((S,b)=>S+b));let w=0,C=0,y=0;for(;y<x;){if(x-y<p){g.push(x-y);break}w+=p;const S=u(d,C,m);w>S&&(w-=S,C++);const b=d[C].getWidth(w-1)===2;b&&w--;const _=b?p-1:p;g.push(_),y+=_}return g},a.getWrappedLineTrimmedLength=u},5295:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const d=u(8460),m=u(844),p=u(9092);class g extends m.Disposable{constructor(w,C){super(),this._optionsService=w,this._bufferService=C,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,C){this._normal.resize(w,C),this._alt.resize(w,C),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}a.BufferSet=g},511:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=u(482),m=u(643),p=u(3734);class g extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const C=new g;return C.setFromCharData(w),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(w[m.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(w[m.CHAR_DATA_CHAR_INDEX].length===2){const y=w[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const S=w[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(y-55296)+S-56320+65536|w[m.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=w[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[m.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=w[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=g},643:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const d=u(8460),m=u(844);class p{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}a.Marker=p,p._nextId=1},7116:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(c,a)=>{var u,d,m;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
|
|
619
|
-
`,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""})(u||(a.C0=u={})),(function(p){p.PAD="",p.HOP="",p.BPH="",p.NBH="",p.IND="",p.NEL="
",p.SSA="",p.ESA="",p.HTS="",p.HTJ="",p.VTS="",p.PLD="",p.PLU="",p.RI="",p.SS2="",p.SS3="",p.DCS="",p.PU1="",p.PU2="",p.STS="",p.CCH="",p.MW="",p.SPA="",p.EPA="",p.SOS="",p.SGCI="",p.SCI="",p.CSI="",p.ST="",p.OSC="",p.PM="",p.APC=""})(d||(a.C1=d={})),(function(p){p.ST=`${u.ESC}\\`})(m||(a.C1_ESCAPED=m={}))},7399:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const d=u(2584),m={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:["'",'"']};a.evaluateKeyboardEvent=function(p,g,x,w){const C={type:0,cancel:!1,key:void 0},y=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?C.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?C.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?C.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(C.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:C.key=p.ctrlKey?"\b":d.C0.DEL,p.altKey&&(C.key=d.C0.ESC+C.key);break;case 9:if(p.shiftKey){C.key=d.C0.ESC+"[Z";break}C.key=d.C0.HT,C.cancel=!0;break;case 13:C.key=p.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,C.cancel=!0;break;case 27:C.key=d.C0.ESC,p.altKey&&(C.key=d.C0.ESC+d.C0.ESC),C.cancel=!0;break;case 37:if(p.metaKey)break;y?(C.key=d.C0.ESC+"[1;"+(y+1)+"D",C.key===d.C0.ESC+"[1;3D"&&(C.key=d.C0.ESC+(x?"b":"[1;5D"))):C.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(p.metaKey)break;y?(C.key=d.C0.ESC+"[1;"+(y+1)+"C",C.key===d.C0.ESC+"[1;3C"&&(C.key=d.C0.ESC+(x?"f":"[1;5C"))):C.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(p.metaKey)break;y?(C.key=d.C0.ESC+"[1;"+(y+1)+"A",x||C.key!==d.C0.ESC+"[1;3A"||(C.key=d.C0.ESC+"[1;5A")):C.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(p.metaKey)break;y?(C.key=d.C0.ESC+"[1;"+(y+1)+"B",x||C.key!==d.C0.ESC+"[1;3B"||(C.key=d.C0.ESC+"[1;5B")):C.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(C.key=d.C0.ESC+"[2~");break;case 46:C.key=y?d.C0.ESC+"[3;"+(y+1)+"~":d.C0.ESC+"[3~";break;case 36:C.key=y?d.C0.ESC+"[1;"+(y+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:C.key=y?d.C0.ESC+"[1;"+(y+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:p.shiftKey?C.type=2:p.ctrlKey?C.key=d.C0.ESC+"[5;"+(y+1)+"~":C.key=d.C0.ESC+"[5~";break;case 34:p.shiftKey?C.type=3:p.ctrlKey?C.key=d.C0.ESC+"[6;"+(y+1)+"~":C.key=d.C0.ESC+"[6~";break;case 112:C.key=y?d.C0.ESC+"[1;"+(y+1)+"P":d.C0.ESC+"OP";break;case 113:C.key=y?d.C0.ESC+"[1;"+(y+1)+"Q":d.C0.ESC+"OQ";break;case 114:C.key=y?d.C0.ESC+"[1;"+(y+1)+"R":d.C0.ESC+"OR";break;case 115:C.key=y?d.C0.ESC+"[1;"+(y+1)+"S":d.C0.ESC+"OS";break;case 116:C.key=y?d.C0.ESC+"[15;"+(y+1)+"~":d.C0.ESC+"[15~";break;case 117:C.key=y?d.C0.ESC+"[17;"+(y+1)+"~":d.C0.ESC+"[17~";break;case 118:C.key=y?d.C0.ESC+"[18;"+(y+1)+"~":d.C0.ESC+"[18~";break;case 119:C.key=y?d.C0.ESC+"[19;"+(y+1)+"~":d.C0.ESC+"[19~";break;case 120:C.key=y?d.C0.ESC+"[20;"+(y+1)+"~":d.C0.ESC+"[20~";break;case 121:C.key=y?d.C0.ESC+"[21;"+(y+1)+"~":d.C0.ESC+"[21~";break;case 122:C.key=y?d.C0.ESC+"[23;"+(y+1)+"~":d.C0.ESC+"[23~";break;case 123:C.key=y?d.C0.ESC+"[24;"+(y+1)+"~":d.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(x&&!w||!p.altKey||p.metaKey)!x||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?C.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(C.key=d.C0.US),p.key==="@"&&(C.key=d.C0.NUL)):p.keyCode===65&&(C.type=1);else{const S=m[p.keyCode],b=S==null?void 0:S[p.shiftKey?1:0];if(b)C.key=d.C0.ESC+b;else if(p.keyCode>=65&&p.keyCode<=90){const _=p.ctrlKey?p.keyCode-64:p.keyCode+32;let k=String.fromCharCode(_);p.shiftKey&&(k=k.toUpperCase()),C.key=d.C0.ESC+k}else if(p.keyCode===32)C.key=d.C0.ESC+(p.ctrlKey?d.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let _=p.code.slice(3,4);p.shiftKey||(_=_.toLowerCase()),C.key=d.C0.ESC+_,C.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?C.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?C.key=d.C0.NUL:p.keyCode>=51&&p.keyCode<=55?C.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?C.key=d.C0.DEL:p.keyCode===219?C.key=d.C0.ESC:p.keyCode===220?C.key=d.C0.FS:p.keyCode===221&&(C.key=d.C0.GS)}return C}},482:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},a.utf32ToString=function(u,d=0,m=u.length){let p="";for(let g=d;g<m;++g){let x=u[g];x>65535?(x-=65536,p+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):p+=String.fromCharCode(x)}return p},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const m=u.length;if(!m)return 0;let p=0,g=0;if(this._interim){const x=u.charCodeAt(g++);56320<=x&&x<=57343?d[p++]=1024*(this._interim-55296)+x-56320+65536:(d[p++]=this._interim,d[p++]=x),this._interim=0}for(let x=g;x<m;++x){const w=u.charCodeAt(x);if(55296<=w&&w<=56319){if(++x>=m)return this._interim=w,p;const C=u.charCodeAt(x);56320<=C&&C<=57343?d[p++]=1024*(w-55296)+C-56320+65536:(d[p++]=w,d[p++]=C)}else w!==65279&&(d[p++]=w)}return p}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const m=u.length;if(!m)return 0;let p,g,x,w,C=0,y=0,S=0;if(this.interim[0]){let k=!1,j=this.interim[0];j&=(224&j)==192?31:(240&j)==224?15:7;let N,D=0;for(;(N=63&this.interim[++D])&&D<4;)j<<=6,j|=N;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,O=E-D;for(;S<O;){if(S>=m)return 0;if(N=u[S++],(192&N)!=128){S--,k=!0;break}this.interim[D++]=N,j<<=6,j|=63&N}k||(E===2?j<128?S--:d[C++]=j:E===3?j<2048||j>=55296&&j<=57343||j===65279||(d[C++]=j):j<65536||j>1114111||(d[C++]=j)),this.interim.fill(0)}const b=m-4;let _=S;for(;_<m;){for(;!(!(_<b)||128&(p=u[_])||128&(g=u[_+1])||128&(x=u[_+2])||128&(w=u[_+3]));)d[C++]=p,d[C++]=g,d[C++]=x,d[C++]=w,_+=4;if(p=u[_++],p<128)d[C++]=p;else if((224&p)==192){if(_>=m)return this.interim[0]=p,C;if(g=u[_++],(192&g)!=128){_--;continue}if(y=(31&p)<<6|63&g,y<128){_--;continue}d[C++]=y}else if((240&p)==224){if(_>=m)return this.interim[0]=p,C;if(g=u[_++],(192&g)!=128){_--;continue}if(_>=m)return this.interim[0]=p,this.interim[1]=g,C;if(x=u[_++],(192&x)!=128){_--;continue}if(y=(15&p)<<12|(63&g)<<6|63&x,y<2048||y>=55296&&y<=57343||y===65279)continue;d[C++]=y}else if((248&p)==240){if(_>=m)return this.interim[0]=p,C;if(g=u[_++],(192&g)!=128){_--;continue}if(_>=m)return this.interim[0]=p,this.interim[1]=g,C;if(x=u[_++],(192&x)!=128){_--;continue}if(_>=m)return this.interim[0]=p,this.interim[1]=g,this.interim[2]=x,C;if(w=u[_++],(192&w)!=128){_--;continue}if(y=(7&p)<<18|(63&g)<<12|(63&x)<<6|63&w,y<65536||y>1114111)continue;d[C++]=y}}return C}}},225:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=u(1480),m=[[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]],p=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;a.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let x=0;x<m.length;++x)g.fill(0,m[x][0],m[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?g[x]:(function(w,C){let y,S=0,b=C.length-1;if(w<C[0][0]||w>C[b][1])return!1;for(;b>=S;)if(y=S+b>>1,w>C[y][1])S=y+1;else{if(!(w<C[y][0]))return!0;b=y-1}return!1})(x,p)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,w){let C=this.wcwidth(x),y=C===0&&w!==0;if(y){const S=d.UnicodeService.extractWidth(w);S===0?y=!1:S>C&&(C=S)}return d.UnicodeService.createPropertyValue(0,C,y)}}},5981:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const d=u(8460),m=u(844);class p extends m.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(w)}_innerWrite(x=0,w=!0){const C=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],S=this._action(y,w);if(S){const _=k=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(C,k);return void S.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(_)}const b=this._callbacks[this._bufferOffset];if(b&&b(),this._bufferOffset++,this._pendingData-=y.length,Date.now()-C>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=p},5941:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function m(p,g){const x=p.toString(16),w=x.length<2?"0"+x:x;switch(g){case 4:return x[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}a.parseColor=function(p){if(!p)return;let g=p.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const x=u.exec(g);if(x){const w=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/w*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/w*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/w*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const x=g.length/3,w=[0,0,0];for(let C=0;C<3;++C){const y=parseInt(g.slice(x*C,x*C+x),16);w[C]=x===1?y<<4:x===2?y:x===3?y>>4:y>>8}return w}},a.toRgbString=function(p,g=16){const[x,w,C]=p;return`rgb:${m(x,g)}/${m(w,g)}/${m(C,g)}`}},5770:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const d=u(482),m=u(8742),p=u(5770),g=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(w,C){this._handlers[w]===void 0&&(this._handlers[w]=[]);const y=this._handlers[w];return y.push(C),{dispose:()=>{const S=y.indexOf(C);S!==-1&&y.splice(S,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(w,C){if(this.reset(),this._ident=w,this._active=this._handlers[w]||g,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(w,C,y){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(w,C,y);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(w,C,y))}unhook(w,C=!0){if(this._active.length){let y=!1,S=this._active.length-1,b=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,y=C,b=this._stack.fallThrough,this._stack.paused=!1),!b&&y===!1){for(;S>=0&&(y=this._active[S].unhook(w),y!==!0);S--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,y;S--}for(;S>=0;S--)if(y=this._active[S].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",w);this._active=g,this._ident=0}};const x=new m.Params;x.addParam(0),a.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=x,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():x,this._data="",this._hitLimit=!1}put(w,C,y){this._hitLimit||(this._data+=(0,d.utf32ToString)(w,C,y),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let C=!1;if(this._hitLimit)C=!1;else if(w&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((y=>(this._params=x,this._data="",this._hitLimit=!1,y)));return this._params=x,this._data="",this._hitLimit=!1,C}}},2015:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const d=u(844),m=u(8742),p=u(6242),g=u(6351);class x{constructor(S){this.table=new Uint8Array(S)}setDefault(S,b){this.table.fill(S<<4|b)}add(S,b,_,k){this.table[b<<8|S]=_<<4|k}addMany(S,b,_,k){for(let j=0;j<S.length;j++)this.table[b<<8|S[j]]=_<<4|k}}a.TransitionTable=x;const w=160;a.VT500_TRANSITION_TABLE=(function(){const y=new x(4095),S=Array.apply(null,Array(256)).map(((D,E)=>E)),b=(D,E)=>S.slice(D,E),_=b(32,127),k=b(0,24);k.push(25),k.push.apply(k,b(28,32));const j=b(0,14);let N;for(N in y.setDefault(1,0),y.addMany(_,0,2,0),j)y.addMany([24,26,153,154],N,3,0),y.addMany(b(128,144),N,3,0),y.addMany(b(144,152),N,3,0),y.add(156,N,0,0),y.add(27,N,11,1),y.add(157,N,4,8),y.addMany([152,158,159],N,0,7),y.add(155,N,11,3),y.add(144,N,11,9);return y.addMany(k,0,3,0),y.addMany(k,1,3,1),y.add(127,1,0,1),y.addMany(k,8,0,8),y.addMany(k,3,3,3),y.add(127,3,0,3),y.addMany(k,4,3,4),y.add(127,4,0,4),y.addMany(k,6,3,6),y.addMany(k,5,3,5),y.add(127,5,0,5),y.addMany(k,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(_,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(b(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(_,7,0,7),y.addMany(k,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(b(64,127),3,7,0),y.addMany(b(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(b(48,60),4,8,4),y.addMany(b(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(b(32,64),6,0,6),y.add(127,6,0,6),y.addMany(b(64,127),6,0,0),y.addMany(b(32,48),3,9,5),y.addMany(b(32,48),5,9,5),y.addMany(b(48,64),5,0,6),y.addMany(b(64,127),5,7,0),y.addMany(b(32,48),4,9,5),y.addMany(b(32,48),1,9,2),y.addMany(b(32,48),2,9,2),y.addMany(b(48,127),2,10,0),y.addMany(b(48,80),1,10,0),y.addMany(b(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(b(96,127),1,10,0),y.add(80,1,11,9),y.addMany(k,9,0,9),y.add(127,9,0,9),y.addMany(b(28,32),9,0,9),y.addMany(b(32,48),9,9,12),y.addMany(b(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(k,11,0,11),y.addMany(b(32,128),11,0,11),y.addMany(b(28,32),11,0,11),y.addMany(k,10,0,10),y.add(127,10,0,10),y.addMany(b(28,32),10,0,10),y.addMany(b(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(b(32,48),10,9,12),y.addMany(k,12,0,12),y.add(127,12,0,12),y.addMany(b(28,32),12,0,12),y.addMany(b(32,48),12,9,12),y.addMany(b(48,64),12,0,11),y.addMany(b(64,127),12,12,13),y.addMany(b(64,127),10,12,13),y.addMany(b(64,127),9,12,13),y.addMany(k,13,13,13),y.addMany(_,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(w,0,2,0),y.add(w,8,5,8),y.add(w,6,0,6),y.add(w,11,0,11),y.add(w,13,13,13),y})();class C extends d.Disposable{constructor(S=a.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(b,_,k)=>{},this._executeHandlerFb=b=>{},this._csiHandlerFb=(b,_)=>{},this._escHandlerFb=b=>{},this._errorHandlerFb=b=>b,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new p.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,b=[64,126]){let _=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=S.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let j=0;j<S.intermediates.length;++j){const N=S.intermediates.charCodeAt(j);if(32>N||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=N}}if(S.final.length!==1)throw new Error("final must be a single byte");const k=S.final.charCodeAt(0);if(b[0]>k||k>b[1])throw new Error(`final must be in range ${b[0]} .. ${b[1]}`);return _<<=8,_|=k,_}identToString(S){const b=[];for(;S;)b.push(String.fromCharCode(255&S)),S>>=8;return b.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,b){const _=this._identifier(S,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const k=this._escHandlers[_];return k.push(b),{dispose:()=>{const j=k.indexOf(b);j!==-1&&k.splice(j,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,b){this._executeHandlers[S.charCodeAt(0)]=b}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,b){const _=this._identifier(S);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const k=this._csiHandlers[_];return k.push(b),{dispose:()=>{const j=k.indexOf(b);j!==-1&&k.splice(j,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,b){return this._dcsParser.registerHandler(this._identifier(S),b)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,b){return this._oscParser.registerHandler(S,b)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}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(S,b,_,k,j){this._parseStack.state=S,this._parseStack.handlers=b,this._parseStack.handlerPos=_,this._parseStack.transition=k,this._parseStack.chunkPos=j}parse(S,b,_){let k,j=0,N=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(_===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const E=this._parseStack.handlers;let O=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&O>-1){for(;O>=0&&(k=E[O](this._params),k!==!0);O--)if(k instanceof Promise)return this._parseStack.handlerPos=O,k}this._parseStack.handlers=[];break;case 4:if(_===!1&&O>-1){for(;O>=0&&(k=E[O](),k!==!0);O--)if(k instanceof Promise)return this._parseStack.handlerPos=O,k}this._parseStack.handlers=[];break;case 6:if(j=S[this._parseStack.chunkPos],k=this._dcsParser.unhook(j!==24&&j!==26,_),k)return k;j===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(j=S[this._parseStack.chunkPos],k=this._oscParser.end(j!==24&&j!==26,_),k)return k;j===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=D;E<b;++E){switch(j=S[E],N=this._transitions.table[this.currentState<<8|(j<160?j:w)],N>>4){case 2:for(let $=E+1;;++$){if($>=b||(j=S[$])<32||j>126&&j<w){this._printHandler(S,E,$),E=$-1;break}if(++$>=b||(j=S[$])<32||j>126&&j<w){this._printHandler(S,E,$),E=$-1;break}if(++$>=b||(j=S[$])<32||j>126&&j<w){this._printHandler(S,E,$),E=$-1;break}if(++$>=b||(j=S[$])<32||j>126&&j<w){this._printHandler(S,E,$),E=$-1;break}}break;case 3:this._executeHandlers[j]?this._executeHandlers[j]():this._executeHandlerFb(j),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:j,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const O=this._csiHandlers[this._collect<<8|j];let L=O?O.length-1:-1;for(;L>=0&&(k=O[L](this._params),k!==!0);L--)if(k instanceof Promise)return this._preserveStack(3,O,L,N,E),k;L<0&&this._csiHandlerFb(this._collect<<8|j,this._params),this.precedingJoinState=0;break;case 8:do switch(j){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(j-48)}while(++E<b&&(j=S[E])>47&&j<60);E--;break;case 9:this._collect<<=8,this._collect|=j;break;case 10:const z=this._escHandlers[this._collect<<8|j];let H=z?z.length-1:-1;for(;H>=0&&(k=z[H](),k!==!0);H--)if(k instanceof Promise)return this._preserveStack(4,z,H,N,E),k;H<0&&this._escHandlerFb(this._collect<<8|j),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|j,this._params);break;case 13:for(let $=E+1;;++$)if($>=b||(j=S[$])===24||j===26||j===27||j>127&&j<w){this._dcsParser.put(S,E,$),E=$-1;break}break;case 14:if(k=this._dcsParser.unhook(j!==24&&j!==26),k)return this._preserveStack(6,[],0,N,E),k;j===27&&(N|=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 $=E+1;;$++)if($>=b||(j=S[$])<32||j>127&&j<w){this._oscParser.put(S,E,$),E=$-1;break}break;case 6:if(k=this._oscParser.end(j!==24&&j!==26),k)return this._preserveStack(5,[],0,N,E),k;j===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&N}}}a.EscapeSequenceParser=C},6242:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const d=u(5770),m=u(482),p=[];a.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,x){this._handlers[g]===void 0&&(this._handlers[g]=[]);const w=this._handlers[g];return w.push(x),{dispose:()=>{const C=w.indexOf(x);C!==-1&&w.splice(C,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,x,w){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(g,x,w);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,x,w))}start(){this.reset(),this._state=1}put(g,x,w){if(this._state!==3){if(this._state===1)for(;x<w;){const C=g[x++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&w-x>0&&this._put(g,x,w)}}end(g,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,C=this._active.length-1,y=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,w=x,y=this._stack.fallThrough,this._stack.paused=!1),!y&&w===!1){for(;C>=0&&(w=this._active[C].end(g),w!==!0);C--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,w;C--}for(;C>=0;C--)if(w=this._active[C].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",g);this._active=p,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,x,w){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,x,w),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let x=!1;if(this._hitLimit)x=!1;else if(g&&(x=this._handler(this._data),x instanceof Promise))return x.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,x}}},8742:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const u=2147483647;class d{static fromArray(p){const g=new d;if(!p.length)return g;for(let x=Array.isArray(p[0])?1:0;x<p.length;++x){const w=p[x];if(Array.isArray(w))for(let C=0;C<w.length;++C)g.addSubParam(w[C]);else g.addParam(w)}return g}constructor(p=32,g=32){if(this.maxLength=p,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new d(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let g=0;g<this.length;++g){p.push(this.params[g]);const x=this._subParamsIdx[g]>>8,w=255&this._subParamsIdx[g];w-x>0&&p.push(Array.prototype.slice.call(this._subParams,x,w))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>u?u:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>u?u:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const g=this._subParamsIdx[p]>>8,x=255&this._subParamsIdx[p];return x-g>0?this._subParams.subarray(g,x):null}getSubParamsAll(){const p={};for(let g=0;g<this.length;++g){const x=this._subParamsIdx[g]>>8,w=255&this._subParamsIdx[g];w-x>0&&(p[g]=this._subParams.slice(x,w))}return p}addDigit(p){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,w=x[g-1];x[g-1]=~w?Math.min(10*w+p,u):p}}a.Params=d},5741:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const m={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(m),d.dispose=()=>this._wrappedAddonDispose(m),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===u){d=m;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const d=u(3785),m=u(511);a.BufferApiView=class{constructor(p,g){this._buffer=p,this.type=g}init(p){return this._buffer=p,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(p){const g=this._buffer.lines.get(p);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const d=u(511);a.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,p){if(!(m<0||m>=this._line.length))return p?(this._line.loadCell(m,p),p):this._line.loadCell(m,new d.CellData)}translateToString(m,p,g){return this._line.translateToString(m,p,g)}}},8285:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const d=u(8771),m=u(8460),p=u(844);class g extends p.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=g},7975:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(m=>d(m.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((m,p)=>d(m,p.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(c,a,u){var d=this&&this.__decorate||function(y,S,b,_){var k,j=arguments.length,N=j<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,b):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,S,b,_);else for(var D=y.length-1;D>=0;D--)(k=y[D])&&(N=(j<3?k(N):j>3?k(S,b,N):k(S,b))||N);return j>3&&N&&Object.defineProperty(S,b,N),N},m=this&&this.__param||function(y,S){return function(b,_){S(b,_,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const p=u(8460),g=u(844),x=u(5295),w=u(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let C=a.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(y,this))}resize(y,S){this.cols=y,this.rows=S,this.buffers.resize(y,S),this._onResize.fire({cols:y,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,S=!1){const b=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===y.fg&&_.getBg(0)===y.bg||(_=b.getBlankLine(y,S),this._cachedBlankLine=_),_.isWrapped=S;const k=b.ybase+b.scrollTop,j=b.ybase+b.scrollBottom;if(b.scrollTop===0){const N=b.lines.isFull;j===b.lines.length-1?N?b.lines.recycle().copyFrom(_):b.lines.push(_.clone()):b.lines.splice(j+1,0,_.clone()),N?this.isUserScrolling&&(b.ydisp=Math.max(b.ydisp-1,0)):(b.ybase++,this.isUserScrolling||b.ydisp++)}else{const N=j-k+1;b.lines.shiftElements(k+1,N-1,-1),b.lines.set(j,_.clone())}this.isUserScrolling||(b.ydisp=b.ybase),this._onScroll.fire(b.ydisp)}scrollLines(y,S,b){const _=this.buffer;if(y<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else y+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const k=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+y,_.ybase),0),k!==_.ydisp&&(S||this._onScroll.fire(_.ydisp))}};a.BufferService=C=d([m(0,w.IOptionsService)],C)},7994:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(c,a,u){var d=this&&this.__decorate||function(_,k,j,N){var D,E=arguments.length,O=E<3?k:N===null?N=Object.getOwnPropertyDescriptor(k,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(_,k,j,N);else for(var L=_.length-1;L>=0;L--)(D=_[L])&&(O=(E<3?D(O):E>3?D(k,j,O):D(k,j))||O);return E>3&&O&&Object.defineProperty(k,j,O),O},m=this&&this.__param||function(_,k){return function(j,N){k(j,N,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const p=u(2585),g=u(8460),x=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:_=>_.button!==4&&_.action===1&&(_.ctrl=!1,_.alt=!1,_.shift=!1,!0)},VT200:{events:19,restrict:_=>_.action!==32},DRAG:{events:23,restrict:_=>_.action!==32||_.button!==3},ANY:{events:31,restrict:_=>!0}};function C(_,k){let j=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(j|=64,j|=_.action):(j|=3&_.button,4&_.button&&(j|=64),8&_.button&&(j|=128),_.action===32?j|=32:_.action!==0||k||(j|=3)),j}const y=String.fromCharCode,S={DEFAULT:_=>{const k=[C(_,!1)+32,_.col+32,_.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${y(k[0])}${y(k[1])}${y(k[2])}`},SGR:_=>{const k=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${C(_,!0)};${_.col};${_.row}${k}`},SGR_PIXELS:_=>{const k=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${C(_,!0)};${_.x};${_.y}${k}`}};let b=a.CoreMouseService=class extends x.Disposable{constructor(_,k){super(),this._bufferService=_,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const j of Object.keys(w))this.addProtocol(j,w[j]);for(const j of Object.keys(S))this.addEncoding(j,S[j]);this.reset()}addProtocol(_,k){this._protocols[_]=k}addEncoding(_,k){this._encodings[_]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(_){if(!this._protocols[_])throw new Error(`unknown protocol "${_}"`);this._activeProtocol=_,this._onProtocolChange.fire(this._protocols[_].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(_){if(!this._encodings[_])throw new Error(`unknown encoding "${_}"`);this._activeEncoding=_}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(_){if(_.col<0||_.col>=this._bufferService.cols||_.row<0||_.row>=this._bufferService.rows||_.button===4&&_.action===32||_.button===3&&_.action!==32||_.button!==4&&(_.action===2||_.action===3)||(_.col++,_.row++,_.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,_,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(_))return!1;const k=this._encodings[this._activeEncoding](_);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,k,j){if(j){if(_.x!==k.x||_.y!==k.y)return!1}else if(_.col!==k.col||_.row!==k.row)return!1;return _.button===k.button&&_.action===k.action&&_.ctrl===k.ctrl&&_.alt===k.alt&&_.shift===k.shift}};a.CoreMouseService=b=d([m(0,p.IBufferService),m(1,p.ICoreService)],b)},6975:function(c,a,u){var d=this&&this.__decorate||function(b,_,k,j){var N,D=arguments.length,E=D<3?_:j===null?j=Object.getOwnPropertyDescriptor(_,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,_,k,j);else for(var O=b.length-1;O>=0;O--)(N=b[O])&&(E=(D<3?N(E):D>3?N(_,k,E):N(_,k))||E);return D>3&&E&&Object.defineProperty(_,k,E),E},m=this&&this.__param||function(b,_){return function(k,j){_(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const p=u(1439),g=u(8460),x=u(844),w=u(2585),C=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=a.CoreService=class extends x.Disposable{constructor(b,_,k){super(),this._bufferService=b,this._logService=_,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(C),this.decPrivateModes=(0,p.clone)(y)}reset(){this.modes=(0,p.clone)(C),this.decPrivateModes=(0,p.clone)(y)}triggerDataEvent(b,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${b}"`,(()=>b.split("").map((j=>j.charCodeAt(0))))),this._onData.fire(b)}triggerBinaryEvent(b){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${b}"`,(()=>b.split("").map((_=>_.charCodeAt(0))))),this._onBinary.fire(b))}};a.CoreService=S=d([m(0,w.IBufferService),m(1,w.ILogService),m(2,w.IOptionsService)],S)},9074:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const d=u(8055),m=u(8460),p=u(844),g=u(6106);let x=0,w=0;class C extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((b=>b==null?void 0:b.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)((()=>this.reset())))}registerDecoration(b){if(b.marker.isDisposed)return;const _=new y(b);if(_){const k=_.marker.onDispose((()=>_.dispose()));_.onDispose((()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),k.dispose())})),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const b of this._decorations.values())b.dispose();this._decorations.clear()}*getDecorationsAtCell(b,_,k){var D,E,O;let j=0,N=0;for(const L of this._decorations.getKeyIterator(_))j=(D=L.options.x)!=null?D:0,N=j+((E=L.options.width)!=null?E:1),b>=j&&b<N&&(!k||((O=L.options.layer)!=null?O:"bottom")===k)&&(yield L)}forEachDecorationAtCell(b,_,k,j){this._decorations.forEachByKey(_,(N=>{var D,E,O;x=(D=N.options.x)!=null?D:0,w=x+((E=N.options.width)!=null?E:1),b>=x&&b<w&&(!k||((O=N.options.layer)!=null?O:"bottom")===k)&&j(N)}))}}a.DecorationService=C;class y extends p.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(b){super(),this.options=b,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=b.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const d=u(2585),m=u(8343);class p{constructor(...x){this._entries=new Map;for(const[w,C]of x)this.set(w,C)}set(x,w){const C=this._entries.get(x);return this._entries.set(x,w),C}forEach(x){for(const[w,C]of this._entries.entries())x(w,C)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}a.ServiceCollection=p,a.InstantiationService=class{constructor(){this._services=new p,this._services.set(d.IInstantiationService,this)}setService(g,x){this._services.set(g,x)}getService(g){return this._services.get(g)}createInstance(g,...x){const w=(0,m.getServiceDependencies)(g).sort(((S,b)=>S.index-b.index)),C=[];for(const S of w){const b=this._services.get(S.id);if(!b)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${S.id}.`);C.push(b)}const y=w.length>0?w[0].index:x.length;if(x.length!==y)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${y+1} conflicts with ${x.length} static arguments`);return new g(...x,...C)}}},7866:function(c,a,u){var d=this&&this.__decorate||function(y,S,b,_){var k,j=arguments.length,N=j<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,b):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,S,b,_);else for(var D=y.length-1;D>=0;D--)(k=y[D])&&(N=(j<3?k(N):j>3?k(S,b,N):k(S,b))||N);return j>3&&N&&Object.defineProperty(S,b,N),N},m=this&&this.__param||function(y,S){return function(b,_){S(b,_,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const p=u(844),g=u(2585),x={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let w,C=a.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let S=0;S<y.length;S++)typeof y[S]=="function"&&(y[S]=y[S]())}_log(y,S,b){this._evalLazyOptionalParams(b),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...b)}trace(y,...S){var b,_;this._logLevel<=g.LogLevelEnum.TRACE&&this._log((_=(b=this._optionsService.options.logger)==null?void 0:b.trace.bind(this._optionsService.options.logger))!=null?_:console.log,y,S)}debug(y,...S){var b,_;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log((_=(b=this._optionsService.options.logger)==null?void 0:b.debug.bind(this._optionsService.options.logger))!=null?_:console.log,y,S)}info(y,...S){var b,_;this._logLevel<=g.LogLevelEnum.INFO&&this._log((_=(b=this._optionsService.options.logger)==null?void 0:b.info.bind(this._optionsService.options.logger))!=null?_:console.info,y,S)}warn(y,...S){var b,_;this._logLevel<=g.LogLevelEnum.WARN&&this._log((_=(b=this._optionsService.options.logger)==null?void 0:b.warn.bind(this._optionsService.options.logger))!=null?_:console.warn,y,S)}error(y,...S){var b,_;this._logLevel<=g.LogLevelEnum.ERROR&&this._log((_=(b=this._optionsService.options.logger)==null?void 0:b.error.bind(this._optionsService.options.logger))!=null?_:console.error,y,S)}};a.LogService=C=d([m(0,g.IOptionsService)],C),a.setTraceLogger=function(y){w=y},a.traceCall=function(y,S,b){if(typeof b.value!="function")throw new Error("not supported");const _=b.value;b.value=function(...k){if(w.logLevel!==g.LogLevelEnum.TRACE)return _.apply(this,k);w.trace(`GlyphRenderer#${_.name}(${k.map((N=>JSON.stringify(N))).join(", ")})`);const j=_.apply(this,k);return w.trace(`GlyphRenderer#${_.name} return`,j),j}}},7302:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const d=u(8460),m=u(844),p=u(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends m.Disposable{constructor(C){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...a.DEFAULT_OPTIONS};for(const S in C)if(S in y)try{const b=C[S];y[S]=this._sanitizeAndValidateOption(S,b)}catch(b){console.error(b)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(C,y){return this.onOptionChange((S=>{S===C&&y(this.rawOptions[C])}))}onMultipleOptionChange(C,y){return this.onOptionChange((S=>{C.indexOf(S)!==-1&&y()}))}_setupOptions(){const C=S=>{if(!(S in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},y=(S,b)=>{if(!(S in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);b=this._sanitizeAndValidateOption(S,b),this.rawOptions[S]!==b&&(this.rawOptions[S]=b,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const b={get:C.bind(this,S),set:y.bind(this,S)};Object.defineProperty(this.options,S,b)}}_sanitizeAndValidateOption(C,y){switch(C){case"cursorStyle":if(y||(y=a.DEFAULT_OPTIONS[C]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${C}`);break;case"wordSeparator":y||(y=a.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=g.includes(y)?y:a.DEFAULT_OPTIONS[C];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${C} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${C} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${C} must be numeric, value: ${y}`);break;case"windowsPty":y=y!=null?y:{}}return y}}a.OptionsService=x},2660:function(c,a,u){var d=this&&this.__decorate||function(x,w,C,y){var S,b=arguments.length,_=b<3?w:y===null?y=Object.getOwnPropertyDescriptor(w,C):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(x,w,C,y);else for(var k=x.length-1;k>=0;k--)(S=x[k])&&(_=(b<3?S(_):b>3?S(w,C,_):S(w,C))||_);return b>3&&_&&Object.defineProperty(w,C,_),_},m=this&&this.__param||function(x,w){return function(C,y){w(C,y,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const p=u(2585);let g=a.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const w=this._bufferService.buffer;if(x.id===void 0){const k=w.addMarker(w.ybase+w.y),j={data:x,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(j,k))),this._dataByLinkId.set(j.id,j),j.id}const C=x,y=this._getEntryIdKey(C),S=this._entriesWithId.get(y);if(S)return this.addLineToLink(S.id,w.ybase+w.y),S.id;const b=w.addMarker(w.ybase+w.y),_={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[b]};return b.onDispose((()=>this._removeMarkerFromLink(_,b))),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(x,w){const C=this._dataByLinkId.get(x);if(C&&C.lines.every((y=>y.line!==w))){const y=this._bufferService.buffer.addMarker(w);C.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(C,y)))}}getLinkData(x){var w;return(w=this._dataByLinkId.get(x))==null?void 0:w.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,w){const C=x.lines.indexOf(w);C!==-1&&(x.lines.splice(C,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};a.OscLinkService=g=d([m(0,p.IBufferService)],g)},8343:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const u="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(m){return m[d]||[]},a.createDecorator=function(m){if(a.serviceRegistry.has(m))return a.serviceRegistry.get(m);const p=function(g,x,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,y,S){y[u]===y?y[d].push({id:C,index:S}):(y[d]=[{id:C,index:S}],y[u]=y)})(p,g,w)};return p.toString=()=>m,a.serviceRegistry.set(m,p),p}},2585:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const d=u(8343);var m;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"})(m||(a.LogLevelEnum=m={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=u(8460),m=u(225);class p{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,w,C=!1){return(16777215&x)<<3|(3&w)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new m.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let w=0,C=0;const y=x.length;for(let S=0;S<y;++S){let b=x.charCodeAt(S);if(55296<=b&&b<=56319){if(++S>=y)return w+this.wcwidth(b);const j=x.charCodeAt(S);56320<=j&&j<=57343?b=1024*(b-55296)+j-56320+65536:w+=this.wcwidth(j)}const _=this.charProperties(b,C);let k=p.extractWidth(_);p.extractShouldJoin(_)&&(k-=p.extractWidth(C)),w+=k,C=_}return w}charProperties(x,w){return this._activeProvider.charProperties(x,w)}}a.UnicodeService=p}},r={};function i(c){var a=r[c];if(a!==void 0)return a.exports;var u=r[c]={exports:{}};return n[c].call(u.exports,u,u.exports,i),u.exports}var l={};return(()=>{var c=l;Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const a=i(9042),u=i(3236),d=i(844),m=i(5741),p=i(8285),g=i(7975),x=i(7090),w=["cols","rows"];class C extends d.Disposable{constructor(S){super(),this._core=this.register(new u.Terminal(S)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const b=k=>this._core.options[k],_=(k,j)=>{this._checkReadonlyOptions(k),this._core.options[k]=j};for(const k in this._core.options){const j={get:b.bind(this,k),set:_.bind(this,k)};Object.defineProperty(this._publicOptions,k,j)}}_checkReadonlyOptions(S){if(w.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let b="none";switch(this._core.coreMouseService.activeProtocol){case"X10":b="x10";break;case"VT200":b="vt200";break;case"DRAG":b="drag";break;case"ANY":b="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:b,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const b in S)this._publicOptions[b]=S[b]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,b=!0){this._core.input(S,b)}resize(S,b){this._verifyIntegers(S,b),this._core.resize(S,b)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){var b,_,k;return this._checkProposedApi(),this._verifyPositiveIntegers((b=S.x)!=null?b:0,(_=S.width)!=null?_:0,(k=S.height)!=null?k:0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,b,_){this._verifyIntegers(S,b,_),this._core.select(S,b,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,b){this._verifyIntegers(S,b),this._core.selectLines(S,b)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,b){this._core.write(S,b)}writeln(S,b){this._core.write(S),this._core.write(`\r
|
|
620
|
-
`,b)}paste(S){this._core.paste(S)}refresh(S,b){this._verifyIntegers(S,b),this._core.refresh(S,b)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return a}_verifyIntegers(...S){for(const b of S)if(b===1/0||isNaN(b)||b%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const b of S)if(b&&(b===1/0||isNaN(b)||b%1!=0||b<0))throw new Error("This API only accepts positive integers")}}c.Terminal=C})(),l})()))})(Qm)),Qm.exports}var j$=R$(),Zm={exports:{}},G_;function T$(){return G_||(G_=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const l=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(l._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,l=i._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),p=u-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=d-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(g/l.css.cell.width)),rows:Math.max(1,Math.floor(p/l.css.cell.height))}}}})(),n})()))})(Zm)),Zm.exports}var D$=T$(),Jm={exports:{}},K_;function M$(){return K_||(K_=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={6:(c,a)=>{function u(m){try{const p=new URL(m),g=p.password&&p.username?`${p.protocol}//${p.username}:${p.password}@${p.host}`:p.username?`${p.protocol}//${p.username}@${p.host}`:`${p.protocol}//${p.host}`;return m.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(m,p,g,x={}){this._terminal=m,this._regex=p,this._handler=g,this._options=x}provideLinks(m,p){const g=d.computeLink(m,this._regex,this._terminal,this._handler);p(this._addCallbacks(g))}_addCallbacks(m){return m.map((p=>(p.leave=this._options.leave,p.hover=(g,x)=>{if(this._options.hover){const{range:w}=p;this._options.hover(g,x,w)}},p)))}};class d{static computeLink(p,g,x,w){const C=new RegExp(g.source,(g.flags||"")+"g"),[y,S]=d._getWindowedLineStrings(p-1,x),b=y.join("");let _;const k=[];for(;_=C.exec(b);){const j=_[0];if(!u(j))continue;const[N,D]=d._mapStrIdx(x,S,0,_.index),[E,O]=d._mapStrIdx(x,N,D,j.length);if(N===-1||D===-1||E===-1||O===-1)continue;const L={start:{x:D+1,y:N+1},end:{x:O,y:E+1}};k.push({range:L,text:j,activate:w})}return k}static _getWindowedLineStrings(p,g){let x,w=p,C=p,y=0,S="";const b=[];if(x=g.buffer.active.getLine(p)){const _=x.translateToString(!0);if(x.isWrapped&&_[0]!==" "){for(y=0;(x=g.buffer.active.getLine(--w))&&y<2048&&(S=x.translateToString(!0),y+=S.length,b.push(S),x.isWrapped&&S.indexOf(" ")===-1););b.reverse()}for(b.push(_),y=0;(x=g.buffer.active.getLine(++C))&&x.isWrapped&&y<2048&&(S=x.translateToString(!0),y+=S.length,b.push(S),S.indexOf(" ")===-1););}return[b,w]}static _mapStrIdx(p,g,x,w){const C=p.buffer.active,y=C.getNullCell();let S=x;for(;w;){const b=C.getLine(g);if(!b)return[-1,-1];for(let _=S;_<b.length;++_){b.getCell(_,y);const k=y.getChars();if(y.getWidth()&&(w-=k.length||1,_===b.length-1&&k==="")){const j=C.getLine(g+1);j&&j.isWrapped&&(j.getCell(0,y),y.getWidth()===2&&(w+=1))}if(w<0)return[g,_]}g++,S=0}return[g,S]}}a.LinkComputer=d}},r={};function i(c){var a=r[c];if(a!==void 0)return a.exports;var u=r[c]={exports:{}};return n[c](u,u.exports,i),u.exports}var l={};return(()=>{var c=l;Object.defineProperty(c,"__esModule",{value:!0}),c.WebLinksAddon=void 0;const a=i(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(m,p){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}c.WebLinksAddon=class{constructor(m=d,p={}){this._handler=m,this._options=p}activate(m){this._terminal=m;const p=this._options,g=p.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,g,this._handler,p))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),l})()))})(Jm)),Jm.exports}var O$=M$();const Oi={INPUT:1,RESIZE:2,CLOSE:3,OUTPUT:4,EXIT:5,ERROR:6,INIT_ACK:7,TITLE:8};function eg(t,e){const n=new Uint8Array(1+e.length);return n[0]=t,n.set(e,1),n}function L$(){const t=new Map;return{get(e){return t.get(e)},set(e,n){t.set(e,n)},delete(e){t.delete(e)},has(e){return t.has(e)},clear(){t.clear()},dispose(e){const n=t.get(e);n&&(n.terminal.dispose(),t.delete(e))},disposeAll(){for(const e of t.values())e.terminal.dispose();t.clear()}}}function I$(t){const e=new j$.Terminal({cursorBlink:!0,cursorStyle:"bar",fontSize:13,fontFamily:"'Menlo', 'Monaco', 'Courier New', monospace",scrollback:1e3,allowProposedApi:!0,theme:{background:"var(--background)",foreground:"var(--foreground)",cursor:"var(--foreground)",selectionBackground:"var(--accent)"}}),n=new D$.FitAddon,r=new O$.WebLinksAddon;return e.loadAddon(n),e.loadAddon(r),{terminal:e,fitAddon:n}}function P$(t,e){const n=he.c(21),{serverUrl:r,apiToken:i,cwd:l}=e,c=R.useRef(null),a=R.useRef("disconnected"),u=R.useRef(!1),d=R.useRef(0),m=R.useRef(e.onOutput),p=R.useRef(e.onStatusChange),g=R.useRef(e.onExit),x=R.useRef(e.onSessionInit),w=R.useRef(e.onTitleChange),C=R.useRef(r),y=R.useRef(i),S=R.useRef(l),b=R.useRef(e.serverSessionId),_=R.useRef(e.terminal);let k;n[0]!==e.onExit||n[1]!==e.onOutput||n[2]!==e.onSessionInit||n[3]!==e.onStatusChange||n[4]!==e.onTitleChange?(k=()=>{m.current=e.onOutput,p.current=e.onStatusChange,g.current=e.onExit,x.current=e.onSessionInit,w.current=e.onTitleChange},n[0]=e.onExit,n[1]=e.onOutput,n[2]=e.onSessionInit,n[3]=e.onStatusChange,n[4]=e.onTitleChange,n[5]=k):k=n[5],R.useEffect(k);let j,N;n[6]!==i||n[7]!==l||n[8]!==e.serverSessionId||n[9]!==e.terminal||n[10]!==r?(j=()=>{C.current=r,y.current=i,S.current=l,b.current=e.serverSessionId,_.current=e.terminal},N=[r,i,l,e.serverSessionId,e.terminal],n[6]=i,n[7]=l,n[8]=e.serverSessionId,n[9]=e.terminal,n[10]=r,n[11]=j,n[12]=N):(j=n[11],N=n[12]),R.useEffect(j,N);let D;n[13]===Symbol.for("react.memo_cache_sentinel")?(D=Y=>{var I;a.current=Y,(I=p.current)==null||I.call(p,Y)},n[13]=D):D=n[13];const E=D;let O;n[14]===Symbol.for("react.memo_cache_sentinel")?(O=Y=>{const I=d.current=d.current+1,M=c.current;M&&(M.onopen=null,M.onclose=null,M.onmessage=null,M.onerror=null,M.close(),c.current=null),Y&&_.current&&_.current.clear(),E("connecting");const P=Y?Gd(C.current,`/ws/terminal?token=${y.current}&cwd=${encodeURIComponent(S.current)}&sessionId=${Y}`):Gd(C.current,`/ws/terminal?token=${y.current}&cwd=${encodeURIComponent(S.current)}`),B=new WebSocket(P);B.binaryType="arraybuffer",B.onopen=()=>{if(d.current!==I){B.close();return}c.current=B},B.onmessage=F=>{var K,V,te,re,ae,se;if(d.current!==I||!(F.data instanceof ArrayBuffer))return;const Q=new Uint8Array(F.data);if(Q.length<1)return;const J=Q[0],ee=Q.slice(1);e:switch(J){case Oi.OUTPUT:{(K=m.current)==null||K.call(m,new TextDecoder().decode(ee));break e}case Oi.EXIT:{const{exitCode:Se}=JSON.parse(new TextDecoder().decode(ee));E("exited"),(V=g.current)==null||V.call(g,Se),B.close();break e}case Oi.ERROR:{const{message:Se}=JSON.parse(new TextDecoder().decode(ee));console.error("[useTerminal] Server error:",Se),E("disconnected");break e}case Oi.INIT_ACK:{const Se=JSON.parse(new TextDecoder().decode(ee));(te=x.current)==null||te.call(x,Se),Se.isReconnect&&Se.status==="exited"?(E("exited"),(re=g.current)==null||re.call(g,Se.exitCode)):Se.isReconnect&&Se.inAlternateScreen?(E("connected"),(ae=m.current)==null||ae.call(m,`\r
|
|
621
|
-
\x1B[33m[Reconnected — a full-screen application is running. Press Ctrl+C to exit it.]\x1B[0m\r
|
|
622
|
-
`)):E("connected");break e}case Oi.TITLE:{const{title:Se}=JSON.parse(new TextDecoder().decode(ee));(se=w.current)==null||se.call(w,Se)}}},B.onclose=()=>{d.current===I&&(c.current=null,(a.current==="connecting"||a.current==="connected")&&E("disconnected"))},B.onerror=z$},n[14]=O):O=n[14];const L=O;let z,H;n[15]!==t?(z=()=>{if(!t)return;u.current=!1;const Y=t.onData(M=>{const P=c.current;if(!P||P.readyState!==WebSocket.OPEN)return;const B=new TextEncoder().encode(M);P.send(eg(Oi.INPUT,B))}),I=t.onResize(M=>{const{cols:P,rows:B}=M,F=c.current;if(!F||F.readyState!==WebSocket.OPEN)return;const Q=new TextEncoder().encode(JSON.stringify({cols:P,rows:B}));F.send(eg(Oi.RESIZE,Q))});return()=>{Y.dispose(),I.dispose(),u.current=!0;const M=c.current;M&&(M.onopen=null,M.onclose=null,M.onmessage=null,M.onerror=null,M.close(),c.current=null)}},H=[t],n[15]=t,n[16]=z,n[17]=H):(z=n[16],H=n[17]),R.useEffect(z,H);let $;n[18]===Symbol.for("react.memo_cache_sentinel")?($=()=>{const Y=c.current;Y&&(Y.onopen=null,Y.onclose=null,Y.onmessage=null,Y.onerror=null,Y.close(),c.current=null)},n[18]=$):$=n[18];const q=$;let G;n[19]===Symbol.for("react.memo_cache_sentinel")?(G=()=>{const Y=c.current;if(Y){try{Y.send(eg(Oi.CLOSE,new Uint8Array(0)))}catch{}Y.close(),c.current=null}u.current=!0},n[19]=G):G=n[19];const W=G;let X;return n[20]===Symbol.for("react.memo_cache_sentinel")?(X={connect:L,disconnect:q,destroy:W},n[20]=X):X=n[20],X}function z$(){}function B$(){const t=he.c(2),[e,n]=R.useState(F$);let r,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=window.visualViewport;if(!l)return;const c=()=>{n({height:l.height,offsetTop:l.offsetTop,scale:l.scale})};return c(),l.addEventListener("resize",c),l.addEventListener("scroll",c),()=>{l.removeEventListener("resize",c),l.removeEventListener("scroll",c)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),R.useEffect(r,i),e}function F$(){return{height:typeof window<"u"?window.innerHeight:0,offsetTop:0,scale:1}}const H$=300,$$=200,U$=.7,V$=R.forwardRef(function({workspaceId:e,workspacePath:n,workspaceName:r,serverUrl:i,apiToken:l,isOpen:c,onClose:a},u){var Ae,De,Ue;const d=ol(),m=B$(),[p,g]=R.useState([]),[x,w]=R.useState(null),[C,y]=R.useState(H$),S=R.useRef(!1),b=R.useRef(0),_=R.useRef(0),k=R.useRef(L$()),j=R.useRef(null),N=R.useRef(null),D=R.useRef([]),E=R.useRef(()=>{}),O=R.useRef(!1),L=R.useRef(void 0),z=R.useRef(new Set),H=R.useRef(()=>{});R.useEffect(()=>{D.current=p},[p]);const $=R.useCallback(ce=>{switch(ce.type){case"snapshot":{const je=z.current;if(g(ce.sessions.map(xe=>({serverSessionId:xe.id,title:xe.title,status:xe.status==="exited"?"exited":"disconnected",cwd:xe.cwd,shell:xe.shell}))),ce.sessions.length>0?w(xe=>xe&&ce.sessions.some(Ve=>Ve.id===xe)?xe:ce.sessions[0].id):(w(null),O.current||(O.current=!0,H.current())),je.size>0){const xe=new Set(ce.sessions.map(We=>We.id)),Ve=[...je].filter(We=>!xe.has(We));for(const We of Ve)H.current()}break}case"created":{g(je=>je.some(xe=>xe.serverSessionId===ce.session.id)?je:[...je,{serverSessionId:ce.session.id,title:ce.session.title,status:"disconnected",cwd:ce.session.cwd,shell:ce.session.shell}]),w(ce.session.id);break}case"destroyed":{g(je=>je.filter(xe=>xe.serverSessionId!==ce.sessionId)),k.current.dispose(ce.sessionId),w(je=>{if(je!==ce.sessionId)return je;const xe=D.current.filter(Ve=>Ve.serverSessionId!==ce.sessionId);return xe.length>0?xe[0].serverSessionId:null});break}case"exited":{g(je=>je.map(xe=>xe.serverSessionId===ce.sessionId?{...xe,status:"exited"}:xe));break}case"title_changed":{g(je=>je.map(xe=>xe.serverSessionId===ce.sessionId?{...xe,title:ce.title}:xe));break}case"status_changed":{g(je=>je.map(xe=>xe.serverSessionId===ce.sessionId?{...xe,status:ce.status==="exited"?"exited":"connected"}:xe));break}}},[]);R.useEffect(()=>{E.current=$},[$]),R.useEffect(()=>{if(!e||!c||!i||!l){g([]),w(null),z.current=new Set,O.current=!1,j.current&&(j.current.disconnect(),j.current=null),I(null),k.current.disposeAll();const xe=N.current;xe&&(xe.onopen=null,xe.onclose=null,xe.onmessage=null,xe.onerror=null,xe.close(),N.current=null);return}j.current&&(j.current.disconnect(),j.current=null),I(null),k.current.disposeAll(),z.current=new Set(D.current.map(xe=>xe.serverSessionId));const ce=Gd(i,`/ws/terminal/events?token=${l}&workspaceId=${encodeURIComponent(e)}`),je=new WebSocket(ce);return N.current=je,je.onmessage=xe=>{try{const Ve=JSON.parse(xe.data);E.current(Ve)}catch(Ve){console.error("[TerminalPanel] Failed to parse event:",Ve)}},()=>{const xe=N.current;xe&&(xe.onopen=null,xe.onclose=null,xe.onmessage=null,xe.onerror=null,xe.close(),N.current=null)}},[e,c,i,l]);const q=R.useCallback(ce=>je=>{const xe=k.current.get(ce);xe==null||xe.terminal.write(je)},[]),G=R.useCallback(ce=>je=>{g(xe=>xe.map(Ve=>Ve.serverSessionId===ce?{...Ve,status:je}:Ve))},[]),W=R.useCallback(ce=>je=>{const xe=k.current.get(ce);xe&&(xe.serverSessionId=je.sessionId),g(Ve=>Ve.map(We=>We.serverSessionId===ce?{...We,title:je.title||We.title}:We))},[]),X=R.useCallback(ce=>je=>{g(xe=>xe.map(Ve=>Ve.serverSessionId===ce?{...Ve,title:je}:Ve))},[]),[Y,I]=R.useState(null),{connect:M,disconnect:P,destroy:B}=P$((Ae=Y==null?void 0:Y.terminal)!=null?Ae:null,Y&&i&&l&&n&&Y.serverSessionId?{terminal:Y.terminal,serverUrl:i,apiToken:l,cwd:(Ue=(De=p.find(ce=>ce.serverSessionId===Y.serverSessionId))==null?void 0:De.cwd)!=null?Ue:n,serverSessionId:Y.serverSessionId,onOutput:q(Y.serverSessionId),onStatusChange:G(Y.serverSessionId),onSessionInit:W(Y.serverSessionId),onTitleChange:X(Y.serverSessionId)}:{terminal:null,serverUrl:"",apiToken:"",cwd:"",onOutput:()=>{},onStatusChange:()=>{}});R.useEffect(()=>{Y&&Y.serverSessionId&&(j.current={serverSessionId:Y.serverSessionId,disconnect:P,destroy:B},M(Y.serverSessionId))},[Y,M,P,B]);const F=R.useCallback(()=>{if(!x||!i||!l||!n)return;const ce=k.current.get(x);let je;if(ce)je=ce;else{const{terminal:xe,fitAddon:Ve}=I$();je={terminal:xe,fitAddon:Ve,serverSessionId:x,status:"connecting",isOpened:!1},k.current.set(x,je)}j.current&&(j.current.disconnect(),j.current=null),I(je)},[x,i,l,n]);R.useEffect(()=>{!c||!x||F()},[c,x,F]);const Q=R.useCallback(async()=>{if(!(!e||!n||!i||!l))try{const ce=await fetch(Xn(i,`/api/workspaces/${e}/terminals`),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify({cwd:n})});ce.ok||console.error("[TerminalPanel] Failed to create terminal:",ce.statusText)}catch(ce){console.error("[TerminalPanel] Failed to create terminal:",ce)}},[e,n,i,l]);R.useEffect(()=>{H.current=Q},[Q]);const J=R.useCallback(async ce=>{var je;if(!(!e||!i||!l)){((je=j.current)==null?void 0:je.serverSessionId)===ce&&(j.current.destroy(),j.current=null,I(null)),k.current.dispose(ce);try{await fetch(Xn(i,`/api/workspaces/${e}/terminals/${ce}`),{method:"DELETE",headers:{Authorization:`Bearer ${l}`}})}catch(xe){console.error("[TerminalPanel] Failed to destroy terminal:",xe)}}},[e,i,l]);R.useEffect(()=>{L.current!==e&&(L.current=e,O.current=!1)},[e]),R.useEffect(()=>{z.current=new Set},[e]),R.useEffect(()=>()=>{k.current.disposeAll()},[]);const ee=R.useCallback(()=>{if(x){const ce=k.current.get(x);ce==null||ce.terminal.focus()}},[x]);R.useImperativeHandle(u,()=>({focus:ee}),[ee]),R.useEffect(()=>{if(!c||!x)return;const ce=setTimeout(ee,300);return()=>clearTimeout(ce)},[c,x,ee]);const K=R.useCallback(ce=>{ce.preventDefault(),S.current=!0;const je="touches"in ce?ce.touches[0].clientY:ce.clientY;b.current=je,_.current=C;const xe=We=>{if(!S.current)return;const it="touches"in We?We.touches[0].clientY:We.clientY,ge=b.current-it,Re=window.innerHeight*U$,be=Math.min(Math.max(_.current+ge,$$),Re);y(be)},Ve=()=>{S.current=!1,document.removeEventListener("mousemove",xe),document.removeEventListener("mouseup",Ve),document.removeEventListener("touchmove",xe),document.removeEventListener("touchend",Ve)};document.addEventListener("mousemove",xe),document.addEventListener("mouseup",Ve),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("touchend",Ve)},[C]);if(!e||!n||!i||!l)return h.jsx("div",{className:"flex items-center justify-center h-[300px] border-t border-border bg-background text-muted-foreground text-sm",children:"Select a workspace to use the terminal."});const V=r||n.split("/").pop()||"ws",te=p.find(ce=>ce.serverSessionId===x),re=x?k.current.get(x):null,ae=ce=>{switch(ce){case"connecting":return"bg-warning";case"connected":return"bg-success";case"disconnected":return"bg-muted-foreground";case"exited":return"bg-error"}},se=()=>h.jsxs("div",{className:"flex items-center gap-0.5 overflow-x-auto px-1 min-h-[32px]",children:[p.map(ce=>h.jsxs("div",{className:Ne("group flex items-center gap-1.5 px-2 py-1 text-xs cursor-pointer rounded-sm whitespace-nowrap border border-transparent",ce.serverSessionId===x?"bg-accent text-accent-foreground border-border":"text-muted-foreground hover:bg-muted"),onClick:()=>w(ce.serverSessionId),children:[h.jsx("span",{className:Ne("w-1.5 h-1.5 rounded-full shrink-0",ae(ce.status))}),h.jsxs("span",{children:[V," ",ce.title]}),h.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-destructive transition-opacity ml-0.5",onClick:je=>{je.stopPropagation(),J(ce.serverSessionId)},children:h.jsx(zn,{className:"w-3 h-3"})})]},ce.serverSessionId)),h.jsx(Te,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:Q,title:"New terminal tab",children:h.jsx(Qr,{className:"w-3.5 h-3.5"})})]}),Se=()=>h.jsx("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:re&&te?h.jsx(N$,{cachedTerminal:re},x):h.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No terminal sessions"})});if(d){const je=m.height<window.innerHeight*.85?`calc(${m.height}px - env(safe-area-inset-top, 0px))`:Math.min(window.innerHeight*.7,m.height);return c?h.jsx($f,{open:c,onOpenChange:xe=>!xe&&a(),children:h.jsxs(Uf,{side:"top",className:"p-0 bg-background [&>button]:hidden flex flex-col",style:{height:je},children:[h.jsx(Vf,{className:"sr-only",children:h.jsx(qf,{children:"Terminal"})}),h.jsxs("div",{className:"flex items-center justify-between p-2 border-b border-border shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Xb,{className:"w-4 h-4"}),h.jsx("span",{className:"font-semibold text-sm",children:"Terminal"})]}),h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:a,children:h.jsx(zn,{className:"w-4 h-4"})})]}),se(),Se()]})}):null}return c?h.jsxs("div",{"data-terminal-panel":"",children:[h.jsx("div",{className:"w-full cursor-ns-resize flex items-center justify-center border-t border-border bg-background select-none shrink-0",style:{height:4},onMouseDown:K,onTouchStart:K,children:h.jsx("div",{className:"w-10 h-0.5 bg-muted-foreground/30 rounded-full"})}),h.jsxs("div",{className:"flex flex-col border-t border-border bg-background overflow-hidden shrink-0",style:{height:C},children:[h.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Xb,{className:"w-3.5 h-3.5 text-muted-foreground"}),h.jsx("span",{className:"font-medium text-xs text-muted-foreground",children:"Terminal"})]}),h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:a,children:h.jsx(zn,{className:"w-3.5 h-3.5"})})]}),se(),Se()]})]}):null});function q$(t){const e=he.c(11),{workspaceId:n,workspacePath:r,workspaceName:i,serverUrl:l,apiToken:c,terminalPanelRef:a}=t,u=qt(G$),d=qt(W$);let m;e[0]!==d?(m=()=>d(!1),e[0]=d,e[1]=m):m=e[1];let p;return e[2]!==c||e[3]!==l||e[4]!==u||e[5]!==m||e[6]!==a||e[7]!==n||e[8]!==i||e[9]!==r?(p=h.jsx(V$,{ref:a,workspaceId:n,workspacePath:r,workspaceName:i,serverUrl:l,apiToken:c,isOpen:u,onClose:m}),e[2]=c,e[3]=l,e[4]=u,e[5]=m,e[6]=a,e[7]=n,e[8]=i,e[9]=r,e[10]=p):p=e[10],p}function W$(t){return t.setShowTerminalPanel}function G$(t){return t.showTerminalPanel}function Y_(t){const e=he.c(3),{message:n}=t,r=n===void 0?"Connecting to server...":n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(Wt,{className:"size-8 animate-spin"}),e[0]=i):i=e[0];let l;return e[1]!==r?(l=h.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-muted-foreground",children:[i,h.jsx("p",{className:"text-sm",children:r})]}),e[1]=r,e[2]=l):l=e[2],l}const K$=t=>{const e=he.c(26),{serverUrl:n,authError:r,retryCount:i,nextRetryIn:l,onRetry:c,onLogout:a}=t;let u,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(PS,{className:"size-12 text-destructive mb-4"}),d=h.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Unable to connect to server"}),e[0]=u,e[1]=d):(u=e[0],d=e[1]);const m=r||"Please check that the server is running.";let p;e[2]!==m?(p=h.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-[400px]",children:m}),e[2]=m,e[3]=p):p=e[3];let g;e[4]!==n?(g=n&&h.jsx("p",{className:"text-xs text-muted-foreground mb-6 font-mono bg-muted px-3 py-1.5 rounded",children:n}),e[4]=n,e[5]=g):g=e[5];let x;e[6]!==l?(x=h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Retrying in ",l,"s..."]}),e[6]=l,e[7]=x):x=e[7];let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx(Pi,{className:"size-4 mr-2","data-icon":"inline-start"}),e[8]=w):w=e[8];let C;e[9]!==c?(C=h.jsxs(Te,{onClick:c,variant:"default",children:[w,"Retry Now"]}),e[9]=c,e[10]=C):C=e[10];let y;e[11]!==a?(y=h.jsx(Te,{onClick:a,variant:"ghost",children:"Change Server"}),e[11]=a,e[12]=y):y=e[12];let S;e[13]!==C||e[14]!==y?(S=h.jsxs("div",{className:"flex items-center gap-2",children:[C,y]}),e[13]=C,e[14]=y,e[15]=S):S=e[15];let b;e[16]!==i?(b=i>0&&h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retry attempt: ",i]}),e[16]=i,e[17]=b):b=e[17];let _;e[18]!==S||e[19]!==b||e[20]!==x?(_=h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[x,S,b]}),e[18]=S,e[19]=b,e[20]=x,e[21]=_):_=e[21];let k;return e[22]!==_||e[23]!==p||e[24]!==g?(k=h.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] px-4 text-center",children:[u,d,p,g,_]}),e[22]=_,e[23]=p,e[24]=g,e[25]=k):k=e[25],k};function X_(t){const e=he.c(40),{onServerAdded:n,error:r}=t,[i,l]=R.useState(""),[c,a]=R.useState("localhost:8742"),[u,d]=R.useState(""),[m,p]=R.useState(!1),[g,x]=R.useState(null);let w;e[0]!==i||e[1]!==n||e[2]!==u||e[3]!==c?(w=I=>{I.preventDefault();const M=i.trim(),P=c.trim(),B=u.trim();if(!M){x("Please enter a server name");return}if(!P){x("Please enter a server URL");return}if(!B){x("Please enter an API token");return}if(!xS(B)){x("Invalid token format. Token should be 64 hex characters (0-9, a-f).");return}const F=Od(P),Q={id:crypto.randomUUID(),name:M,url:F,token:B,createdAt:new Date().toISOString()};n(Q)},e[0]=i,e[1]=n,e[2]=u,e[3]=c,e[4]=w):w=e[4];const C=w;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsxs("div",{className:"px-6 pt-6 pb-4 text-center border-b border-border",children:[h.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Add your first server"}),h.jsx("p",{className:"text-muted-foreground mt-1",children:"Connect to a Jean2 server to get started"})]}),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx("label",{htmlFor:"serverName",className:"text-sm font-medium text-foreground",children:"Server Name"}),e[6]=S):S=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=I=>{l(I.target.value),x(null)},e[7]=b):b=e[7];let _;e[8]!==i?(_=h.jsxs("div",{className:"space-y-2",children:[S,h.jsx("input",{id:"serverName",type:"text",value:i,onChange:b,placeholder:"Production",className:"w-full px-3 py-2 bg-background border border-input rounded-lg text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"})]}),e[8]=i,e[9]=_):_=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx("label",{htmlFor:"serverUrl",className:"text-sm font-medium text-foreground",children:"Server URL"}),e[10]=k):k=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=I=>{a(I.target.value),x(null)},e[11]=j):j=e[11];let N;e[12]!==c?(N=h.jsxs("div",{className:"space-y-2",children:[k,h.jsx("input",{id:"serverUrl",type:"text",value:c,onChange:j,placeholder:"localhost:8742",className:"w-full px-3 py-2 bg-background border border-input rounded-lg text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"})]}),e[12]=c,e[13]=N):N=e[13];let D;e[14]===Symbol.for("react.memo_cache_sentinel")?(D=h.jsx("label",{htmlFor:"token",className:"text-sm font-medium text-foreground",children:"API Token"}),e[14]=D):D=e[14];const E=m?"text":"password";let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=I=>{d(I.target.value),x(null)},e[15]=O):O=e[15];let L;e[16]!==E||e[17]!==u?(L=h.jsx("input",{id:"token",type:E,value:u,onChange:O,placeholder:"Enter your 64-character token",className:"w-full px-3 py-2 pr-10 bg-background border border-input rounded-lg text-foreground font-mono text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"}),e[16]=E,e[17]=u,e[18]=L):L=e[18];let z;e[19]!==m?(z=()=>p(!m),e[19]=m,e[20]=z):z=e[20];const H=m?"Hide token":"Show token";let $;e[21]!==m?($=m?h.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}):h.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),e[21]=m,e[22]=$):$=e[22];let q;e[23]!==z||e[24]!==H||e[25]!==$?(q=h.jsx("button",{type:"button",onClick:z,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":H,children:$}),e[23]=z,e[24]=H,e[25]=$,e[26]=q):q=e[26];let G;e[27]!==L||e[28]!==q?(G=h.jsxs("div",{className:"space-y-2",children:[D,h.jsxs("div",{className:"relative",children:[L,q]})]}),e[27]=L,e[28]=q,e[29]=G):G=e[29];let W;e[30]!==r||e[31]!==g?(W=(g||r)&&h.jsx("div",{className:"px-3 py-2 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive text-sm",children:g||r}),e[30]=r,e[31]=g,e[32]=W):W=e[32];let X;e[33]===Symbol.for("react.memo_cache_sentinel")?(X=h.jsx("button",{type:"submit",className:"w-full py-2.5 bg-primary text-primary-foreground font-medium rounded-lg hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-colors",children:"Add Server"}),e[33]=X):X=e[33];let Y;return e[34]!==C||e[35]!==G||e[36]!==W||e[37]!==_||e[38]!==N?(Y=h.jsx("div",{className:"w-full h-full flex items-center justify-center bg-background dark:bg-gradient-to-br dark:from-muted dark:via-background dark:to-muted p-4",children:h.jsx("div",{className:"w-full max-w-md",children:h.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[y,h.jsxs("form",{onSubmit:C,className:"p-6 space-y-4",children:[_,N,G,W,X]})]})})}),e[34]=C,e[35]=G,e[36]=W,e[37]=_,e[38]=N,e[39]=Y):Y=e[39],Y}function Y$(t){const e=he.c(12);let n,r,i;e[0]!==t?({className:n,value:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let l;e[4]!==n?(l=Ne("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",n),e[4]=n,e[5]=l):l=e[5];const c=`translateX(-${100-(i||0)}%)`;let a;e[6]!==c?(a=h.jsx($D,{"data-slot":"progress-indicator",className:"size-full flex-1 bg-primary transition-all",style:{transform:c}}),e[6]=c,e[7]=a):a=e[7];let u;return e[8]!==r||e[9]!==l||e[10]!==a?(u=h.jsx(HD,{"data-slot":"progress",className:l,...r,children:a}),e[8]=r,e[9]=l,e[10]=a,e[11]=u):u=e[11],u}function kd(t){return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":t.toString()}function X$(t){return t>=60?"critical":t>=40?"warning":"normal"}function Q$(t){const e=he.c(41),{totalTokens:n,contextWindow:r,modelName:i,compact:l}=t,c=n===void 0?0:n,a=r===void 0?0:r,u=l===void 0?!1:l,d=c===0?0:a;let m;e[0]!==d||e[1]!==c?(m=d===0?0:Math.min(100,Math.round(c/d*100)),e[0]=d,e[1]=c,e[2]=m):m=e[2];const p=m;let g;e[3]!==p?(g=X$(p),e[3]=p,e[4]=g):g=e[4];const x=g;if(u){let L;e[5]!==c?(L=kd(c),e[5]=c,e[6]=L):L=e[6];let z;e[7]!==d?(z=kd(d),e[7]=d,e[8]=z):z=e[8];let H;e[9]!==L||e[10]!==z?(H=h.jsxs("span",{className:"text-xs font-mono",children:[L,"/",z]}),e[9]=L,e[10]=z,e[11]=H):H=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=h.jsx(Nc,{asChild:!0,children:h.jsx(zA,{className:"size-3 text-muted-foreground cursor-help"})}),e[12]=$):$=e[12];let q;e[13]!==p?(q=h.jsx(Kd,{children:h.jsxs(Ac,{children:[$,h.jsx(Rc,{side:"bottom",children:h.jsxs("p",{className:"text-xs",children:[p,"% of context window used"]})})]})}),e[13]=p,e[14]=q):q=e[14];let G;return e[15]!==q||e[16]!==H?(G=h.jsxs("div",{className:"flex items-center gap-1.5",children:[H,q]}),e[15]=q,e[16]=H,e[17]=G):G=e[17],G}let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx("span",{className:"text-xs text-muted-foreground",children:"Tokens:"}),e[18]=w):w=e[18];let C;e[19]!==c?(C=kd(c),e[19]=c,e[20]=C):C=e[20];let y;e[21]!==d?(y=kd(d),e[21]=d,e[22]=y):y=e[22];let S;e[23]!==C||e[24]!==y?(S=h.jsxs("div",{className:"flex items-center gap-2",children:[w,h.jsxs("span",{className:"text-xs font-mono",children:[C,"/",y]})]}),e[23]=C,e[24]=y,e[25]=S):S=e[25];const b=x==="critical"&&"[&>div]:bg-destructive",_=x==="warning"&&"[&>div]:bg-warning",k=x==="normal"&&"[&>div]:bg-primary";let j;e[26]!==b||e[27]!==_||e[28]!==k?(j=Ne("h-1 w-20",b,_,k),e[26]=b,e[27]=_,e[28]=k,e[29]=j):j=e[29];let N;e[30]!==p||e[31]!==j?(N=h.jsx(Y$,{value:p,className:j}),e[30]=p,e[31]=j,e[32]=N):N=e[32];let D;e[33]!==p?(D=h.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["(",p,"%)"]}),e[33]=p,e[34]=D):D=e[34];let E;e[35]!==N||e[36]!==D?(E=h.jsxs("div",{className:"flex items-center gap-2",children:[N,D]}),e[35]=N,e[36]=D,e[37]=E):E=e[37];let O;return e[38]!==S||e[39]!==E?(O=h.jsx("div",{className:"flex items-center gap-3",children:h.jsxs("div",{className:"flex flex-col gap-1",children:[S,E]})}),e[38]=S,e[39]=E,e[40]=O):O=e[40],O}function Qv(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(CM,{"data-slot":"select",...n}),e[2]=n,e[3]=r):r=e[3],r}function Z$(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("scroll-my-1 p-1",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(TM,{"data-slot":"select-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function Ya(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=h.jsx(EM,{"data-slot":"select-value",...n}),e[2]=n,e[3]=r):r=e[3],r}function Zv(t){const e=he.c(13);let n,r,i,l;e[0]!==t?({className:r,size:l,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l):(n=e[1],r=e[2],i=e[3],l=e[4]);const c=l===void 0?"default":l;let a;e[5]!==r?(a=Ne("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=h.jsx(AM,{asChild:!0,children:h.jsx(Za,{className:"pointer-events-none size-4 text-muted-foreground"})}),e[7]=u):u=e[7];let d;return e[8]!==n||e[9]!==i||e[10]!==c||e[11]!==a?(d=h.jsxs(kM,{"data-slot":"select-trigger","data-size":c,className:a,...i,children:[n,u]}),e[8]=n,e[9]=i,e[10]=c,e[11]=a,e[12]=d):d=e[12],d}function Jv(t){const e=he.c(24);let n,r,i,l,c;e[0]!==t?({className:r,children:n,position:l,align:c,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=c):(n=e[1],r=e[2],i=e[3],l=e[4],c=e[5]);const a=l===void 0?"item-aligned":l,u=c===void 0?"center":c,d=a==="item-aligned",m=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let p;e[6]!==r||e[7]!==m?(p=Ne("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",m,r),e[6]=r,e[7]=m,e[8]=p):p=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx(eU,{}),e[9]=g):g=e[9];const x=a==="popper"&&"";let w;e[10]!==x?(w=Ne("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",x),e[10]=x,e[11]=w):w=e[11];let C;e[12]!==n||e[13]!==a||e[14]!==w?(C=h.jsx(jM,{"data-position":a,className:w,children:n}),e[12]=n,e[13]=a,e[14]=w,e[15]=C):C=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(tU,{}),e[16]=y):y=e[16];let S;return e[17]!==u||e[18]!==a||e[19]!==i||e[20]!==d||e[21]!==p||e[22]!==C?(S=h.jsx(NM,{children:h.jsxs(RM,{"data-slot":"select-content","data-align-trigger":d,className:p,position:a,align:u,...i,children:[g,C,y]})}),e[17]=u,e[18]=a,e[19]=i,e[20]=d,e[21]=p,e[22]=C,e[23]=S):S=e[23],S}function J$(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("px-1.5 py-1 text-xs text-muted-foreground",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=h.jsx(DM,{"data-slot":"select-label",className:i,...r}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function th(t){const e=he.c(13);let n,r,i;e[0]!==t?({className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let l;e[4]!==r?(l=Ne("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",r),e[4]=r,e[5]=l):l=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:h.jsx(LM,{children:h.jsx(Vn,{className:"pointer-events-none"})})}),e[6]=c):c=e[6];let a;e[7]!==n?(a=h.jsx(OM,{children:n}),e[7]=n,e[8]=a):a=e[8];let u;return e[9]!==i||e[10]!==l||e[11]!==a?(u=h.jsxs(MM,{"data-slot":"select-item",className:l,...i,children:[c,a]}),e[9]=i,e[10]=l,e[11]=a,e[12]=u):u=e[12],u}function eU(t){const e=he.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=i):i=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(J5,{}),e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==i?(c=h.jsx(IM,{"data-slot":"select-scroll-up-button",className:i,...r,children:l}),e[6]=r,e[7]=i,e[8]=c):c=e[8],c}function tU(t){const e=he.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ne("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=i):i=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsx(Za,{}),e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==i?(c=h.jsx(PM,{"data-slot":"select-scroll-down-button",className:i,...r,children:l}),e[6]=r,e[7]=i,e[8]=c):c=e[8],c}function nU(t){switch(t){case"budget":return"$";case"standard":return"$$";case"premium":return"$$$";default:return""}}function rU(t){const e=he.c(43),{models:n,selectedModelId:r,onChangeModel:i,disabled:l,compact:c,iconOnly:a}=t,u=c===void 0?!1:c,d=a===void 0?!1:a;let m,p,g,x,w,C,y,S,b;if(e[0]!==u||e[1]!==l||e[2]!==d||e[3]!==n||e[4]!==i||e[5]!==r){const N=n.reduce(oU,{});let D;e[15]!==n||e[16]!==i?(D=$=>{const q=n.find(G=>G.id===$);q&&i($,q.providerId)},e[15]=n,e[16]=i,e[17]=D):D=e[17];const E=D,O=u&&!d;S="flex items-center gap-2",e[18]!==d||e[19]!==O?(b=!d&&h.jsx(xt,{className:"text-xs text-muted-foreground",children:O?h.jsx(Kb,{className:"size-3.5"}):"Model:"}),e[18]=d,e[19]=O,e[20]=b):b=e[20],p=Qv,x=r||"",w=E,C=l;const L=d?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[180px] h-8 text-sm";let z;e[21]!==d?(z=d&&h.jsxs(h.Fragment,{children:[h.jsx(Kb,{className:"size-4"}),h.jsx(Ya,{className:"sr-only"})]}),e[21]=d,e[22]=z):z=e[22];let H;e[23]!==d?(H=!d&&h.jsx(Ya,{placeholder:"Select model"}),e[23]=d,e[24]=H):H=e[24],e[25]!==L||e[26]!==z||e[27]!==H?(y=h.jsxs(Zv,{className:L,children:[z,H]}),e[25]=L,e[26]=z,e[27]=H,e[28]=y):y=e[28],m=Jv,g=Object.entries(N).map(sU),e[0]=u,e[1]=l,e[2]=d,e[3]=n,e[4]=i,e[5]=r,e[6]=m,e[7]=p,e[8]=g,e[9]=x,e[10]=w,e[11]=C,e[12]=y,e[13]=S,e[14]=b}else m=e[6],p=e[7],g=e[8],x=e[9],w=e[10],C=e[11],y=e[12],S=e[13],b=e[14];let _;e[29]!==m||e[30]!==g?(_=h.jsx(m,{children:g}),e[29]=m,e[30]=g,e[31]=_):_=e[31];let k;e[32]!==p||e[33]!==_||e[34]!==x||e[35]!==w||e[36]!==C||e[37]!==y?(k=h.jsxs(p,{value:x,onValueChange:w,disabled:C,children:[y,_]}),e[32]=p,e[33]=_,e[34]=x,e[35]=w,e[36]=C,e[37]=y,e[38]=k):k=e[38];let j;return e[39]!==k||e[40]!==S||e[41]!==b?(j=h.jsxs("div",{className:S,children:[b,k]}),e[39]=k,e[40]=S,e[41]=b,e[42]=j):j=e[42],j}function sU(t){const[e,n]=t;return h.jsxs(Z$,{children:[h.jsx(J$,{children:e}),n.map(iU)]},e)}function iU(t){return h.jsx(th,{value:t.id,children:h.jsxs("span",{className:"flex items-center gap-2",children:[t.name,h.jsx("span",{className:"text-muted-foreground text-xs",children:nU(t.tier)})]})},t.id)}function oU(t,e){return t[e.providerName]||(t[e.providerName]=[]),t[e.providerName].push(e),t}const aU={low:"Low",medium:"Medium",high:"High",xhigh:"X-High",minimal:"Minimal",max:"Max"};function lU(t){return aU[t]||t.charAt(0).toUpperCase()+t.slice(1)}function cU(t){const e=he.c(45),{variants:n,selectedVariant:r,onChangeVariant:i,disabled:l,compact:c,iconOnly:a}=t,u=c===void 0?!1:c,d=a===void 0?!1:a,m=u&&!d;if(!n||Object.keys(n).length===0)return null;let p,g,x,w,C,y,S,b,_,k;if(e[0]!==l||e[1]!==d||e[2]!==i||e[3]!==r||e[4]!==m||e[5]!==n){const E=Object.keys(n);let O;e[16]!==i?(O=q=>{i(q==="__none__"?null:q)},e[16]=i,e[17]=O):O=e[17];const L=O;k="flex items-center gap-2",e[18]!==d||e[19]!==m?(x=!d&&h.jsx(xt,{className:"text-xs text-muted-foreground",children:m?h.jsx(Gb,{className:"size-3.5"}):"Thinking:"}),e[18]=d,e[19]=m,e[20]=x):x=e[20],g=Qv,y=r||"__none__",S=L,b=l;const z=d?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[120px] h-8 text-sm";let H;e[21]!==d?(H=d&&h.jsxs(h.Fragment,{children:[h.jsx(Gb,{className:"size-4"}),h.jsx(Ya,{className:"sr-only"})]}),e[21]=d,e[22]=H):H=e[22];let $;e[23]!==d?($=!d&&h.jsx(Ya,{placeholder:"Default"}),e[23]=d,e[24]=$):$=e[24],e[25]!==z||e[26]!==H||e[27]!==$?(_=h.jsxs(Zv,{className:z,children:[H,$]}),e[25]=z,e[26]=H,e[27]=$,e[28]=_):_=e[28],p=Jv,e[29]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx(th,{value:"__none__",children:"Default"}),e[29]=w):w=e[29],C=E.map(uU),e[0]=l,e[1]=d,e[2]=i,e[3]=r,e[4]=m,e[5]=n,e[6]=p,e[7]=g,e[8]=x,e[9]=w,e[10]=C,e[11]=y,e[12]=S,e[13]=b,e[14]=_,e[15]=k}else p=e[6],g=e[7],x=e[8],w=e[9],C=e[10],y=e[11],S=e[12],b=e[13],_=e[14],k=e[15];let j;e[30]!==p||e[31]!==w||e[32]!==C?(j=h.jsxs(p,{children:[w,C]}),e[30]=p,e[31]=w,e[32]=C,e[33]=j):j=e[33];let N;e[34]!==g||e[35]!==j||e[36]!==y||e[37]!==S||e[38]!==b||e[39]!==_?(N=h.jsxs(g,{value:y,onValueChange:S,disabled:b,children:[_,j]}),e[34]=g,e[35]=j,e[36]=y,e[37]=S,e[38]=b,e[39]=_,e[40]=N):N=e[40];let D;return e[41]!==x||e[42]!==N||e[43]!==k?(D=h.jsxs("div",{className:k,children:[x,N]}),e[41]=x,e[42]=N,e[43]=k,e[44]=D):D=e[44],D}function uU(t){return h.jsx(th,{value:t,children:lU(t)},t)}function dU(t){const e=he.c(24),{preconfigs:n,selectedPreconfigId:r,onChangePreconfig:i,disabled:l,compact:c,iconOnly:a}=t,u=c===void 0?!1:c,d=a===void 0?!1:a,m=u&&!d;let p;e[0]!==d||e[1]!==m?(p=!d&&h.jsx(xt,{className:"text-xs text-muted-foreground",children:m?h.jsx(uA,{className:"size-3.5"}):"Config:"}),e[0]=d,e[1]=m,e[2]=p):p=e[2];const g=r||"",x=d?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[140px] h-8 text-sm";let w;e[3]!==d?(w=d&&h.jsxs(h.Fragment,{children:[h.jsx(MS,{className:"size-4"}),h.jsx(Ya,{className:"sr-only"})]}),e[3]=d,e[4]=w):w=e[4];let C;e[5]!==d?(C=!d&&h.jsx(Ya,{placeholder:"Select config"}),e[5]=d,e[6]=C):C=e[6];let y;e[7]!==x||e[8]!==w||e[9]!==C?(y=h.jsxs(Zv,{className:x,children:[w,C]}),e[7]=x,e[8]=w,e[9]=C,e[10]=y):y=e[10];let S;e[11]!==n?(S=n.map(fU),e[11]=n,e[12]=S):S=e[12];let b;e[13]!==S?(b=h.jsx(Jv,{children:S}),e[13]=S,e[14]=b):b=e[14];let _;e[15]!==l||e[16]!==i||e[17]!==b||e[18]!==g||e[19]!==y?(_=h.jsxs(Qv,{value:g,onValueChange:i,disabled:l,children:[y,b]}),e[15]=l,e[16]=i,e[17]=b,e[18]=g,e[19]=y,e[20]=_):_=e[20];let k;return e[21]!==_||e[22]!==p?(k=h.jsxs("div",{className:"flex items-center gap-2",children:[p,_]}),e[21]=_,e[22]=p,e[23]=k):k=e[23],k}function fU(t){return h.jsxs(th,{value:t.id,children:[t.name,t.isDefault&&h.jsx("span",{className:"ml-2 text-muted-foreground text-xs",children:"(default)"})]},t.id)}function hU(t){var Fe;const e=he.c(102),{session:n,preconfigs:r,models:i,usage:l,modelName:c,onChangePreconfig:a,onChangeModel:u,onChangeVariant:d,onRename:m,onNavigateBack:p,isStreaming:g,onInterrupt:x,onCompact:w,isCompacting:C,canCompact:y,selectedVariant:S,variants:b}=t,[_,k]=R.useState(!1),[j,N]=R.useState(n.title||""),D=R.useRef(null),E=ol(),O=Q8();let L,z;e[0]!==_?(L=()=>{_&&D.current&&(D.current.focus(),D.current.select())},z=[_],e[0]=_,e[1]=L,e[2]=z):(L=e[1],z=e[2]),R.useEffect(L,z);let H;e[3]!==n.title?(H=()=>{N(n.title||""),k(!0)},e[3]=n.title,e[4]=H):H=e[4];const $=H;let q;e[5]!==j||e[6]!==m||e[7]!==n.id||e[8]!==n.title?(q=()=>{const Ge=j.trim();Ge&&Ge!==n.title&&m(n.id,Ge),k(!1)},e[5]=j,e[6]=m,e[7]=n.id,e[8]=n.title,e[9]=q):q=e[9];const G=q;let W;e[10]!==G||e[11]!==n.title?(W=Ge=>{Ge.key==="Enter"?G():Ge.key==="Escape"&&(N(n.title||""),k(!1))},e[10]=G,e[11]=n.title,e[12]=W):W=e[12];const X=W;let Y;e[13]!==c||e[14]!==r||e[15]!==n.preconfigId||e[16]!==n.selectedModel?(Y=n.selectedModel||((Fe=r.find(Ge=>Ge.id===n.preconfigId))==null?void 0:Fe.model)||c,e[13]=c,e[14]=r,e[15]=n.preconfigId,e[16]=n.selectedModel,e[17]=Y):Y=e[17];const I=Y;let M;if(e[18]!==i||e[19]!==I){let Ge;e[21]!==I?(Ge=Ze=>Ze.id===I,e[21]=I,e[22]=Ge):Ge=e[22],M=i.find(Ge),e[18]=i,e[19]=I,e[20]=M}else M=e[20];const P=M,B=P==null?void 0:P.contextWindow;let F;e[23]!==p||e[24]!==n.parentId?(F=n.parentId&&p&&h.jsxs(Te,{variant:"ghost",size:"sm",onClick:p,className:"h-7",children:[h.jsx(Fg,{className:"size-4","data-icon":"inline-start"}),"Back"]}),e[23]=p,e[24]=n.parentId,e[25]=F):F=e[25];let Q;e[26]!==j||e[27]!==X||e[28]!==$||e[29]!==G||e[30]!==_||e[31]!==n.title?(Q=_?h.jsx("input",{ref:D,type:"text",value:j,onChange:Ge=>N(Ge.target.value),onBlur:G,onKeyDown:X,className:"text-lg font-semibold bg-background border border-primary rounded px-2 py-0.5 outline-none min-w-0 flex-1",autoFocus:!0}):h.jsx("h2",{className:"text-lg font-semibold cursor-pointer px-2 py-0.5 -mx-2 rounded hover:bg-accent transition-colors truncate min-w-0",onDoubleClick:$,children:n.title||"Untitled Session"}),e[26]=j,e[27]=X,e[28]=$,e[29]=G,e[30]=_,e[31]=n.title,e[32]=Q):Q=e[32];let J;e[33]!==n.id?(J=n.id.slice(0,8),e[33]=n.id,e[34]=J):J=e[34];let ee;e[35]!==J?(ee=h.jsx(Ft,{variant:"outline",className:"font-mono text-xs",children:J}),e[35]=J,e[36]=ee):ee=e[36];let K;e[37]!==n.status?(K=n.status==="closed"&&h.jsxs(Ft,{variant:"secondary",children:[h.jsx(z5,{className:"size-3","data-icon":"inline-start"}),"Archived"]}),e[37]=n.status,e[38]=K):K=e[38];let V;e[39]!==ee||e[40]!==K||e[41]!==F||e[42]!==Q?(V=h.jsx("div",{className:"flex items-center justify-start px-4 py-2 overflow-hidden",children:h.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[F,Q,ee,K]})}),e[39]=ee,e[40]=K,e[41]=F,e[42]=Q,e[43]=V):V=e[43];let te;e[44]===Symbol.for("react.memo_cache_sentinel")?(te=h.jsx(_n,{}),e[44]=te):te=e[44];let re;e[45]!==B||e[46]!==E||e[47]!==c||e[48]!==l.completionTokens||e[49]!==l.promptTokens||e[50]!==l.totalTokens?(re=h.jsx(Q$,{promptTokens:l.promptTokens,completionTokens:l.completionTokens,totalTokens:l.totalTokens,contextWindow:B,modelName:c,compact:E}),e[45]=B,e[46]=E,e[47]=c,e[48]=l.completionTokens,e[49]=l.promptTokens,e[50]=l.totalTokens,e[51]=re):re=e[51];let ae;e[52]===Symbol.for("react.memo_cache_sentinel")?(ae=h.jsx(_n,{orientation:"vertical",className:"hidden sm:block"}),e[52]=ae):ae=e[52];const se=n.status==="closed"||!!n.parentId;let Se;e[53]!==O||e[54]!==E||e[55]!==i||e[56]!==u||e[57]!==I||e[58]!==se?(Se=h.jsx(rU,{models:i,selectedModelId:I,onChangeModel:u,disabled:se,compact:O,iconOnly:E}),e[53]=O,e[54]=E,e[55]=i,e[56]=u,e[57]=I,e[58]=se,e[59]=Se):Se=e[59];const Ae=n.status==="closed"||!!n.parentId;let De;e[60]!==O||e[61]!==E||e[62]!==d||e[63]!==S||e[64]!==Ae||e[65]!==b?(De=h.jsx(cU,{variants:b,selectedVariant:S,onChangeVariant:d,disabled:Ae,compact:O,iconOnly:E}),e[60]=O,e[61]=E,e[62]=d,e[63]=S,e[64]=Ae,e[65]=b,e[66]=De):De=e[66];const Ue=n.status==="closed"||!!n.parentId;let ce;e[67]!==O||e[68]!==E||e[69]!==a||e[70]!==r||e[71]!==n.preconfigId||e[72]!==Ue?(ce=h.jsx(dU,{preconfigs:r,selectedPreconfigId:n.preconfigId,onChangePreconfig:a,disabled:Ue,compact:O,iconOnly:E}),e[67]=O,e[68]=E,e[69]=a,e[70]=r,e[71]=n.preconfigId,e[72]=Ue,e[73]=ce):ce=e[73];let je;e[74]===Symbol.for("react.memo_cache_sentinel")?(je=h.jsx(_n,{orientation:"vertical",className:"hidden sm:block"}),e[74]=je):je=e[74];let xe;e[75]!==y||e[76]!==O||e[77]!==C||e[78]!==g||e[79]!==w?(xe=w&&h.jsxs(h.Fragment,{children:[h.jsxs(Te,{variant:"outline",size:O?"icon":"sm",onClick:w,disabled:g||C||!y,title:C?"Compacting...":"Compact older messages",children:[h.jsx(jS,{className:"size-4"}),!O&&h.jsx("span",{className:"ml-1",children:C?"Compacting...":"Compact"})]}),h.jsx(_n,{orientation:"vertical",className:"hidden sm:block"})]}),e[75]=y,e[76]=O,e[77]=C,e[78]=g,e[79]=w,e[80]=xe):xe=e[80];const Ve=g?"destructive":"outline",We=O?"icon":"sm",it=!x,ge=g?"":"opacity-60 hover:opacity-100",Re=g?"Interrupt operation":"Interrupt (no active operation)";let be;e[81]===Symbol.for("react.memo_cache_sentinel")?(be=h.jsx(LS,{className:"size-4"}),e[81]=be):be=e[81];let oe;e[82]!==O?(oe=!O&&h.jsx("span",{className:"ml-1",children:"Stop"}),e[82]=O,e[83]=oe):oe=e[83];let me;e[84]!==x||e[85]!==Ve||e[86]!==We||e[87]!==it||e[88]!==ge||e[89]!==Re||e[90]!==oe?(me=h.jsxs(Te,{variant:Ve,size:We,onClick:x,disabled:it,className:ge,title:Re,children:[be,oe]}),e[84]=x,e[85]=Ve,e[86]=We,e[87]=it,e[88]=ge,e[89]=Re,e[90]=oe,e[91]=me):me=e[91];let Ee;e[92]!==re||e[93]!==Se||e[94]!==De||e[95]!==ce||e[96]!==xe||e[97]!==me?(Ee=h.jsxs("div",{className:"inline-flex align-middle items-center gap-3 sm:gap-4 px-4 py-2 flex-wrap",children:[re,ae,Se,De,ce,je,xe,me]}),e[92]=re,e[93]=Se,e[94]=De,e[95]=ce,e[96]=xe,e[97]=me,e[98]=Ee):Ee=e[98];let Ie;return e[99]!==V||e[100]!==Ee?(Ie=h.jsxs("header",{className:"flex flex-col border-b border-border bg-card",children:[V,te,Ee]}),e[99]=V,e[100]=Ee,e[101]=Ie):Ie=e[101],Ie}function pU(t){const e=he.c(33),{workspaceId:n,searchQuery:r,selectedIndex:i,onSelect:l,onFilesChange:c,showHidden:a,serverUrl:u,apiToken:d}=t,m=a===void 0?!0:a;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[g,x]=R.useState(p),[w,C]=R.useState(!1),[y,S]=R.useState(r),{fetchWithAuth:b}=ns(),_=R.useRef(0);let k,j;e[1]!==r?(k=()=>{const G=setTimeout(()=>{S(r)},300);return()=>clearTimeout(G)},j=[r],e[1]=r,e[2]=k,e[3]=j):(k=e[2],j=e[3]),R.useEffect(k,j);let N,D;if(e[4]!==d||e[5]!==y||e[6]!==b||e[7]!==c||e[8]!==u||e[9]!==m||e[10]!==n?(N=()=>{if(!y||y.length<2){x([]),c([]);return}const G=_.current=_.current+1;C(!0);const W=new AbortController;return b(`/api/workspaces/${n}/files?search=${encodeURIComponent(y)}&showHidden=${m}`,{signal:W.signal},{serverUrl:u,token:d}).then(gU).then(X=>{if(G!==_.current)return;const Y=X.files||[];x(Y),c(Y)}).catch(mU).finally(()=>{G===_.current&&C(!1)}),()=>W.abort()},D=[n,y,c,m,b,u,d],e[4]=d,e[5]=y,e[6]=b,e[7]=c,e[8]=u,e[9]=m,e[10]=n,e[11]=N,e[12]=D):(N=e[11],D=e[12]),R.useEffect(N,D),!r||r.length<2){let G;return e[13]===Symbol.for("react.memo_cache_sentinel")?(G=h.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"Type at least 2 characters to search files..."}),e[13]=G):G=e[13],G}if(w){let G;return e[14]===Symbol.for("react.memo_cache_sentinel")?(G=h.jsxs("div",{className:"flex items-center justify-center p-4 text-muted-foreground",children:[h.jsx(Wt,{className:"w-4 h-4 animate-spin mr-2"}),"Searching..."]}),e[14]=G):G=e[14],G}if(g.length===0){let G;return e[15]!==r?(G=h.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No files found matching "',r,'"']}),e[15]=r,e[16]=G):G=e[16],G}let E;if(e[17]!==g||e[18]!==l||e[19]!==i){let G;e[21]!==l||e[22]!==i?(G=(W,X)=>h.jsxs("button",{onClick:()=>l(W),className:Ne("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",X===i&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[W.type==="directory"?h.jsx(Vs,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}):h.jsx(Pr,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),h.jsx("span",{className:"truncate flex-1",children:W.path}),W.extension&&h.jsx("span",{className:"text-xs text-muted-foreground",children:W.extension})]},W.path),e[21]=l,e[22]=i,e[23]=G):G=e[23],E=g.map(G),e[17]=g,e[18]=l,e[19]=i,e[20]=E}else E=e[20];const O=g.length!==1?"s":"";let L;e[24]===Symbol.for("react.memo_cache_sentinel")?(L=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[24]=L):L=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[25]=z):z=e[25];let H;e[26]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[26]=H):H=e[26];let $;e[27]!==g.length||e[28]!==O?($=h.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[g.length," result",O," •",L," navigate",z," select",H," close"]}),e[27]=g.length,e[28]=O,e[29]=$):$=e[29];let q;return e[30]!==$||e[31]!==E?(q=h.jsxs("div",{className:"p-1",children:[E,$]}),e[30]=$,e[31]=E,e[32]=q):q=e[32],q}function mU(t){t.name!=="AbortError"&&console.error("File search failed:",t)}function gU(t){return t.json()}function vU(t){const e=he.c(25),{prompts:n,query:r,selectedIndex:i,onSelect:l}=t;let c,a,u,d;if(e[0]!==l||e[1]!==n||e[2]!==r||e[3]!==i){d=Symbol.for("react.early_return_sentinel");e:{let y;if(e[8]!==r?(y=b=>b.name.toLowerCase().includes(r.toLowerCase()),e[8]=r,e[9]=y):y=e[9],c=n.filter(y),c.length===0){let b;e[10]!==r?(b=h.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No prompts matching "/',r,'"']}),e[10]=r,e[11]=b):b=e[11],d=b;break e}a="p-1";let S;e[12]!==l||e[13]!==i?(S=(b,_)=>h.jsxs("button",{onClick:()=>l(b),className:Ne("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",_===i&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[h.jsx(JA,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"font-mono text-xs",children:["/",b.name]}),h.jsx("div",{className:"text-xs text-muted-foreground truncate",children:b.description})]})]},b.name),e[12]=l,e[13]=i,e[14]=S):S=e[14],u=c.map(S)}e[0]=l,e[1]=n,e[2]=r,e[3]=i,e[4]=c,e[5]=a,e[6]=u,e[7]=d}else c=e[4],a=e[5],u=e[6],d=e[7];if(d!==Symbol.for("react.early_return_sentinel"))return d;const m=c.length!==1?"s":"";let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[15]=p):p=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[16]=g):g=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=h.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[17]=x):x=e[17];let w;e[18]!==c.length||e[19]!==m?(w=h.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[c.length," prompt",m," •",p," navigate",g," select",x," close"]}),e[18]=c.length,e[19]=m,e[20]=w):w=e[20];let C;return e[21]!==a||e[22]!==u||e[23]!==w?(C=h.jsxs("div",{className:a,children:[u,w]}),e[21]=a,e[22]=u,e[23]=w,e[24]=C):C=e[24],C}function yU(t){const e=he.c(26),{id:n,kind:r,filename:i,size:l,previewUrl:c,isUploading:a,onRemove:u}=t,d=a&&"opacity-50";let m;e[0]!==d?(m=Ne("flex items-center gap-2 px-2 py-1.5 bg-muted rounded-lg border border-border max-w-[180px]",d),e[0]=d,e[1]=m):m=e[1];let p;e[2]!==i||e[3]!==r||e[4]!==c?(p=r==="image"&&c?h.jsx("img",{src:c,alt:i,className:"size-8 rounded object-cover shrink-0"}):r==="image"?h.jsx(IA,{className:"size-4 text-muted-foreground shrink-0"}):h.jsx(Pr,{className:"size-4 text-muted-foreground shrink-0"}),e[2]=i,e[3]=r,e[4]=c,e[5]=p):p=e[5];let g;e[6]!==i?(g=h.jsx("div",{className:"text-xs truncate",children:i}),e[6]=i,e[7]=g):g=e[7];let x;e[8]!==l?(x=bU(l),e[8]=l,e[9]=x):x=e[9];let w;e[10]!==x?(w=h.jsx("div",{className:"text-[10px] text-muted-foreground",children:x}),e[10]=x,e[11]=w):w=e[11];let C;e[12]!==g||e[13]!==w?(C=h.jsxs("div",{className:"min-w-0 flex-1",children:[g,w]}),e[12]=g,e[13]=w,e[14]=C):C=e[14];let y;e[15]!==n||e[16]!==u?(y=()=>u(n),e[15]=n,e[16]=u,e[17]=y):y=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=h.jsx(zn,{className:"size-3 text-muted-foreground"}),e[18]=S):S=e[18];let b;e[19]!==y?(b=h.jsx("button",{type:"button",onClick:y,className:"shrink-0 p-0.5 hover:bg-accent rounded",children:S}),e[19]=y,e[20]=b):b=e[20];let _;return e[21]!==b||e[22]!==m||e[23]!==p||e[24]!==C?(_=h.jsxs("div",{className:m,children:[p,C,b]}),e[21]=b,e[22]=m,e[23]=p,e[24]=C,e[25]=_):_=e[25],_}function bU(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function xU(t){const e=he.c(9),[n,r]=R.useState(""),[i,l]=R.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,u]=R.useState(c);let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=C=>{const y={type:"file",path:C.path,display:C.name};return u(S=>[...S,y]),l(!1),r(""),y},e[1]=d):d=e[1];const m=d,p=_U;let g;e[2]!==a?(g=C=>{const y=/@([^\s@]+)/g,S=[];let b;for(;(b=y.exec(C))!==null;){const _=b[1];a.some(k=>k.path===_)&&!S.some(k=>k.path===_)&&S.push({type:"file",path:_,display:_.split("/").pop()||_})}return S},e[2]=a,e[3]=g):g=e[3];const x=g;let w;return e[4]!==x||e[5]!==a||e[6]!==n||e[7]!==i?(w={query:n,setQuery:r,showAutocomplete:i,setShowAutocomplete:l,mentions:a,handleFileSelect:m,insertMention:p,extractMentions:x},e[4]=x,e[5]=a,e[6]=n,e[7]=i,e[8]=w):w=e[8],w}function _U(t,e,n){const r=t.lastIndexOf("@",e);if(r===-1)return{text:t,cursorPos:e};const i=t.slice(0,r)+`@${n.path}`+t.slice(e),l=r+n.path.length+1;return{text:i,cursorPos:l}}function yc(t){return`${gS}${t}`}function Q_(t,e){if(!(typeof window>"u"))try{localStorage.setItem(yc(t),JSON.stringify({text:e,updatedAt:Date.now()}))}catch(n){console.warn("Error saving draft:",n)}}function SU(t){if(typeof window>"u")return"";try{const e=localStorage.getItem(yc(t));if(e===null)return"";const n=JSON.parse(e);return typeof n.text!="string"||typeof n.updatedAt!="number"||Date.now()-n.updatedAt>vS?(localStorage.removeItem(yc(t)),""):n.text}catch{return""}}function Z_(t){if(!(typeof window>"u"))try{localStorage.removeItem(yc(t))}catch(e){console.warn("Error clearing draft:",e)}}function wU(){u5()}function CU(t){const e=he.c(12),[n,r]=R.useState(""),i=R.useRef(void 0),l=R.useRef("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0],R.useEffect(kU,c);let a;e[1]!==t?(a=w=>{r(w),l.current=w,t!==void 0&&(w===""?Z_(t):Q_(t,w))},e[1]=t,e[2]=a):a=e[2];const u=a;let d;e[3]!==t?(d=()=>{r(""),l.current="",t!==void 0&&Z_(t)},e[3]=t,e[4]=d):d=e[4];const m=d;let p,g;e[5]!==t?(p=()=>{const w=i.current;if(w!==void 0&&w!==t){const C=l.current;C!==""&&Q_(w,C)}if(t!==void 0){const C=SU(t);l.current=C,r(C)}else l.current="",r("");i.current=t},g=[t],e[5]=t,e[6]=p,e[7]=g):(p=e[6],g=e[7]),R.useEffect(p,g);let x;return e[8]!==m||e[9]!==n||e[10]!==u?(x={input:n,setInput:u,clearInput:m},e[8]=m,e[9]=n,e[10]=u,e[11]=x):x=e[11],x}function kU(){wU()}function EU(t,e){return e?t.content.includes("ARG")?t.content.replace("ARG",e):`${t.content}
|
|
623
|
-
${e}`:t.content}function AU(t){const e=t.trimStart();if(!e.startsWith("/"))return null;const n=e.indexOf(" ");return n===-1?{command:e.slice(1),rest:""}:{command:e.slice(1,n),rest:e.slice(n+1).trim()}}const NU=R.forwardRef(function({onSendMessage:e,disabled:n,isStreaming:r,onStopStreaming:i,placeholder:l="Type a message...",workspaceId:c,serverUrl:a,apiToken:u,prompts:d=[],sessionId:m,modelSupportsImage:p},g){const{input:x,setInput:w,clearInput:C}=CU(m),[y,S]=R.useState(0),[b,_]=R.useState([]),[k,j]=R.useState(0),[N,D]=R.useState("none"),[E,O]=R.useState(""),[L,z]=R.useState([]),[H,$]=R.useState(!1),q=R.useRef(null),G=R.useRef(null);R.useImperativeHandle(g,()=>({focus:()=>{var ge;return(ge=q.current)==null?void 0:ge.focus()}}),[]);const{query:W,setQuery:X,showAutocomplete:Y,setShowAutocomplete:I,handleFileSelect:M,insertMention:P}=xU();R.useEffect(()=>{j(0)},[b,E,d]),R.useEffect(()=>{const ge=q.current;ge&&(ge.style.height="auto",ge.style.height=`${Math.min(ge.scrollHeight,150)}px`)},[x]);const B=d.filter(ge=>ge.name.toLowerCase().includes(E.toLowerCase())),F=N==="prompts"&&d.length>0,Q=N==="files"&&Y&&!!c,J=R.useCallback(ge=>{const Re=ge.target.value,be=ge.target.selectionStart||0;w(Re),S(be);const oe=Re.lastIndexOf("/",be);if(oe!==-1){const Ee=oe>0?Re[oe-1]:`
|
|
624
|
-
`,Ie=Re.slice(oe+1,be);if((Ee===`
|
|
625
|
-
`||Ee===" "||Ee==="")&&!Ie.includes(" ")){O(Ie),D("prompts");return}}const me=Re.lastIndexOf("@",be);if(me!==-1){const Ee=Re.slice(me+1,be);if(!Ee.includes(" ")){X(Ee),I(!0),D("files");return}}D("none"),I(!1)},[X,I,w]),ee=R.useCallback(ge=>{const Re=M(ge),be=P(x,y,Re);w(be.text),D("none"),I(!1),_([]),setTimeout(()=>{q.current&&(q.current.focus(),q.current.setSelectionRange(be.cursorPos,be.cursorPos))},0)},[x,y,M,P,I,w]),K=R.useCallback(ge=>{const Re=x.lastIndexOf("/",y),be=x.slice(0,Re),oe=x.slice(Re+1),me=oe.indexOf(" "),Ee=me!==-1?oe.slice(me):"",Ie=`${be}/${ge.name}${Ee}`,Fe=Re+1+ge.name.length+0;w(Ie),D("none"),setTimeout(()=>{q.current&&(q.current.focus(),q.current.setSelectionRange(Fe,Fe))},0)},[x,y,w]),V=R.useCallback(()=>{for(const ge of L)ge.previewUrl&&URL.revokeObjectURL(ge.previewUrl);z([]),C()},[L,C]),te=R.useCallback(async ge=>{if(!a||!u||!m)return null;try{const Re=new FormData;Re.append("file",ge);const be=await fetch(Xn(a,`/api/sessions/${m}/attachments`),{method:"POST",headers:{Authorization:`Bearer ${u}`},body:Re});if(!be.ok){const me=await be.json().catch(()=>({message:"Upload failed"}));return console.error("Upload failed:",me.message),null}const oe=await be.json();return{id:crypto.randomUUID(),kind:oe.kind,filename:oe.filename,size:oe.size,previewUrl:ge.type.startsWith("image/")?URL.createObjectURL(ge):void 0,uploadedId:oe.id,uploadedKind:oe.kind}}catch(Re){return console.error("Upload error:",Re),null}},[a,u,m]),re=R.useCallback(ge=>{z(Re=>{const be=Re.find(oe=>oe.id===ge);return be!=null&&be.previewUrl&&URL.revokeObjectURL(be.previewUrl),Re.filter(oe=>oe.id!==ge)})},[]),ae=R.useCallback(async ge=>{const Re=Array.from(ge);for(const be of Re){if(be.size>20*1024*1024)continue;const oe=be.type.startsWith("image/")?"image":be.type.startsWith("video/")?"video":"file",me={id:crypto.randomUUID(),kind:oe,filename:be.name,size:be.size,previewUrl:be.type.startsWith("image/")?URL.createObjectURL(be):void 0,isUploading:!0};z(Ie=>[...Ie,me]);const Ee=await te(be);z(Ee?Ie=>Ie.map(Fe=>Fe.id===me.id?(Fe.previewUrl&&Fe.previewUrl!==Ee.previewUrl&&URL.revokeObjectURL(Fe.previewUrl),{...Ee,isUploading:!1}):Fe):Ie=>Ie.filter(Fe=>Fe.id!==me.id))}},[te]),se=R.useCallback(ge=>{var be;const Re=(be=ge.clipboardData)==null?void 0:be.files;Re&&Re.length>0&&(ge.preventDefault(),ae(Re))},[ae]),Se=R.useCallback(ge=>{ge.preventDefault(),ge.stopPropagation(),$(!0)},[]),Ae=R.useCallback(ge=>{ge.preventDefault(),ge.stopPropagation(),$(!1)},[]),De=R.useCallback(ge=>{var be;ge.preventDefault(),ge.stopPropagation(),$(!1);const Re=(be=ge.dataTransfer)==null?void 0:be.files;Re&&Re.length>0&&ae(Re)},[ae]),Ue=async ge=>{ge==null||ge.preventDefault();const Re=x.trim();if(!Re&&L.length===0||n)return;const be=AU(x);if(be){const me=d.find(Ee=>Ee.name===be.command);if(me){const Ee=EU(me,be.rest),Ie=L.filter(Fe=>Fe.uploadedId).map(Fe=>({id:Fe.uploadedId,kind:Fe.uploadedKind}));e(Ee,Ie.length>0?Ie:void 0),V();return}}const oe=L.filter(me=>me.uploadedId).map(me=>({id:me.uploadedId,kind:me.uploadedKind}));e(Re||"",oe.length>0?oe:void 0),V()},ce=ge=>{if(!ge.nativeEvent.isComposing){if(F&&B.length>0)switch(ge.key){case"ArrowDown":ge.preventDefault(),j(Re=>Math.min(Re+1,B.length-1));return;case"ArrowUp":ge.preventDefault(),j(Re=>Math.max(Re-1,0));return;case"Enter":if(ge.shiftKey)return;ge.preventDefault(),B[k]&&K(B[k]);return;case"Tab":ge.preventDefault(),B[k]&&K(B[k]);return;case"Escape":ge.preventDefault(),D("none");return}if(Q&&b.length>0)switch(ge.key){case"ArrowDown":ge.preventDefault(),j(Re=>Math.min(Re+1,b.length-1));return;case"ArrowUp":ge.preventDefault(),j(Re=>Math.max(Re-1,0));return;case"Enter":ge.preventDefault(),b[k]&&ee(b[k]);return;case"Escape":ge.preventDefault(),I(!1),D("none");return;case"Tab":ge.preventDefault(),b[k]&&ee(b[k]);return}ge.key==="Enter"&&!ge.shiftKey&&(ge.preventDefault(),Ue())}},je=R.useCallback(ge=>{_(ge)},[]);if(r&&i)return h.jsx("div",{className:"p-4 border-t border-border bg-card",children:h.jsxs("div",{className:"flex items-center justify-center gap-3",children:[h.jsxs("div",{className:"animate-pulse flex items-center gap-2 text-muted-foreground",children:[h.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce"}),h.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.1s]"}),h.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.2s]"}),h.jsx("span",{className:"text-sm ml-2",children:"Generating..."})]}),h.jsxs(Te,{variant:"outline",size:"sm",onClick:i,children:[h.jsx(LS,{className:"size-4","data-icon":"inline-start"}),"Stop"]})]})});const xe=x.trim(),Ve=L.some(ge=>ge.isUploading),it=!(xe||L.length>0)||n||Ve;return h.jsxs("form",{onSubmit:Ue,onDragOver:Se,onDragLeave:Ae,onDrop:De,className:Ne("p-4 border-t border-border bg-card",H&&"ring-2 ring-primary"),children:[(L.length>0||!r)&&h.jsx("div",{className:"flex gap-2 flex-wrap mb-2",children:L.map(ge=>h.jsx(yU,{id:ge.id,kind:ge.kind,filename:ge.filename,size:ge.size,previewUrl:ge.previewUrl,isUploading:ge.isUploading,onRemove:re},ge.id))}),L.length>0&&p===!1&&h.jsxs("div",{className:"flex items-center gap-1.5 mb-2 text-xs text-amber-600 dark:text-amber-400",children:[h.jsx(Ua,{className:"size-3 shrink-0"}),h.jsx("span",{children:"This model will not inspect images directly. They will be sent as file paths instead."})]}),h.jsxs("div",{className:"flex gap-3 items-end",children:[h.jsx("div",{className:"flex-1 relative",children:h.jsxs(Ff,{open:F||Q,onOpenChange:ge=>{ge||(D("none"),I(!1))},children:[h.jsx(G8,{asChild:!0,children:h.jsx(Rk,{ref:q,value:x,onChange:J,onKeyDown:ce,onPaste:se,placeholder:l,disabled:n,className:Ne("min-h-[44px] max-h-[150px] resize-none pr-12 chat-input-scrollbar","focus-visible:ring-1"),rows:1,"data-chat-input":"true"})}),h.jsx(Hf,{className:"w-72 p-0",align:"start",side:"top",sideOffset:8,onOpenAutoFocus:ge=>ge.preventDefault(),onCloseAutoFocus:ge=>ge.preventDefault(),children:Q?h.jsx(pU,{workspaceId:c||"",searchQuery:W,selectedIndex:k,onSelect:ee,onFilesChange:je,serverUrl:a,apiToken:u}):h.jsx(vU,{prompts:d,query:E,selectedIndex:k,onSelect:K})})]})}),h.jsx("button",{type:"button",className:"flex items-center justify-center size-11 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50 disabled:pointer-events-none",onClick:()=>{var ge;return(ge=G.current)==null?void 0:ge.click()},disabled:n,children:h.jsx(uN,{className:"size-4"})}),h.jsx("input",{ref:G,type:"file",accept:"image/*,video/*,.pdf,.doc,.docx,.txt,.csv,.json,.xml,.md",multiple:!0,className:"hidden",onChange:ge=>{ge.target.files&&ae(ge.target.files),ge.target.value=""}}),h.jsx(Te,{type:"submit",disabled:it,size:"default",className:"h-11",children:h.jsx(SN,{className:"size-4"})})]}),h.jsxs("div",{className:"mt-2 text-xs text-muted-foreground text-center hidden sm:flex items-center justify-center gap-1",children:[h.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"/"}),h.jsx("span",{children:"prompts"}),h.jsx("span",{className:"mx-2",children:"•"}),h.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"@"}),h.jsx("span",{children:"files"}),h.jsx("span",{className:"mx-2",children:"•"}),h.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Enter"}),h.jsx("span",{children:"to send"}),h.jsx("span",{className:"mx-2",children:"•"}),h.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Shift + Enter"}),h.jsx("span",{children:"for new line"})]})]})});function RU(t){const e=he.c(3),n=R.useRef(t);let r;e[0]!==t?(r=()=>{n.current=t},e[0]=t,e[1]=r):r=e[1],R.useLayoutEffect(r);let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(...c)=>{const a=c;return n.current(...a)},e[2]=i):i=e[2],i}function Oa(t,e,n){var a;let r=(a=n.initialDeps)!=null?a:[],i,l=!0;function c(){var u,d,m;let p;n.key&&((u=n.debug)!=null&&u.call(n))&&(p=Date.now());const g=t();if(!(g.length!==r.length||g.some((C,y)=>r[y]!==C)))return i;r=g;let w;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(w=Date.now()),i=e(...g),n.key&&((m=n.debug)!=null&&m.call(n))){const C=Math.round((Date.now()-p)*100)/100,y=Math.round((Date.now()-w)*100)/100,S=y/16,b=(_,k)=>{for(_=String(_);_.length<k;)_=" "+_;return _};console.info(`%c⏱ ${b(y,5)} /${b(C,5)} ms`,`
|
|
626
|
-
font-size: .6rem;
|
|
627
|
-
font-weight: bold;
|
|
628
|
-
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(l&&n.skipInitialOnChange)&&n.onChange(i),l=!1,i}return c.updateDeps=u=>{r=u},c}function J_(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const jU=(t,e)=>Math.abs(t-e)<1.01,TU=(t,e,n)=>{let r;return function(...i){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,i),n)}},eS=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},DU=t=>t,MU=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let i=e;i<=n;i++)r.push(i);return r},OU=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const i=c=>{const{width:a,height:u}=c;e({width:Math.round(a),height:Math.round(u)})};if(i(eS(n)),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver(c=>{const a=()=>{const u=c[0];if(u!=null&&u.borderBoxSize){const d=u.borderBoxSize[0];if(d){i({width:d.inlineSize,height:d.blockSize});return}}i(eS(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},tS={passive:!0},nS=typeof window>"u"?!0:"onscrollend"in window,LU=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let i=0;const l=t.options.useScrollendEvent&&nS?()=>{}:TU(r,()=>{e(i,!1)},t.options.isScrollingResetDelay),c=m=>()=>{const{horizontal:p,isRtl:g}=t.options;i=p?n.scrollLeft*(g&&-1||1):n.scrollTop,l(),e(i,m)},a=c(!0),u=c(!1);n.addEventListener("scroll",a,tS);const d=t.options.useScrollendEvent&&nS;return d&&n.addEventListener("scrollend",u,tS),()=>{n.removeEventListener("scroll",a),d&&n.removeEventListener("scrollend",u)}},IU=(t,e,n)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},PU=(t,{adjustments:e=0,behavior:n},r)=>{var i,l;const c=t+e;(l=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||l.call(i,{[r.options.horizontal?"left":"top"]:c,behavior:n})};class zU{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var l;var n,r,i;return(l=(i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))!=null?l:Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(l=>{const c=()=>{const a=l.target,u=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(a,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var l;return(l=r())==null?void 0:l.observe(i,{box:"border-box"})},unobserve:i=>{var l;return(l=r())==null?void 0:l.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:DU,rangeExtractor:MU,onChange:()=>{},measureElement:IU,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Oa(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(i=(n=this.scrollElement)==null?void 0:n.window)!=null?i:null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,c)=>{this.scrollAdjustments=0,this.scrollDirection=c?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=c,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>{var n;return this.options.enabled?(this.scrollRect=(n=this.scrollRect)!=null?n:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var n;return this.options.enabled?(this.scrollOffset=(n=this.scrollOffset)!=null?n:typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(n,r)=>{const i=new Map,l=new Map;for(let c=r-1;c>=0;c--){const a=n[c];if(i.has(a.lane))continue;const u=l.get(a.lane);if(u==null||a.end>u.end?l.set(a.lane,a):a.end<u.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((c,a)=>c.end===a.end?c.index-a.index:c.end-a.end)[0]:void 0},this.getMeasurementOptions=Oa(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,i,l,c,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:l,enabled:c,lanes:a}),{key:!1}),this.getMeasurements=Oa(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:l,enabled:c,lanes:a},u)=>{if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const g of this.laneAssignments.keys())g>=n&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,d),p=new Array(a).fill(void 0);for(let g=0;g<d;g++){const x=m[g];x&&(p[x.lane]=g)}for(let g=d;g<n;g++){const x=l(g),w=this.laneAssignments.get(g);let C,y;if(w!==void 0&&this.options.lanes>1){C=w;const k=p[C],j=k!==void 0?m[k]:void 0;y=j?j.end+this.options.gap:r+i}else{const k=this.options.lanes===1?m[g-1]:this.getFurthestMeasurement(m,g);y=k?k.end+this.options.gap:r+i,C=k?k.lane:g%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(g,C)}const S=u.get(x),b=typeof S=="number"?S:this.options.estimateSize(g),_=y+b;m[g]={index:g,start:y,size:b,end:_,key:x,lane:C},p[C]=g}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Oa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,l)=>this.range=n.length>0&&r>0?BU({measurements:n,outerSize:r,scrollOffset:i,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Oa(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,l,c)=>l===null||c===null?[]:n({startIndex:l,endIndex:c,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var l;var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=(l=this.scrollState.index)!=null?l:(r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index;if(i!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,i-c),u=Math.min(this.options.count-1,i+c);return n>=a&&n<=u}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((c,a)=>{c.isConnected||(this.observer.unobserve(c),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),i=this.options.getItemKey(r),l=this.elementsCache.get(i);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(i,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var u;var i;const l=this.measurementsCache[n];if(!l)return;const c=(u=this.itemSizeCache.get(l.key))!=null?u:l.size,a=r-c;a!==0&&(((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,a,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,r)),this.notify(!1))},this.getVirtualItems=Oa(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let l=0,c=n.length;l<c;l++){const a=n[l],u=r[a];i.push(u)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return J_(r[t3(0,r.length-1,i=>J_(r[i]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),c=this.getScrollOffset();r==="auto"&&(r=n>=c+l?"end":"start"),r==="center"?n+=(i-l)/2:r==="end"&&(n-=l);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),l=this.getScrollOffset(),c=this.measurementsCache[n];if(!c)return;if(r==="auto")if(c.end>=l+i-this.options.scrollPaddingEnd)r="end";else if(c.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?c.end+this.options.scrollPaddingEnd:c.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,c.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{const l=this.getOffsetForAlignment(n,r),c=this.now();this.scrollState={index:null,align:r,behavior:i,startedAt:c,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:i="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const l=this.getOffsetForIndex(n,r);if(!l)return;const[c,a]=l,u=this.now();this.scrollState={index:n,align:a,behavior:i,startedAt:u,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getScrollOffset()+n,l=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var l;var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=(l=(n=r[r.length-1])==null?void 0:n.end)!=null?l:0;else{const c=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&c.some(u=>u===null);){const u=r[a];c[u.lane]===null&&(c[u.lane]=u.end),a--}i=Math.max(...c.filter(u=>u!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=r?r[0]:this.scrollState.lastTargetOffset,l=1,c=i!==this.scrollState.lastTargetOffset;if(!c&&jU(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,c&&(this.scrollState.lastTargetOffset=i,this.scrollState.behavior="auto",this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const t3=(t,e,n,r)=>{for(;t<=e;){const i=(t+e)/2|0,l=n(i);if(l<r)t=i+1;else if(l>r)e=i-1;else return i}return t>0?t-1:0};function BU({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const i=t.length-1,l=u=>t[u].start;if(t.length<=r)return{startIndex:0,endIndex:i};let c=t3(0,i,l,n),a=c;if(r===1)for(;a<i&&t[a].end<n+e;)a++;else if(r>1){const u=Array(r).fill(0);for(;a<i&&u.some(m=>m<n+e);){const m=t[a];u[m.lane]=m.end,a++}const d=Array(r).fill(n+e);for(;c>=0&&d.some(m=>m>=n);){const m=t[c];d[m.lane]=m.start,c--}c=Math.max(0,c-c%r),a=Math.min(i,a+(r-1-a%r))}return{startIndex:c,endIndex:a}}const rS=typeof document<"u"?R.useLayoutEffect:R.useEffect;function FU({useFlushSync:t=!0,...e}){const n=R.useReducer(()=>({}),{})[1],r={...e,onChange:(l,c)=>{var a;t&&c?el.flushSync(n):n(),(a=e.onChange)==null||a.call(e,l,c)}},[i]=R.useState(()=>new zU(r));return i.setOptions(r),rS(()=>i._didMount(),[]),rS(()=>i._willUpdate()),i}function HU(t){return FU({observeElementRect:OU,observeElementOffset:LU,scrollToFn:PU,...t})}function $U(t){const e=he.c(47),{message:n,textContent:r,children:i,isQueued:l,onRemove:c,onRevert:a,canRevert:u,onFork:d,canFork:m}=t,p=l===void 0?!1:l,g=u===void 0?!1:u,x=m===void 0?!1:m,[w,C]=R.useState(!1),[y,S]=R.useState(!1),[b,_]=R.useState(!1),k=n.role==="user";let j;e[0]!==r?(j=async()=>{const Q=r||"";await navigator.clipboard.writeText(Q),C(!0),setTimeout(()=>C(!1),2e3)},e[0]=r,e[1]=j):j=e[1];const N=j,D=k?"items-end":"items-start";let E;e[2]!==D?(E=Ne("flex flex-col gap-1 animate-slide-up min-w-0",D),e[2]=D,e[3]=E):E=e[3];const O=k?"mr-3":"ml-3";let L;e[4]!==O?(L=Ne("flex items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground",O),e[4]=O,e[5]=L):L=e[5];let z;e[6]!==x||e[7]!==g||e[8]!==w||e[9]!==N||e[10]!==p||e[11]!==k||e[12]!==n.role||e[13]!==d||e[14]!==a?(z=k?h.jsxs(h.Fragment,{children:[!p&&h.jsxs(h.Fragment,{children:[g&&a&&h.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>S(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Revert to this point",children:h.jsx(PN,{className:"size-3"})}),x&&d&&h.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>_(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Fork from this point",children:h.jsx(DA,{className:"size-3"})}),h.jsx(Te,{variant:"ghost",size:"icon",onClick:N,className:"size-5 text-muted-foreground hover:text-foreground",children:w?h.jsx(Vn,{className:"size-3"}):h.jsx(bc,{className:"size-3"})})]}),h.jsx(IS,{className:"size-3"}),n.role]}):h.jsxs(h.Fragment,{children:[h.jsx(U5,{className:"size-3"}),n.role,h.jsx(Te,{variant:"ghost",size:"icon",onClick:N,className:"size-5 text-muted-foreground hover:text-foreground",children:w?h.jsx(Vn,{className:"size-3"}):h.jsx(bc,{className:"size-3"})})]}),e[6]=x,e[7]=g,e[8]=w,e[9]=N,e[10]=p,e[11]=k,e[12]=n.role,e[13]=d,e[14]=a,e[15]=z):z=e[15];let H;e[16]!==L||e[17]!==z?(H=h.jsx("div",{className:L,children:z}),e[16]=L,e[17]=z,e[18]=H):H=e[18];const $=k?"max-w-[90%]":"max-w-full",q=p?"bg-muted border-2 border-dashed border-muted-foreground/30 opacity-80":k?"bg-primary text-primary-foreground rounded-br-md":"bg-card text-card-foreground border border-border rounded-bl-md";let G;e[19]!==$||e[20]!==q?(G=Ne("rounded-2xl px-4 py-3 relative group min-w-0 overflow-hidden",$,q),e[19]=$,e[20]=q,e[21]=G):G=e[21];let W;e[22]!==p||e[23]!==c?(W=p&&h.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 pb-2 border-b border-muted-foreground/20",children:[h.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[h.jsx(kS,{className:"size-3 animate-pulse"}),h.jsx("span",{children:"Pending"})]}),c&&h.jsx(Te,{variant:"ghost",size:"icon",onClick:c,className:"size-6 text-muted-foreground hover:text-destructive hover:bg-destructive/10",title:"Remove from queue",children:h.jsx(zn,{className:"size-3"})})]}),e[22]=p,e[23]=c,e[24]=W):W=e[24];let X;e[25]!==i?(X=h.jsx("div",{className:"min-w-0",children:i}),e[25]=i,e[26]=X):X=e[26];let Y;e[27]!==G||e[28]!==W||e[29]!==X?(Y=h.jsxs("div",{className:G,children:[W,X]}),e[27]=G,e[28]=W,e[29]=X,e[30]=Y):Y=e[30];let I;e[31]!==a?(I=()=>{a==null||a()},e[31]=a,e[32]=I):I=e[32];let M;e[33]!==y||e[34]!==I?(M=h.jsx(_g,{open:y,onOpenChange:S,title:"Revert Conversation",description:"This will delete this message and all messages after it. Are you sure you want to continue?",confirmLabel:"Revert",cancelLabel:"Cancel",onConfirm:I,variant:"destructive"}),e[33]=y,e[34]=I,e[35]=M):M=e[35];let P;e[36]!==d?(P=()=>{d==null||d()},e[36]=d,e[37]=P):P=e[37];let B;e[38]!==b||e[39]!==P?(B=h.jsx(_g,{open:b,onOpenChange:_,title:"Fork Conversation",description:"This will create a new session with messages up to and including this point. The original session will be unchanged.",confirmLabel:"Fork",cancelLabel:"Cancel",onConfirm:P}),e[38]=b,e[39]=P,e[40]=B):B=e[40];let F;return e[41]!==H||e[42]!==Y||e[43]!==M||e[44]!==B||e[45]!==E?(F=h.jsxs("div",{className:E,children:[H,Y,M,B]}),e[41]=H,e[42]=Y,e[43]=M,e[44]=B,e[45]=E,e[46]=F):F=e[46],F}const UU=cl.oneDark;function VU(t){var r;const e=(r=t.split(".").pop())==null?void 0:r.toLowerCase();return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",go:"go",rs:"rust",sh:"bash",yaml:"yaml",yml:"yaml"}[e||""]||e||"text"}const qU=R.memo(function(e){const n=he.c(28),{type:r,content:i,lineNumber:l,newLineNumber:c,language:a}=e,u=r==="added"&&"bg-green-500/20",d=r==="removed"&&"bg-red-500/20",m=r==="context"&&"bg-muted/30";let p;n[0]!==u||n[1]!==d||n[2]!==m?(p=Ne("flex font-mono text-xs",u,d,m),n[0]=u,n[1]=d,n[2]=m,n[3]=p):p=n[3];const g=p,x=r==="added"&&"text-green-400",w=r==="removed"&&"text-red-400",C=r==="context"&&"text-muted-foreground/50";let y;n[4]!==x||n[5]!==w||n[6]!==C?(y=Ne("font-bold w-4 select-none",x,w,C),n[4]=x,n[5]=w,n[6]=C,n[7]=y):y=n[7];const S=y,b=l!=null?l:"";let _;n[8]!==b?(_=h.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:b}),n[8]=b,n[9]=_):_=n[9];const k=c!=null?c:"";let j;n[10]!==k?(j=h.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:k}),n[10]=k,n[11]=j):j=n[11];const N=r==="added"&&"+",D=r==="removed"&&"-",E=r==="context"&&" ";let O;n[12]!==S||n[13]!==N||n[14]!==D||n[15]!==E?(O=h.jsxs("span",{className:S,children:[N,D,E]}),n[12]=S,n[13]=N,n[14]=D,n[15]=E,n[16]=O):O=n[16];let L;n[17]!==i||n[18]!==a?(L=h.jsx(Jf,{theme:UU,code:i,language:a,children:WU}),n[17]=i,n[18]=a,n[19]=L):L=n[19];let z;n[20]!==O||n[21]!==L?(z=h.jsxs("span",{className:"pl-2 flex-1 whitespace-pre flex",children:[O,L]}),n[20]=O,n[21]=L,n[22]=z):z=n[22];let H;return n[23]!==_||n[24]!==j||n[25]!==z||n[26]!==g?(H=h.jsxs("div",{className:g,children:[_,j,z]}),n[23]=_,n[24]=j,n[25]=z,n[26]=g,n[27]=H):H=n[27],H}),n3=R.memo(function(e){const n=he.c(33),{hunks:r,path:i,language:l,additions:c,deletions:a}=e,[u,d]=R.useState(!0);let m;n[0]!==i||n[1]!==l?(m=l||VU(i),n[0]=i,n[1]=l,n[2]=m):m=n[2];const p=m,g=qt(GU),x=Bg(KU);let w;n[3]!==x||n[4]!==g||n[5]!==i?(w=()=>{x&&g({workspaceId:x.id,path:i,name:i.split("/").pop()||i})},n[3]=x,n[4]=g,n[5]=i,n[6]=w):w=n[6];const C=w;let y;n[7]!==u?(y=()=>d(!u),n[7]=u,n[8]=y):y=n[8];let S;n[9]!==u?(S=u?h.jsx(Za,{className:"size-3"}):h.jsx(Hr,{className:"size-3"}),n[9]=u,n[10]=S):S=n[10];let b;n[11]!==y||n[12]!==S?(b=h.jsx("button",{onClick:y,className:"px-1 py-1 hover:bg-muted rounded",children:S}),n[11]=y,n[12]=S,n[13]=b):b=n[13];let _;n[14]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx(Oc,{className:"size-3"}),n[14]=_):_=n[14];let k;n[15]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(xc,{className:"size-2.5 opacity-0 group-hover/path:opacity-100 transition-opacity"}),n[15]=k):k=n[15];let j;n[16]!==C||n[17]!==i?(j=h.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-1 font-mono pr-2 hover:text-foreground transition-colors cursor-pointer rounded px-1 py-0.5 -mx-1 hover:bg-muted",title:"Open file preview",children:[i,k]}),n[16]=C,n[17]=i,n[18]=j):j=n[18];let N;n[19]!==c||n[20]!==a?(N=c!==void 0&&a!==void 0&&h.jsxs("span",{className:"ml-auto mr-2 text-muted-foreground",children:["+",c," -",a]}),n[19]=c,n[20]=a,n[21]=N):N=n[21];let D;n[22]!==b||n[23]!==j||n[24]!==N?(D=h.jsxs("div",{className:"group/path flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[b,_,j,N]}),n[22]=b,n[23]=j,n[24]=N,n[25]=D):D=n[25];let E;n[26]!==u||n[27]!==r||n[28]!==p?(E=u&&h.jsx("div",{style:{backgroundColor:"#282c34"},children:r.map((L,z)=>h.jsx("div",{className:"divide-y divide-white/5",children:L.changes.map((H,$)=>h.jsx(qU,{...H,language:p},$))},z))}),n[26]=u,n[27]=r,n[28]=p,n[29]=E):E=n[29];let O;return n[30]!==D||n[31]!==E?(O=h.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:h.jsxs("div",{children:[D,E]})}),n[30]=D,n[31]=E,n[32]=O):O=n[32],O});function WU(t){const{tokens:e,getTokenProps:n}=t;return h.jsx(h.Fragment,{children:e.map((r,i)=>h.jsx("span",{children:r.map((l,c)=>h.jsx("span",{...n({token:l})},c))},i))})}function GU(t){return t.openFilePreview}function KU(t){return t.activeWorkspace}const YU=cl.oneDark,XU=20;function QU(t){var r;const e=(r=t.split(".").pop())==null?void 0:r.toLowerCase();return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",go:"go",rs:"rust",sh:"bash",yaml:"yaml",yml:"yaml"}[e||""]||e||"text"}const ZU=R.memo(t=>{const e=he.c(46),{content:n,path:r,language:i,created:l,highlightLines:c}=t;let a;e[0]!==c?(a=c===void 0?[]:c,e[0]=c,e[1]=a):a=e[1];const u=a,[d,m]=R.useState(!1),p=qt(JU),g=Bg(eV);let x;e[2]!==g||e[3]!==p||e[4]!==r?(x=()=>{g&&p({workspaceId:g.id,path:r,name:r.split("/").pop()||r})},e[2]=g,e[3]=p,e[4]=r,e[5]=x):x=e[5];const w=x;let C;e[6]!==i||e[7]!==r?(C=i||QU(r),e[6]=i,e[7]=r,e[8]=C):C=e[8];const y=C;let S;e[9]!==u?(S=new Set(u),e[9]=u,e[10]=S):S=e[10];const b=S;let _;e[11]!==n?(_=n.split(`
|
|
629
|
-
`),e[11]=n,e[12]=_):_=e[12];const k=_.length;let j;e[13]!==d?(j=()=>m(!d),e[13]=d,e[14]=j):j=e[14];let N;e[15]!==d?(N=d?h.jsx(Za,{className:"size-3"}):h.jsx(Hr,{className:"size-3"}),e[15]=d,e[16]=N):N=e[16];let D;e[17]!==j||e[18]!==N?(D=h.jsx("button",{onClick:j,className:"flex items-center gap-2 px-2 py-1 hover:bg-muted",children:N}),e[17]=j,e[18]=N,e[19]=D):D=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=h.jsx(Oc,{className:"size-3"}),e[20]=E):E=e[20];let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=h.jsx(xc,{className:"size-2.5 opacity-0 group-hover/path:opacity-100 transition-opacity"}),e[21]=O):O=e[21];let L;e[22]!==w||e[23]!==r?(L=h.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-1 font-mono pr-2 hover:text-foreground transition-colors cursor-pointer rounded px-1 py-0.5 -mx-1 hover:bg-muted",title:"Open file preview",children:[r,O]}),e[22]=w,e[23]=r,e[24]=L):L=e[24];let z;e[25]!==d||e[26]!==k?(z=!d&&h.jsxs("span",{className:"text-xs text-muted-foreground/70",children:[k," lines"]}),e[25]=d,e[26]=k,e[27]=z):z=e[27];let H;e[28]!==l?(H=l===!1?h.jsxs("span",{className:"flex items-center gap-1 text-warning ml-auto mr-2",children:[h.jsx(To,{className:"size-3"}),"Overwrote"]}):h.jsxs("span",{className:"flex items-center gap-1 text-success ml-auto mr-2",children:[h.jsx(Vn,{className:"size-3"}),"Created"]}),e[28]=l,e[29]=H):H=e[29];let $;e[30]!==L||e[31]!==z||e[32]!==H||e[33]!==D?($=h.jsxs("div",{className:"group/path flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[D,E,L,z,H]}),e[30]=L,e[31]=z,e[32]=H,e[33]=D,e[34]=$):$=e[34];let q;e[35]===Symbol.for("react.memo_cache_sentinel")?(q={backgroundColor:"#282c34"},e[35]=q):q=e[35];let G;e[36]!==d||e[37]!==b?(G=Y=>{const{tokens:I,getTokenProps:M}=Y,P=d?I:I.slice(0,XU);return h.jsx(h.Fragment,{children:P.map((B,F)=>h.jsxs("div",{className:`flex font-mono text-xs ${b.has(F+1)?"bg-yellow-500/20":""}`,children:[h.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:F+1}),h.jsx("span",{className:"pl-2 flex-1 whitespace-pre",children:B.map((Q,J)=>h.jsx("span",{...M({token:Q})},J))})]},F))})},e[36]=d,e[37]=b,e[38]=G):G=e[38];let W;e[39]!==n||e[40]!==y||e[41]!==G?(W=h.jsx("div",{style:q,children:h.jsx(Jf,{theme:YU,code:n,language:y,children:G})}),e[39]=n,e[40]=y,e[41]=G,e[42]=W):W=e[42];let X;return e[43]!==$||e[44]!==W?(X=h.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:h.jsxs("div",{children:[$,W]})}),e[43]=$,e[44]=W,e[45]=X):X=e[45],X});function JU(t){return t.openFilePreview}function eV(t){return t.activeWorkspace}function tV(t){const e=he.c(3),{message:n}=t,r=n===void 0?"Success":n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(Mc,{className:"size-4"}),e[0]=i):i=e[0];let l;return e[1]!==r?(l=h.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i,h.jsx("span",{className:"break-all",children:r})]}),e[1]=r,e[2]=l):l=e[2],l}const nV={edit:SA,plus:Qr,trash:Br,search:$g};function rV(t){const e=he.c(7),{text:n}=t,[r,i]=R.useState(!1);let l;e[0]!==n?(l=async()=>{await navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),1500)},e[0]=n,e[1]=l):l=e[1];const c=l;let a;e[2]!==r?(a=r?h.jsx("span",{className:"text-success text-xs",children:"Copied!"}):h.jsx(bc,{className:"size-3"}),e[2]=r,e[3]=a):a=e[3];let u;return e[4]!==c||e[5]!==a?(u=h.jsx("button",{onClick:c,className:"text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:a}),e[4]=c,e[5]=a,e[6]=u):u=e[6],u}function sV(t){const e=he.c(16),{title:n,groups:r,files:i,total:l}=t;let c;e[0]!==i?(c=i||[],e[0]=i,e[1]=c):c=e[1];let a;e[2]!==c?(a={label:"Files",files:c,icon:void 0},e[2]=c,e[3]=a):a=e[3];const u=a;let d;e[4]!==u||e[5]!==i||e[6]!==r?(d=r||(i?[u]:[]),e[4]=u,e[5]=i,e[6]=r,e[7]=d):d=e[7];const m=d;if(m.length===0)return null;let p;e[8]!==n||e[9]!==l?(p=n&&h.jsxs("div",{className:"text-sm font-medium text-foreground",children:[n,l!==void 0&&h.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",l," files)"]})]}),e[8]=n,e[9]=l,e[10]=p):p=e[10];let g;e[11]!==m?(g=m.map(iV),e[11]=m,e[12]=g):g=e[12];let x;return e[13]!==p||e[14]!==g?(x=h.jsxs("div",{className:"flex flex-col gap-3",children:[p,g]}),e[13]=p,e[14]=g,e[15]=x):x=e[15],x}function iV(t,e){return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.icon&&h.jsx("span",{className:"flex items-center",children:(()=>{const n=nV[t.icon];return h.jsx(n,{className:"size-3"})})()}),h.jsx("span",{children:t.label}),h.jsxs("span",{className:"text-muted-foreground/50",children:["(",t.files.length,")"]})]}),h.jsx("div",{className:"flex flex-col gap-0.5 pl-5",children:t.files.map(oV)})]},e)}function oV(t,e){return h.jsxs("div",{className:"flex items-center gap-2 text-xs group",children:[h.jsx(Oc,{className:"size-3 text-muted-foreground shrink-0"}),h.jsx("span",{className:"font-mono text-foreground/80 truncate",children:t.path}),t.line!==void 0&&h.jsxs("span",{className:"text-muted-foreground shrink-0",children:[":",t.line]}),t.action&&h.jsx("span",{className:Ne("text-xs px-1 rounded shrink-0",t.action==="created"&&"bg-success/20 text-success",t.action==="modified"&&"bg-warning/20 text-warning",t.action==="deleted"&&"bg-destructive/20 text-destructive"),children:t.action}),h.jsx(rV,{text:t.path})]},e)}function aV(t){const e=he.c(15),{command:n,stdout:r,stderr:i,exitCode:l}=t,c=l===0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=h.jsx("span",{className:"text-muted-foreground",children:"$ "}),e[0]=a):a=e[0];let u;e[1]!==n?(u=h.jsxs("div",{className:"font-mono text-xs text-muted-foreground truncate flex-1 mr-2",children:[a,h.jsx("span",{className:"text-foreground",children:n})]}),e[1]=n,e[2]=u):u=e[2];const d=`text-xs font-mono px-2 py-0.5 rounded ${c?"bg-muted text-muted-foreground":"bg-red-500/20 text-red-400"}`;let m;e[3]!==l||e[4]!==d?(m=h.jsxs("span",{className:d,children:["[",l,"]"]}),e[3]=l,e[4]=d,e[5]=m):m=e[5];let p;e[6]!==u||e[7]!==m?(p=h.jsxs("div",{className:"bg-muted px-3 py-2 flex items-center justify-between",children:[u,m]}),e[6]=u,e[7]=m,e[8]=p):p=e[8];let g;e[9]!==i||e[10]!==r?(g=(r||i)&&h.jsxs("div",{className:"bg-black px-3 py-2 font-mono text-xs overflow-x-auto",children:[r&&h.jsx("pre",{className:"text-gray-300 whitespace-pre-wrap",children:r}),i&&h.jsx("pre",{className:"text-red-400 whitespace-pre-wrap mt-1",children:i})]}),e[9]=i,e[10]=r,e[11]=g):g=e[11];let x;return e[12]!==p||e[13]!==g?(x=h.jsxs("div",{className:"visualization-container border border-white/10 rounded-md overflow-hidden",children:[p,g]}),e[12]=p,e[13]=g,e[14]=x):x=e[14],x}const lV={pending:{icon:aA,color:"text-muted-foreground"},in_progress:{icon:Wt,color:"text-warning",animate:!0},completed:{icon:Mc,color:"text-success"},cancelled:{icon:cf,color:"text-destructive"}},cV={high:{label:"high",className:"bg-destructive/20 text-destructive"},medium:{label:"",className:""},low:{label:"low",className:"text-muted-foreground"}};function uV(t){const e=he.c(13),{title:n,items:r}=t;if(r.length===0)return null;let i;e[0]!==r?(i=r.filter(pV),e[0]=r,e[1]=i):i=e[1];const l=i.length;r.filter(hV),r.filter(fV);let c;e[2]!==l||e[3]!==r.length||e[4]!==n?(c=(n||r.length>0)&&h.jsxs("div",{className:"text-sm font-medium text-foreground",children:[n||"Todo List",h.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",r.length,")"]}),l>0&&h.jsxs("span",{className:"ml-2 text-success text-xs",children:[l," completed"]})]}),e[2]=l,e[3]=r.length,e[4]=n,e[5]=c):c=e[5];let a;e[6]!==r?(a=r.map(dV),e[6]=r,e[7]=a):a=e[7];let u;e[8]!==a?(u=h.jsx("div",{className:"flex flex-col gap-1 w-full",children:a}),e[8]=a,e[9]=u):u=e[9];let d;return e[10]!==c||e[11]!==u?(d=h.jsxs("div",{className:"flex flex-col gap-3 w-full overflow-hidden",children:[c,u]}),e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function dV(t,e){const n=lV[t.status],r=n.icon,i=cV[t.priority];return h.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[h.jsx(r,{className:Ne("size-4 shrink-0",n.color,n.animate&&"animate-spin")}),h.jsx("span",{className:Ne("flex-1 break-all",t.status==="completed"&&"line-through text-muted-foreground",t.status==="cancelled"&&"text-muted-foreground"),children:t.content}),i.label&&t.priority==="high"&&h.jsx("span",{className:Ne("text-xs px-1.5 py-0.5 rounded shrink-0",i.className),children:i.label}),t.priority==="low"&&t.status!=="completed"&&t.status!=="cancelled"&&h.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:i.label})]},e)}function fV(t){return t.status==="pending"}function hV(t){return t.status==="in_progress"}function pV(t){return t.status==="completed"}const mV=R.memo(function(e){const n=he.c(38),{visualization:r}=e;if(!r)return null;switch(r.type){case"diff":{let i;return n[0]!==r.additions||n[1]!==r.deletions||n[2]!==r.hunks||n[3]!==r.language||n[4]!==r.matchInfo||n[5]!==r.path?(i=h.jsx(n3,{path:r.path,hunks:r.hunks,language:r.language,additions:r.additions,deletions:r.deletions,matchInfo:r.matchInfo}),n[0]=r.additions,n[1]=r.deletions,n[2]=r.hunks,n[3]=r.language,n[4]=r.matchInfo,n[5]=r.path,n[6]=i):i=n[6],i}case"diffs":{let i;n[7]!==r.items?(i=r.items.map(gV),n[7]=r.items,n[8]=i):i=n[8];let l;return n[9]!==i?(l=h.jsx("div",{className:"space-y-3",children:i}),n[9]=i,n[10]=l):l=n[10],l}case"code":{let i;return n[11]!==r.content||n[12]!==r.created||n[13]!==r.highlightLines||n[14]!==r.language||n[15]!==r.path?(i=h.jsx(ZU,{path:r.path,content:r.content,language:r.language,created:r.created,highlightLines:r.highlightLines}),n[11]=r.content,n[12]=r.created,n[13]=r.highlightLines,n[14]=r.language,n[15]=r.path,n[16]=i):i=n[16],i}case"file-list":{let i;return n[17]!==r.files||n[18]!==r.groups||n[19]!==r.title||n[20]!==r.total?(i=h.jsx(sV,{title:r.title,groups:r.groups,files:r.files,total:r.total}),n[17]=r.files,n[18]=r.groups,n[19]=r.title,n[20]=r.total,n[21]=i):i=n[21],i}case"table":{let i;n[22]!==r.rows?(i=JSON.stringify(r.rows,null,2),n[22]=r.rows,n[23]=i):i=n[23];let l;return n[24]!==i?(l=h.jsx("pre",{className:"text-xs bg-muted/50 border rounded-md p-2 overflow-x-auto",children:i}),n[24]=i,n[25]=l):l=n[25],l}case"markdown":{let i;return n[26]!==r.content?(i=h.jsx("div",{className:"prose prose-sm dark:prose-invert",children:r.content}),n[26]=r.content,n[27]=i):i=n[27],i}case"none":{let i;return n[28]!==r.message?(i=h.jsx(tV,{message:r.message}),n[28]=r.message,n[29]=i):i=n[29],i}case"shell-output":{let i;return n[30]!==r.command||n[31]!==r.exitCode||n[32]!==r.stderr||n[33]!==r.stdout?(i=h.jsx(aV,{command:r.command,stdout:r.stdout,stderr:r.stderr,exitCode:r.exitCode}),n[30]=r.command,n[31]=r.exitCode,n[32]=r.stderr,n[33]=r.stdout,n[34]=i):i=n[34],i}case"todo-list":{let i;return n[35]!==r.items||n[36]!==r.title?(i=h.jsx(uV,{title:r.title,items:r.items}),n[35]=r.items,n[36]=r.title,n[37]=i):i=n[37],i}default:return null}});function gV(t,e){return h.jsx(n3,{path:t.path,hunks:t.hunks,language:t.language,additions:t.additions,deletions:t.deletions,matchInfo:t.matchInfo},`${t.path}-${e}`)}const sS=1536,iS=R.memo(function(e){const n=he.c(16),{content:r,className:i}=e,[l,c]=R.useState(!1);let a;n[0]!==r?(a=new Blob([r]),n[0]=r,n[1]=a):a=n[1];const u=a.size,d=u>sS,m=d?r.slice(0,sS)+`
|
|
630
|
-
...`:null;if(!d){let _;return n[2]!==i||n[3]!==r?(_=h.jsx("pre",{className:i,children:r}),n[2]=i,n[3]=r,n[4]=_):_=n[4],_}let p;n[5]!==u?(p=u>1048576?`${(u/1048576).toFixed(1)} MB`:u>1024?`${(u/1024).toFixed(1)} KB`:`${u} bytes`,n[5]=u,n[6]=p):p=n[6];const g=p,x=l?r:m;let w;n[7]!==i||n[8]!==x?(w=h.jsx("pre",{className:i,children:x}),n[7]=i,n[8]=x,n[9]=w):w=n[9];let C;n[10]===Symbol.for("react.memo_cache_sentinel")?(C=()=>c(_V),n[10]=C):C=n[10];const y=l?"Show less":`Show full output (${g})`;let S;n[11]!==y?(S=h.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground mt-1 transition-colors cursor-pointer",onClick:C,children:y}),n[11]=y,n[12]=S):S=n[12];let b;return n[13]!==w||n[14]!==S?(b=h.jsxs("div",{children:[w,S]}),n[13]=w,n[14]=S,n[15]=b):b=n[15],b});function vV(t){switch(t){case"pending":return h.jsx(kS,{className:"size-3 text-warning"});case"running":return h.jsx(Wt,{className:"size-3 text-warning animate-spin"});case"completed":return h.jsx(Mc,{className:"size-3 text-success"});case"error":return h.jsx(cf,{className:"size-3 text-destructive"});case"interrupted":return h.jsx(TS,{className:"size-3 text-warning"});default:return null}}function yV(t){if(t&&typeof t=="object"&&"_visualization"in t)return t._visualization}const bV=(t,e)=>{if(t.part!==e.part||t.onNavigateToSubagent!==e.onNavigateToSubagent)return!1;if(t.part.state.status!=="pending")return!0;const r=t.pendingPermissions.find(l=>l.toolCallId===t.part.callId),i=e.pendingPermissions.find(l=>l.toolCallId===e.part.callId);return r===i},xV=R.memo(function({part:e,pendingPermissions:n,onPermissionResponse:r,onNavigateToSubagent:i}){var _;const[l,c]=R.useState(!1),[a,u]=R.useState(!1),d=e.state,m=d.status,p=R.useMemo(()=>{if(!l)return"";try{return JSON.stringify(d.input,null,2)}catch{return String(d.input)}},[d.input,l]),g=R.useMemo(()=>!l||m!=="completed"||!("output"in d)?null:typeof d.output=="string"?d.output:JSON.stringify(d.output,null,2),[m,d,l]),x=m==="completed"&&"output"in d?yV(d.output):void 0,w=m==="pending"?n.find(k=>k.toolCallId===e.callId):void 0,C=w?typeof((_=w.args)==null?void 0:_.command)=="string"?w.args.command:JSON.stringify(w.args,null,2):null;let y=null;if(e.name==="task"){if("childSessionId"in d&&d.childSessionId)y=d.childSessionId;else if(m==="completed"&&"output"in d){const j=(typeof d.output=="string"?d.output:"").match(/task_id:\s*([a-f0-9-]{36})/i);j&&(y=j[1])}}const S=async()=>{if("output"in d){const k=typeof d.output=="string"?d.output:JSON.stringify(d.output,null,2);await navigator.clipboard.writeText(k),u(!0),setTimeout(()=>u(!1),2e3)}},b=(()=>{try{const k=JSON.stringify(d.input);return k.length>50?k.slice(0,47)+"...":k}catch{return String(d.input)}})();return h.jsxs("div",{className:"my-1",children:[h.jsxs(Ks,{open:l,onOpenChange:c,children:[h.jsx($i,{asChild:!0,children:h.jsxs("div",{className:"flex items-center gap-2 py-1 cursor-pointer hover:text-foreground transition-colors text-muted-foreground",children:[l?h.jsx(Za,{className:"size-4 text-muted-foreground"}):h.jsx(Hr,{className:"size-4 text-muted-foreground"}),h.jsx(YN,{className:"size-3"}),h.jsx("span",{className:"text-xs truncate max-w-[120px] sm:max-w-none",children:e.name}),!l&&h.jsx("span",{className:"text-xs text-muted-foreground font-mono truncate flex-1 min-w-0 sm:max-w-[200px] hidden sm:block",children:b}),h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[vV(m),y&&i&&h.jsxs(Te,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 sm:w-auto sm:px-2",onClick:k=>{k.stopPropagation(),i(y)},title:"View session",children:[h.jsx(xc,{className:"size-3"}),h.jsx("span",{className:"hidden sm:inline ml-1",children:"View"})]})]})]})}),l&&h.jsx(Ys,{children:h.jsxs("div",{className:"pl-5 pb-2 flex flex-col gap-2",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Input"}),h.jsx(iS,{content:p,className:"text-xs bg-background border rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words"})]}),(m==="running"||m==="completed")&&y&&i&&h.jsxs(Te,{variant:"outline",className:"w-full",size:"sm",onClick:()=>i(y),children:[h.jsx(xc,{className:"size-4","data-icon":"inline-start"}),m==="running"?"Watch Subagent":"View Session"]}),m==="completed"&&g!==null&&h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:"Output"}),h.jsx(Te,{variant:"ghost",size:"icon",onClick:S,className:"size-6",children:a?h.jsx(Vn,{className:"size-3 text-success"}):h.jsx(bc,{className:"size-3"})})]}),h.jsx(iS,{content:g,className:"text-xs bg-success/10 border border-success/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words"})]}),m==="error"&&"error"in d&&h.jsxs("div",{children:[h.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Error"}),h.jsx("pre",{className:"text-xs bg-destructive/10 border border-destructive/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words text-destructive",children:d.error})]})]})})]}),m==="pending"&&w&&h.jsxs("div",{className:"border border-warning/50 bg-warning/10 rounded-md p-3 flex flex-col gap-3 mt-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ua,{className:"size-4 text-warning"}),h.jsx("span",{className:"text-sm font-medium",children:"Permission Required"})]}),w.message&&h.jsx("p",{className:"text-sm",children:w.message}),w.dangerous&&h.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive font-medium",children:[h.jsx(Ua,{className:"size-4"}),"This operation is marked as dangerous"]}),C&&h.jsxs(Ks,{children:[h.jsx($i,{asChild:!0,children:h.jsxs("button",{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors w-full text-left",children:[h.jsx(Hr,{className:"size-3"}),h.jsx("span",{className:"uppercase tracking-wide",children:"Command"})]})}),h.jsx(Ys,{children:h.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 mt-1 overflow-x-auto whitespace-pre-wrap break-words overflow-wrap-break",children:C})})]}),h.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[h.jsx(Te,{variant:"outline",size:"sm",onClick:()=>r(e.callId,!1,!1),children:"Deny"}),h.jsx(Te,{variant:"secondary",size:"sm",onClick:()=>r(e.callId,!0,!1),children:"Approve"}),h.jsx(Te,{size:"sm",onClick:()=>r(e.callId,!0,!0),children:"Always Allow"})]})]}),m==="completed"&&x&&h.jsx("div",{className:"mt-2",children:h.jsx(mV,{visualization:x})})]})},bV);function _V(t){return!t}const tg=60,oS=300,Ro=16;function aS(t){if(t.length===0)return!1;const e=t[t.length-1];return zg(e.message)&&e.message.status==="streaming"}function lS(t){return t.filter(e=>e.type==="text").map(e=>e.text).join("")}function SV(t,e){const n=e.findIndex(r=>r.message.id===t);if(n<=0)return null;for(let r=n-1;r>=0;r--){const i=e[r];if(i.message.role==="assistant"&&i.message.status!=="streaming")return i.message.id}return null}function wV(){const t=he.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground bg-muted rounded-lg px-3 py-2 border border-border shadow-sm",children:[h.jsx(jS,{className:"size-4 animate-pulse"}),h.jsx("span",{children:"Compacting conversation..."})]}),t[0]=e):e=t[0],e}function CV(){const t=he.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-green-700 dark:text-green-400 bg-green-500/15 rounded-lg px-3 py-2 border border-green-500/30 shadow-sm",children:[h.jsx(sA,{className:"size-4"}),h.jsx("span",{children:"Compaction complete"})]}),t[0]=e):e=t[0],e}function kV(t){const e=he.c(8),{message:n,textContent:r,onRetry:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=h.jsxs("div",{className:"flex items-center gap-1.5 text-xs uppercase tracking-wide text-destructive ml-3",children:[h.jsx(Ua,{className:"size-3"}),"Compaction Failed"]}),e[0]=l):l=e[0];const c=r||n.error||"Compaction failed. The conversation could not be summarized.";let a;e[1]!==c?(a=h.jsx("p",{className:"text-sm text-destructive/90",children:c}),e[1]=c,e[2]=a):a=e[2];let u;e[3]!==i?(u=i&&h.jsxs(Te,{variant:"outline",size:"sm",onClick:i,className:"mt-2 h-7 text-xs gap-1.5",children:[h.jsx(DS,{className:"size-3"}),"Retry"]}),e[3]=i,e[4]=u):u=e[4];let d;return e[5]!==a||e[6]!==u?(d=h.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[l,h.jsxs("div",{className:"rounded-2xl px-4 py-3 max-w-full bg-destructive/10 border border-destructive/30 rounded-bl-md",children:[a,u]})]}),e[5]=a,e[6]=u,e[7]=d):d=e[7],d}function EV(t,e){var r;return(t==null?void 0:t.split("/").pop())||((r=e==null?void 0:e.split(".").pop())==null?void 0:r.toLowerCase())||""}function AV(t){const e=he.c(15),{part:n}=t,[r,i]=R.useState(!1),l=n.overflow?"overflow":n.auto?"auto":"manual";let c;e[0]!==r?(c=()=>i(!r),e[0]=r,e[1]=c):c=e[1];let a;e[2]!==r?(a=r?h.jsx(Za,{className:"size-3"}):h.jsx(Hr,{className:"size-3"}),e[2]=r,e[3]=a):a=e[3];const u=l==="overflow"?"Context overflow":l==="auto"?"Auto":"Manual";let d;e[4]!==u?(d=h.jsxs("span",{className:"border-b border-dashed border-muted-foreground/40 pb-px",children:[u," compaction"]}),e[4]=u,e[5]=d):d=e[5];let m;e[6]!==c||e[7]!==a||e[8]!==d?(m=h.jsxs("button",{onClick:c,className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[a,d]}),e[6]=c,e[7]=a,e[8]=d,e[9]=m):m=e[9];let p;e[10]!==r?(p=r&&h.jsx("div",{className:"mt-2 text-xs text-muted-foreground italic",children:"Summary available in the assistant message below"}),e[10]=r,e[11]=p):p=e[11];let g;return e[12]!==m||e[13]!==p?(g=h.jsxs("div",{className:"flex flex-col items-center py-3",children:[m,p]}),e[12]=m,e[13]=p,e[14]=g):g=e[14],g}const NV=R.memo(function(e){const n=he.c(15),{parts:r,pendingPermissions:i,onPermissionResponse:l,onNavigateToSubagent:c,inverted:a,serverUrl:u}=e,d=a===void 0?!1:a;let m;if(n[0]!==d||n[1]!==c||n[2]!==l||n[3]!==r||n[4]!==i||n[5]!==u){const g=[...r].sort(TV);let x;n[7]!==d||n[8]!==c||n[9]!==l||n[10]!==i||n[11]!==u?(x=w=>{switch(w.type){case"text":return h.jsx("div",{className:"min-w-0",children:h.jsx(JE,{inverted:d,children:w.text||"..."})},w.id);case"reasoning":return h.jsx("div",{className:"visualization-container text-muted-foreground text-sm italic border-l-2 border-muted-foreground/30 pl-3 my-2 wrap-break-word",children:w.text},w.id);case"tool":return h.jsx(xV,{part:w,pendingPermissions:i,onPermissionResponse:l,onNavigateToSubagent:c},w.id);case"image":{const C=u?Xn(u,w.url):w.url;return h.jsx("img",{src:C,alt:"",className:Ne("max-w-full max-h-64 rounded-xl mt-2 object-contain",d&&"ring-2 ring-white/20")},w.id)}case"file":{const C=u?Xn(u,w.url):w.url,y=EV(w.mimeType,w.filename),S=w.filename||"",b=S.length>30?S.slice(0,27)+"...":S||"unnamed";return h.jsxs("a",{href:C,className:Ne("mt-2 p-2 rounded-lg text-sm flex items-center gap-2 transition-colors",d?"bg-white/15 hover:bg-white/25 text-primary-foreground":"bg-muted hover:bg-accent"),target:"_blank",rel:"noopener noreferrer",children:[h.jsx(Pr,{className:"size-4 shrink-0"}),h.jsx("span",{className:"truncate",children:b}),y&&h.jsx("span",{className:Ne("px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide ml-auto shrink-0",d?"bg-white/25 text-primary-foreground":"bg-secondary text-secondary-foreground"),children:y}),h.jsx(pA,{className:"size-3.5 shrink-0 opacity-60"})]},w.id)}default:return null}},n[7]=d,n[8]=c,n[9]=l,n[10]=i,n[11]=u,n[12]=x):x=n[12],m=g.map(x),n[0]=d,n[1]=c,n[2]=l,n[3]=r,n[4]=i,n[5]=u,n[6]=m}else m=n[6];let p;return n[13]!==m?(p=h.jsx(h.Fragment,{children:m}),n[13]=m,n[14]=p):p=n[14],p},(t,e)=>{if(t.parts!==e.parts||t.inverted!==e.inverted||t.onPermissionResponse!==e.onPermissionResponse||t.onNavigateToSubagent!==e.onNavigateToSubagent||t.serverUrl!==e.serverUrl)return!1;if(!t.parts.some(c=>c.type==="tool"&&c.state.status==="pending"))return!0;const r=new Set(t.parts.filter(c=>c.type==="tool").map(c=>c.callId)),i=t.pendingPermissions.filter(c=>r.has(c.toolCallId)),l=e.pendingPermissions.filter(c=>r.has(c.toolCallId));if(i.length!==l.length)return!1;for(let c=0;c<i.length;c++)if(i[c].toolCallId!==l[c].toolCallId)return!1;return!0}),RV=R.memo(function(e){const n=he.c(46),{item:r,messagesWithParts:i,sessionId:l,pendingPermissions:c,onPermissionResponse:a,onNavigateToSubagent:u,onRemoveFromQueue:d,onRevert:m,onFork:p,isMainActiveSession:g,isCompacting:x,onCompact:w,serverUrl:C}=e,y=g===void 0?!1:g,S=x===void 0?!1:x;let b;n[0]!==r.parts?(b=r.parts.find(DV),n[0]=r.parts,n[1]=b):b=n[1];const _=b;if(zg(r.message)&&r.message.mode==="compact_failed"){const X=r.message;let Y;n[2]!==r.parts?(Y=lS(r.parts),n[2]=r.parts,n[3]=Y):Y=n[3];const I=y&&!S?w:void 0;let M;return n[4]!==X||n[5]!==Y||n[6]!==I?(M=h.jsx(kV,{message:X,textContent:Y,onRetry:I}),n[4]=X,n[5]=Y,n[6]=I,n[7]=M):M=n[7],M}if(_){let X;return n[8]!==_?(X=h.jsx(AV,{part:_}),n[8]=_,n[9]=X):X=n[9],X}const j=!r.isQueued&&r.message.role==="user";let N;n[10]!==j||n[11]!==r.message||n[12]!==i?(N=j?SV(r.message.id,i):null,n[10]=j,n[11]=r.message,n[12]=i,n[13]=N):N=n[13];const D=N,E=r.message;let O;n[14]!==r.parts?(O=lS(r.parts),n[14]=r.parts,n[15]=O):O=n[15];let L;n[16]!==r.isQueued||n[17]!==r.queueId||n[18]!==d?(L=r.isQueued?()=>d(r.queueId):void 0,n[16]=r.isQueued,n[17]=r.queueId,n[18]=d,n[19]=L):L=n[19];const z=j&&D!==null;let H;n[20]!==m||n[21]!==D||n[22]!==l?(H=D?()=>m==null?void 0:m(l,D):void 0,n[20]=m,n[21]=D,n[22]=l,n[23]=H):H=n[23];const $=j&&D!==null;let q;n[24]!==r.message||n[25]!==p||n[26]!==D||n[27]!==l?(q=D?()=>p==null?void 0:p(l,r.message.id):void 0,n[24]=r.message,n[25]=p,n[26]=D,n[27]=l,n[28]=q):q=n[28];let G;n[29]!==r.message||n[30]!==r.parts||n[31]!==u||n[32]!==a||n[33]!==c||n[34]!==C?(G=r.parts.length===0?h.jsx("span",{className:"opacity-50",children:"..."}):h.jsx(NV,{parts:r.parts,pendingPermissions:c,onPermissionResponse:a,onNavigateToSubagent:u,inverted:r.message.role==="user",serverUrl:C}),n[29]=r.message,n[30]=r.parts,n[31]=u,n[32]=a,n[33]=c,n[34]=C,n[35]=G):G=n[35];let W;return n[36]!==r.isQueued||n[37]!==r.message||n[38]!==$||n[39]!==q||n[40]!==G||n[41]!==O||n[42]!==L||n[43]!==z||n[44]!==H?(W=h.jsx($U,{message:E,textContent:O,isQueued:r.isQueued,onRemove:L,canRevert:z,onRevert:H,canFork:$,onFork:q,children:G}),n[36]=r.isQueued,n[37]=r.message,n[38]=$,n[39]=q,n[40]=G,n[41]=O,n[42]=L,n[43]=z,n[44]=H,n[45]=W):W=n[45],W});function jV({displayItems:t,messagesWithParts:e,sessionId:n,sessionStatus:r,pendingPermissions:i,isCompacting:l=!1,compactionSuccess:c=!1,onClearCompactionSuccess:a,onPermissionResponse:u,onNavigateToSubagent:d,onRemoveFromQueue:m,onRevert:p,onFork:g,onCompact:x,isMainActiveSession:w=!1,autoFollow:C=!0,onAutoScrollChange:y,scrollToBottomRef:S,serverUrl:b}){var F,Q;const _=R.useRef(null),[k,j]=R.useState(!1),N=R.useRef(C),D=R.useRef(t.length),E=R.useRef(0),O=R.useRef(!1),L=R.useRef(!1),z=R.useRef(""),H=R.useCallback(J=>{if(J.length===0)return"";const ee=J[J.length-1],V=ee.parts.filter(ae=>ae.type==="text").reduce((ae,se)=>ae+se.text.length,0),te=ee.message.id,re=zg(ee.message)?ee.message.status:"n/a";return`${te}:${re}:${ee.parts.length}:${V}`},[]),$=R.useRef(null),q=R.useRef(null),G=R.useRef(new Map),W=R.useRef(t);W.current=t;const X=R.useCallback(J=>{const ee=W.current[J];if(!ee)return tg+Ro;if(ee.message.role==="assistant"){let V=100;return ee.parts.some(ae=>{var se,Se;return ae.type==="text"&&((se=ae.text)==null?void 0:se.includes("```"))||ae.type==="tool"&&((Se=ae.state.input)==null?void 0:Se.command)})&&(V=180),ee.parts.some(ae=>ae.type==="tool")&&(V=Math.max(V,150)),ee.parts.some(ae=>ae.type==="compaction")&&(V=60),ee.message.mode==="compact_failed"&&(V=100),Math.min(Math.max(V+Ro,tg+Ro),oS+Ro)}const K=ee.parts.length>1?80:60;return Math.min(Math.max(K+Ro,tg+Ro),oS+Ro)},[]);R.useLayoutEffect(()=>{const J=_.current;if(!J)return;const ee=requestAnimationFrame(()=>{J.querySelectorAll("[data-index]").forEach(V=>{const te=V.getAttribute("data-index");if(te===null)return;const re=parseInt(te,10);G.current.set(re,V.offsetHeight)})});return()=>cancelAnimationFrame(ee)},[t.length]);const Y=R.useRef(null);R.useLayoutEffect(()=>{const J=_.current;if(!J)return;Y.current&&Y.current.disconnect();const ee=new ResizeObserver(V=>{V.forEach(te=>{const re=te.target,ae=re.getAttribute("data-index");if(ae===null)return;const se=parseInt(ae,10),Se=re.offsetHeight;G.current.set(se,Se)})});return Y.current=ee,J.querySelectorAll("[data-index]").forEach(V=>ee.observe(V)),()=>ee.disconnect()},[t.length]);const I=HU({count:t.length,getScrollElement:()=>_.current,estimateSize:X,overscan:5,getItemKey:J=>{var K,V;const ee=t[J];return(V=(K=ee==null?void 0:ee.message)==null?void 0:K.id)!=null?V:`fallback-${J}`}});R.useLayoutEffect(()=>{N.current=C,D.current=t.length,E.current=0,O.current=!1,z.current="",t.length!==0&&(I.scrollToIndex(t.length-1,{align:"end"}),O.current=!0)},[n]),R.useEffect(()=>{const J=_.current;if(!J)return;const ee=K=>{N.current&&K.deltaY<0&&(N.current=!1,y==null||y(!1))};return J.addEventListener("wheel",ee,{passive:!1}),()=>J.removeEventListener("wheel",ee)},[y]);const M=RU(()=>{if(L.current)return;const J=_.current;if(J)if(N.current){const{scrollTop:ee,scrollHeight:K,clientHeight:V}=J;K-ee-V>0&&(L.current=!0,J.scrollTop=K,requestAnimationFrame(()=>{L.current=!1}))}else{const{scrollTop:ee,scrollHeight:K,clientHeight:V}=J;K-ee-V<=5&&(N.current=!0,y==null||y(!0))}});R.useLayoutEffect(()=>{j(l)},[l]);const P=H(t);R.useLayoutEffect(()=>{var Ae;const J=t.length,ee=D.current,K=J!==ee,V=P,te=V!==z.current;z.current=V;const re=J-1;let ae=0;re>=0&&(ae=(Ae=G.current.get(re))!=null?Ae:0);const se=E.current,Se=re>=0&&ae>se&&se>0;if(D.current=J,E.current=ae,!(J===0||!K&&!te&&!Se)){if(ee===0&&J>0&&se===0&&!O.current){I.scrollToIndex(J-1,{align:"end"}),O.current=!0;return}N.current&&(_.current.scrollTop=_.current.scrollHeight)}},[t.length,P,I]),R.useEffect(()=>{var te;const J=I.getVirtualItems(),ee=J.length-1;if(ee<0)return;const K=J[ee],V=(te=_.current)==null?void 0:te.querySelector(`[data-index="${K.index}"]`);if($.current&&$.current.disconnect(),!!V&&(q.current=V,!(!aS(t)||!N.current)))return $.current=new ResizeObserver(re=>{N.current&&aS(t)&&requestAnimationFrame(()=>{N.current&&(_.current.scrollTop=_.current.scrollHeight)})}),$.current.observe(V),()=>{$.current&&($.current.disconnect(),$.current=null)}},[t,I]),R.useEffect(()=>{if(c){const J=setTimeout(()=>{a==null||a()},3e3);return()=>clearTimeout(J)}},[c,a]),R.useLayoutEffect(()=>{S&&(S.current=()=>{N.current=!0,L.current=!0,_.current.scrollTop=_.current.scrollHeight,requestAnimationFrame(()=>{L.current=!1})})},[S]),R.useLayoutEffect(()=>{N.current=C},[C]);const B=I.getVirtualItems();return h.jsxs("div",{ref:_,className:"flex-1 min-h-0 overflow-y-auto relative chat-transcript-scrollbar",style:{WebkitOverflowScrolling:"touch"},onScroll:M,children:[k&&h.jsx("div",{className:"sticky top-0 z-10 px-4 pt-4 pb-1 bg-gradient-to-b from-background via-background/95 to-transparent",children:h.jsx(wV,{})}),c&&h.jsx("div",{className:"sticky top-0 z-10 px-4 pt-4 pb-1 bg-gradient-to-b from-background via-background/95 to-transparent",children:h.jsx(CV,{})}),r==="closed"&&h.jsx(Rd,{className:"mx-4 mt-4",children:h.jsx(jd,{children:"This session is archived. You can reopen it from the sidebar."})}),h.jsx("div",{className:"relative w-full",style:{height:`${I.getTotalSize()}px`},children:t.length===0?h.jsxs("div",{className:"text-center py-16 text-muted-foreground px-4",children:[h.jsx("p",{className:"text-lg mb-2",children:"Start a conversation"}),h.jsx("p",{className:"text-sm",children:"Send a message below to begin."})]}):h.jsx("div",{className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${(Q=(F=B[0])==null?void 0:F.start)!=null?Q:0}px)`},children:B.map(J=>{const ee=t[J.index];return h.jsx("div",{"data-index":J.index,ref:I.measureElement,className:"px-4 py-4",children:h.jsx(RV,{item:ee,messagesWithParts:e,sessionId:n,pendingPermissions:i,onPermissionResponse:u,onNavigateToSubagent:d,onRemoveFromQueue:m,onRevert:p,onFork:g,isMainActiveSession:w,isCompacting:l,onCompact:x,serverUrl:b})},ee.message.id)})})})]})}function TV(t,e){return t.createdAt-e.createdAt}function DV(t){return t.type==="compaction"}function MV(t,e){const n=t.map(c=>({message:c.message,parts:c.parts,isQueued:!1})),r=e.map(c=>{const a=(c.attachments||[]).map(u=>{const d=`/api/sessions/${c.sessionId}/attachments/${u.id}/content?key=${u.accessKey}`;return u.kind==="image"?{id:`${c.id}-att-${u.id}`,messageId:c.id,createdAt:c.createdAt,type:"image",url:d,mimeType:u.mimeType}:{id:`${c.id}-att-${u.id}`,messageId:c.id,createdAt:c.createdAt,type:"file",url:d,mimeType:u.mimeType||"",filename:u.filename}});return{message:{id:c.id,role:"user",sessionId:c.sessionId,createdAt:c.createdAt},parts:[...a,...c.content.trim()?[{id:`${c.id}-part`,messageId:c.id,createdAt:c.createdAt,type:"text",text:c.content}]:[]],isQueued:!0,queueId:c.id}}),i=[...n].sort((c,a)=>c.message.createdAt-a.message.createdAt),l=[...r].sort((c,a)=>c.message.createdAt-a.message.createdAt);return[...i,...l]}function OV(t){const e=he.c(9),{permissions:n,onPermissionResponse:r}=t;if(n.length===0)return null;let i,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={overflow:"overlay"},l=h.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide font-medium",children:"Pending Requests"}),e[0]=i,e[1]=l):(i=e[0],l=e[1]);let c;if(e[2]!==r||e[3]!==n){let u;e[5]!==r?(u=d=>{var p;const m=typeof((p=d.args)==null?void 0:p.command)=="string"?d.args.command:JSON.stringify(d.args,null,2);return h.jsxs("div",{className:"p-3 bg-warning/10 border border-warning/30 rounded-lg flex flex-col gap-2",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"text-sm font-medium",children:d.toolName})}),h.jsx("p",{className:"text-sm",children:d.message}),h.jsxs(Ks,{children:[h.jsx($i,{asChild:!0,children:h.jsxs("button",{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors w-full text-left",children:[h.jsx(Hr,{className:"size-3"}),h.jsx("span",{className:"uppercase tracking-wide",children:"Command"})]})}),h.jsx(Ys,{children:h.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 mt-1 overflow-x-auto whitespace-pre-wrap break-words",children:m})})]}),h.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[h.jsx(Te,{variant:"outline",size:"sm",onClick:()=>r(d.toolCallId,!1,!1),children:"Deny"}),h.jsx(Te,{variant:"secondary",size:"sm",onClick:()=>r(d.toolCallId,!0,!1),children:"Approve"}),h.jsx(Te,{size:"sm",onClick:()=>r(d.toolCallId,!0,!0),children:"Always Allow"})]})]},d.toolCallId)},e[5]=r,e[6]=u):u=e[6],c=n.map(u),e[2]=r,e[3]=n,e[4]=c}else c=e[4];let a;return e[7]!==c?(a=h.jsxs("div",{className:"border-t border-border bg-muted/30 flex flex-col gap-2 p-4",style:i,children:[l,c]}),e[7]=c,e[8]=a):a=e[8],a}function LV(t){const e=he.c(86),{session:n,messagesWithParts:r,queuedMessages:i,preconfigs:l,prompts:c,models:a,defaultModel:u,onSendMessage:d,onRemoveFromQueue:m,onChangePreconfig:p,onChangeModel:g,onChangeVariant:x,pendingPermissions:w,onPermissionResponse:C,onRename:y,usage:S,modelName:b,modelSupportsImage:_,onNavigateToSubagent:k,onNavigateBack:j,isStreaming:N,onInterrupt:D,onRevert:E,onFork:O,onCompact:L,isCompacting:z,compactionSuccess:H,onClearCompactionSuccess:$,serverUrl:q,apiToken:G,selectedVariant:W,variants:X,inputRef:Y,scrollToBottomRef:I,autoFollowToggleRef:M}=t,B=!n.parentId&&n.status==="active",[F,Q]=R.useState(!0);let J;e[0]!==I?(J=()=>{Q(Re=>{var oe;const be=!Re;return be&&((oe=I==null?void 0:I.current)==null||oe.call(I)),be})},e[0]=I,e[1]=J):J=e[1];const ee=J;let K,V;e[2]!==M||e[3]!==ee?(K=()=>{M&&(M.current={toggle:()=>{ee()}})},V=[M,ee],e[2]=M,e[3]=ee,e[4]=K,e[5]=V):(K=e[4],V=e[5]),R.useEffect(K,V);let te;e[6]!==r||e[7]!==i?(te=MV(r,i),e[6]=r,e[7]=i,e[8]=te):te=e[8];const re=te;let ae;if(e[9]!==r||e[10]!==w||e[11]!==n.id){let Re;e[13]!==r||e[14]!==n.id?(Re=be=>be.sessionId!==n.id?!1:!r.some(oe=>oe.parts.some(me=>me.type==="tool"&&me.callId===be.toolCallId)),e[13]=r,e[14]=n.id,e[15]=Re):Re=e[15],ae=w.filter(Re),e[9]=r,e[10]=w,e[11]=n.id,e[12]=ae}else ae=e[12];const se=ae,Se=r.length>=4;let Ae;e[16]!==u||e[17]!==z||e[18]!==N||e[19]!==b||e[20]!==a||e[21]!==g||e[22]!==p||e[23]!==x||e[24]!==L||e[25]!==D||e[26]!==j||e[27]!==y||e[28]!==l||e[29]!==W||e[30]!==n||e[31]!==Se||e[32]!==S||e[33]!==X?(Ae=h.jsx(hU,{session:n,preconfigs:l,models:a,defaultModel:u,usage:S,modelName:b,onChangePreconfig:p,onChangeModel:g,onChangeVariant:x,onRename:y,onNavigateBack:j,isStreaming:N,onInterrupt:D,onCompact:L,isCompacting:z,canCompact:Se,selectedVariant:W,variants:X}),e[16]=u,e[17]=z,e[18]=N,e[19]=b,e[20]=a,e[21]=g,e[22]=p,e[23]=x,e[24]=L,e[25]=D,e[26]=j,e[27]=y,e[28]=l,e[29]=W,e[30]=n,e[31]=Se,e[32]=S,e[33]=X,e[34]=Ae):Ae=e[34];let De;e[35]!==O||e[36]!==E||e[37]!==F||e[38]!==H||e[39]!==re||e[40]!==z||e[41]!==B||e[42]!==r||e[43]!==$||e[44]!==L||e[45]!==k||e[46]!==C||e[47]!==m||e[48]!==w||e[49]!==I||e[50]!==q||e[51]!==n.id||e[52]!==n.status?(De=h.jsx(jV,{displayItems:re,messagesWithParts:r,sessionId:n.id,sessionStatus:n.status,pendingPermissions:w,isCompacting:z,compactionSuccess:H,onClearCompactionSuccess:$,onPermissionResponse:C,onNavigateToSubagent:k,onRemoveFromQueue:m,onRevert:E,onFork:O,onCompact:L,isMainActiveSession:B,autoFollow:F,onAutoScrollChange:Q,scrollToBottomRef:I,serverUrl:q}),e[35]=O,e[36]=E,e[37]=F,e[38]=H,e[39]=re,e[40]=z,e[41]=B,e[42]=r,e[43]=$,e[44]=L,e[45]=k,e[46]=C,e[47]=m,e[48]=w,e[49]=I,e[50]=q,e[51]=n.id,e[52]=n.status,e[53]=De):De=e[53];const Ue=F?"Auto-follow enabled (Cmd+Shift+F)":"Auto-follow disabled (Cmd+Shift+F)";let ce;e[54]!==F?(ce=F?h.jsx(F5,{className:"size-3.5"}):h.jsx(Hg,{className:"size-3.5"}),e[54]=F,e[55]=ce):ce=e[55];let je;e[56]!==ee||e[57]!==ce||e[58]!==Ue?(je=h.jsx("button",{onClick:ee,className:"absolute bottom-4 right-4 z-50 flex items-center p-1.5 text-xs rounded-full transition-colors cursor-pointer bg-background/80 backdrop-blur-sm hover:bg-background border border-border/50 shadow-sm pointer-events-auto",title:Ue,children:ce}),e[56]=ee,e[57]=ce,e[58]=Ue,e[59]=je):je=e[59];let xe;e[60]!==je||e[61]!==De?(xe=h.jsxs("div",{className:"relative flex flex-col flex-1 min-h-0",children:[De,je]}),e[60]=je,e[61]=De,e[62]=xe):xe=e[62];let Ve;e[63]!==C||e[64]!==se?(Ve=se.length>0&&h.jsx(OV,{permissions:se,onPermissionResponse:C}),e[63]=C,e[64]=se,e[65]=Ve):Ve=e[65];let We;e[66]!==G||e[67]!==Y||e[68]!==z||e[69]!==_||e[70]!==d||e[71]!==c||e[72]!==q||e[73]!==n.id||e[74]!==n.parentId||e[75]!==n.status||e[76]!==n.workspaceId?(We=n.status==="active"&&!n.parentId&&h.jsx(NU,{ref:Y,onSendMessage:d,disabled:z,workspaceId:n.workspaceId,serverUrl:q,apiToken:G,prompts:c,sessionId:n.id,modelSupportsImage:_}),e[66]=G,e[67]=Y,e[68]=z,e[69]=_,e[70]=d,e[71]=c,e[72]=q,e[73]=n.id,e[74]=n.parentId,e[75]=n.status,e[76]=n.workspaceId,e[77]=We):We=e[77];let it;e[78]!==n.parentId?(it=n.parentId&&h.jsxs("div",{className:"p-4 border-t border-border bg-muted/50 text-center flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[h.jsx(QA,{className:"size-4"}),"This is a subagent session (read-only)"]}),e[78]=n.parentId,e[79]=it):it=e[79];let ge;return e[80]!==xe||e[81]!==Ve||e[82]!==We||e[83]!==it||e[84]!==Ae?(ge=h.jsxs("div",{className:"flex flex-col flex-1 min-h-0 relative",children:[Ae,xe,Ve,We,it]}),e[80]=xe,e[81]=Ve,e[82]=We,e[83]=it,e[84]=Ae,e[85]=ge):ge=e[85],ge}function IV(t){var lt,ze,qe;const e=he.c(79),{servers:n,activeServer:r,isSwitching:i,connected:l,authError:c,connectionTimedOut:a,retryCount:u,nextRetryIn:d,serverUrl:m,currentSession:p,messagesWithParts:g,queuedMessages:x,preconfigs:w,primaryPreconfigs:C,prompts:y,models:S,defaultModel:b,selectedVariant:_,pendingPermissions:k,sessionUsage:j,currentModel:N,streamingSessionIds:D,isCompacting:E,compactionSuccess:O,isPrimarySession:L,inputRef:z,apiToken:H,onFirstServerAdded:$,onRetry:q,onLogout:G,onSendMessage:W,onRemoveFromQueue:X,onChangePreconfig:Y,onChangeModel:I,onChangeVariant:M,onPermissionResponse:P,onRename:B,onNavigateToSubagent:F,onNavigateBack:Q,onInterrupt:J,onRevert:ee,onFork:K,onCompact:V,onClearCompactionSuccess:te,scrollToBottomRef:re,autoFollowToggleRef:ae}=t,se=!!r;let Se;e[0]!==Y?(Se=Pe=>{Y(Pe)},e[0]=Y,e[1]=Se):Se=e[1];const Ae=Se;let De;e[2]!==M?(De=Pe=>{M(Pe)},e[2]=M,e[3]=De):De=e[3];const Ue=De;let ce;e[4]!==J?(ce=()=>{J()},e[4]=J,e[5]=ce):ce=e[5];const je=ce;if(n.length===0){const Pe=c||void 0;let nt;return e[6]!==$||e[7]!==Pe?(nt=h.jsx(X_,{onServerAdded:$,error:Pe}),e[6]=$,e[7]=Pe,e[8]=nt):nt=e[8],nt}if(!se){const Pe=c||void 0;let nt;return e[9]!==$||e[10]!==Pe?(nt=h.jsx(X_,{onServerAdded:$,error:Pe}),e[9]=$,e[10]=Pe,e[11]=nt):nt=e[11],nt}if(i){const Pe=`Connecting to ${(r==null?void 0:r.name)||"server"}...`;let nt;return e[12]!==Pe?(nt=h.jsx("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:h.jsx(Y_,{message:Pe})}),e[12]=Pe,e[13]=nt):nt=e[13],nt}if(!l&&n.length>0){if(a){let kt;return e[14]!==c||e[15]!==d||e[16]!==G||e[17]!==q||e[18]!==u||e[19]!==m?(kt=h.jsx("div",{className:"flex w-full h-full items-center justify-center bg-background",children:h.jsx(K$,{serverUrl:m,authError:c,retryCount:u,nextRetryIn:d,onRetry:q,onLogout:G})}),e[14]=c,e[15]=d,e[16]=G,e[17]=q,e[18]=u,e[19]=m,e[20]=kt):kt=e[20],kt}let Pe;e[21]===Symbol.for("react.memo_cache_sentinel")?(Pe=h.jsx(Y_,{}),e[21]=Pe):Pe=e[21];let nt;return e[22]!==G?(nt=h.jsxs("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:[Pe,h.jsx(Te,{variant:"ghost",size:"sm",onClick:G,className:"text-muted-foreground",children:"Change Server"})]}),e[22]=G,e[23]=nt):nt=e[23],nt}if(!p){let Pe;return e[24]===Symbol.for("react.memo_cache_sentinel")?(Pe=h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center text-muted-foreground px-6",children:[h.jsx("h2",{className:"mb-2",children:"Select or create a session"}),h.jsx("p",{children:"Choose a session from the sidebar or create a new one to start chatting."})]}),e[24]=Pe):Pe=e[24],Pe}let xe;e[25]!==g?(xe=g.filter(PV),e[25]=g,e[26]=xe):xe=e[26];const We=xe.length>=4;let it;if(e[27]!==N||e[28]!==S){let Pe;e[30]!==N?(Pe=nt=>nt.id===N,e[30]=N,e[31]=Pe):Pe=e[31],it=S.find(Pe),e[27]=N,e[28]=S,e[29]=it}else it=e[29];const ge=it;let Re;e[32]!==p.id||e[33]!==x?(Re=x[p.id]||[],e[32]=p.id,e[33]=x,e[34]=Re):Re=e[34];const be=L?C:w,oe=ge==null?void 0:ge.variants,me=(qe=(ze=(lt=ge==null?void 0:ge.capabilities)==null?void 0:lt.input)==null?void 0:ze.image)!=null?qe:!1;let Ee;e[35]!==p.id||e[36]!==p.runningAt||e[37]!==D?(Ee=D.has(p.id)||!!p.runningAt,e[35]=p.id,e[36]=p.runningAt,e[37]=D,e[38]=Ee):Ee=e[38];let Ie;e[39]!==We||e[40]!==p.id||e[41]!==V?(Ie=We?()=>V(p.id):void 0,e[39]=We,e[40]=p.id,e[41]=V,e[42]=Ie):Ie=e[42];const Fe=m!=null?m:void 0,Ge=H!=null?H:void 0;let Ze;return e[43]!==ae||e[44]!==O||e[45]!==N||e[46]!==p||e[47]!==b||e[48]!==Ae||e[49]!==Ue||e[50]!==je||e[51]!==z||e[52]!==E||e[53]!==g||e[54]!==S||e[55]!==I||e[56]!==te||e[57]!==K||e[58]!==Q||e[59]!==F||e[60]!==P||e[61]!==X||e[62]!==B||e[63]!==ee||e[64]!==W||e[65]!==k||e[66]!==y||e[67]!==re||e[68]!==_||e[69]!==j||e[70]!==Ee||e[71]!==Ie||e[72]!==Fe||e[73]!==Ge||e[74]!==Re||e[75]!==be||e[76]!==oe||e[77]!==me?(Ze=h.jsx(LV,{inputRef:z,session:p,messagesWithParts:g,queuedMessages:Re,preconfigs:be,prompts:y,models:S,defaultModel:b,onSendMessage:W,onRemoveFromQueue:X,onChangePreconfig:Ae,onChangeModel:I,onChangeVariant:Ue,selectedVariant:_,variants:oe,pendingPermissions:k,onPermissionResponse:P,onRename:B,usage:j,modelName:N,modelSupportsImage:me,onNavigateToSubagent:F,onNavigateBack:Q,isStreaming:Ee,onInterrupt:je,onRevert:ee,onFork:K,onCompact:Ie,isCompacting:E,compactionSuccess:O,onClearCompactionSuccess:te,serverUrl:Fe,apiToken:Ge,scrollToBottomRef:re,autoFollowToggleRef:ae}),e[43]=ae,e[44]=O,e[45]=N,e[46]=p,e[47]=b,e[48]=Ae,e[49]=Ue,e[50]=je,e[51]=z,e[52]=E,e[53]=g,e[54]=S,e[55]=I,e[56]=te,e[57]=K,e[58]=Q,e[59]=F,e[60]=P,e[61]=X,e[62]=B,e[63]=ee,e[64]=W,e[65]=k,e[66]=y,e[67]=re,e[68]=_,e[69]=j,e[70]=Ee,e[71]=Ie,e[72]=Fe,e[73]=Ge,e[74]=Re,e[75]=be,e[76]=oe,e[77]=me,e[78]=Ze):Ze=e[78],Ze}function PV(t){return t.message.role!=="system"}const zV={".ts":{icon:Pr,color:"text-blue-500"},".tsx":{icon:Pr,color:"text-blue-500"},".js":{icon:Pr,color:"text-yellow-500"},".jsx":{icon:Pr,color:"text-yellow-500"},".json":{icon:Pr,color:"text-yellow-600"},".md":{icon:Pr,color:"text-gray-500"},".css":{icon:Pr,color:"text-purple-500"},".html":{icon:Pr,color:"text-orange-500"}};function r3({entry:t,workspaceId:e,parentPath:n,depth:r,onFileSelect:i,showHidden:l=!0,serverUrl:c,apiToken:a}){const{fetchWithAuth:u}=ns(),[d,m]=R.useState(!1),[p,g]=R.useState([]),[x,w]=R.useState(!1),[C,y]=R.useState(!1),S=n?`${n}/${t.path}`:t.path,b=t.type==="directory",_=async()=>{if(!(C||x)){w(!0);try{const z=await(await u(`/api/workspaces/${e}/files?path=${encodeURIComponent(S)}&showHidden=${l}`,{},{serverUrl:c,token:a})).json();g(z.files||[]),y(!0)}catch(L){console.error("Failed to load children:",L)}finally{w(!1)}}},k=L=>{var z;(z=document.activeElement)==null||z.focus(),m(L),L&&b&&_()},j=L=>{L.currentTarget.focus(),!b&&i&&i({...t,path:S})},N=L=>{L.key==="Enter"&&(L.preventDefault(),j(L))},D=t.extension?zV[t.extension]:null,E=b?d?sg:Vs:(D==null?void 0:D.icon)||Pr,O=b?"text-amber-500":(D==null?void 0:D.color)||"text-muted-foreground";return b?h.jsxs(Ks,{open:d,onOpenChange:k,children:[h.jsx($i,{asChild:!0,children:h.jsxs("button",{"data-file-node":!0,"data-file-type":"directory","data-file-is-open":d||void 0,className:Ne("flex items-center gap-2 w-full min-w-0 overflow-hidden rounded-md p-2 text-left text-sm","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus:ring-1 focus:ring-inset ring-sidebar-ring outline-hidden","[&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate"),style:{paddingLeft:`${r*12+8}px`},children:[x?h.jsx(Wt,{className:"w-3 h-3 animate-spin shrink-0"}):h.jsx(Hr,{className:Ne("w-3 h-3 shrink-0 transition-transform",d&&"rotate-90")}),h.jsx(E,{className:O}),h.jsx("div",{className:"flex-1 min-w-0 truncate",children:t.name})]})}),h.jsx(Ys,{children:p.map(L=>h.jsx(r3,{entry:L,workspaceId:e,parentPath:S,depth:r+1,onFileSelect:i,showHidden:l,serverUrl:c,apiToken:a},`${S}/${L.path}`))})]}):h.jsxs("button",{"data-file-node":!0,"data-file-type":"file",onClick:j,onKeyDown:N,className:Ne("flex items-center gap-2 w-full min-w-0 overflow-hidden rounded-md p-2 text-left text-sm","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus:ring-1 focus:ring-inset ring-sidebar-ring outline-hidden","[&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate"),style:{paddingLeft:`${r*12+8}px`},children:[h.jsx(E,{className:O}),h.jsx("div",{className:"flex-1 min-w-0 truncate",children:t.name})]})}const Ig=R.forwardRef(({workspaceId:t,serverUrl:e,apiToken:n,onFileSelect:r,showHidden:i=!0,width:l},c)=>{const[a,u]=R.useState([]),[d,m]=R.useState(""),[p,g]=R.useState(!0),[x,w]=R.useState(null),{fetchWithAuth:C}=ns(),y=R.useRef(null),S=R.useCallback(async()=>{g(!0),w(null);try{const _=await C(`/api/workspaces/${t}/files?showHidden=${i}`,{},{serverUrl:e,token:n}),k=await _.json();if(!_.ok)throw new Error(k.message||"Failed to load files");u(k.files),m(k.currentPath)}catch(_){w(_ instanceof Error?_.message:"Failed to load files")}finally{g(!1)}},[t,i,C,e,n]);R.useEffect(()=>{S()},[S]),R.useImperativeHandle(c,()=>({refresh:S,focus:()=>{const _=y.current;if(!_)return;const k=_.querySelector("[data-file-node]");k?k.focus():_.focus()}}),[S]);const b=R.useCallback(_=>{var D,E,O,L,z,H,$;const k=y.current;if(!k)return;const j=Array.from(k.querySelectorAll("[data-file-node]"));if(j.length===0)return;const N=j.indexOf(document.activeElement);switch(_.key){case"ArrowDown":{_.preventDefault();const q=N<j.length-1?N+1:0;(D=j[q])==null||D.focus();break}case"ArrowUp":{_.preventDefault();const q=N>0?N-1:j.length-1;(E=j[q])==null||E.focus();break}case"ArrowRight":{_.preventDefault();const q=document.activeElement;if(!q)break;if(q.getAttribute("data-file-type")==="directory")if(q.getAttribute("data-file-is-open")!=="true")q.click();else{const X=N<j.length-1?N+1:-1;X>=0&&((O=j[X])==null||O.focus())}else{const W=N<j.length-1?N+1:-1;W>=0&&((L=j[W])==null||L.focus())}break}case"ArrowLeft":{_.preventDefault();const q=document.activeElement;if(!q)break;if(q.getAttribute("data-file-type")==="directory")if(q.getAttribute("data-file-is-open")==="true")q.click();else{const X=N>0?N-1:-1;X>=0&&((z=j[X])==null||z.focus())}else{const W=N>0?N-1:-1;W>=0&&((H=j[W])==null||H.focus())}break}case"Enter":{document.activeElement instanceof HTMLButtonElement&&document.activeElement.click();break}case"Escape":{_.preventDefault(),($=document.activeElement)==null||$.blur();break}}},[]);return p?h.jsxs("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:[h.jsx(Wt,{className:"w-4 h-4 animate-spin mr-2"}),"Loading files..."]}):x?h.jsxs("div",{className:"p-4 text-sm text-destructive",children:[x,h.jsx(Te,{variant:"ghost",size:"sm",onClick:S,className:"ml-2",children:h.jsx(Pi,{className:"w-3 h-3"})})]}):a.length===0?h.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Empty workspace",h.jsx(Te,{variant:"ghost",size:"sm",onClick:S,className:"ml-2",children:h.jsx(Pi,{className:"w-3 h-3"})})]}):h.jsx("div",{ref:y,tabIndex:-1,onKeyDown:b,className:"flex-1 min-h-0 min-w-0 w-full outline-none",children:h.jsx(ds,{className:"h-full",children:h.jsx("div",{className:"px-2 pb-2 w-full min-w-0",style:l?{width:`${l-8}px`}:void 0,children:h.jsx("div",{className:"space-y-0.5 min-w-0",children:a.map(_=>h.jsx(r3,{entry:_,workspaceId:t,parentPath:d,depth:0,onFileSelect:r,showHidden:i,serverUrl:e,apiToken:n},_.path))})})})})});Ig.displayName="FileTree";const s3=R.forwardRef((t,e)=>{const n=he.c(43),{workspaceId:r,serverUrl:i,apiToken:l,isOpen:c,onClose:a}=t,u=ol(),d=R.useRef(null),m=qt(BV),p=qt(FV);let g;n[0]!==p?(g=()=>{p(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var z;(z=d.current)==null||z.focus()})})},n[0]=p,n[1]=g):g=n[1];const x=g;let w,C;n[2]!==x?(w=()=>({focus:x}),C=[x],n[2]=x,n[3]=w,n[4]=C):(w=n[3],C=n[4]),R.useImperativeHandle(e,w,C);const y=qt(HV);let S;n[5]!==y||n[6]!==r?(S=z=>{z.type==="file"&&r&&y({workspaceId:r,path:z.path,name:z.name})},n[5]=y,n[6]=r,n[7]=S):S=n[7];const b=S;if(!r)return null;if(u){let z;n[8]!==a?(z=I=>!I&&a(),n[8]=a,n[9]=z):z=n[9];let H;n[10]===Symbol.for("react.memo_cache_sentinel")?(H=h.jsx(Vf,{className:"sr-only",children:h.jsx(qf,{children:"Files"})}),n[10]=H):H=n[10];let $;n[11]===Symbol.for("react.memo_cache_sentinel")?($=h.jsx("span",{className:"font-semibold text-sm text-sidebar-foreground",children:"Files"}),n[11]=$):$=n[11];let q;n[12]===Symbol.for("react.memo_cache_sentinel")?(q=h.jsx(zn,{className:"size-4"}),n[12]=q):q=n[12];let G;n[13]!==a?(G=h.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[$,h.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:a,children:q})]}),n[13]=a,n[14]=G):G=n[14];let W;n[15]!==l||n[16]!==b||n[17]!==i||n[18]!==r?(W=h.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:h.jsx(Ig,{ref:d,workspaceId:r,serverUrl:i,apiToken:l,showHidden:!0,onFileSelect:b},r)}),n[15]=l,n[16]=b,n[17]=i,n[18]=r,n[19]=W):W=n[19];let X;n[20]!==W||n[21]!==G?(X=h.jsxs(Uf,{side:"right",className:"w-72 p-0 bg-sidebar [&>button]:hidden",children:[H,G,W]}),n[20]=W,n[21]=G,n[22]=X):X=n[22];let Y;return n[23]!==c||n[24]!==X||n[25]!==z?(Y=h.jsx($f,{open:c,onOpenChange:z,children:X}),n[23]=c,n[24]=X,n[25]=z,n[26]=Y):Y=n[26],Y}const _=`${m}px`;let k;n[27]!==_?(k={"--sidebar-width":_},n[27]=_,n[28]=k):k=n[28];const j=k;let N;n[29]===Symbol.for("react.memo_cache_sentinel")?(N=h.jsx(Pk,{side:"right",panelId:"files"}),n[29]=N):N=n[29];let D;n[30]===Symbol.for("react.memo_cache_sentinel")?(D=h.jsx(Lk,{children:h.jsx(jo,{children:h.jsx(Hs,{children:h.jsxs(Ii,{className:"w-full justify-between",onClick:()=>{var z;return(z=d.current)==null?void 0:z.refresh()},children:[h.jsx("span",{className:"text-sm font-semibold",children:"Files"}),h.jsx(Pi,{className:"size-4"})]})})})}),n[30]=D):D=n[30];let E;n[31]!==l||n[32]!==m||n[33]!==b||n[34]!==i||n[35]!==r?(E=h.jsx(Ik,{className:"overflow-hidden",children:h.jsx(Ig,{ref:d,workspaceId:r,serverUrl:i,apiToken:l,showHidden:!0,width:m,onFileSelect:b},r)}),n[31]=l,n[32]=m,n[33]=b,n[34]=i,n[35]=r,n[36]=E):E=n[36];let O;n[37]!==c||n[38]!==E?(O=h.jsxs(Ok,{side:"right",isOpen:c,children:[N,D,E]}),n[37]=c,n[38]=E,n[39]=O):O=n[39];let L;return n[40]!==O||n[41]!==j?(L=h.jsx(Mk,{panelId:"files",defaultOpen:!0,className:"w-0 shrink-0",style:j,children:O}),n[40]=O,n[41]=j,n[42]=L):L=n[42],L});s3.displayName="FilesPanel";function BV(t){return t.filesPanelWidth}function FV(t){return t.setShowFilesPanel}function HV(t){return t.openFilePreview}function $V(t,e){var w;const{session:n}=t,{setSessions:r,setCurrentSession:i,setMessagesBySession:l,setPartsBySession:c,setSessionUsage:a,setCurrentModel:u,setSelectedVariant:d,pendingSessionCreateRef:m,sessionAccessTimesRef:p,partIdIndexRef:g,defaultModel:x}=e;r(C=>[n,...C]),m.current&&(i(n),l({[n.id]:[]}),c({[n.id]:{}}),g.current.clear(),a({promptTokens:0,completionTokens:0,totalTokens:0}),u(n.selectedModel||x),d((w=n.selectedVariant)!=null?w:null),m.current=!1),p.current.set(n.id,Date.now())}function UV(t,e){var D;const{session:n,messages:r,usage:i,isRunning:l}=t,{setCurrentSession:c,removeInterruptedSession:a,addStreamingSession:u,removeStreamingSession:d,skipFinishSoundSessionIdsRef:m,setMessagesBySession:p,setPartsBySession:g,setSessionUsage:x,setCurrentModel:w,setSelectedVariant:C,sessionAccessTimesRef:y,partIdIndexRef:S,models:b,defaultModel:_,clearCompletion:k}=e;if(c(n),a(n.id),k(n.id),l?u(n.id):(d(n.id),m.current.add(n.id)),r){p({[n.id]:r.map(E=>E.message)}),g(()=>{const E={};E[n.id]={};for(const O of r)E[n.id][O.message.id]=O.parts;return E}),S.current.clear();for(const E of r)for(let O=0;O<E.parts.length;O++)S.current.set(E.parts[O].id,{sessionId:n.id,messageId:E.message.id,index:O})}x(i!=null?i:{promptTokens:0,completionTokens:0,totalTokens:0}),w(n.selectedModel||_),C(n.selectedVariant||null);const j=n.selectedModel||_,N=(D=b.find(E=>E.id===j))==null?void 0:D.variants;n.selectedVariant&&N&&!N[n.selectedVariant]&&C(null),y.current.set(n.id,Date.now())}function VV(t,e){const{sessionId:n}=t,{setSessions:r,setMessagesBySession:i,setPartsBySession:l,setCurrentSession:c,partIdIndexRef:a,partAppendRafRef:u,pendingPartAppendsRef:d,sessionAccessTimesRef:m,currentSessionIdRef:p,clearCompletion:g}=e;r(x=>x.map(w=>w.id===n?{...w,status:"closed"}:w)),g(n),p.current===n&&(u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),d.current.clear()),i(x=>{const w={...x};return delete w[n],w}),l(x=>{const w={...x};return delete w[n],w});for(const[x,w]of a.current)w.sessionId===n&&a.current.delete(x);m.current.delete(n),p.current===n&&c(null)}function qV(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:i,currentSessionIdRef:l}=e;r(c=>c.map(a=>a.id===n.id?n:a)),l.current===n.id&&i(n)}function WV(t,e){const{sessionId:n}=t,{setSessions:r,setMessagesBySession:i,setPartsBySession:l,removeInterruptedSession:c,partIdIndexRef:a,sessionAccessTimesRef:u,setCurrentSession:d,currentSessionIdRef:m,clearCompletion:p}=e;r(g=>g.filter(x=>x.id!==n)),p(n),i(g=>{const x={...g};return delete x[n],x}),l(g=>{const x={...g};return delete x[n],x}),c(n);for(const[g,x]of a.current)x.sessionId===n&&a.current.delete(g);u.current.delete(n),m.current===n&&d(null)}function GV(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:i,setSelectedVariant:l,setCurrentModel:c,currentSessionIdRef:a}=e;r(u=>u.map(d=>d.id===n.id?n:d)),a.current===n.id&&(i(n),n.selectedVariant!==void 0&&l(n.selectedVariant),n.selectedModel&&c(n.selectedModel))}function KV(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:i,currentSessionIdRef:l}=e;r(c=>c.map(a=>a.id===n.id?n:a)),l.current===n.id&&i(n)}function YV(t,e){const{sessionId:n,result:r}=t,{addInterruptedSession:i,skipFinishSoundSessionIdsRef:l,removeStreamingSession:c}=e;i(n),l.current.add(n),c(n),r.cascadedTo.length>0&&console.log(`Session ${n} interrupted. Cascaded to:`,r.cascadedTo)}function XV(t,e){const{sessionId:n,revertedTo:r,removed:i}=t;console.log(`Session ${n} reverted to message ${r.messageId}, removed ${i.messageIds.length} messages`)}function QV(t,e){const{forkedSession:n,messages:r}=t,{setSessions:i,setCurrentSession:l,setMessagesBySession:c,setPartsBySession:a,setSessionUsage:u,sessionAccessTimesRef:d,partIdIndexRef:m,clearCompletion:p}=e;i(g=>[n,...g]),c({[n.id]:r.map(g=>g.message)}),a(()=>{const g={};g[n.id]={};for(const x of r)g[n.id][x.message.id]=x.parts;return g}),m.current.clear();for(const g of r)for(let x=0;x<g.parts.length;x++)m.current.set(g.parts[x].id,{sessionId:n.id,messageId:g.message.id,index:x});l(n),u({promptTokens:0,completionTokens:0,totalTokens:0}),d.current.set(n.id,Date.now()),p(n.id)}function ZV(t,e){const{sessionId:n,messages:r}=t,{setMessagesBySession:i,setPartsBySession:l,partIdIndexRef:c,partAppendRafRef:a,skipFinishSoundSessionIdsRef:u,removeStreamingSession:d,sessionAccessTimesRef:m,flushPendingPartAppends:p,currentSessionIdRef:g,clearCompletion:x}=e;if(g.current===n&&(a.current!==null&&(cancelAnimationFrame(a.current),a.current=null),p()),g.current===n){i({[n]:r.map(w=>w.message)}),l(()=>{const w={};w[n]={};for(const C of r)w[n][C.message.id]=C.parts;return w}),c.current.clear();for(const w of r)for(let C=0;C<w.parts.length;C++)c.current.set(w.parts[C].id,{sessionId:n,messageId:w.message.id,index:C})}u.current.add(n),d(n),m.current.set(n,Date.now()),x(n)}const JV={"session.created":$V,"session.resumed":UV,"session.closed":VV,"session.reopened":qV,"session.deleted":WV,"session.updated":GV,"session.renamed":KV,"session.interrupted":YV,"session.reverted":XV,"session.forked":QV,"session.state":ZV};function eq(t,e){const{message:n}=t,{setMessagesBySession:r,setPartsBySession:i,addStreamingSession:l,removeInterruptedSession:c,currentSessionIdRef:a,clearCompletion:u}=e;u(n.sessionId),n.sessionId===a.current&&(r(d=>({...d,[n.sessionId]:[...d[n.sessionId]||[],n]})),i(d=>({...d,[n.sessionId]:{...d[n.sessionId],[n.id]:[]}}))),n.sessionId===a.current&&"status"in n&&n.status==="streaming"&&(l(n.sessionId),c(n.sessionId))}function tq(t,e){const{message:n}=t,{setMessagesBySession:r,removeStreamingSession:i,partAppendRafRef:l,partAppendTimeoutRef:c,flushPendingPartAppends:a,currentSessionIdRef:u,sessionsRef:d,setCompletion:m,chatFinishSoundEnabledRef:p,playChatFinishSound:g}=e;if(n.sessionId===u.current&&("status"in n&&n.status!=="streaming"&&(l.current!==null&&(cancelAnimationFrame(l.current),l.current=null),c.current!==null&&(clearTimeout(c.current),c.current=null),a()),r(x=>({...x,[n.sessionId]:(x[n.sessionId]||[]).map(w=>w.id===n.id?n:w)}))),"status"in n&&n.status!=="streaming"){i(n.sessionId);const x=d.current.find(C=>C.id===n.sessionId);if(x&&x.parentId===null){const C=Date.now();m(n.sessionId,{type:"flash-only",flashStartedAt:C}),p.current&&g()}}}function nq(t,e){const{sessionId:n,part:r}=t,{setPartsBySession:i,partIdIndexRef:l,currentSessionIdRef:c,clearCompletion:a}=e;if(a(n),n===c.current){i(d=>{const m=d[n]||{},p=m[r.messageId]||[];return{...d,[n]:{...m,[r.messageId]:[...p,r]}}});let u=0;for(const d of l.current.values())d.sessionId===n&&d.messageId===r.messageId&&(u=Math.max(u,d.index+1));l.current.set(r.id,{sessionId:n,messageId:r.messageId,index:u})}}function rq(t,e){const{sessionId:n,part:r}=t,{setPartsBySession:i,partIdIndexRef:l,currentSessionIdRef:c,clearCompletion:a}=e;if(a(n),n===c.current){const u=l.current.get(r.id);i(u?d=>{const m=d[u.sessionId];if(!m)return d;const p=m[u.messageId];if(!p)return d;const g=[...p];return g[u.index]=r,{...d,[u.sessionId]:{...m,[u.messageId]:g}}}:d=>{const m=d[n]||{},p=m[r.messageId]||[];return{...d,[n]:{...m,[r.messageId]:p.map(g=>g.id===r.id?r:g)}}})}}function sq(t,e){const{sessionId:n,partId:r,delta:i}=t,{addStreamingSession:l,pendingPartAppendsRef:c,partAppendRafRef:a,lastPartAppendFlushAtRef:u,partAppendTimeoutRef:d,interruptedSessions:m,currentSessionIdRef:p,flushPendingPartAppends:g,clearCompletion:x}=e;if(x(n),n===p.current&&!m.has(n)&&l(n),n===p.current){const w=c.current.get(r);c.current.set(r,(w||"")+i);const y=Date.now()-u.current,S=50;if(y<S){if(d.current===null){const b=S-y;d.current=setTimeout(()=>{d.current=null,a.current===null&&(a.current=requestAnimationFrame(()=>{g()}))},b)}}else a.current===null&&(a.current=requestAnimationFrame(()=>{g()}))}}function iq(t,e){const{sessionId:n,usage:r,model:i}=t,{setSessionUsage:l,setCurrentModel:c,currentSessionIdRef:a}=e;n===a.current&&(l({promptTokens:r.promptTokens,completionTokens:r.completionTokens,totalTokens:r.totalTokens}),c(i))}function oq(t,e){const{sessionId:n}=t,{setCompactionSuccess:r,currentSessionIdRef:i}=e;n===i.current&&r(!0)}function aq(t,e){const{code:n,message:r}=t;console.error("Server error:",n,r)}const lq={"message.created":eq,"message.updated":tq,"part.created":nq,"part.updated":rq,"part.append":sq,"chat.usage":iq,"compaction.complete":oq,error:aq};function cq(t,e){const{permissions:n}=t,{setPermissions:r}=e;r(n)}function uq(t,e){const{approvals:n}=t,{mergePendingPermissions:r}=e;r(n.map(i=>({toolCallId:i.toolCallId,sessionId:i.sessionId,toolName:i.toolName,args:i.args,permissionType:i.permissionType,permissionKey:i.permissionKey,message:i.message,details:i.details,dangerous:i.dangerous,childSessionId:i.childSessionId,subagentName:i.subagentName})))}function dq(t,e){const{permissionId:n}=t,{setPermissions:r}=e;r(i=>i.map(l=>l.id===n?{...l,revokedAt:new Date().toISOString()}:l))}function fq(t,e){const{setPermissions:n}=e;n(r=>{const i=new Date().toISOString();return r.map(l=>({...l,revokedAt:i}))})}function hq(t,e){const{sessionId:n,toolCallId:r,toolName:i,args:l,permissionType:c,permissionKey:a,message:u,details:d,dangerous:m,childSessionId:p,subagentName:g}=t,{addPendingPermission:x,sessionsRef:w,notifiedToolCallIdsRef:C,permissionSoundEnabledRef:y,playPermissionSound:S}=e;x({toolCallId:r,sessionId:n,toolName:i,args:l,permissionType:c,permissionKey:a,message:u,details:d,dangerous:m,childSessionId:p,subagentName:g});const _=w.current.find(k=>k.id===n);(_==null?void 0:_.parentId)===null&&y.current&&!C.current.has(r)&&(S(),C.current.add(r))}function pq(t,e){const{toolCallId:n}=t,{removePendingPermissionByToolCallId:r}=e;r(n)}function mq(t,e){const{sessionId:n,messages:r}=t,{setQueuedMessagesForSession:i}=e;i(n,r)}function gq(t,e){const{sessionId:n,message:r}=t,{addQueuedMessage:i}=e;i(n,r)}function vq(t,e){const{sessionId:n,queueId:r}=t,{removeQueuedMessageById:i}=e;i(n,r)}function yq(t,e){const{sessionId:n,queueId:r}=t,{removeQueuedMessageById:i}=e;i(n,r)}const bq={"permission.list":cq,"permissions.sync":uq,"permission.revoked":dq,"permission.all_revoked":fq,"permission.request":hq,"permission.granted":pq,"queue.list":mq,"queue.added":gq,"queue.removed":vq,"queue.sending":yq};function xq(t,e){const{provider:n,connected:r,authorizationUrl:i,error:l}=t,{setProviderStatuses:c}=e;c(a=>a.find(d=>d.provider===n)?a.map(d=>d.provider===n?{...d,connected:r,authorizationUrl:i,error:l}:d):[...a,{provider:n,connected:r,authorizationUrl:i,error:l}])}function _q(t,e){const{provider:n,connected:r,connectedAt:i,accountId:l}=t,{setProviderStatuses:c}=e;c(a=>a.map(u=>u.provider===n?{...u,connected:r,connectedAt:i,accountId:l}:u))}const Sq={"provider.status":xq,"provider.connected":_q},cS=t=>t?Xn(t,"/api"):null;function wq(){var iu,vl,ou,au,lu;const{servers:t,activeServer:e,addServer:n,removeServer:r,isSwitching:i,clearSwitchingState:l,quickConnections:c,isAddingServerRef:a,prepareForServerAdd:u,removeFromQuickConnectionsByWorkspace:d}=Qa(),{sessions:m,currentSession:p,setSessions:g,setCurrentSession:x,clearSessionState:w}=_5(ko(de=>({sessions:de.sessions,currentSession:de.currentSession,setSessions:de.setSessions,setCurrentSession:de.setCurrentSession,clearSessionState:de.clearSessionState}))),[C,y]=R.useState([]),[S,b]=R.useState([]),{setMessagesBySession:_,setPartsBySession:k}=sc(ko(de=>({setMessagesBySession:de.setMessagesBySession,setPartsBySession:de.setPartsBySession}))),j=p==null?void 0:p.id,N=sc(ko(de=>j?de.messagesBySession[j]||[]:[])),D=sc(ko(de=>j?de.partsBySession[j]||{}:{})),E=R.useRef({});R.useLayoutEffect(()=>{E.current=sc.getState().messagesBySession});const O=1,L=R.useRef(new Map),z=R.useRef(0),[H,$]=R.useState(null),q=R.useRef(null),G=R.useRef(null),W=R.useRef(null),X=R.useRef(null),Y=R.useRef(null),I=R.useRef(null),M=R.useRef(null),P=R.useRef(null),[B,F]=R.useState(!1),Q=R.useRef([]),{streamingSessionIds:J,interruptedSessions:ee,clearStreamingSessions:K,clearInterruptedSessions:V,addStreamingSession:te,removeStreamingSession:re,addInterruptedSession:ae,removeInterruptedSession:se}=ng(ko(de=>({streamingSessionIds:de.streamingSessionIds,interruptedSessions:de.interruptedSessions,clearStreamingSessions:de.clearStreamingSessions,clearInterruptedSessions:de.clearInterruptedSessions,addStreamingSession:de.addStreamingSession,removeStreamingSession:de.removeStreamingSession,addInterruptedSession:de.addInterruptedSession,removeInterruptedSession:de.removeInterruptedSession}))),[Se,Ae]=R.useState({promptTokens:0,completionTokens:0,totalTokens:0}),[De,Ue]=R.useState("gpt-4o"),[ce,je]=R.useState(null),[xe,Ve]=R.useState([]),[We,it]=R.useState("gpt-4o");R.useEffect(()=>{var ft;const de=(ft=xe.find(Ht=>Ht.id===De))==null?void 0:ft.variants;ce&&de&&!de[ce]&&je(null)},[De,ce,xe]);const[ge,Re]=R.useState([]),[be,oe]=R.useState(null),me=Bg(de=>de.setActiveWorkspace);R.useLayoutEffect(()=>{me(be)},[be,me]);const{showSettings:Ee,showMCPDialog:Ie,showAddServer:Fe,showConfiguration:Ge,editServerData:Ze,showFilesPanel:lt,setShowFilesPanel:ze,filesPanelWidth:qe,setShowSettings:Pe,setShowMCPDialog:nt,setShowAddServer:kt,setShowConfiguration:mn,setEditServerData:gn,setCompletion:Zt,clearCompletion:rn,clearAllCompletions:Jt,filePreviewTarget:ve,closeFilePreview:He}=qt(ko(de=>({showSettings:de.showSettings,showMCPDialog:de.showMCPDialog,showAddServer:de.showAddServer,showConfiguration:de.showConfiguration,editServerData:de.editServerData,showFilesPanel:de.showFilesPanel,setShowFilesPanel:de.setShowFilesPanel,filesPanelWidth:de.filesPanelWidth,setShowSettings:de.setShowSettings,setShowMCPDialog:de.setShowMCPDialog,setShowAddServer:de.setShowAddServer,setShowConfiguration:de.setShowConfiguration,setEditServerData:de.setEditServerData,setCompletion:de.setCompletion,clearCompletion:de.clearCompletion,clearAllCompletions:de.clearAllCompletions,filePreviewTarget:de.filePreviewTarget,closeFilePreview:de.closeFilePreview}))),[et,Me]=R.useState(()=>{const de=localStorage.getItem("jean2_sound_chat_finish_enabled");return de!==null?de==="true":!0}),[Oe,ot]=R.useState(()=>{const de=localStorage.getItem("jean2_sound_permission_enabled");return de!==null?de==="true":!0}),Tt=R.useRef(Oe);R.useLayoutEffect(()=>{Tt.current=Oe},[Oe]);const[Gt,Kt]=R.useState([]),[lr,An]=R.useState([]),{pendingPermissions:vn,queuedMessages:Nn,clearPendingPermissions:Rn,clearQueuedMessages:Mt,mergePendingPermissions:Nt,addPendingPermission:Dt,removePendingPermissionByToolCallId:jn,removePendingPermissionsBySessionId:bs,setQueuedMessagesForSession:Zs,addQueuedMessage:Js,removeQueuedMessageById:xs}=x5(ko(de=>({pendingPermissions:de.pendingPermissions,queuedMessages:de.queuedMessages,clearPendingPermissions:de.clearPendingPermissions,clearQueuedMessages:de.clearQueuedMessages,mergePendingPermissions:de.mergePendingPermissions,addPendingPermission:de.addPendingPermission,removePendingPermissionByToolCallId:de.removePendingPermissionByToolCallId,removePendingPermissionsBySessionId:de.removePendingPermissionsBySessionId,setQueuedMessagesForSession:de.setQueuedMessagesForSession,addQueuedMessage:de.addQueuedMessage,removeQueuedMessageById:de.removeQueuedMessageById}))),[kr,Er]=R.useState(null),[Bn,Wn]=R.useState(!1),[Gn,wn]=R.useState(0),[en,Ur]=R.useState(0),[_s,Zn]=R.useState(0),cr=(iu=p==null?void 0:p.compacting)!=null?iu:!1,[rs,Jn]=R.useState(!1),ur=R.useRef(new Set),ul=R.useRef(0),dr=R.useRef(new Map),Ar=R.useRef(new Map),yn=R.useRef(null),Tn=R.useRef(0),Vr=R.useRef(null),Qc=R.useCallback(()=>{if(yn.current!==null&&(cancelAnimationFrame(yn.current),yn.current=null),Vr.current!==null&&(clearTimeout(Vr.current),Vr.current=null),Ar.current.size===0)return;const de=new Map(Ar.current);Ar.current.clear(),Tn.current=Date.now(),k(ft=>{const Ht={...ft};let _t=!1;for(const[nn,St]of de){const Rt=dr.current.get(nn);if(!Rt)continue;const ao=Ht[Rt.sessionId];if(!ao)continue;const yl=ao[Rt.messageId];if(!yl)continue;const lo=yl[Rt.index];if(!lo||lo.type!=="text"&&lo.type!=="reasoning")continue;_t=!0;const cu=[...yl];cu[Rt.index]={...lo,text:lo.text+St},Ht[Rt.sessionId]={...ao,[Rt.messageId]:cu}}return _t?Ht:ft})},[k]),{playChatFinishSound:qo,playPermissionSound:dl}=VH(),Ss=R.useRef(new Set),Zc=R.useRef(null),Fn=R.useRef(et);R.useLayoutEffect(()=>{Fn.current=et},[et]),R.useEffect(()=>{localStorage.setItem("jean2_sound_chat_finish_enabled",String(et))},[et]),R.useEffect(()=>{localStorage.setItem("jean2_sound_permission_enabled",String(Oe))},[Oe]),R.useLayoutEffect(()=>{const de=sc.getState().getMessagesBySessionKeysCount();if(de<=z.current){z.current=de;return}if(z.current=de,de<=O)return;const ft=E.current,Ht=Object.keys(ft);for(;Ht.length>O;){let _t=null,nn=1/0;for(const St of Ht){if(St===(p==null?void 0:p.id))continue;const Rt=L.current.get(St);Rt!==void 0&&Rt<nn&&(nn=Rt,_t=St)}if(!_t)break;L.current.delete(_t);for(const[St,Rt]of dr.current)Rt.sessionId===_t&&dr.current.delete(St);Ht.splice(Ht.indexOf(_t),1),_(St=>{if(!(_t in St))return St;const Rt={...St};return delete Rt[_t],Rt}),k(St=>{if(!(_t in St))return St;const Rt={...St};return delete Rt[_t],Rt})}},[p,_,k]);const Wo=R.useRef(null),[,Jc]=R.useState(!1),Yt=(vl=e==null?void 0:e.token)!=null?vl:null,It=(ou=e==null?void 0:e.url)!=null?ou:null;R.useEffect(()=>{q.current=H},[H]),R.useEffect(()=>{var de;G.current=(de=p==null?void 0:p.id)!=null?de:null},[p]),R.useEffect(()=>{ur.current.clear()},[p==null?void 0:p.id]),R.useLayoutEffect(()=>{Q.current=m},[m]);const Ji=R.useRef(null),Go=R.useRef(!1),ei=R.useCallback(de=>{var ft;(ft=Ji.current)==null||ft.call(Ji,de)},[]),nh=R.useCallback(de=>{u(),n(de.name,de.url,de.token)},[n,u]),ti=R.useCallback(()=>{e&&r(e.id),q.current&&q.current.close(),$(null),F(!1),Wn(!1),wn(0),Ur(0)},[e,r]),eu=R.useCallback(()=>{wn(de=>de+1),Wn(!1),Ur(0)},[]),ni=R.useCallback(()=>{ul.current+=1,q.current&&q.current.close(),$(null),F(!1),Wn(!1),wn(0),Ur(0),w(),y([]),_({}),k({}),L.current.clear(),z.current=0,Ss.current=new Set(ng.getState().streamingSessionIds),ur.current.clear(),K(),V(),Ae({promptTokens:0,completionTokens:0,totalTokens:0}),Ue("gpt-4o"),Ve([]),Re([]),oe(null),Kt([]),Rn(),Mt(),Jt(),dr.current.clear(),yn.current!==null&&(cancelAnimationFrame(yn.current),yn.current=null),Vr.current!==null&&(clearTimeout(Vr.current),Vr.current=null),Ar.current.clear(),Tn.current=0,Zn(de=>de+1)},[]);R.useEffect(()=>{var de;(e==null?void 0:e.id)!==Wo.current&&a.current&&(a.current=!1,Wo.current=(de=e==null?void 0:e.id)!=null?de:null,ni())},[e,ni,a]);const ri=R.useCallback(async(de,ft={})=>{if(!Yt)throw new Error("No API token available");const Ht=new Headers(ft.headers||{});Ht.set("Authorization",`Bearer ${Yt}`);const _t=await fetch(de,{...ft,signal:ft.signal,headers:Ht});if(_t.status===401)throw Er("Authentication failed. Your token may have been regenerated."),ti(),new Error("Unauthorized");return _t},[Yt,ti]),rh=R.useCallback(de=>de!==j?[]:N.map(ft=>({message:ft,parts:(D[ft.id]||[]).sort((Ht,_t)=>Ht.createdAt-_t.createdAt)})),[j,N,D]);XH({apiToken:Yt,serverUrl:It,wsRef:q,serverEpochRef:ul,currentSessionIdRef:G,clearPendingPermissions:Rn,handleLogout:ti,setWs:$,setConnected:F,setAuthError:Er,setConnectionTimedOut:Wn,setRetryCount:wn,setNextRetryIn:Ur,setReconnectTrigger:Zn,reconnectTrigger:_s,connected:B,connectionTimedOut:Bn,retryCount:Gn,onMessage:ei}),ZH({apiToken:Yt,serverUrl:It,reconnectTrigger:_s,serverEpochRef:ul,fetchWithAuth:ri,clearSwitchingState:l,setSessions:g,setPreconfigs:y,setPrompts:b,setModels:Ve,setDefaultModel:it,setProviderStatuses:An,setWorkspaces:Re,setActiveWorkspace:oe,activeWorkspace:be,setIsLoadingServerData:Jc,setAuthError:Er,pendingWorkspaceIdRef:Zc}),R.useEffect(()=>{if(!Ge&&Yt&&It){const de=Xn(It,"/api");Promise.all([ri(`${de}/preconfigs`).then(ft=>ft.json()),ri(`${de}/prompts`).then(ft=>ft.json()),ri(`${de}/models`).then(ft=>ft.json())]).then(([ft,Ht,_t])=>{y(ft.preconfigs||[]),b(Ht.prompts||[]),Ve((_t.models||[]).filter(nn=>{var St;return(St=nn.runtimeStatus)==null?void 0:St.usable})),it(_t.defaultModel||"gpt-4o")}).catch(()=>{})}},[Ge]);const eo=async(de,ft,Ht)=>{const _t=cS(It);if(!_t)return;const Rt=(await(await ri(`${_t}/workspaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:de,path:ft,isVirtual:Ht})})).json()).workspace;return Re(ao=>[...ao,Rt]),oe(Rt),x(null),Rt},qr=de=>{oe(de),x(null)},fl=de=>{Zc.current=de},hl=async de=>{const ft=cS(It);if(!ft)return;const Ht=await ri(`${ft}/workspaces/${de}`,{method:"DELETE"});if(!Ht.ok){const nn=await Ht.json().catch(()=>({message:"Failed to delete workspace"}));console.error("Failed to delete workspace:",nn.message);return}const{deletedSessions:_t}=await Ht.json();d(de),p&&(p.workspaceId===de||_t.includes(p.id))&&x(null),g(nn=>nn.filter(St=>!_t.includes(St.id))),_(nn=>{const St={...nn};return _t.forEach(Rt=>delete St[Rt]),St}),k(nn=>{const St={...nn};return _t.forEach(Rt=>delete St[Rt]),St}),_t.forEach(nn=>L.current.delete(nn));for(const[nn,St]of dr.current)_t.includes(St.sessionId)&&dr.current.delete(nn);Re(nn=>{const St=nn.filter(Rt=>Rt.id!==de);return(be==null?void 0:be.id)===de&&oe(St[0]||null),St})},si=async()=>{const de=`Workspace ${ge.length+1}`,ft=`~/.jean2/workspaces/${crypto.randomUUID()}`;await eo(de,ft,!0)},ii=async de=>{const ft=de.split("/").pop()||de.split("\\").pop()||"Workspace";await eo(ft,de,!1)},oi=R.useMemo(()=>({setSessions:g,setCurrentSession:x,setMessagesBySession:_,setPartsBySession:k,setSessionUsage:Ae,setCurrentModel:Ue,setSelectedVariant:je,addStreamingSession:te,removeStreamingSession:re,addInterruptedSession:ae,removeInterruptedSession:se,setQueuedMessagesForSession:Zs,addQueuedMessage:Js,removeQueuedMessageById:xs,clearPendingPermissions:Rn,clearQueuedMessages:Mt,setCompactionSuccess:Jn,setCompletion:Zt,clearCompletion:rn,clearAllCompletions:Jt,pendingSessionCreateRef:Go,sessionAccessTimesRef:L,partIdIndexRef:dr,partAppendRafRef:yn,pendingPartAppendsRef:Ar,lastPartAppendFlushAtRef:Tn,partAppendTimeoutRef:Vr,skipFinishSoundSessionIdsRef:Ss,currentSessionIdRef:G,models:xe,defaultModel:We,interruptedSessions:ee,sessionsRef:Q,flushPendingPartAppends:Qc,setProviderStatuses:An,setPermissions:Kt,mergePendingPermissions:Nt,addPendingPermission:Dt,removePendingPermissionByToolCallId:jn,notifiedToolCallIdsRef:ur,permissionSoundEnabledRef:Tt,playPermissionSound:dl,chatFinishSoundEnabledRef:Fn,playChatFinishSound:qo}),[g,x,_,k,Ae,Ue,je,te,re,ae,se,Zs,Js,xs,Rn,Mt,Jn,Go,L,dr,yn,Ar,Tn,Vr,Ss,G,xe,We,ee,Q,Qc,An,Kt,Nt,Dt,jn,ur,Tt,dl,Zt,rn,Jt,Fn,qo]),Ko=R.useCallback(de=>{switch(de.type){case"session.created":case"session.resumed":case"session.closed":case"session.reopened":case"session.deleted":case"session.updated":case"session.renamed":case"session.interrupted":case"session.reverted":case"session.forked":case"session.state":JV[de.type](de,oi);break;case"message.created":case"message.updated":case"part.created":case"part.updated":case"part.append":case"chat.usage":case"compaction.complete":case"error":lq[de.type](de,oi);break;case"permission.list":case"permissions.sync":case"permission.revoked":case"permission.all_revoked":case"permission.request":case"permission.granted":case"queue.list":case"queue.added":case"queue.removed":case"queue.sending":bq[de.type](de,oi);break;case"provider.status":case"provider.connected":Sq[de.type](de,oi);break;default:{console.warn(`[handleServerMessage] Unknown message type: ${de.type}`);break}}},[oi]);R.useEffect(()=>{Ji.current=Ko},[Ko]);const to=C.filter(de=>de.mode!=="subagent"),{sendMessage:ai,createSession:Nr,resumeSession:Yo,closeSession:no,reopenSession:ss,permanentlyDeleteSession:pl,handleRenameSession:ro,revertSession:tu,forkSession:Xo,compactSession:Qo,removeFromQueue:nu,sendChatMessage:Hn,handlePermissionResponse:ws,handleInterruptSession:so,updateSessionPreconfig:io,updateSessionModel:sh,updateSessionVariant:ml,handleNavigateBack:gl,refreshPermissions:oo,createSessionInWorkspace:Zo}=o$({ws:H,currentSession:p,sessions:m,workspaces:ge,activeWorkspace:be,currentModel:De,streamingSessionIds:J,isCompacting:cr,primaryPreconfigs:to,setCurrentSession:x,setActiveWorkspace:oe,setCompactionSuccess:Jn,setCurrentModel:Ue,setSelectedVariant:je,removePendingPermissionByToolCallId:jn,removePendingPermissionsBySessionId:bs,clearStreamingSessions:K,pendingSessionCreateRef:Go,partAppendRafRef:yn,pendingPartAppendsRef:Ar,skipFinishSoundSessionIdsRef:Ss}),ru=m.filter(de=>de.workspaceId===(be==null?void 0:be.id)),ih=c.filter(de=>de.serverId===(e==null?void 0:e.id)&&de.workspaceId).map(de=>de.workspaceId),oh=p?rh(p.id):[],ah=p&&(au=be==null?void 0:be.name)!=null?au:"Jean2",Jo=qt(de=>de.setSidebarViewMode),lh=qt(de=>de.sessionsPanelWidth),su=R.useCallback(de=>{const ft=qt.getState().sidebarViewMode,Ht=typeof de=="function"?de(ft):de;Jo(Ht),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var _t;(_t=I.current)==null||_t.focusSessionPanel()})})},[I,Jo]),ch=!(p!=null&&p.parentId),li=!!e;return h.jsxs(Mk,{panelId:"sessions",defaultOpen:!0,style:{"--sidebar-width":`${lh}px`},children:[h.jsx(_$,{sidebarRef:I,terminalPanelRef:X,filesPanelRef:Y,chatInputRef:W,activeWorkspace:be,primaryPreconfigs:to,handleInterruptSession:so,handleSidebarViewModeChange:su,createSession:Nr,onToggleAutoFollow:()=>{var de;return(de=P.current)==null?void 0:de.toggle()}}),li&&h.jsx(CL,{ref:I,allSessions:m,favoritedWorkspaceIds:ih,sessions:ru,currentSession:p,currentSessionId:(lu=p==null?void 0:p.id)!=null?lu:null,streamingSessionIds:J,connected:B,workspaces:ge,activeWorkspace:be,onCreateSession:()=>{var de;return Nr((de=to[0])==null?void 0:de.id)},onResumeSession:Yo,onCloseSession:no,onReopenSession:ss,onDeleteSession:pl,onRenameSession:ro,onSelectWorkspace:qr,onCreateVirtualWorkspace:si,onCreatePhysicalWorkspace:ii,onDeleteWorkspace:hl,onOpenSettings:()=>Pe(!0),onOpenMCP:()=>nt(!0),onOpenAddServer:()=>kt(!0),onOpenConfiguration:()=>mn(!0),onServerSwitch:ni,onEscape:()=>{var de;p&&((de=W.current)==null||de.focus())},onCreateSessionInWorkspace:Zo,pendingPermissions:vn}),li&&h.jsx(s3,{ref:Y,workspaceId:be==null?void 0:be.id,serverUrl:It!=null?It:void 0,apiToken:Yt!=null?Yt:void 0,isOpen:lt,onClose:()=>ze(!1)}),h.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden",style:{paddingTop:"env(safe-area-inset-top, 0)",paddingBottom:"env(safe-area-inset-bottom, 0)"},children:[h.jsx(S$,{headerTitle:ah,isLoggedIn:li,activeWorkspace:be,onServerSwitch:ni,onSelectWorkspace:fl,onSidebarViewModeChange:su}),h.jsx(IV,{servers:t,activeServer:e,isSwitching:i,connected:B,authError:kr,connectionTimedOut:Bn,retryCount:Gn,nextRetryIn:en,serverUrl:It,currentSession:p,messagesWithParts:oh,queuedMessages:Nn,preconfigs:C,primaryPreconfigs:to,prompts:S,models:xe,defaultModel:We,selectedVariant:ce,pendingPermissions:vn,sessionUsage:Se,currentModel:De,streamingSessionIds:J,isCompacting:cr,compactionSuccess:rs,isPrimarySession:ch,inputRef:W,apiToken:Yt,onFirstServerAdded:nh,onRetry:eu,onLogout:ti,onSendMessage:Hn,onRemoveFromQueue:nu,onChangePreconfig:io,onChangeModel:sh,onChangeVariant:ml,onPermissionResponse:ws,onRename:ro,onNavigateToSubagent:Yo,onNavigateBack:gl,onInterrupt:so,onRevert:tu,onFork:Xo,onCompact:Qo,onClearCompactionSuccess:()=>Jn(!1),scrollToBottomRef:M,autoFollowToggleRef:P}),h.jsx(q$,{workspaceId:be==null?void 0:be.id,workspacePath:be==null?void 0:be.path,workspaceName:be==null?void 0:be.name,serverUrl:It!=null?It:void 0,apiToken:Yt!=null?Yt:void 0,terminalPanelRef:X})]}),li&&h.jsx("div",{"data-panel-gap":"files",className:`relative bg-transparent transition-[width] duration-200 ease-linear shrink-0 ${lt?"":"w-0"}`,style:{width:lt?qe:0}}),li&&h.jsxs(h.Fragment,{children:[h.jsx(HL,{open:Ee,onOpenChange:Pe,permissions:Gt,onRefreshPermissions:oo,onRevokePermission:de=>{ai("permission.revoke",{permissionId:de})},onRevokeAllPermissions:()=>{ai("permission.revoke_all",{workspaceId:be==null?void 0:be.id})},apiToken:Yt,onLogout:ti,chatFinishSoundEnabled:et,onChatFinishSoundEnabledChange:Me,permissionSoundEnabled:Oe,onPermissionSoundEnabledChange:ot,serverUrl:It}),h.jsx(GL,{open:Ie,onOpenChange:nt,workspaceId:be==null?void 0:be.id,workspacePath:be==null?void 0:be.path,serverUrl:It!=null?It:void 0,apiToken:Yt!=null?Yt:void 0}),h.jsx(n7,{open:Ge,onOpenChange:mn,serverUrl:It,apiToken:Yt})]}),h.jsx(r7,{open:Fe,onOpenChange:de=>{kt(de),de||gn(null)},editServer:Ze}),li&&h.jsx(PH,{workspaceId:be==null?void 0:be.id,target:ve,serverUrl:It!=null?It:void 0,apiToken:Yt!=null?Yt:void 0,open:ve!==null,onOpenChange:de=>{de||He()}})]})}function Cq(){const t=he.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=h.jsx(T5,{children:h.jsx(wq,{})}),t[0]=e):e=t[0],e}document.addEventListener("dragover",t=>t.preventDefault());document.addEventListener("drop",t=>t.preventDefault());Y4.createRoot(document.getElementById("root")).render(h.jsx(R.StrictMode,{children:h.jsx(J4,{defaultMode:"system",defaultScheme:"neutral",children:h.jsx(Cq,{})})}));
|